/*
 * DeutschGo Consolidated Stylesheet
 *
 * Merges: SSPF base theme + SSPFBA UI components + app styles + dictionary styles.
 * Google Fonts are loaded as <link> tags by DefaultAppPage (no @import).
 * Exercise-specific styles live in exercises.css, loaded only on exercise pages.
 */

/* =================================================================
   1. CUSTOM PROPERTIES
   ================================================================= */

/* ── SSPF theme configuration ──────────────────────────────────── */
:root {
    --sspf-body-font-family: 'Poppins', sans-serif;
       --sspf-body-font-size: 18px;
       --sspf-body-font-weight: 300;
    --sspf-body-color: #333;
    --sspf-heading-font-family: 'League Spartan', sans-serif;
    --sspf-heading-color: #2c3e50;
    --sspf-line-height: 1.6;

    /* --- Primary Color Variables (Direct mapping to Bootstrap) --- */
    --sspf-primary: #007bff;
    --sspf-primary-rgb: 0, 123, 255;

    /* --- Background Variables --- */
    --sspf-bg-light: 240, 240, 240;

    /* --- Additional Custom Variables (from the original library) --- */
    --sspf-shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --sspf-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
    --sspf-transition: all 0.2s ease-in-out;

    /* --- SSPFBA: dark overlay/panel background colour --- */
    --sspf-dark-surface: #282a35;

    /* --- App: verb property colors --- */
    --app-color-regular: #28a745;
    --app-color-irregular: #dc3545;
    --app-color-transitive: #007bff;
    --app-color-intransitive: #6c757d;
    --app-color-separable: #fd7e14;
    --app-color-inseparable: #6610f2;
    --app-color-reflexive: #20c997;

    /* --- App: word type colors (reutilizando colores donde es posible) --- */
    --app-color-word-type-noun: var(--app-color-transitive);      /* Azul #007bff */
    --app-color-word-type-verb: var(--app-color-regular);         /* Verde #28a745 */
    --app-color-word-type-adjective: var(--app-color-irregular);  /* Rojo #dc3545 */
    --app-color-word-type-adverb: var(--app-color-separable);     /* Naranja #fd7e14 */
    --app-color-word-type-pronoun: var(--app-color-inseparable);  /* Morado #6610f2 */
    --app-color-word-type-article: var(--app-color-reflexive);    /* Turquesa #20c997 */
    --app-color-word-type-preposition: #ffc107;                    /* Amarillo */
    --app-color-word-type-conjunction: #e83e8c;                    /* Rosa */
    --app-color-word-type-numeral: #17a2b8;                        /* Cian */
    --app-color-word-type-particle: var(--app-color-intransitive);/* Gris #6c757d */
}

/* ── Bootstrap variable mappings ────────────────────────────────── */
:root {
    --bs-body-font-family: var(--sspf-body-font-family);
    --bs-heading-font-family: var(--sspf-heading-font-family);
    --bs-heading-color: var(--sspf-heading-color);
    --bs-body-font-size: var(--sspf-body-font-size);
    --bs-body-font-weight: var(--sspf-body-font-weight);
    --bs-body-color: var(--sspf-body-color);
    --bs-body-line-height: var(--sspf-line-height);
    --bs-primary: var(--sspf-primary);
    --bs-primary-rgb: var(--sspf-primary-rgb);
    --bs-light-rgb: var(--sspf-bg-light);
}

/* =================================================================
   2. BOOTSTRAP & FRAMEWORK RESETS
   ================================================================= */

/* Font-size reset: make Bootstrap components inherit the body font-size
   instead of Bootstrap's fixed 1rem default. */
.btn,
.dropdown-item,
.form-control,
.form-select,
.alert,
.breadcrumb-item {
    font-size: inherit;
}

.nav-link {
    font-size: 1.1rem;
}

.badge {
    font-size: 0.75rem;
}

/* Lighter weight for form inputs — global app preference. */
.form-control {
    font-weight: 300;
}

/* =================================================================
   3. BASE HTML ELEMENTS
   ================================================================= */

body {
    color: #333;
}

header {
    background-color: var(--bs-body-bg);
}

h1, h2, h3, h4 {
    font-family: var(--bs-heading-font-family); /* Ensures correct font */
    font-weight: 600;
    color: var(--sspf-heading-color);
}

h1 {
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    border-bottom: 2px solid var(--bs-primary);
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-style: italic;
    font-size: 2rem; /* The correct size from the mockup */
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.5rem;
}

/* Anchor offset for fixed navbar */
h2[id], h3[id] {
    scroll-margin-top: 100px;
}

a, p a, li a, .link {
    text-decoration: underline dashed #666;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.3s ease;
    color: var(--sspf-body-color);
}

a:hover, p a:hover, li a:hover {
    color: #666;
    text-decoration-color: #999;
}

a.no-link {
    text-decoration: none;
}

main {
    position: relative; /* Required by main::before separator. */
}

main.container {
    min-height: 640px;
    max-width: 1040px;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Full-width separator between header and content.
   Lives on main (not on header) so the overlay panel covers it when open,
   keeping the dark nav-item bridge seamless. */
main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 1px;
    background-color: var(--bs-border-color, #dee2e6);
}

.table th, .table td {
    color: var(--sspf-body-color);
}

/* =================================================================
   4. LIBRARY COMPONENTS
   ================================================================= */

/* ── H1 Split Component ─────────────────────────────────────────── */
.h1-split {
    margin-top: 2.5rem;
    margin-bottom: 3rem;
}
.h1-split .h1-split-main {
    display: flex;
    align-items: center;
    gap: .875rem;
    font-family: var(--bs-heading-font-family);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.09rem;
    color: var(--sspf-heading-color);
    line-height: 1.15;
    margin-bottom: .25rem;
}
.h1-split .h1-split-main .bi {
    font-size: 3rem;
    color: #0d6efd;
    flex-shrink: 0;
}
.h1-split .h1-split-separator {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--bs-border-color);
    margin-bottom: .5rem;
}
.h1-split .h1-split-subtitle {
    display: block;
    font-family: var(--bs-body-font-family);
    font-size: 2rem;
    font-weight: 300;
    color: #5a6268;
    line-height: 1.55;
    letter-spacing: -0.02rem;
}

/* ── Highlight text (note / golden-rule) ────────────────────────── */
.note, .golden-rule {
    padding: 15px;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.note {
    border-left: 4px solid #0d6efd;
    background-color: #e7f1ff;
}

.golden-rule {
    border-left: 4px solid #ffc107;
    background-color: #fff9e6;
}

/* ── Audio player ───────────────────────────────────────────────── */
[data-audio] {
    display: inline-block;
    vertical-align: baseline;
}

[data-audio] .btn-audio {
    margin-left: 0.25em;
    vertical-align: baseline;
}

.btn-audio {
    background: none;
    border: none;
    padding: 0 0;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.btn-audio i {
    font-size: 1.5rem;
    vertical-align: middle;
    transition: transform 0.2s ease, color 0.2s ease;
    color: #0d6efd;
}

.btn-audio .bi-volume-up {
    cursor: pointer;
}

.btn-audio:hover .bi-volume-up {
    transform: scale(1.1);
}

.btn-audio-unsupported {
    cursor: not-allowed;
}

.audio-speaking {
    background-color: #fffbe5;
    border-radius: 4px;
    box-shadow: 0 0 0 3px #fffbe5;
}

/* ── Card components (BSCard, BSCardMenu, BSCardForm) ───────────── */
.bs-card {
    background-color: #f8f9fa;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.bs-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bs-card .text-preview {
    color: #6c757d;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-menu {
    margin-bottom: 1.5rem;
}

/* =================================================================
   5. NAVIGATION
   ================================================================= */

/*
 * Site Header + Full-Screen Overlay Mega-Menu
 *
 * Architecture:
 *   - <header> is sticky (z-index 1020) with solid background.
 *   - Overlay panels are children of <body>, NOT of <header>.
 *     This puts them in the root stacking context where header (1020) > overlay (1015).
 *   - Nav items stretch to fill the full header height via align-items:stretch
 *     at every flex level. The selected item's dark background (var(--sspf-dark-surface)) therefore
 *     covers the full header height, connecting seamlessly with the overlay below.
 *   - The overlay uses top:var(--header-height) so it starts just below the header.
 *     The header paints on top of it (higher z-index), leaving only the area below
 *     the header visible, with the selected nav item's dark background as the bridge.
 */

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    /* background-color comes from header { background-color: var(--bs-body-bg) } above */
}

.site-header-bar {
    display: flex;
    align-items: stretch;   /* KEY: all children fill the full header height */
    padding-top: 0;
    padding-bottom: 0;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo img {
    height: 54px;
    width: auto;
}

/* ── Hamburger toggle (mobile only) ──────────────────────────────── */
.site-toggle {
    display: none;          /* hidden on desktop */
    align-items: center;
    background: none;
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    color: inherit;
}

.site-toggle:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

.site-toggle i {
    font-size: 1.75rem;
}

/* ── Nav ─────────────────────────────────────────────────────────── */
.site-nav {
    flex: 1;
    display: flex;
    min-height: 5rem;
    align-items: stretch;
}

.site-nav ul {
    display: flex;
    align-items: stretch;   /* stretch li elements */
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.site-nav-item {
    display: flex;
    align-items: stretch;   /* stretch the link inside */
}

.site-nav-link {
    display: flex;
    align-items: center;    /* center text vertically within the stretched space */
    padding: 0 1.25rem;
    font-weight: 700;
    font-size: 1.2rem;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.site-nav-link:hover {
    background-color: rgba(0, 0, 0, 0.15);
    color: inherit;
    text-decoration: none;
}

.site-nav-link::after {
    content: '';
    display: inline-block;
    margin-left: 0.4rem;
    width: 0;
    height: 0;
    border-left: 0.3em solid transparent;
    border-right: 0.3em solid transparent;
    border-top: 0.4em solid currentColor;
    transition: transform 0.2s ease;
}

.site-nav-item.is-open .site-nav-link::after {
    transform: rotate(180deg);
}

/* Active state: dark background bridges with the overlay below (NavOverlayMenu only) */
.site-nav-item[data-overlay].is-open .site-nav-link {
    background-color: var(--sspf-dark-surface);
    color: #c8c8d8;
}

.site-nav-item[data-overlay].is-open .site-nav-link:hover {
    background-color: var(--sspf-dark-surface);
    color: #e0e0e0;
}

/* Mega menu items use same colour as hover when open (no dark bridge needed) */
.site-nav-item.dropdown.is-open .site-nav-link {
    background-color: rgba(0, 0, 0, 0.15);
    color: inherit;
}

.site-nav-separator {
    display: flex;
    align-items: center;
    padding: 0 0.25rem;
    color: rgba(0, 0, 0, 0.25);
    font-weight: 300;
    pointer-events: none;
    user-select: none;
}

.site-nav-separator::before {
    content: '|';
}

/* ── Controls (language + auth) ──────────────────────────────────── */
.site-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Mobile (<992px) ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {

    .site-logo {
        padding-left: 0;
    }

    .site-header-bar {
        flex-wrap: wrap;
        align-items: center; /* center in the header row on mobile */
        padding-left: 0;
        padding-right: 0;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .site-toggle {
        display: flex;       /* show hamburger */
    }

    .site-controls {
        margin-left: auto;   /* push to the right, next to toggle */
        padding-right: 1rem;
    }

    /* Force locale text visible on xs — Bootstrap's d-none hides it below 576px. */
    .site-controls .dropdown-toggle span {
        display: inline !important;
    }

    /* Nav becomes a full-width row below the header bar */
    .site-nav {
        order: 4;
        flex: 0 0 100%;
        flex-direction: column;
        display: none;       /* collapsed by default */
        border-top: 1px solid var(--bs-border-color);
        background-color: var(--bs-body-bg);
        min-height: 4rem;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .site-nav-item {
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav-link,
    .site-nav-link:hover {
        padding: 0.75rem 1.25rem;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .site-nav-item:last-child .site-nav-link,
    .site-nav-item:last-child .site-nav-link:hover {
        border-bottom: none;
    }

    /* Dark overlay bridge effect on mobile too */
    .site-nav-item[data-overlay].is-open .site-nav-link {
        background-color: var(--sspf-dark-surface);
        color: #c8c8d8;
    }
}

/* ── Full-screen overlay panel ───────────────────────────────────── */

/* Panels live as children of <body>, not inside <header>.
   In the root stacking context, z-index 1015 < header 1020.        */
.mega-overlay {
    position: fixed;
    top: var(--header-height, 84px); left: 0; right: 0; bottom: 0;
    z-index: 1015;
    display: none;
    flex-direction: column;
    background-color: var(--sspf-dark-surface);
    color: #e0e0e0;
    overflow: hidden;
}

.mega-overlay.is-open {
    display: flex;
}

.mega-overlay-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #3a3c4a;
    flex-shrink: 0;
}

.mega-overlay-filter {
    flex: 1;
    max-width: 420px;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #3a3c4a;
    color: #e0e0e0;
}

.mega-overlay-filter::placeholder { color: #999; }
.mega-overlay-filter:focus { outline: none; border-color: #888; }

.mega-overlay-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.mega-overlay-close:hover { color: #fff; }

.mega-overlay-body {
    display: grid;
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    column-gap: 2rem;
    row-gap: 2rem;
    align-content: start;
}

.mega-overlay--cols-2 .mega-overlay-body { grid-template-columns: repeat(2, 1fr); }
.mega-overlay--cols-3 .mega-overlay-body { grid-template-columns: repeat(3, 1fr); }
.mega-overlay--cols-4 .mega-overlay-body { grid-template-columns: repeat(4, 1fr); }

.mega-overlay-col {
    box-sizing: border-box;
    min-width: 0; /* required for text-overflow:ellipsis to work inside grid tracks */
}

/* Level 1 — Section (any element + optional hub-page link) */
.mega-category {
    display: block;
    font-family: var(--bs-body-font-family);
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffe407c7;
    padding: 0;
    margin-top: 1rem;
    margin-bottom: 0;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mega-category:first-child { margin-top: 0; }

.mega-category a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.mega-category a:hover {
    color: #ffe407;
    text-decoration: none;
}

/* Level 2 — Entry (navigable leaf or subsection label) */
.mega-section {
    display: block;
    font-family: var(--bs-body-font-family);
    font-size: 1.125rem;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 300;
    padding: 0.2rem 0;
    text-decoration: none;
}

a.mega-section {
    text-decoration: underline dashed #bbb;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.mega-section a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.mega-section:hover, .mega-section:focus {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration-color: #fff;
}

.mega-section:hover a, .mega-section:focus a {
    color: inherit;
}

/* Level 3 — Items: compact inline links under a MenuEntry */
.mega-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 0.1rem 0 0.2rem;
}

.mega-item {
    font-size: 0.875rem;
    font-weight: 300;
    color: #bbb;
    text-decoration: underline dashed #bbb;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.mega-item:hover {
    color: #fff;
    text-decoration-color: #fff;
}

/* ::after pipe separator rendered as display:inline-block so it sits outside
   the text-decoration flow of the <a> and is not underlined. */
.mega-item:not(:last-child)::after {
    content: '|';
    display: inline-block;
    color: #bbb;
    margin-left: 0.3rem;
    margin-right: 0.3rem;
    text-decoration: none;
}

body.mega-overlay-active { overflow: hidden; }

/* ── Language selector dropdown ──────────────────────────────────── */
.flag-icon {
    width: 20px;
    height: 15px;
    margin-right: 0.5rem;
    border-radius: 2px;
}

/* The global  a, li a  rule above adds text-decoration:underline dashed to
   all anchors. Reset it for Bootstrap dropdown items in the header.   */
.site-controls .dropdown-item {
    text-decoration: none;
}

.site-controls .dropdown-item:hover,
.site-controls .dropdown-item:focus {
    text-decoration: none;
}

/* Two-column grid for the language list.
   The grid goes on the inner div, NOT on .dropdown-menu itself —
   Bootstrap controls display:none/block on .dropdown-menu and
   overriding it here would cause the menu to appear on page load. */
.site-controls .dropdown-menu {
    min-width: 220px;
    padding: 0.5rem;
}

.site-controls .dropdown-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.site-controls .dropdown-menu-grid li {
    list-style: none;
}

/* ── Bootstrap Dropdown Mega Menu (NavMegaMenu) ───────────────────── */
.dropdown-menu.mega-menu {
    padding: 1em;
    border-radius: 0;
    border-color: #ddd;
    top: 100%;
    position: absolute;
    box-shadow: 0 3px 6px rgba(0, 0, 0, .23);
    display: none;
}

/* Hover trigger (desktop) */
.dropdown:hover .dropdown-menu.mega-menu {
    display: grid;
    gap: 1rem;
}

/* Click/tap trigger via Bootstrap .show (touch devices + JS coordination) */
.dropdown-menu.mega-menu.show {
    display: grid;
    gap: 1rem;
}

.dropdown-menu.mega-menu.mega-menu--cols-2 { grid-template-columns: repeat(2, 1fr); }
.dropdown-menu.mega-menu.mega-menu--cols-3 { grid-template-columns: repeat(3, 1fr); }
.dropdown-menu.mega-menu.mega-menu--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Override Bootstrap's smaller default font-size for dropdown headers */
.dropdown-menu.mega-menu .dropdown-header {
    font-size: 1.1rem;
    font-weight: bold;
    color: #444;
}

.dropdown-menu.mega-menu .dropdown-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 300;
}

/* ── Navigation responsive breakpoints ───────────────────────────── */

/* lg (992–1199px): 4 cols → 2 */
@media (max-width: 1199.98px) {
    .mega-overlay--cols-4 .mega-overlay-body { grid-template-columns: repeat(2, 1fr); }
}

/* md (768–991px): overlay 3 cols → 2; mega-menu scrollable */
@media (max-width: 991.98px) {
    .mega-overlay--cols-3 .mega-overlay-body { grid-template-columns: repeat(2, 1fr); }

    .dropdown-menu.mega-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* sm / mobile (<768px): overlay 1 col centered; mega-menu single column */
@media (max-width: 767.98px) {
    .mega-overlay-header {
        padding: 0.75rem 1rem;
    }

    .mega-overlay-body {
        grid-template-columns: minmax(0, 540px) !important;
        justify-content: center;
        padding: 1rem 2rem;
    }

    .dropdown-menu.mega-menu {
        width: 80%;
        max-height: 70vh;
        overflow-y: auto;
    }

    .dropdown-menu.mega-menu.mega-menu--cols-2,
    .dropdown-menu.mega-menu.mega-menu--cols-3,
    .dropdown-menu.mega-menu.mega-menu--cols-4 {
        grid-template-columns: 1fr;
    }
}

/* =================================================================
   6. APP COMPONENTS
   ================================================================= */

/* ── Badge styles ────────────────────────────────────────────────── */
.property-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-regular { background-color: var(--app-color-regular); }
.bg-irregular { background-color: var(--app-color-irregular); }
.bg-transitive { background-color: var(--app-color-transitive); }
.bg-intransitive { background-color: var(--app-color-intransitive); }
.bg-separable { background-color: var(--app-color-separable); }
.bg-inseparable { background-color: var(--app-color-inseparable); }
.bg-reflexive { background-color: var(--app-color-reflexive); }

.bg-word-type-noun { background-color: var(--app-color-word-type-noun); }
.bg-word-type-verb { background-color: var(--app-color-word-type-verb); }
.bg-word-type-adjective { background-color: var(--app-color-word-type-adjective); }
.bg-word-type-adverb { background-color: var(--app-color-word-type-adverb); }
.bg-word-type-pronoun { background-color: var(--app-color-word-type-pronoun); }
.bg-word-type-article { background-color: var(--app-color-word-type-article); }
.bg-word-type-preposition { background-color: var(--app-color-word-type-preposition); }
.bg-word-type-conjunction { background-color: var(--app-color-word-type-conjunction); }
.bg-word-type-numeral { background-color: var(--app-color-word-type-numeral); }
.bg-word-type-particle { background-color: var(--app-color-word-type-particle); }

/* ── Examples component ──────────────────────────────────────────── */
.examples {
    background-color: var(--bs-secondary-bg-subtle);
    border-left: 4px solid var(--bs-primary);
    border-radius: var(--bs-border-radius);
    overflow: hidden; /* Importante para que el header no tenga esquinas redondeadas */
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.examples-header {
    background-color: var(--bs-primary);
    color: white;
    padding: 0.75rem 1rem;
    margin: 0;
    font-weight: 600;
}

.examples-content {
    padding: 1rem;
}

.examples-content p:last-child {
    margin-bottom: 0;
}

.examples-content p {
    margin-bottom: 0.5rem;
}

.examples-list {
    list-style: none;
    counter-reset: example-counter;
    padding-left: 2rem;
    margin-bottom: 0;
}

.examples-list li {
    counter-increment: example-counter;
    margin-bottom: 0.5rem;
    position: relative;
}

.examples-list li:last-child {
    margin-bottom: 0;
}

.examples-list li::before {
    content: counter(example-counter, lower-alpha) ") ";
    position: absolute;
    left: -2rem;
}

/* Fix text wrapping in examples with audio buttons */
.examples-content span[lang] {
    display: inline !important;
}

.examples-content .btn-audio {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.examples-meta {
    display: block;
    font-size: 1rem;
    color: var(--bs-secondary-color);
    margin-top: 0.2rem;
}

/* =================================================================
   7. PAGE LAYOUTS
   ================================================================= */

div.default-user-ui-container {
    max-width: 600px;
    padding: 100px 20px
}

.home h1 {
    font-size: 3.5rem;
}

.home h2 {
    font-size: 3rem;
}

.home p {
    font-family: var(--sspf-body-font-family), sans-serif;
    font-size: 1.2rem;
}

footer li a {
    font-size: 1rem;
}

/* =================================================================
   8. CARD COMPONENTS
   ================================================================= */

.card-header {
    font-size: 1.25rem;
}

/* =================================================================
   9. DICTIONARY STYLES
   ================================================================= */

.word-root {
    font-weight: bold;
}

.word-prefix, .word-ending {
    color: red;
    font-weight: bold;
}

.alphabetical-listing a {
    font-weight: 600;
}

/* Center the text of the first column in the table body */
.word-table tbody th {
    text-align: center;
}

/* Apply bold styling to the first and second columns of the table body */
.word-table tbody th,
.word-table tbody td:nth-child(2) {
    font-weight: bolder;
}

/* =================================================================
   10. MOBILE BREAKPOINT (≤575px)
   ================================================================= */

@media (max-width: 575.98px) {

    /* Body font: 16px so buttons, inputs and nav-link scale down automatically. */
    :root {
        --sspf-body-font-size: 16px;
    }

    p {
        font-size: 1rem;
    }

    /* H1 split: tighter margins and smaller type. Icon tracks main font size. */
    .h1-split {
        margin-top: 1.5rem;
        margin-bottom: 2rem;
    }

    .h1-split .h1-split-main {
        font-size: 2.4rem;
    }

    .h1-split .h1-split-main .bi {
        font-size: 2rem;
    }

    .h1-split .h1-split-subtitle {
        font-size: 1.5rem;
    }

    /* Heading scale. */
    h2 {
        font-size: 1.75rem;
        margin-top: 1.25rem;
        margin-bottom: 0.75rem;
    }

    h3 {
        font-size: 1.4rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }

    h4 {
        font-size: 1.2rem;
    }

    /* Reduce top breathing room between sticky header and content. */
    main.container {
        padding-top: 1rem;
    }

    /* Site header: smaller logo, hamburger icon and control buttons. */
    .site-logo img {
        height: 40px;
    }

    .site-toggle i {
        font-size: 1.5rem;
    }

    .site-controls .btn,
    .site-controls .nav-link {
        font-size: 0.9rem;
    }

    /* Collapsed mobile nav: the three main items shown when hamburger is open. */
    .site-nav-link {
        font-size: 1.075rem;
    }

    /* Full-page overlay menu: tighter padding and smaller type. */
    .mega-overlay-body {
        padding: 0.75rem 1rem;
    }

    .mega-category {
        font-size: 1.075rem;
    }

    .mega-section {
        font-size: 1rem;
    }

    .mega-item {
        font-size: 0.875rem;
    }

    /* Practice modal table: smaller text, fixed 1/3 + 2/3 column split. */
    .fitg-practice-table {
        font-size: 0.875rem;
    }

    .fitg-practice-table th:first-child,
    .fitg-practice-table td:first-child {
        width: 33% !important;
        white-space: normal !important;
    }

    /* Exercise card header: smaller than global 1.25rem on mobile. */
    .exercise-component-card .card-header {
        font-size: 1.125rem;
    }

    /* Header right section (help, level, char bar): smaller and compact on mobile. */
    .exercise-header-controls {
        font-size: 1rem;
    }

    .exercise-header-controls .btn.char-btn {
        width: 1.75rem;
        height: 1.75rem;
    }
}
