/* Material theme custom styles */

/* ============================================
   TABLE STYLES - FULL WIDTH
   ============================================ */

/* Tables should fill available width */
.md-typeset table {
    width: 100%;
    max-width: 100%;
    display: table;
    border-collapse: collapse;
}

/* Table cells */
.md-typeset table th,
.md-typeset table td {
    padding: 0.75em 1em;
    text-align: left;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    vertical-align: top;
}

.md-typeset table th {
    font-weight: 700;
    background-color: var(--md-default-fg-color--lightest);
    border-bottom: 2px solid var(--md-default-fg-color--lighter);
}

.md-typeset table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Dark mode */
[data-md-color-scheme="slate"] .md-typeset table th {
    background-color: var(--md-default-bg-color--lightest);
}

[data-md-color-scheme="slate"] .md-typeset table tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Code in tables */
.md-typeset table code {
    white-space: nowrap;
}

/* ============================================
   CODE BLOCKS - CONSTRAINED WIDTH
   ============================================ */

/* Code blocks should NOT overflow */
.md-typeset pre {
    max-width: 100%;
    overflow-x: auto;
}

/* Ensure code blocks stay in their container */
.md-typeset .highlight {
    max-width: 100%;
    overflow-x: auto;
}

/* Code inside pre should wrap or scroll */
.md-typeset pre code {
    max-width: 100%;
    word-wrap: normal;
    white-space: pre;
}

/* Inline code */
.md-typeset code {
    word-break: break-word;
}

/* ============================================
   ADMONITIONS - CONSTRAINED
   ============================================ */

.md-typeset .admonition {
    max-width: 100%;
}

/* ============================================
   GRID LAYOUT - Homepage Cards
   ============================================ */

.md-typeset .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin: 1em 0;
}

.md-typeset .grid > div {
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 0.2rem;
    padding: 1rem;
    background-color: var(--md-default-bg-color);
}

.md-typeset .grid h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1.1rem;
    font-weight: 600;
}

.md-typeset .grid p {
    margin-bottom: 0;
}

/* ============================================
   HEADINGS
   ============================================ */

.md-typeset h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.md-typeset h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* ============================================
   MERMAID DIAGRAMS
   ============================================ */

.mermaid {
    text-align: center;
    margin: 1em 0;
    max-width: 100%;
}

/* ============================================
   HORIZONTAL RULES
   ============================================ */

.md-typeset hr {
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
    margin: 2em 0;
}

/* ============================================
   LISTS
   ============================================ */

.md-typeset ul,
.md-typeset ol {
    margin: 1em 0;
}

/* ============================================
   DEFINITION LISTS
   ============================================ */

.md-typeset dt {
    font-weight: 700;
    margin-top: 1em;
}

.md-typeset dd {
    margin-left: 2em;
}

/* ============================================
   HOMEPAGE SPECIFIC
   ============================================ */

.md-content__inner h1:first-child {
    font-weight: 300;
}

.md-typeset .md-button {
    display: inline-block;
}

/* ============================================
   CONTENT AREA FIX
   ============================================ */

/* Ensure main content doesn't overflow */
.md-content__inner {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix for snippets and warnings */
.md-typeset .snippet,
.md-typeset .warning,
.md-typeset blockquote {
    max-width: 100%;
    box-sizing: border-box;
}
