html {
    color-scheme: light;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sélection & Curseur apaisants pour la lecture */
::selection {
    background-color: #E2ECE8;
    color: #1F282C;
}

:root {
    /* Palette Principale Harmonie "Kin" & "Still" */
    --primary: #4A6B7C;            /* Ardoise brumeuse / bleu crépuscule apaisant */
    --primary-hover: #385564;
    --primary-light: #EBF2F6;
    --secondary: #A7442E;          /* Terracotta chaleureux, conforme WCAG AA ≥ 4.8:1 */
    --secondary-hover: #8E3622;
    --secondary-light: #FBF0EB;
    --accent: #769784;             /* Sauge douce / vert herboriste */
    --accent-hover: #60806E;
    --accent-light: #EFF5F1;

    /* Neutres & Surfaces Chaleureuses */
    --light: #FAF8F5;              /* Lin naturel / papier d'art doux pour la rétine */
    --surface: #FFFFFF;            /* Blanc pur pour l'élévation des cartes */
    --surface-subtle: #F3EFEA;     /* Séparations feutrées */
    --ink: #20272B;                /* Encre profonde, contraste maximal et netteté (WCAG AAA >= 12:1) */
    --ink-muted: #4B5A62;          /* Secondaire éditorial contrasté (WCAG AA >= 5.8:1) */
    --ink-faint: #72848F;          /* Mentions tertiaires & métadonnées visibles (WCAG AA >= 4.5:1) */

    /* Frontières & Micro-détails */
    --border-subtle: rgba(44, 53, 57, 0.08);
    --border-medium: rgba(44, 53, 57, 0.14);
    --border-strong: rgba(44, 53, 57, 0.22);
    
    /* Système d'Élévation Multi-couches Douces */
    --shadow-xs: 0 1px 3px rgba(36, 48, 54, 0.04);
    --shadow-soft: 0 4px 20px -2px rgba(36, 48, 54, 0.05), 0 2px 6px -1px rgba(36, 48, 54, 0.02);
    --shadow-hover: 0 16px 36px -6px rgba(36, 48, 54, 0.09), 0 4px 12px -2px rgba(36, 48, 54, 0.04);
    --shadow-dialog: 0 24px 64px -8px rgba(26, 37, 43, 0.18), 0 8px 24px -4px rgba(26, 37, 43, 0.08);

    /* Rayons & Courbures Organiques */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background-color: var(--light);
    line-height: 1.75;
    letter-spacing: -0.01em;
}

h1,
h2,
h3,
h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 500;
    color: #1F282C;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

/* ========================================================
   LOGO TYPOGRAPHIQUE MAÎTRE KINSTILL (Wordmark)
   ======================================================== */
.brand-logo {
    display: inline-flex !important;
    align-items: baseline !important;
    font-family: 'Playfair Display', Georgia, serif !important;
    font-weight: 700 !important;
    font-size: 1.85rem !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: var(--primary, #4A6B7C) !important;
    line-height: 1 !important;
    text-decoration: none !important;
    user-select: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.brand-logo:hover {
    color: var(--primary-hover, #385564) !important;
    opacity: 0.95;
}

/* Le point terracotta d'ancrage (Stillness) */
.brand-logo .brand-dot {
    display: inline-block !important;
    width: 7px !important;
    height: 7px !important;
    margin-left: 4px !important;
    background-color: var(--secondary, #A7442E) !important;
    border-radius: 50% !important;
    vertical-align: baseline !important;
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.brand-logo:hover .brand-dot {
    transform: translateY(-2px) scale(1.2);
}

/* Variante moderne avec distinction typographique "Kin" & "Still" */
.brand-logo .brand-kin {
    font-weight: 800 !important;
    letter-spacing: 0.10em !important;
    color: var(--ink, #20272B) !important;
}

.brand-logo .brand-still {
    font-weight: 400 !important;
    letter-spacing: 0.16em !important;
    color: var(--primary, #4A6B7C) !important;
    opacity: 0.92;
}

html[data-theme="dark"] .brand-logo {
    color: #F0F3F6 !important;
}

html[data-theme="dark"] .brand-logo .brand-kin {
    color: #FFFFFF !important;
}

html[data-theme="dark"] .brand-logo .brand-still {
    color: #9EC0D2 !important;
}

html[data-theme="dark"] .brand-logo .brand-dot {
    background-color: #E2846F !important;
}

header.sticky {
    background-color: rgba(250, 248, 245, 0.88) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Alignement parfait du header KINSTILL */
header > div {
    display: flex !important;
    align-items: center !important;
}

header > div > a[aria-label*="home"] {
    display: inline-flex;
    align-items: center;
    margin-right: 2.25rem;
    flex-shrink: 0;
}

header nav {
    display: flex;
    align-items: center;
    gap: 1.85rem;
}

header nav a {
    position: relative;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--ink-muted);
    transition: var(--transition);
    padding: 0.35rem 0.2rem;
}

header nav a:hover,
header nav a[aria-current="page"] {
    color: var(--primary);
}

header nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: var(--radius-full);
}

header nav a:hover::after,
header nav a[aria-current="page"]::after {
    transform: scaleX(1);
}

/* Personnalisation de la barre de défilement */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: #CBD5DC;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary: #8EB4C7;
    --primary-hover: #A5C8DB;
    --primary-light: #1D2830;
    --secondary: #DC8F7C;
    --secondary-hover: #EBB0A2;
    --secondary-light: #2B211E;
    --accent: #9BB8A7;
    --accent-hover: #AFC8B9;
    --accent-light: #1E2823;

    --light: #13181C;
    --surface: #1B2228;
    --surface-subtle: #242D34;
    --ink: #E5EBF0;
    --ink-muted: #9EACB7;
    --ink-faint: #677884;

    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);

    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 16px 36px -6px rgba(0, 0, 0, 0.65);
    --shadow-dialog: 0 24px 64px -8px rgba(0, 0, 0, 0.75);
}

/* ========================================================
   ACTIONS HEADER ÉPURÉES (Harmonisées avec Home, Articles, About, Contact)
   ======================================================== */

/* Conteneur d'actions positionné fermement tout à droite */
.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 1.15rem;
    margin-left: auto !important; /* Pousse fermement à l'extrême droite */
    flex-shrink: 0;
}

/* Style de base partagé avec header nav a */
.site-library-link,
.language-toggle-wrapper,
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.25rem;
    background: transparent !important;
    border: none !important;
    border-radius: var(--radius-xs);
    color: var(--ink-muted) !important;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: color 0.2s ease, transform 0.2s ease;
}

.site-library-link:hover,
.language-toggle-wrapper:hover,
.theme-toggle:hover {
    color: var(--primary) !important;
    transform: translateY(-1px);
}

html[data-theme="dark"] .site-library-link,
html[data-theme="dark"] .language-toggle-wrapper,
html[data-theme="dark"] .theme-toggle {
    color: var(--ink-muted) !important;
}

html[data-theme="dark"] .site-library-link:hover,
html[data-theme="dark"] .language-toggle-wrapper:hover,
html[data-theme="dark"] .theme-toggle:hover {
    color: var(--primary) !important;
}

/* Ligne d'accent terracotta signature sous Library et Langue au survol */
.site-library-link::after,
.language-toggle-wrapper::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: var(--radius-full);
}

.site-library-link:hover::after,
.language-toggle-wrapper:hover::after {
    transform: scaleX(1);
}

/* Icônes linéaires fines épurées */
.header-action-icon {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    flex-shrink: 0;
    vertical-align: middle;
    transition: transform 0.25s ease, stroke 0.2s ease;
}

/* Bouton Dark Mode épuré (icône lune / soleil seule) */
.theme-toggle {
    padding: 0.35rem;
    justify-content: center;
}

.theme-toggle:hover .header-action-icon {
    transform: rotate(20deg) scale(1.1);
}

/* Sélecteur de langue épuré (Globe + Code langue + Chevron discret) */
.language-toggle-wrapper {
    position: relative;
    cursor: pointer;
}

.language-current-label {
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.language-chevron {
    stroke: currentColor;
    opacity: 0.65;
    margin-left: -2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.language-toggle-wrapper:hover .language-chevron {
    transform: translateY(1px);
    opacity: 1;
}

/* Le select natif invisible par-dessus pour déclencher le choix de langue */
.language-toggle-wrapper select.language-toggle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    z-index: 5;
    font-size: 1rem;
}

/* Focus accessible */
.site-library-link:focus-visible,
.language-toggle-wrapper:focus-within,
.theme-toggle:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}

/* Bouton Menu Mobile (Hamburger) */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    margin-left: 0.25rem;
    background: transparent !important;
    border: none !important;
    border-radius: var(--radius-xs);
    color: var(--ink-muted) !important;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, background-color 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    color: var(--primary) !important;
    background-color: rgba(74, 107, 124, 0.08) !important;
}

html[data-theme="dark"] .mobile-menu-toggle:hover {
    background-color: rgba(142, 180, 199, 0.15) !important;
}

/* Drawer / Tiroir Mobile fluide et feutré */
.mobile-nav-drawer {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(250, 248, 245, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.25rem 2.5rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.22s;
    border-bottom: 1px solid var(--border-subtle);
}

html[data-theme="dark"] .mobile-nav-drawer {
    background: rgba(19, 24, 28, 0.98);
}

.mobile-nav-drawer.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a[aria-current="page"] {
    color: var(--primary);
    background-color: rgba(74, 107, 124, 0.08);
}

html[data-theme="dark"] .mobile-nav-links a:hover,
html[data-theme="dark"] .mobile-nav-links a[aria-current="page"] {
    background-color: rgba(142, 180, 199, 0.15);
}

.mobile-nav-divider {
    height: 1px;
    background-color: var(--border-subtle);
    margin: 1.25rem 0;
}

.mobile-nav-secondary {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mobile-nav-secondary a {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease;
}

.mobile-nav-secondary a:hover {
    color: var(--primary);
}

/* ========================================================
   BREAKPOINTS : TABLETTE (max-width: 1024px)
   ======================================================== */
@media (max-width: 1024px) {
    header > div > a[aria-label*="home"] {
        margin-right: 1.25rem !important;
    }
    header nav {
        gap: 1.15rem !important;
    }
    header nav a {
        font-size: 0.9rem !important;
    }
    .header-actions {
        gap: 0.75rem !important;
    }
}

/* ========================================================
   BREAKPOINTS : MOBILE & PETITE TABLETTE (max-width: 768px)
   ======================================================== */
@media (max-width: 768px) {
    /* Masquer la navigation desktop horizontale */
    header nav {
        display: none !important;
    }

    /* Afficher le bouton menu hamburger */
    .mobile-menu-toggle {
        display: inline-flex !important;
    }

    /* Cacher le bouton statique ancien s'il existe */
    header button.md\:hidden:not(.mobile-menu-toggle) {
        display: none !important;
    }

    /* Adapter les actions pour l'ergonomie mobile */
    .header-actions {
        gap: 0.35rem !important;
    }

    .site-library-link,
    .language-toggle-wrapper,
    .theme-toggle,
    .mobile-menu-toggle {
        min-width: 2.25rem;
        min-height: 2.25rem;
        padding: 0.4rem !important;
        justify-content: center;
    }

    /* Masquer le texte "Library" sur mobile pour garder le signet seul */
    .site-library-label {
        display: none !important;
    }

    /* Logo KINSTILL ajusté pour ne jamais déborder */
    .brand-logo {
        font-size: 1.4rem !important;
        letter-spacing: 0.09em !important;
    }
}

/* ========================================================
   PETITS MOBILES (max-width: 380px)
   ======================================================== */
@media (max-width: 380px) {
    header > div {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .brand-logo {
        font-size: 1.22rem !important;
        letter-spacing: 0.05em !important;
    }
    .header-actions {
        gap: 0.2rem !important;
    }
    .language-chevron {
        display: none !important;
    }
}

.google-translate-host {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

iframe.skiptranslate,
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

@media (max-width: 900px) {
    header nav.space-x-8 {
        gap: 0.75rem;
    }

    header nav.space-x-8 > :not([hidden]) ~ :not([hidden]) {
        margin-left: 0;
    }

    .theme-toggle-label,
    .site-library-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .site-library-link {
        width: 2.5rem;
        justify-content: center;
        padding: 0.35rem;
    }
}

.articles-nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.articles-nav-item::after {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 0.65rem;
    content: "";
}

.articles-nav-trigger::after {
    margin-inline-start: 0.35rem;
    content: "\25be";
    font-size: 0.75em;
}

.articles-dropdown {
    position: absolute;
    z-index: 100;
    top: calc(100% + 0.6rem);
    left: 50%;
    display: none;
    width: min(54rem, calc(100vw - 2rem));
    max-height: min(72vh, 42rem);
    overflow: auto;
    border: 1px solid #dbe2dd;
    border-radius: 0.4rem;
    background: #fcfcfd;
    padding: 1.25rem;
    box-shadow: 0 18px 42px rgba(27, 40, 46, 0.18);
    transform: translateX(-50%);
}

.articles-nav-item:hover .articles-dropdown,
.articles-nav-item:focus-within .articles-dropdown {
    display: block;
}

.articles-dropdown-heading {
    display: grid;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.articles-dropdown-heading strong {
    color: #35434c;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 500;
}

.articles-dropdown-heading span {
    color: #637179;
    font-size: 0.85rem;
}

.articles-dropdown-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e6e3;
    padding-bottom: 1rem;
}

.articles-stage-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.articles-stage-button {
    min-height: 2.35rem;
    border: 1px solid #d6dfd9;
    border-radius: 999px;
    background: #fff;
    color: #44535a;
    padding: 0.4rem 0.65rem;
    font: 600 0.8rem/1.2 'Nunito', sans-serif;
    cursor: pointer;
}

.articles-stage-button[aria-pressed="true"] {
    border-color: #547767;
    background: #547767;
    color: #fff;
}

.articles-family-filter {
    display: grid;
    min-width: 12rem;
    gap: 0.25rem;
    color: #637179;
    font-size: 0.75rem;
    font-weight: 700;
}

.articles-family-select {
    min-height: 2.35rem;
    border: 1px solid #cbd3d8;
    border-radius: 0.25rem;
    background: #fff;
    color: #35434c;
    padding: 0.35rem 0.55rem;
    font: 500 0.82rem/1.2 'Nunito', sans-serif;
}

.articles-dropdown-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem 0.75rem;
}

.articles-dropdown-links a {
    border-radius: 0.2rem;
    color: #44535a;
    padding: 0.55rem 0.45rem;
    font-size: 0.84rem;
    line-height: 1.35;
    text-decoration: none;
}

.articles-dropdown-links a:hover,
.articles-dropdown-links a:focus-visible {
    background: #edf2ee;
    color: #355b48;
}

.articles-stage-button:focus-visible,
.articles-family-select:focus-visible,
.articles-dropdown-links a:focus-visible {
    outline: 3px solid #d57a66;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .theme-toggle {
        width: 2.6rem;
        padding: 0.35rem;
    }

    .language-toggle {
        padding: 0.35rem 0.45rem;
        font-size: 0.75rem;
    }

    .site-library-link {
        width: 2.5rem;
        justify-content: center;
        padding: 0.35rem;
    }

    .site-library-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .theme-toggle-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}

html[data-theme="dark"] .theme-toggle {
    border-color: #46535e;
    background: #202a34;
    color: #e1e7ed;
}

html[data-theme="dark"] .language-toggle {
    border-color: #46535e;
    background: #202a34;
    color: #e1e7ed;
}

html[data-theme="dark"] .theme-toggle-track {
    background: #61785a;
}

html[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(0.98rem);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --primary: #8cb5cb;
    --primary-hover: #a5c7da;
    --primary-light: #243542;
    --secondary: #e59381;
    --secondary-hover: #f0a999;
    --secondary-light: #3a2520;
    --accent: #9dc4ad;
    --accent-hover: #b2d4c0;
    --accent-light: #22342a;
    --light: #161d24;
    --surface: #202a34;
    --surface-subtle: #1a242d;
    --ink: #f0f3f6;
    --ink-muted: #c8d3dd;
    --ink-faint: #9cb0bf;
    --border-subtle: rgba(255, 255, 255, 0.12);
    --border-medium: rgba(255, 255, 255, 0.2);
    --border-strong: rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
    color: #f0f3f6 !important;
}

html[data-theme="dark"] .article-card {
    background-color: #202a34 !important;
    border-color: #344350 !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.3) !important;
}

html[data-theme="dark"] .article-card:hover {
    border-color: #5c798c !important;
    box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.45) !important;
}

/* Logo toujours net et sans aucun halo artificiel */
img[src*="logo.svg"] {
    display: inline-block;
    vertical-align: middle;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

html[data-theme="dark"] img[src*="logo.svg"] {
    filter: brightness(1.75) saturate(1.2);
}

/* Pied de page épuré, harmonieux et sans halo pour sublimer le logo transparent */
footer {
    background-color: #F5F2EB !important;
    color: #162025 !important;
    border-top: 1px solid rgba(44, 53, 57, 0.14) !important;
}

footer h2,
footer h3,
footer h4,
footer .brand-logo {
    color: #141C21 !important;
    font-weight: 700 !important;
}

footer p,
footer span,
footer li,
footer a {
    color: #243037 !important;
    opacity: 1 !important;
}

footer a {
    font-weight: 500;
    transition: color 0.18s ease, text-decoration 0.18s ease;
}

footer a:hover,
footer a:focus-visible {
    color: #A7442E !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

footer [class*="border-t"],
footer .border-t {
    border-color: rgba(44, 53, 57, 0.14) !important;
}

footer .opacity-80,
footer .opacity-90 {
    opacity: 1 !important;
}

html[data-theme="dark"] body {
    background-color: #161d24 !important;
    color: #e1e7ed !important;
}

html[data-theme="dark"] header {
    border-color: #34414b;
    background-color: #1b252e !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18) !important;
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] [class~="bg-[#fcfcfd]"] {
    background-color: #202a34 !important;
}

html[data-theme="dark"] [class~="bg-[#f4f5f7]"],
html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] [class~="bg-[#f9f9fb]"] {
    background-color: #1a242d !important;
}

html[data-theme="dark"] .hero-watermark,
html[data-theme="dark"] .about-hero {
    background: linear-gradient(135deg, #1b292b 0%, #1a242d 56%, #1c2932 100%) !important;
}

html[data-theme="dark"] section.bg-gradient-to-r {
    background-image: linear-gradient(110deg, #4b6371, #405663) !important;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] [class~="text-[#35434c]"] {
    color: #e1e7ed !important;
}

html[data-theme="dark"] .text-gray-400 {
    color: #bac5cf !important;
}

html[data-theme="dark"] .text-white {
    color: #f0f3f6 !important;
}

html[data-theme="dark"] a.text-\[var\(--primary\)\],
html[data-theme="dark"] .about-copy h2 {
    color: #a7bfcd !important;
}

html[data-theme="dark"] [class~="border-gray-100"],
html[data-theme="dark"] [class~="border-gray-200"],
html[data-theme="dark"] [class~="border-gray-300"] {
    border-color: #3c4954 !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    border-color: #53616d !important;
    background-color: #202a34 !important;
    color: #e1e7ed !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #b5c0c9 !important;
    opacity: 1;
}

html[data-theme="dark"] footer {
    background-color: #0E151B !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #F8FAFC !important;
}

html[data-theme="dark"] footer h2,
html[data-theme="dark"] footer h3,
html[data-theme="dark"] footer h4,
html[data-theme="dark"] footer .brand-logo {
    color: #FFFFFF !important;
    font-weight: 700 !important;
}

html[data-theme="dark"] footer p,
html[data-theme="dark"] footer span,
html[data-theme="dark"] footer li,
html[data-theme="dark"] footer a {
    color: #E2E8F0 !important;
    opacity: 1 !important;
}

html[data-theme="dark"] footer a:hover,
html[data-theme="dark"] footer a:focus-visible {
    color: #F8A896 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

html[data-theme="dark"] footer [class*="border-t"],
html[data-theme="dark"] footer .border-t {
    border-color: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme="dark"] footer .opacity-80,
html[data-theme="dark"] footer .opacity-90 {
    opacity: 1 !important;
}

html[data-theme="dark"] [class~="bg-[var(--primary)]"] {
    background-color: #526a79 !important;
}

html[data-theme="dark"] [class~="bg-[var(--accent)]"] {
    background-color: #617459 !important;
}

html[data-theme="dark"] [class~="bg-[var(--secondary)]"] {
    background-color: #986554 !important;
}

html[data-theme="dark"] .tag-filter.active {
    background-color: #526a79 !important;
    color: #f0f3f6 !important;
}

@media (prefers-reduced-motion: reduce) {
    .theme-toggle,
    .theme-toggle-track,
    .theme-toggle-thumb {
        transition: none;
    }
}

html[data-theme="dark"] .articles-dropdown {
    border-color: #46535e;
    background: #202a34;
}

html[data-theme="dark"] .articles-dropdown-heading strong,
html[data-theme="dark"] .articles-dropdown-links a {
    color: #e1e7ed;
}

html[data-theme="dark"] .articles-dropdown-heading span,
html[data-theme="dark"] .articles-family-filter {
    color: #bac5cf;
}

html[data-theme="dark"] .articles-stage-button,
html[data-theme="dark"] .articles-family-select {
    border-color: #46535e;
    background: #1a242d;
    color: #e1e7ed;
}

html[data-theme="dark"] .articles-dropdown-links a:hover {
    background: #2a3b34;
}

@media (max-width: 900px) {
    .articles-dropdown-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .articles-dropdown-controls {
        align-items: stretch;
        flex-direction: column;
    }
}

html[data-theme="dark"] .site-library-link {
    border-color: #46535e;
    background: #202a34;
    color: #e1e7ed;
}