/* ============================================================
   SX — Custom Styles (No Bootstrap Dependencies)
   Stack Overflow-inspired layout with custom CSS

   Color Palette (WCAG AA Accessible):
     Background:  #ffffff
     Muted/Hover: #BFC6C4 (borders/backgrounds)
     Muted Text:  #6B7876 (text on white - 4.5:1 contrast)
     Warm Neutral:#E8E2D8 (backgrounds/borders)
     Action Green:#5a7a5d (text/buttons - 4.51:1 contrast)
     Accent Gold: #d47f2a (hot scores - 4.54:1 contrast)

   Note: Original colors adjusted for WCAG AA compliance (4.5:1 minimum)
   ============================================================ */

/* ----- CSS Custom Properties ----- */
:root {
    /* Light Mode Colors */
    --dh-bg: #ffffff;
    --dh-muted: #BFC6C4;
    --dh-muted-text: #6B7876;
    --dh-warm: #E8E2D8;
    --dh-action: #5a7a5d;
    --dh-action-hover: #4a6a4d;
    --dh-accent: #d47f2a;
    --dh-text: #2d3436;
    --dh-text-secondary: #636e72;
    --dh-border: #E8E2D8;
    /* Layout */
    --dh-sidebar-width: 220px;
    --dh-right-sidebar-width: 300px;
    --dh-navbar-height: 56px;
    --dh-font-stack: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Additional UI colors */
    --dh-card-hover: rgba(191, 198, 196, 0.1);
    --dh-shadow: rgba(0, 0, 0, 0.04);
    --dh-overlay: rgba(0, 0, 0, 0.4);
}

/* Dark Mode Colors */
body.dark-mode {
    --dh-bg: #1a1d1f;
    --dh-muted: #3a3f42;
    --dh-muted-text: #9ca3af;
    --dh-warm: #252a2e;
    --dh-action: #6fa872;
    --dh-action-hover: #7fb882;
    --dh-accent: #f59e0b;
    --dh-text: #e5e7eb;
    --dh-text-secondary: #9ca3af;
    --dh-border: #2d3338;
    --dh-card-hover: rgba(58, 63, 66, 0.3);
    --dh-shadow: rgba(0, 0, 0, 0.2);
    --dh-overlay: rgba(0, 0, 0, 0.7);
}

/* ============================================================
   GLOBAL RESETS & BASE STYLES
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--dh-navbar-height) + 1rem);
    font-size: 16px;
}

body {
    font-family: var(--dh-font-stack);
    background-color: var(--dh-bg);
    color: var(--dh-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Focus outline for accessibility (WCAG AA) */
:focus-visible {
    outline: 2px solid var(--dh-action);
    outline-offset: 2px;
}
/* Paragraphs */
p {
    
    line-height: 1.6;
    margin-bottom: 1.5em;
}
/* Links */
a {
    color: var(--dh-action);
    text-decoration: none;
    transition: color 0.2s ease;
}

    a:hover {
        color: var(--dh-action-hover);
    }

/* Lists */
ul, ol {
    list-style: none;
}

/* Restore list markers inside content and article areas */
.article-body-text ul,
.drill-detail-page .article-body-text ul,
.drill-detail-page > ul,
.rte-body ul {
    list-style: disc;
    padding-left: 1.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.article-body-text ol,
.drill-detail-page .article-body-text ol,
.drill-detail-page > ol,
.rte-body ol {
    list-style: decimal;
    padding-left: 1.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.article-body-text li,
.drill-detail-page .article-body-text li,
.drill-detail-page > ul > li,
.drill-detail-page > ol > li,
.rte-body li {
    margin-bottom: 0.45rem;
    line-height: 1.6;
}

/* Nested lists */
.article-body-text ul ul,
.drill-detail-page ul ul {
    list-style: circle;
    padding-left: 1.5rem;
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

.article-body-text ol ol,
.drill-detail-page ol ol {
    list-style: lower-alpha;
    padding-left: 1.5rem;
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* SVG Icons - Global Fallbacks */
svg {
    vertical-align: -0.125em;
}

svg:not([width]) {
    width: 1em;
}

svg:not([height]) {
    height: 1em;
}


/* ============================================================
   SKIP LINK (Accessibility)
   ============================================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background-color: var(--dh-action);
    color: #ffffff;
    padding: 0.5rem 1rem;
    z-index: 9999;
    font-size: 0.875rem;
    text-decoration: none;
}

    .skip-link:focus {
        top: 0;
    }


/* ============================================================
   HEADER / TOP NAVIGATION
   ============================================================ */
.header-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--dh-bg);
    border-bottom: 1px solid var(--dh-border);
    min-height: var(--dh-navbar-height);
    z-index: 1040;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    min-height: var(--dh-navbar-height);
    max-width: 100%;
}

/* Logo/Brand */
.nav-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

    .nav-brand:hover {
        opacity: 0.8;
    }

.logo-img {
    height: 32px;
    width: auto;
    display: block;
    max-width: 180px;
}

.logo-light {
    display: none;
}

body.dark-mode .logo-dark {
    display: none;
}

body.dark-mode .logo-light {
    display: block;
}

/* Nav Toggle Button (Mobile): user icon on small screens, hamburger on tablet */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    cursor: pointer;
    background: transparent;
    border: none;
    position: relative;
}

/* User icon: hidden by default (shown only on mobile via media query) */
.nav-toggle-user-icon {
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--dh-action);
}

.nav-toggle-user-icon svg {
    width: 24px;
    height: 24px;
}

body.dark-mode .nav-toggle-user-icon {
    color: #ffffff;
}

.nav-toggle-icon {
    width: 24px;
    height: 2px;
    background-color: var(--dh-text);
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger to X animation (desktop/tablet only; icons are 2nd–4th child due to user icon) */
.nav-toggle.open .nav-toggle-icon:nth-child(2) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-icon:nth-child(3) {
    opacity: 0;
}

.nav-toggle.open .nav-toggle-icon:nth-child(4) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Nav Content (collapsible on mobile) */
.nav-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    margin-left: 2rem;
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    margin-right: auto;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    color: var(--dh-text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

    .nav-link:hover {
        color: var(--dh-text);
        background-color: rgba(191, 198, 196, 0.2);
    }

    .nav-link.active {
        color: var(--dh-action);
        font-weight: 600;
    }

/* Search Form */
.nav-search {
    width: 320px;
    flex-shrink: 0;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--dh-text-secondary);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--dh-border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .search-input:focus {
        outline: none;
        border-color: var(--dh-action);
        box-shadow: 0 0 0 0.2rem rgba(90, 122, 93, 0.2);
    }


    
/* Dark mode search input */
body.dark-mode .search-input {
    background-color: var(--dh-warm);
    color: var(--dh-text);
}

/* Auth Buttons */
.nav-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

/* Dark Mode Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--dh-border);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--dh-text);
    font-size: 1.1rem;
}

    .theme-toggle:hover {
        background-color: var(--dh-card-hover);
        border-color: var(--dh-action);
    }

    .theme-toggle i,
    .theme-toggle svg {
        transition: transform 0.3s ease;
    }

    .theme-toggle:hover i,
    .theme-toggle:hover svg {
        transform: rotate(20deg);
    }

/* Hide sun in light mode, moon in dark mode */
body:not(.dark-mode) .theme-toggle .bi-moon-fill {
    display: block;
}

body:not(.dark-mode) .theme-toggle .bi-sun-fill {
    display: none;
}

body.dark-mode .theme-toggle .bi-moon-fill {
    display: none;
}

body.dark-mode .theme-toggle .bi-sun-fill {
    display: block;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

    .btn i,
    .btn svg {
        font-size: 1rem;
        width: 1rem;
        height: 1rem;
    }

.btn-primary {
    background-color: var(--dh-action);
    color: #ffffff;
    border-color: var(--dh-action);
}

    .btn-primary:hover,
    .btn-primary:focus-visible {
        background-color: var(--dh-action-hover);
        border-color: var(--dh-action-hover);
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(90, 122, 93, 0.3);
    }

.btn-outline {
    color: var(--dh-action);
    border: 1px solid var(--dh-action);
    background-color: transparent;
}

    .btn-outline:hover,
    .btn-outline:focus-visible {
        background-color: var(--dh-action);
        color: #ffffff;
    }


/* ============================================================
   ADMIN NAV BAR
   ============================================================ */
.admin-nav {
    background-color: #c0392b;
    display: flex;
    justify-content: center;
    position: fixed;
    top: var(--dh-navbar-height);
    left: 0;
    right: 0;
    z-index: 1035;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

@media print {
    .admin-nav { display: none; }
}

.admin-nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.admin-nav-item {
    position: relative;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.45rem 0.9rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

    .admin-nav-link:hover,
    .admin-nav-link:focus-visible {
        background-color: rgba(0, 0, 0, 0.15);
        color: #fff;
        text-decoration: none;
    }

    .admin-nav-link svg {
        fill: currentColor;
    }

/* Dropdown */
.admin-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background-color: var(--dh-bg);
    border: 1px solid var(--dh-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    padding: 0.35rem 0;
    margin: 0;
    list-style: none;
    z-index: 1050;
}

.admin-nav-dropdown:hover > .admin-dropdown-menu {
    display: block;
}

.admin-dropdown-menu li a {
    display: block;
    padding: 0.4rem 0.9rem;
    color: var(--dh-text);
    text-decoration: none;
    font-size: 0.84rem;
    transition: background-color 0.15s ease;
}

    .admin-dropdown-menu li a:hover {
        background-color: var(--dh-warm);
        color: var(--dh-action);
        text-decoration: none;
    }

.admin-dropdown-header {
    padding: 0.35rem 0.9rem 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--dh-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-dropdown-divider {
    height: 0;
    margin: 0.3rem 0;
    border-top: 1px solid var(--dh-border);
}

/* Offset page content when admin nav is present */
body:has(.admin-nav) .page-wrapper {
    padding-top: calc(var(--dh-navbar-height) + 34px);
}

body:has(.admin-nav) .sidebar-left .sidebar-inner {
    top: calc(var(--dh-navbar-height) + 34px);
    max-height: calc(100vh - var(--dh-navbar-height) - 34px);
}

/* Mobile: wrap admin nav */
@media (max-width: 576px) {
    .admin-nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-nav-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.78rem;
    }
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page-wrapper {
    padding-top: var(--dh-navbar-height);
    min-height: 100vh;
}

.page-grid {
    display: flex;
    position: relative;
}


/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.sidebar-left {
    width: var(--dh-sidebar-width);
    min-height: calc(100vh - var(--dh-navbar-height));
    border-right: 1px solid var(--dh-border);
    background-color: var(--dh-bg);
    flex-shrink: 0;
}

    .sidebar-left .sidebar-inner {
        position: sticky;
        top: var(--dh-navbar-height);
        padding: 1rem 0;
        max-height: calc(100vh - var(--dh-navbar-height));
        overflow-y: auto;
    }

/* Sidebar Navigation */
.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .sidebar-nav li {
        margin: 0;
    }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.25rem;
    color: var(--dh-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

    .sidebar-link i,
    .sidebar-link svg {
        font-size: 1.1rem;
        width: 1.25rem;
        height: 1.1rem;
        text-align: center;
        flex-shrink: 0;
    }

    .sidebar-link:hover {
        color: var(--dh-text);
        background-color: rgba(191, 198, 196, 0.15);
    }

    .sidebar-link.active {
        color: var(--dh-action);
        background-color: rgba(90, 122, 93, 0.08);
        border-left-color: var(--dh-action);
        font-weight: 600;
    }

/* Sidebar "Show All Skills" — collapsed extra skill links */
.sidebar-skill-more {
    display: none;
}

.sidebar-nav.skills-expanded .sidebar-skill-more {
    display: block;
}

.sidebar-nav.skills-expanded #showAllSkillsItem {
    display: none;
}

.sidebar-more-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 1.25rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: var(--dh-action);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .sidebar-more-btn svg {
        width: 1.25rem;
        height: 1.1rem;
        flex-shrink: 0;
    }

    .sidebar-more-btn:hover {
        color: var(--dh-action-hover);
        background-color: rgba(90, 122, 93, 0.08);
    }

/* Sidebar Heading */
.sidebar-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dh-muted-text);
    padding: 0.75rem 1.25rem 0.25rem;
    margin-top: 0.5rem;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: var(--dh-overlay);
    z-index: 1029;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

/* Sidebar Toggle Button in Navbar (Tablet/Mobile) */
.sidebar-toggle-nav {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0.5rem;
    cursor: pointer;
    background: transparent;
    border: none;
    margin-right: 0.75rem;
}

.sidebar-toggle-icon {
    width: 24px;
    height: 2px;
    background-color: var(--dh-text);
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Sidebar hamburger to X animation */
.sidebar-toggle-nav.open .sidebar-toggle-icon:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.sidebar-toggle-nav.open .sidebar-toggle-icon:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle-nav.open .sidebar-toggle-icon:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}


/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.content-main {
    flex: 1;
    min-width: 0;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

    .content-header h1 {
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
    }

/* Content Tabs */
.content-tabs {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1.5rem 0;
    padding: 0;
    border-bottom: 1px solid var(--dh-border);
}

.tab-link {
    color: var(--dh-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

    .tab-link:hover {
        color: var(--dh-text);
        border-bottom-color: var(--dh-muted);
    }

    .tab-link.active {
        color: var(--dh-action);
        border-bottom-color: var(--dh-action);
        font-weight: 600;
    }


/* ============================================================
   QUESTION CARDS
   ============================================================ */
.question-list {
    margin-bottom: 2rem;
}

.question-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--dh-border);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 4px;
    margin-bottom: 2px;
}

    .question-card:hover {
        background-color: var(--dh-card-hover);
        box-shadow: 0 2px 8px var(--dh-shadow);
    }

    .question-card:focus-visible {
        outline: 2px solid var(--dh-action);
        outline-offset: -2px;
    }

/* Stats Column */
.question-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
    min-width: 70px;
    flex-shrink: 0;
    padding-top: 0.125rem;
}

.stat-item {
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.2;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.stat-number {
    font-weight: 700;
    display: block;
    font-size: 0.9rem;
    color: var(--dh-text);
}

.stat-label {
    color: var(--dh-text-secondary);
    font-size: 0.7rem;
}

.stat-item.answered {
    border: 1px solid var(--dh-action);
    color: var(--dh-action);
}

    .stat-item.answered .stat-number,
    .stat-item.answered .stat-label {
        color: var(--dh-action);
    }

.stat-item.has-accepted {
    background-color: var(--dh-action);
    color: #ffffff;
}

    .stat-item.has-accepted .stat-number,
    .stat-item.has-accepted .stat-label {
        color: #ffffff;
    }

/* Question Body */
.question-body {
    flex: 1;
    min-width: 0;
}

.question-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    line-height: 1.4;
}

    .question-title a {
        color: var(--dh-action);
        text-decoration: none;
    }

        .question-title a:hover {
            color: var(--dh-action-hover);
            text-decoration: underline;
        }

.question-excerpt {
    font-size: 0.825rem;
    color: var(--dh-text-secondary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Question Meta */
.question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag-badge {
    display: inline-block;
    background-color: rgba(90, 122, 93, 0.1);
    color: var(--dh-action);
    font-size: 0.725rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

    .tag-badge:hover {
        background-color: rgba(90, 122, 93, 0.2);
        color: var(--dh-action-hover);
    }

.tag-count {
    color: var(--dh-text-secondary);
    font-size: 0.65rem;
    margin-left: 0.25rem;
}

.article-description {
    color: var(--dh-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 1rem 0;
}

.meta-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--dh-text-secondary);
    white-space: nowrap;
}

.avatar-sm {
    border-radius: 4px;
    width: 24px;
    height: 24px;
}

.meta-user {
    color: var(--dh-action);
    font-weight: 500;
}

.meta-time {
    color: var(--dh-text-secondary);
}


/* ============================================================
   DRILL LIST CARDS
   ============================================================ */
.drill-list {
  margin-bottom: 2rem;
}

.drill-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--dh-border);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border-radius: 4px;
  margin-bottom: 2px;
}

.drill-card:hover {
  background-color: var(--dh-card-hover);
  box-shadow: 0 2px 8px var(--dh-shadow);
}

.drill-card:focus-visible {
  outline: 2px solid var(--dh-action);
  outline-offset: -2px;
}

/* Thumbnail */
.drill-card-thumbnail {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
}

.drill-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Difficulty badge overlay */
.drill-difficulty {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #ffffff;
  line-height: 1.3;
}

.drill-difficulty--easy {
  background-color: #4caf50;
}

.drill-difficulty--medium {
  background-color: var(--dh-accent);
}

.drill-difficulty--hard {
  background-color: #e53935;
}

/* Card body */
.drill-card-body {
  flex: 1;
  min-width: 0;
}

.drill-card-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.drill-card-title a {
  color: var(--dh-action);
  text-decoration: none;
}

.drill-card-title a:hover {
  color: var(--dh-action-hover);
  text-decoration: underline;
}

.drill-card-excerpt {
  font-size: 0.825rem;
  color: var(--dh-text-secondary);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Detail pills row */
.drill-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.drill-detail {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.725rem;
  color: var(--dh-text-secondary);
  background-color: var(--dh-warm);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.drill-detail i {
  font-size: 0.75rem;
  color: var(--dh-action);
}

/* Meta row */
.drill-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.drill-rating,
.drill-views {
  font-size: 0.75rem;
  color: var(--dh-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.drill-rating i {
  color: var(--dh-accent);
  font-size: 0.7rem;
}

.drill-views i {
  font-size: 0.7rem;
}

/* Responsive drill cards */
@media (max-width: 767px) {
  .drill-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .drill-card-thumbnail {
    width: 100%;
    height: 160px;
  }

  .drill-card-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-wrapper {
    margin-top: 2rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-item {
    margin: 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0.375rem 0.75rem;
    color: var(--dh-text);
    border: 1px solid var(--dh-border);
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

    .page-link:hover {
        background-color: rgba(191, 198, 196, 0.2);
        border-color: var(--dh-muted);
        color: var(--dh-text);
    }

.page-item.active .page-link {
    background-color: var(--dh-action);
    border-color: var(--dh-action);
    color: #ffffff;
}

.page-item.disabled .page-link {
    color: var(--dh-muted-text);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

    .page-item.disabled .page-link:hover {
        background-color: transparent;
        border-color: var(--dh-border);
    }


/* ============================================================
   RIGHT SIDEBAR
   ============================================================ */
.sidebar-right {
    width: var(--dh-right-sidebar-width);
    min-width: 300px;
    flex-shrink: 0;
    display: none;
    /*overflow: hidden;*/
}

    /* Scrolls with the page (no sticky / own scrollbar) so it moves in sync
       with .content-main. The left sidebar keeps its independent scroll. */
    .sidebar-right .sidebar-inner {
        position: static;
        padding: 1.5rem 0 2rem;
        overflow-x: hidden;
    }

/* Widgets */
.widget {
    background-color: var(--dh-warm);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}

/* Dark mode widget border */
body.dark-mode .widget {
    border: 1px solid var(--dh-border);
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dh-text);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.widget-title svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .widget-list li {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

        .widget-list li:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

    .widget-list a {
        font-size: 0.8rem;
        color: var(--dh-text);
        line-height: 1.4;
        display: block;
    }

        .widget-list a:hover {
            color: var(--dh-action);
        }

.widget-meta {
    font-size: 0.7rem;
    color: var(--dh-text-secondary);
    display: block;
    margin-top: 0.25rem;
}

/* Trending Tags */
.trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Hot Scores */
.hot-score {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dh-accent);
    margin-right: 0.25rem;
}

/* Community Stats */
.community-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.stat-row {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dh-action);
}

.stat-desc {
    font-size: 0.7rem;
    color: var(--dh-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background-color: #2d3436;
    color: #b2bec3;
    padding: 2rem 0 1rem;
    margin-top: 2rem;
}

/* Dark mode footer adjustment */
body.dark-mode .site-footer {
    background-color: #0f1214;
    border-top: 1px solid var(--dh-border);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-col {
    margin: 0;
}

.footer-about {
    max-width: 280px;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-logo-img {
    height: 28px;
    width: auto;
    display: block;
    max-width: 160px;
}

.footer-text {
    font-size: 0.8rem;
    color: #b2bec3;
    margin-top: 0.75rem;
}

.footer-heading {
    color: #ffffff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .footer-links li {
        margin-bottom: 0.375rem;
    }

    .footer-links a {
        color: #b2bec3;
        font-size: 0.8rem;
        transition: color 0.2s ease;
    }

        .footer-links a:hover {
            color: #ffffff;
        }

.footer-socials {
    display: flex;
    gap: 0.75rem;
}

    .footer-socials a {
        color: #b2bec3;
        font-size: 1.15rem;
        transition: color 0.2s ease;
        display: inline-flex;
        align-items: center;
    }

    .footer-socials a svg {
        width: 1.15rem;
        height: 1.15rem;
    }

        .footer-socials a:hover {
            color: var(--dh-action);
        }

.footer-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1.25rem 0;
}

.footer-copy {
    font-size: 0.75rem;
    color: #636e72;
    text-align: center;
    margin: 0;
}


/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
.sidebar-inner::-webkit-scrollbar {
    width: 4px;
}

.sidebar-inner::-webkit-scrollbar-thumb {
    background-color: var(--dh-muted);
    border-radius: 4px;
}

.sidebar-inner::-webkit-scrollbar-track {
    background-color: transparent;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet & Below (< 992px) */
@media (max-width: 991px) {
    .sidebar-left {
        position: fixed;
        top: var(--dh-navbar-height);
        left: 0;
        bottom: 0;
        z-index: 1030;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }

        .sidebar-left.open {
            transform: translateX(0);
            box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
        }

    .sidebar-toggle-nav {
        display: flex;
    }

    /* Nav bar: sidebar hamburger left, logo center, user/nav toggle right */
    .nav-container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 0.25rem 0.5rem;
    }

    .sidebar-toggle-nav {
        justify-self: start;
        margin-right: 0;
    }

    .nav-brand {
        justify-self: center;
    }

    /*.nav-toggle {
        display: flex;
        justify-self: end;
    }

    .nav-toggle .nav-toggle-icon {
        display: none;
    }*/

    .nav-toggle .nav-toggle-user-icon {
        display: none;
    }

    .nav-content {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-left: 0;
    }

    .content-main {
        width: 100%;
        /* Full-width basis (not flex: 1 1 0) so the right sidebar wraps below it */
        flex-basis: 100%;
    }

    /* Right sidebar stacks full-width below the main content */
    .page-grid {
        flex-wrap: wrap;
    }

    .sidebar-right {
        display: block;
        width: 100%;
        min-width: 0;
        border-top: 1px solid var(--dh-border);
    }

        .sidebar-right .sidebar-inner {
            max-width: 900px;
            margin: 0 auto;
            padding: 1.5rem 1.25rem 2rem;
        }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    /* Logo sizing for smaller screens */
    .logo-img {
        height: 40px;
        max-width: 160px;
    }

    /* Header Navigation: show user icon instead of hamburger to avoid duplicate hamburgers */
    .nav-toggle {
        display: flex;
        justify-self: end;
        order: 2;
    }

    .nav-toggle .nav-toggle-icon {
        display: none;
    }

    .nav-toggle .nav-toggle-user-icon {
        display: flex;
    }

    .nav-content {
        position: fixed;
        top: var(--dh-navbar-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background-color: var(--dh-bg);
        border-bottom: 1px solid var(--dh-border);
        /* padding: 1rem; */
        gap: 1rem;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

        .nav-content.open {
            max-height: calc(100vh - var(--dh-navbar-height));
            padding: 1rem;
        }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .nav-search {
        width: 100%;
    }

    .nav-actions {
        width: 100%;
        flex-direction: column;
    }

        .nav-actions .btn {
            width: 100%;
            justify-content: center;
        }

    /* Content */
    .content-wrapper {
        padding: 1rem 0.75rem 2rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

        .content-header h1 {
            font-size: 1.25rem;
        }

    /* Question Cards */
    .question-card {
        flex-direction: column;
        gap: 0.5rem;
    }

    .question-stats {
        flex-direction: row;
        justify-content: flex-start;
        min-width: auto;
        gap: 0.75rem;
    }

    .question-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-about {
        max-width: 100%;
    }
}

/* Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .sidebar-right {
        display: none;
    }
}

/* Large Desktop (≥ 1200px) */
@media (min-width: 1200px) {
    .sidebar-right {
        display: block;
    }

    .nav-container {
        padding: 0 2rem;
    }

    .content-wrapper {
        max-width: 100%;
        padding: 1.5rem 2rem 3rem;
    }
}

/* Extra Large Desktop (≥ 1400px) */
@media (min-width: 1400px) {
    :root {
        --dh-right-sidebar-width: 340px;
    }
}

/* ============================================================
   ARTICLE PAGE STYLES
   ============================================================ */

/* Breadcrumb */
.article-breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0;
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    color: var(--dh-text-muted);
}

.article-breadcrumb li + li::before {
    content: "/";
    margin-right: 0.25rem;
    color: var(--dh-muted);
}

.article-breadcrumb a {
    color: var(--dh-action);
    text-decoration: none;
}

    .article-breadcrumb a:hover {
        text-decoration: underline;
    }

.article-breadcrumb li[aria-current="page"] {
    color: var(--dh-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

/* Article Header */
.article-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--dh-muted);
}

.article-title {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--dh-text);
    margin: 0 0 0.75rem;
}

.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .article-author .meta-user {
        font-weight: 500;
        color: var(--dh-action);
        text-decoration: none;
    }

    .article-author .meta-time {
        display: block;
        font-size: 0.8rem;
        color: var(--dh-text-muted);
    }

.avatar-md {
    border-radius: 50%;
}

.article-stats-bar {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--dh-text-muted);
}

    .article-stats-bar i {
        margin-right: 0.2rem;
    }

/* Traditional Article Content */
.article-traditional {
    display: block;
    padding: 1.25rem 0;
    border-bottom: none;
}

/* Article lead paragraph */
.article-lead {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--dh-text-muted);
    border-left: 3px solid var(--dh-action);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

/* Article text body */
.article-text {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--dh-text);
}

    .article-text p {
        margin: 0 0 1rem;
    }

    .article-text h2 {
        font-size: 1.3rem;
        font-weight: 600;
        color: var(--dh-text);
        margin: 2rem 0 0.75rem;
        padding-top: 0.5rem;
    }

        .article-text h2:first-of-type {
            margin-top: 0;
        }

    .article-text h3 {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--dh-text);
        margin: 1.5rem 0 0.5rem;
    }

    .article-text ul {
        margin: 0 0 1rem;
        padding-left: 1.5rem;
        list-style: disc;
    }

    .article-text ol {
        margin: 0 0 1rem;
        padding-left: 1.5rem;
        list-style: decimal;
    }

    .article-text li {
        margin-bottom: 0.35rem;
    }

    .article-text pre {
        background: var(--dh-card-bg);
        border: 1px solid var(--dh-muted);
        border-radius: 6px;
        padding: 1rem;
        overflow-x: auto;
        margin: 0 0 1.25rem;
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .article-text code {
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
        font-size: 0.875em;
    }

    .article-text p code,
    .article-text li code {
        background: var(--dh-card-bg);
        border: 1px solid var(--dh-muted);
        border-radius: 3px;
        padding: 0.15em 0.35em;
    }

/* Article Footer Actions */
.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--dh-muted);
    border-bottom: 1px solid var(--dh-muted);
    margin-bottom: 1.5rem;
}

.article-actions-left {
    display: flex;
    gap: 0.5rem;
}

.article-actions-social {
    display: flex;
    align-items: center;
}

.social-share-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.social-share-list li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--dh-text-secondary);
    transition: color 0.2s, background 0.2s;
}

.social-share-list li a:hover {
    color: var(--dh-action);
    background: var(--dh-warm);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

    .btn-sm i {
        margin-right: 0.25rem;
    }

/* Author Bio */
.author-bio {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--dh-card-bg);
    border: 1px solid var(--dh-muted);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.author-bio-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.author-bio-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

    .author-bio-info h3 a {
        color: var(--dh-action);
        text-decoration: none;
    }

.author-bio-info p {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--dh-text-muted);
}

/* Comments Section */
.article-comments {
    margin-top: 0.5rem;
}

.comments-heading {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--dh-text);
}

    .comments-heading i {
        margin-right: 0.35rem;
    }

.comment {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--dh-muted);
}

    .comment .avatar-sm {
        border-radius: 50%;
        flex-shrink: 0;
        align-self: flex-start;
    }

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

    .comment-header .meta-user {
        font-weight: 500;
        font-size: 0.85rem;
        color: var(--dh-action);
        text-decoration: none;
    }

    .comment-header .meta-time {
        font-size: 0.8rem;
        color: var(--dh-text-muted);
    }

.comment-body p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--dh-text);
}

    .comment-body p code {
        background: var(--dh-card-bg);
        border: 1px solid var(--dh-muted);
        border-radius: 3px;
        padding: 0.1em 0.3em;
        font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
        font-size: 0.85em;
    }

.comment-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.comment-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--dh-text-muted);
    padding: 0;
    transition: color 0.15s;
}

    .comment-action-btn:hover {
        color: var(--dh-action);
    }

    .comment-action-btn i {
        margin-right: 0.2rem;
    }

/* Add Comment */
.add-comment {
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.comment-textarea {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid var(--dh-muted);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--dh-bg);
    color: var(--dh-text);
}

    .comment-textarea:focus {
        outline: none;
        border-color: var(--dh-action);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--dh-action) 20%, transparent);
    }

/* ============================================================
   DRILL PAGE STYLES
   ============================================================ */

/* Drill subtitle */
.drill-subtitle {
    font-size: 1rem;
    color: var(--dh-text-muted);
    margin: -0.35rem 0 0.75rem;
    line-height: 1.4;
}

/* Drill Quick Reference Grid */
.drill-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--dh-card-bg);
    border: 1px solid var(--dh-muted);
    border-radius: 8px;
}

.drill-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
}

    .drill-detail-item > i,
    .drill-detail-item > svg {
        font-size: 1.25rem;
        width: 1.25rem;
        height: 1.25rem;
        color: var(--dh-action);
        margin-bottom: 0.15rem;
    }

.drill-detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dh-text-muted);
    font-weight: 600;
}

.drill-detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dh-text);
}

/* Section heading icons */
.article-text h2 > i,
.article-text h2 > svg,
.article-section-heading > i,
.article-section-heading > svg {
    margin-right: 0.4rem;
    color: var(--dh-action);
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

/* Equipment pills */
.drill-equipment {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.equipment-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: var(--dh-card-bg);
    border: 1px solid var(--dh-muted);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--dh-text);
}

    .equipment-item i {
        font-size: 0.5rem;
        color: var(--dh-action);
    }

/* Drill Hero: image + meta side-by-side */
.drill-hero {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.drill-hero-image {
    flex: 2;
    min-width: 0;
}

.drill-hero-image .drill-diagram-img {
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.drill-hero-meta {
    flex: 1;
    min-width: 220px;
}

.drill-hero-meta .drill-details-grid {
    height: 100%;
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0;
    align-content: center;
}

/* Drill video full-width */
.drill-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.drill-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Drill diagram image */
.drill-diagram-img {
    display: block;
    max-width: 550px;
    width: 100%;
    height: auto;
    border: 1px solid var(--dh-muted);
    border-radius: 8px;
}

/* Responsive adjustments for article & drill */
@media (max-width: 768px) {
    .drill-hero {
        flex-direction: column;
    }

    .drill-hero-meta {
        min-width: unset;
    }

    .drill-hero-meta .drill-details-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .drill-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .article-title {
        font-size: 1.25rem;
    }

    .article-meta-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .author-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .article-actions-left {
        flex-wrap: wrap;
    }

    .drill-details-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0.85rem;
    }

    .drill-hero-meta .drill-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ============================================================
   HOME PAGE STYLES
   ============================================================ */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--dh-action) 0%, #3d5a3f 100%);
    color: #ffffff;
    padding: 3rem 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

    .hero-section::after {
        content: "";
        position: absolute;
        top: -50%;
        right: -20%;
        width: 400px;
        height: 400px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 50%;
        pointer-events: none;
    }

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.05rem;
    opacity: 0.9;
    margin: 0 0 1.5rem;
    max-width: 560px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-hero-primary {
    background-color: #ffffff;
    color: var(--dh-action);
    border-color: #ffffff;
}

    .btn-hero-primary:hover {
        background-color: transparent;
        color: #ffffff;
        border-color: #ffffff;
    }

.btn-hero-outline {
    background-color: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

    .btn-hero-outline:hover {
        border-color: #ffffff;
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

/* Section Headings */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--dh-border);
}

    .section-heading h2 {
        font-size: 1.15rem;
        font-weight: 600;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .section-heading h2 i,
        .section-heading h2 svg {
            color: var(--dh-action);
            font-size: 1rem;
            width: 1rem;
            height: 1rem;
        }

    .section-heading a {
        font-size: 0.8rem;
        font-weight: 500;
    }

/* Feature Cards Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-card {
    padding: 1.25rem;
    border: 1px solid var(--dh-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

    .feature-card:hover {
        border-color: var(--dh-action);
        box-shadow: 0 4px 12px var(--dh-shadow);
        transform: translateY(-2px);
        color: inherit;
    }

.feature-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background-color: rgba(90, 122, 93, 0.1);
    color: var(--dh-action);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.feature-card p {
    font-size: 0.8rem;
    color: var(--dh-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Drill Preview Cards */
.drill-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.drill-preview-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--dh-border);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

    .drill-preview-card:hover {
        border-color: var(--dh-action);
        box-shadow: 0 2px 8px var(--dh-shadow);
        color: inherit;
    }

.drill-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background-color: rgba(90, 122, 93, 0.08);
    color: var(--dh-action);
    font-size: 1.35rem;
    flex-shrink: 0;
}

.drill-preview-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.drill-preview-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.drill-preview-info p {
    font-size: 0.78rem;
    color: var(--dh-text-secondary);
    margin: 0;
    line-height: 1.4;
}

.drill-preview-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: var(--dh-muted-text);
}

    .drill-preview-meta span {
        display: flex;
        align-items: center;
        gap: 0.2rem;
    }

/* Age Group Badges */
.age-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.age-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--dh-border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--dh-text);
    transition: all 0.2s ease;
    flex: 1;
    min-width: 100px;
    text-align: center;
}

    .age-badge:hover {
        border-color: var(--dh-action);
        background-color: rgba(90, 122, 93, 0.05);
        color: var(--dh-action);
    }

.age-badge-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dh-action);
}

.age-badge-desc {
    font-size: 0.7rem;
    color: var(--dh-text-secondary);
}

/* Quick Stats Bar */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background-color: var(--dh-warm);
    border-radius: 8px;
}

body.dark-mode .quick-stats {
    border: 1px solid var(--dh-border);
}

.quick-stat {
    text-align: center;
}

.quick-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dh-action);
}

.quick-stat-label {
    font-size: 0.72rem;
    color: var(--dh-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Responsive Home Page */
@media (max-width: 991px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .hero-section {
        padding: 2rem 1.25rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .drill-preview-grid {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .age-groups {
        flex-wrap: wrap;
    }

    .age-badge {
        min-width: 80px;
    }
}
/* ============================================================
   ADMIN FORMS
   ============================================================ */

/* Form Container */
.admin-form {
  max-width: 100%;
}

/* Form Sections (Fieldsets) */
.form-section {
  border: 1px solid var(--dh-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: var(--dh-bg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dh-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--dh-border);
}

.form-section-title i {
  color: var(--dh-action);
  font-size: 1.1rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Form Row (multi-column) */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row .form-group {
  margin-bottom: 0;
}

.form-group-half {
  flex: 1;
  min-width: 0;
}

.form-group-third {
  flex: 1;
  min-width: 0;
}

/* Labels */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dh-text);
  margin-bottom: 0.375rem;
}

.form-required {
  color: #e53935;
  font-weight: 700;
}

/* Hint text */
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--dh-text-secondary);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.form-hint-inline {
  font-size: 0.75rem;
  color: var(--dh-text-secondary);
  margin-left: 0.25rem;
}

/* ---- Core Form Controls ---- */
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--dh-text);
  background-color: var(--dh-bg);
  border: 1px solid var(--dh-border);
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-control::placeholder {
  color: var(--dh-muted-text);
  opacity: 1;
}

.form-control:focus {
  outline: none;
  border-color: var(--dh-action);
  box-shadow: 0 0 0 0.2rem rgba(90, 122, 93, 0.2);
}

.form-control:hover:not(:focus):not(:disabled):not([readonly]) {
  border-color: var(--dh-muted);
}

.form-control:disabled {
  background-color: var(--dh-warm);
  color: var(--dh-muted-text);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-control[readonly] {
  background-color: var(--dh-warm);
  cursor: default;
}

/* Dark mode form controls */
body.dark-mode .form-control {
  background-color: var(--dh-warm);
  color: var(--dh-text);
}

body.dark-mode .form-control:disabled,
body.dark-mode .form-control[readonly] {
  background-color: var(--dh-muted);
  opacity: 0.6;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-control-rich {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* ---- Rich Text Toolbar ---- */
.form-toolbar {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 0.5rem;
  background-color: var(--dh-warm);
  border: 1px solid var(--dh-border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.form-toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--dh-text-secondary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.form-toolbar-btn:hover {
  background-color: rgba(90, 122, 93, 0.12);
  color: var(--dh-action);
}

.form-toolbar-divider {
  width: 1px;
  height: 20px;
  background-color: var(--dh-border);
  margin: 0 0.25rem;
}

/* ---- Select / Dropdown ---- */
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7876' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.25rem;
  cursor: pointer;
}

.form-select[multiple] {
  background-image: none;
  padding-right: 0.75rem;
  height: auto;
}

.form-select-sm {
  padding: 0.25rem 2rem 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* ---- Input Groups (Prefix/Suffix) ---- */
.form-input-group {
  display: flex;
  align-items: stretch;
}

.form-input-group .form-control {
  flex: 1;
  min-width: 0;
  border-radius: 0;
}

.form-input-group .form-control:first-child {
  border-radius: 6px 0 0 6px;
}

.form-input-group .form-control:last-child {
  border-radius: 0 6px 6px 0;
}

.form-input-group .form-control:only-child {
  border-radius: 6px;
}

.form-input-addon {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  color: var(--dh-text-secondary);
  background-color: var(--dh-warm);
  border: 1px solid var(--dh-border);
  white-space: nowrap;
}

.form-input-addon:first-child {
  border-right: none;
  border-radius: 6px 0 0 6px;
}

.form-input-addon:last-child {
  border-left: none;
  border-radius: 0 6px 6px 0;
}

.form-input-addon-btn {
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.form-input-addon-btn:hover {
  color: var(--dh-action);
  background-color: rgba(90, 122, 93, 0.08);
}

/* ---- Radio Buttons ---- */
.form-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-radio-group-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  position: relative;
}

.form-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-radio-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--dh-muted);
  border-radius: 50%;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-radio-indicator::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--dh-action);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.form-radio input[type="radio"]:checked + .form-radio-indicator {
  border-color: var(--dh-action);
}

.form-radio input[type="radio"]:checked + .form-radio-indicator::after {
  transform: scale(1);
}

.form-radio input[type="radio"]:focus-visible + .form-radio-indicator {
  outline: 2px solid var(--dh-action);
  outline-offset: 2px;
}

.form-radio-label {
  color: var(--dh-text);
  font-weight: 500;
}

/* ---- Checkboxes ---- */
.form-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 1.25rem;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  position: relative;
}

.form-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-checkbox-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--dh-muted);
  border-radius: 4px;
  flex-shrink: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-checkbox-indicator::after {
  content: "";
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
  margin-top: -1px;
}

.form-checkbox input[type="checkbox"]:checked + .form-checkbox-indicator {
  background-color: var(--dh-action);
  border-color: var(--dh-action);
}

.form-checkbox input[type="checkbox"]:checked + .form-checkbox-indicator::after {
  transform: rotate(45deg) scale(1);
}

.form-checkbox input[type="checkbox"]:focus-visible + .form-checkbox-indicator {
  outline: 2px solid var(--dh-action);
  outline-offset: 2px;
}

.form-checkbox-label {
  color: var(--dh-text);
  font-weight: 500;
}

.form-checkbox-header {
  margin: 0;
}

/* ---- Toggle Switches ---- */
.form-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  position: relative;
}

.form-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.form-toggle-slider {
  position: relative;
  width: 40px;
  height: 22px;
  background-color: var(--dh-muted);
  border-radius: 22px;
  flex-shrink: 0;
  transition: background-color 0.25s ease;
}

.form-toggle-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.form-toggle input[type="checkbox"]:checked + .form-toggle-slider {
  background-color: var(--dh-action);
}

.form-toggle input[type="checkbox"]:checked + .form-toggle-slider::after {
  transform: translateX(18px);
}

.form-toggle input[type="checkbox"]:focus-visible + .form-toggle-slider {
  outline: 2px solid var(--dh-action);
  outline-offset: 2px;
}

.form-toggle-label {
  color: var(--dh-text);
  font-weight: 500;
  min-width: 120px;
}

/* ---- Range Slider ---- */
.form-range-wrapper {
  padding: 0.25rem 0;
}

.form-range {
  width: 100%;
  height: 6px;
  background: var(--dh-warm);
  border-radius: 6px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--dh-action);
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--dh-action);
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.form-range:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--dh-action);
  outline-offset: 2px;
}

.form-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--dh-text-secondary);
  margin-top: 0.35rem;
}

/* ---- Color Picker ---- */
.form-color-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-color {
  width: 40px;
  height: 40px;
  padding: 2px;
  border: 2px solid var(--dh-border);
  border-radius: 6px;
  cursor: pointer;
  background: none;
  transition: border-color 0.2s ease;
}

.form-color:hover {
  border-color: var(--dh-action);
}

.form-color:focus-visible {
  outline: 2px solid var(--dh-action);
  outline-offset: 2px;
}

.form-color-value {
  font-size: 0.85rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--dh-text-secondary);
}

/* ---- File Upload ---- */
.form-file-upload {
  position: relative;
}

.form-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.form-file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  border: 2px dashed var(--dh-border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  color: var(--dh-text-secondary);
}

.form-file-label i {
  font-size: 2rem;
  color: var(--dh-action);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.form-file-label:hover,
.form-file-input:focus + .form-file-label {
  border-color: var(--dh-action);
  background-color: rgba(90, 122, 93, 0.04);
}

.form-file-label:hover i,
.form-file-input:focus + .form-file-label i {
  opacity: 1;
}

.form-file-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dh-text);
}

.form-file-hint {
  font-size: 0.75rem;
  color: var(--dh-text-secondary);
}

/* ---- Tags / Chips ---- */
.form-tags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.form-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background-color: rgba(90, 122, 93, 0.1);
  color: var(--dh-action);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.form-tag-remove {
  background: none;
  border: none;
  color: var(--dh-action);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.form-tag-remove:hover {
  opacity: 1;
}

/* ---- Badges ---- */
.form-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  color: #ffffff;
}

.form-badge-easy {
  background-color: #4caf50;
}

.form-badge-medium {
  background-color: var(--dh-accent);
}

.form-badge-hard {
  background-color: #e53935;
}

/* ---- Status Indicators ---- */
.form-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.form-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.form-status-published {
  background-color: rgba(76, 175, 80, 0.1);
  color: #4caf50;
}

.form-status-published::before {
  background-color: #4caf50;
}

.form-status-draft {
  background-color: rgba(107, 120, 118, 0.1);
  color: var(--dh-muted-text);
}

.form-status-draft::before {
  background-color: var(--dh-muted-text);
}

.form-status-archived {
  background-color: rgba(212, 127, 42, 0.1);
  color: var(--dh-accent);
}

.form-status-archived::before {
  background-color: var(--dh-accent);
}

/* ---- Validation States ---- */
.form-control.is-valid {
  border-color: #4caf50;
}

.form-control.is-valid:focus {
  box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.2);
}

.form-control.is-invalid {
  border-color: #e53935;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 0.2rem rgba(229, 57, 53, 0.2);
}

.form-control.is-warning {
  border-color: var(--dh-accent);
}

.form-control.is-warning:focus {
  box-shadow: 0 0 0 0.2rem rgba(212, 127, 42, 0.2);
}

.form-feedback {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.form-feedback i {
  font-size: 0.85rem;
}

.form-feedback-valid {
  color: #4caf50;
}

.form-feedback-invalid {
  color: #e53935;
}

.form-feedback-warning {
  color: var(--dh-accent);
}

/* ---- Alerts ---- */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
}

.form-alert:last-child {
  margin-bottom: 0;
}

.form-alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.form-alert-info {
  background-color: rgba(90, 122, 93, 0.08);
  border-color: rgba(90, 122, 93, 0.2);
  color: var(--dh-action);
}

.form-alert-success {
  background-color: rgba(76, 175, 80, 0.08);
  border-color: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

body.dark-mode .form-alert-success {
  color: #66bb6a;
}

.form-alert-warning {
  background-color: rgba(212, 127, 42, 0.08);
  border-color: rgba(212, 127, 42, 0.2);
  color: #b36a1e;
}

body.dark-mode .form-alert-warning {
  color: #f59e0b;
}

.form-alert-danger {
  background-color: rgba(229, 57, 53, 0.08);
  border-color: rgba(229, 57, 53, 0.2);
  color: #c62828;
}

body.dark-mode .form-alert-danger {
  color: #ef5350;
}

/* ---- Progress Bars ---- */
.form-progress {
  width: 100%;
  height: 24px;
  background-color: var(--dh-warm);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--dh-border);
}

.form-progress-bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--dh-action);
  border-radius: 6px 0 0 6px;
  transition: width 0.4s ease;
}

.form-progress-bar-accent {
  background-color: var(--dh-accent);
}

/* ---- Data Table ---- */
.form-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--dh-border);
  border-radius: 8px;
}

.form-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.form-table thead {
  background-color: var(--dh-warm);
}

.form-table th {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--dh-text-secondary);
  border-bottom: 2px solid var(--dh-border);
  white-space: nowrap;
}

.form-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--dh-border);
  color: var(--dh-text);
  vertical-align: middle;
}

.form-table tbody tr {
  transition: background-color 0.15s ease;
}

.form-table tbody tr:hover {
  background-color: var(--dh-card-hover);
}

.form-table tbody tr:last-child td {
  border-bottom: none;
}

.form-table a {
  color: var(--dh-action);
  font-weight: 500;
}

.form-table a:hover {
  text-decoration: underline;
}

.form-table-actions {
  display: flex;
  gap: 0.25rem;
}

.form-table-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--dh-border);
  border-radius: 4px;
  background: transparent;
  color: var(--dh-text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.form-table-btn:hover {
  background-color: rgba(90, 122, 93, 0.08);
  border-color: var(--dh-action);
  color: var(--dh-action);
}

.form-table-btn-danger:hover {
  background-color: rgba(229, 57, 53, 0.08);
  border-color: #e53935;
  color: #e53935;
}

/* Table Footer */
.form-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.form-table-info {
  font-size: 0.8rem;
  color: var(--dh-text-secondary);
}

.form-table-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.form-inline-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--dh-text-secondary);
}

.form-table-footer .pagination-wrapper {
  margin-top: 0;
}

/* Checklist Widget */
.form-checklist-widget {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ---- Form Actions Bar ---- */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--dh-border);
  margin-top: 0.5rem;
}

.form-actions-left,
.form-actions-right {
  display: flex;
  gap: 0.5rem;
}

/* ---- Responsive Admin Forms ---- */
@media (max-width: 767px) {
  .form-section {
    padding: 1rem;
  }

  .form-row {
    flex-direction: column;
    gap: 1.25rem;
  }

  .form-radio-group-inline {
    flex-direction: column;
    gap: 0.5rem;
  }

  .form-checkbox-group {
    flex-direction: column;
  }

  .form-toggle-label {
    min-width: auto;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions-left,
  .form-actions-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .form-actions .btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .form-table-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-table-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   SPACING UTILITIES (Bootstrap-style)
   p  = padding,  m  = margin
   t/b/l/r = top/bottom/left/right
   x = left + right,  y = top + bottom
   Scale: 0=0, 1=0.25rem, 2=0.5rem, 3=1rem, 4=1.5rem, 5=3rem
   ============================================================ */

/* --- Padding --- */
.p-0 {
    padding: 0 !important;
}

.p-1 {
    padding: 0.25rem !important;
}

.p-2 {
    padding: 0.5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.p-4 {
    padding: 1.5rem !important;
}

.p-5 {
    padding: 3rem !important;
}

.pt-0 {
    padding-top: 0 !important;
}

.pt-1 {
    padding-top: 0.25rem !important;
}

.pt-2 {
    padding-top: 0.5rem !important;
}

.pt-3 {
    padding-top: 1rem !important;
}

.pt-4 {
    padding-top: 1.5rem !important;
}

.pt-5 {
    padding-top: 3rem !important;
}

.pb-0 {
    padding-bottom: 0 !important;
}

.pb-1 {
    padding-bottom: 0.25rem !important;
}

.pb-2 {
    padding-bottom: 0.5rem !important;
}

.pb-3 {
    padding-bottom: 1rem !important;
}

.pb-4 {
    padding-bottom: 1.5rem !important;
}

.pb-5 {
    padding-bottom: 3rem !important;
}

.pl-0 {
    padding-left: 0 !important;
}

.pl-1 {
    padding-left: 0.25rem !important;
}

.pl-2 {
    padding-left: 0.5rem !important;
}

.pl-3 {
    padding-left: 1rem !important;
}

.pl-4 {
    padding-left: 1.5rem !important;
}

.pl-5 {
    padding-left: 3rem !important;
}

.pr-0 {
    padding-right: 0 !important;
}

.pr-1 {
    padding-right: 0.25rem !important;
}

.pr-2 {
    padding-right: 0.5rem !important;
}

.pr-3 {
    padding-right: 1rem !important;
}

.pr-4 {
    padding-right: 1.5rem !important;
}

.pr-5 {
    padding-right: 3rem !important;
}

.px-0 {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.px-1 {
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
}

.px-2 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.px-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

.px-5 {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
}

.py-0 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.py-1 {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.py-2 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.py-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* --- Margin --- */
.m-0 {
    margin: 0 !important;
}

.m-1 {
    margin: 0.25rem !important;
}

.m-2 {
    margin: 0.5rem !important;
}

.m-3 {
    margin: 1rem !important;
}

.m-4 {
    margin: 1.5rem !important;
}

.m-5 {
    margin: 3rem !important;
}

.mt-0 {
    margin-top: 0 !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-5 {
    margin-top: 3rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

.ml-0 {
    margin-left: 0 !important;
}

.ml-1 {
    margin-left: 0.25rem !important;
}

.ml-2 {
    margin-left: 0.5rem !important;
}

.ml-3 {
    margin-left: 1rem !important;
}

.ml-4 {
    margin-left: 1.5rem !important;
}

.ml-5 {
    margin-left: 3rem !important;
}

.mr-0 {
    margin-right: 0 !important;
}

.mr-1 {
    margin-right: 0.25rem !important;
}

.mr-2 {
    margin-right: 0.5rem !important;
}

.mr-3 {
    margin-right: 1rem !important;
}

.mr-4 {
    margin-right: 1.5rem !important;
}

.mr-5 {
    margin-right: 3rem !important;
}

.mx-0 {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.mx-1 {
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
}

.mx-2 {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
}

.mx-3 {
    margin-left: 1rem !important;
    margin-right: 1rem !important;
}

.mx-4 {
    margin-left: 1.5rem !important;
    margin-right: 1.5rem !important;
}

.mx-5 {
    margin-left: 3rem !important;
    margin-right: 3rem !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

.my-0 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.my-1 {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.my-2 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

.my-3 {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

.my-4 {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.my-5 {
    margin-top: 3rem !important;
    margin-bottom: 3rem !important;
}

/* ---- Social Media Icons: Dark Mode ---- */
body.dark-mode .social-share-list li a {
    color: var(--dh-text-secondary);
}

body.dark-mode .social-share-list li a:hover {
    color: var(--dh-action);
    background: var(--dh-warm);
}

/* ============================================================
   PREMIUM LIGHTBOX
   Modal promoting SoccerXpert Premium to anonymous visitors.
   Center modal on desktop; bottom sheet on small screens.
   ============================================================ */

.premium-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--dh-overlay);
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* The base rule's display:flex would otherwise override the
   [hidden] attribute, leaving an invisible layer blocking clicks */
.premium-lightbox-overlay[hidden] {
    display: none;
}

.premium-lightbox-overlay.is-open {
    opacity: 1;
}

.premium-lightbox {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 2rem;
    background-color: var(--dh-bg);
    border: 1px solid var(--dh-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(16px);
    transition: transform 0.25s ease;
}

.premium-lightbox-overlay.is-open .premium-lightbox {
    transform: translateY(0);
}

.premium-lightbox:focus {
    outline: none;
}

.premium-lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--dh-text-secondary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.premium-lightbox-close:hover,
.premium-lightbox-close:focus-visible {
    background-color: var(--dh-warm);
    color: var(--dh-text);
}

.premium-lightbox-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dh-accent);
}

.premium-lightbox-eyebrow .logo-img {
    height: 28px;
}

.premium-lightbox-title {
    margin: 0 1.5rem 0.75rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dh-text);
}

.premium-lightbox-desc {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--dh-text-secondary);
}

.premium-lightbox-benefits {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.premium-lightbox-benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--dh-text);
}

.premium-lightbox-benefits svg {
    flex-shrink: 0;
    margin-top: 0.15em;
    color: var(--dh-action);
}

.premium-lightbox-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.premium-lightbox-cta {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 600;
}

.premium-lightbox-decline {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--dh-text-secondary);
    text-decoration: underline;
    cursor: pointer;
}

.premium-lightbox-decline:hover,
.premium-lightbox-decline:focus-visible {
    color: var(--dh-text);
}

/* Bottom sheet on small screens — less aggressive than a centered modal */
@media (max-width: 576px) {
    .premium-lightbox-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .premium-lightbox {
        max-width: none;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
        padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
        transform: translateY(100%);
    }

    .premium-lightbox-title {
        font-size: 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .premium-lightbox-overlay,
    .premium-lightbox {
        transition: none;
    }
}

/* ==========================================================================
   AD CONTAINER CLS PROTECTION & MONETIZATION OPTIMIZATIONS
   ========================================================================== */
.sx-ad-top-landscape,
.sx-ad-landscape,
.sx-ad-multiplex {
    width: 100%;
    max-width: 100%;
    display: block;
    text-align: center;
    background-color: var(--dh-warm);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.sx-ad-top-landscape {
    min-height: 50px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .sx-ad-top-landscape {
        min-height: 90px;
        transition: min-height 0.25s ease-out;
    }
}

.sx-ad-landscape {
    min-height: 250px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .sx-ad-landscape {
        min-height: 90px;
        transition: min-height 0.25s ease-out;
    }
}

.sx-ad-square,
.sx-ad-square-placeholder {
    min-height: 250px;
    width: 100%;
    max-width: 336px;
    margin: 0 auto;
    display: block;
    text-align: center;
    background-color: var(--dh-warm);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.sidebar-ad-secondary,
.sx-ad-vertical {
    min-height: 250px;
    width: 100%;
    max-width: 100%;
    display: block;
    text-align: center;
    background-color: var(--dh-warm);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

@media (min-width: 992px) {
    .sidebar-ad-secondary {
        position: sticky;
        top: calc(var(--dh-navbar-height) + 1rem);
        z-index: 10;
    }
}

.sx-ad-multiplex {
    min-height: 250px;
    margin: 1.5rem auto 0;
}

/* Development Ad Placeholders */
.sx-ad-top-landscape-placeholder,
.sx-ad-landscape-placeholder,
.sx-ad-vertical-placeholder {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--dh-warm);
    border: 1px dashed var(--dh-border);
    border-radius: 8px;
    color: var(--dh-muted);
    font-size: 0.85rem;
    font-weight: 500;
    box-sizing: border-box;
    margin: 0 auto;
}

.sx-ad-top-landscape-placeholder {
    min-height: 50px;
}

.sx-ad-landscape-placeholder {
    min-height: 250px;
}

.sx-ad-vertical-placeholder {
    min-height: 250px;
    max-width: 300px;
}

@media (min-width: 768px) {
    .sx-ad-top-landscape-placeholder,
    .sx-ad-landscape-placeholder {
        min-height: 90px;
    }
    .sx-ad-vertical-placeholder {
        min-height: 600px;
    }
}

.sx-ad-top-landscape-placeholder::before {
    content: "Advertisement Slot (Leaderboard)";
}

.sx-ad-landscape-placeholder::before {
    content: "Advertisement Slot (Responsive)";
}

.sx-ad-square-placeholder::before {
    content: "Advertisement Slot (Square)";
}

.sx-ad-vertical-placeholder::before {
    content: "Advertisement Slot (Vertical)";
}

ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}

/* Collapse empty/unfilled ad containers so blank boxes aren't left behind */
.sx-ad-top-landscape:has(ins[data-ad-status="unfilled"]),
.sx-ad-landscape:has(ins[data-ad-status="unfilled"]),
.sx-ad-square:has(ins[data-ad-status="unfilled"]),
.sidebar-ad-secondary:has(ins[data-ad-status="unfilled"]),
.sx-ad-vertical:has(ins[data-ad-status="unfilled"]),
.sx-ad-multiplex:has(ins[data-ad-status="unfilled"]) {
    min-height: 0 !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

div[aria-label="Advertisement"] {
    contain: layout style;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* ==========================================================================
   MOBILE SIDEBAR LAYOUT REFINEMENT & COLLAPSIBLE WIDGETS
   ========================================================================== */
.mobile-sidebar-toggle-btn {
    display: none;
}

@media (max-width: 991px) {
    .mobile-sidebar-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--dh-text);
        background: var(--dh-warm);
        border: 1px solid var(--dh-border);
        border-radius: 8px;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        cursor: pointer;
        transition: background-color 0.15s ease;
    }

    .mobile-sidebar-toggle-btn:hover {
        background: var(--dh-border);
    }

    .sidebar-right.mobile-collapsed .sidebar-inner > .widget:not(:first-child) {
        display: none;
    }
}

/* ==========================================================================
   OUTDOOR FIELD MODE (High Contrast Outdoor Coaching View)
   ========================================================================== */
.field-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0b1d0c;
    color: #ffffff;
    z-index: 99999;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.field-mode-overlay.active {
    display: flex;
}

.field-mode-header {
    position: sticky;
    top: 0;
    background-color: #051006;
    border-bottom: 2px solid #2e7d32;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.field-mode-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-mode-close-btn {
    background: #2e7d32;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.field-mode-close-btn:hover,
.field-mode-close-btn:focus-visible {
    background: #388e3c;
}

.field-mode-body {
    padding: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.field-mode-hero-img {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    margin-bottom: 1.5rem;
}

.field-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.field-mode-card {
    background: #143216;
    border: 1px solid #2e7d32;
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.field-mode-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #a5d6a7;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.field-mode-card-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
}

.field-mode-section {
    background: #143216;
    border: 1px solid #2e7d32;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.field-mode-section h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #81c784;
    margin-top: 0;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid #2e7d32;
    padding-bottom: 0.5rem;
}

.field-mode-section p,
.field-mode-section li {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #f1f8e9;
    font-weight: 500;
}

.field-mode-section ul,
.field-mode-section ol {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.field-mode-section li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   FACETED LIVE SEARCH & FILTER BAR
   ========================================================================== */
.facet-filter-container {
    background-color: var(--dh-bg);
    border: 1px solid var(--dh-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--dh-shadow);
}

.facet-search-box {
    position: relative;
    margin-bottom: 1rem;
}

.facet-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--dh-border);
    border-radius: 8px;
    background-color: var(--dh-warm);
    color: var(--dh-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.facet-search-input:focus {
    border-color: var(--dh-action);
    outline: none;
    box-shadow: 0 0 0 3px rgba(90, 122, 93, 0.2);
}

.facet-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--dh-text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
    display: none;
}

.facet-group {
    margin-bottom: 0.85rem;
}

.facet-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dh-text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.facet-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.facet-pill {
    background-color: var(--dh-warm);
    border: 1px solid var(--dh-border);
    color: var(--dh-text);
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.facet-pill:hover {
    border-color: var(--dh-action);
    color: var(--dh-action);
}

.facet-pill.active {
    background-color: var(--dh-action);
    border-color: var(--dh-action);
    color: #ffffff;
    font-weight: 600;
}

.facet-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--dh-border);
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--dh-text-secondary);
}

.facet-reset-btn {
    background: none;
    border: none;
    color: var(--dh-action);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
    padding: 0;
}

.facet-reset-btn:hover {
    color: var(--dh-action-hover);
}

/* ============================================================
   FAQ ACCORDION & E-E-A-T RICH SNIPPET SECTIONS
   ============================================================ */
.faq-section {
    margin-top: 2.25rem;
    margin-bottom: 2rem;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.faq-item {
    border: 1px solid var(--dh-border);
    border-radius: 8px;
    background-color: var(--dh-warm);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
    border-color: var(--dh-muted);
}

.faq-item[open] {
    border-color: var(--dh-action);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.15rem;
    font-weight: 600;
    font-size: 0.975rem;
    color: var(--dh-text);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.15s ease;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question:hover {
    color: var(--dh-action);
}

.faq-chevron {
    transition: transform 0.2s ease;
    color: var(--dh-action);
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.15rem 1rem 1.15rem;
    color: var(--dh-text-secondary);
    font-size: 0.925rem;
    line-height: 1.65;
}

.faq-answer p {
    margin-bottom: 0.5rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}


