/* ============================================
   Silicium IA — Thème personnalisé
   Mode sombre/clair + style terminal + animations
   ============================================ */

/* ---------- Palettes ---------- */
html[data-theme="dark"] {
    --background-color: #0b0f19;
    --color-lighter-gray: rgb(255 255 255 / 0.06);
    --color-light-gray: #161c2b;
    --color-mid-gray: #232b3f;
    --color-dark-gray: #8b95a7;
    --color-darker-gray: #e8eaf0;
    --color-primary-text: #e8eaf0;
    --color-secondary-text: rgb(232 234 240 / 0.6);
    --color-border: rgb(255 255 255 / 0.1);
    --color-dark-border: rgb(255 255 255 / 0.4);
}

/* Thème clair : palette complète (texte sombre, pas blanc !) */
html[data-theme="light"] {
    --background-color: #ffffff;
    --color-lighter-gray: rgb(0 0 0 / 0.05);
    --color-light-gray: #eef1f6;
    --color-mid-gray: #d4d9e2;
    --color-dark-gray: #5a6472;
    --color-darker-gray: #15171a;
    --color-primary-text: #15171a;
    --color-secondary-text: rgb(0 0 0 / 0.55);
    --color-border: rgb(0 0 0 / 0.1);
    --color-dark-border: rgb(0 0 0 / 0.5);
}

/* Sécurité : html + body toujours fondus dans le thème */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: #0b0f19;
}
html[data-theme="light"],
html[data-theme="light"] body {
    background-color: #ffffff;
}

/* Garde-fous anti has-light-text résiduel (Ghost) */
html[data-theme="dark"].has-light-text {
    --color-darker-gray: #e8eaf0;
    --color-secondary-text: rgb(232 234 240 / 0.6);
    --color-border: rgb(255 255 255 / 0.1);
}
html[data-theme="light"].has-light-text {
    --color-darker-gray: #15171a;
    --color-secondary-text: rgb(0 0 0 / 0.55);
    --color-border: rgb(0 0 0 / 0.1);
    --color-dark-border: rgb(0 0 0 / 0.5);
}

/* Transitions douces au changement de thème */
body,
.gh-card,
.gh-navigation,
.gh-footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ---------- Bandeau du haut : dégradé distinct ---------- */
html[data-theme="dark"] .gh-navigation {
    background: linear-gradient(180deg, #141b2e 0%, #0b0f19 100%);
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
}
html[data-theme="light"] .gh-navigation {
    background: linear-gradient(180deg, #e8edf5 0%, #ffffff 100%);
    border-bottom: 1px solid rgb(0 0 0 / 0.08);
}
/* Laisse le dégradé visible (le thème Source peint les actions en blanc) */
.gh-navigation-actions {
    background: transparent !important;
}

/* ---------- Bouton thème (style terminal) ---------- */
.gh-theme-toggle {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    border: 1px solid var(--color-dark-border);
    border-radius: 6px;
    padding: 6px 10px;
    background: var(--color-light-gray);
    color: var(--color-primary-text);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
}
.gh-theme-toggle:hover {
    border-color: var(--ghost-accent-color);
    color: var(--ghost-accent-color);
    box-shadow: 0 0 14px rgb(0 102 255 / 0.35);
}
.theme-toggle-icon {
    font-size: 1.15rem;
    line-height: 1;
}
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-dark { display: none; }
@media (max-width: 480px) {
    .theme-toggle-text { display: none; }
}

/* ---------- Boutons visibles : recherche + navigation ---------- */
.gh-icon-button {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-light-gray);
    color: var(--color-primary-text);
    transition: all 0.2s ease;
}
.gh-icon-button:hover {
    border-color: var(--ghost-accent-color);
    color: var(--ghost-accent-color);
}
.gh-navigation-members .gh-button {
    background-color: var(--ghost-accent-color);
    color: #fff;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
}
.gh-navigation-members .gh-button:hover {
    box-shadow: 0 4px 18px rgb(0 102 255 / 0.4);
}

/* ---------- Bandeau mobile : logo + recherche + thème + burger ---------- */
@media (max-width: 767px) {
    #gh-navigation .gh-navigation-brand {
        grid-template-columns: 1fr auto auto auto;
        gap: 10px;
    }
}

/* ---------- Style terminal : étiquettes ---------- */
.term-label {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ghost-accent-color);
}
.term-label::before { content: "["; color: var(--color-dark-gray); margin-right: 0.3em; }
.term-label::after { content: "]"; color: var(--color-dark-gray); margin-left: 0.3em; }

/* ---------- Signature en bas d'article ---------- */
.gh-article-footer {
    border-top: 1px solid var(--color-border);
    margin-top: clamp(32px, 6vw, 56px);
    padding-top: clamp(24px, 4vw, 36px);
}
.gh-article-footer .term-label {
    display: inline-block;
    margin-bottom: 12px;
}
.gh-article-footer .gh-article-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}
.gh-article-footer .gh-article-author-name {
    color: var(--color-primary-text);
}

/* ---------- Micro-animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Cartes : survol élégant ---------- */
.gh-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gh-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgb(0 0 0 / 0.15);
}
html[data-theme="dark"] .gh-card:hover {
    box-shadow: 0 8px 30px rgb(0 0 0 / 0.5);
}
.gh-card:hover .gh-card-title {
    color: var(--ghost-accent-color);
}

/* ---------- Recherche (sodo-search) : visible en mode sombre ---------- */
html[data-theme="dark"] #sodo-search-root input,
html[data-theme="dark"] #sodo-search-root input[type="search"] {
    background-color: #161c2b !important;
    border: 1px solid rgb(255 255 255 / 0.25) !important;
    color: #e8eaf0 !important;
}
html[data-theme="dark"] #sodo-search-root input::placeholder {
    color: rgb(232 234 240 / 0.5) !important;
}
html[data-theme="light"] #sodo-search-root input,
html[data-theme="light"] #sodo-search-root input[type="search"] {
    background-color: #ffffff !important;
    border: 1px solid rgb(0 0 0 / 0.2) !important;
    color: #15171a !important;
}
html[data-theme="light"] #sodo-search-root input::placeholder {
    color: rgb(0 0 0 / 0.4) !important;
}

/* ---------- Liens ---------- */
a {
    transition: color 0.2s ease;
}
