/* ==========================================================================
   Blog index — Dark mode
   Fichier : /assets/css/blog-index-dark.css

   Cette feuille cible uniquement la page d’index du blog en mode sombre.
   Elle conserve les classes HTML existantes :
   .hero, .silo-grid, .silo-card, .blog-latest, .related-grid, .mini-card
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables locales
   -------------------------------------------------------------------------- */

html[data-theme="dark"] body.blog-index {
    --blog-dark-bg: #06130d;
    --blog-dark-bg-soft: #081a12;
    --blog-dark-surface: #0d2419;
    --blog-dark-surface-hover: #133525;
    --blog-dark-border: rgba(117, 192, 157, 0.22);
    --blog-dark-border-strong: rgba(117, 192, 157, 0.42);

    --blog-dark-text: #f1fff6;
    --blog-dark-text-soft: #d9eee4;
    --blog-dark-text-muted: #9fc4b2;

    --blog-dark-primary: #b6ff2d;
    --blog-dark-primary-hover: #d3ff79;
    --blog-dark-secondary: #61d6a3;
    --blog-dark-blue: #54c6ed;

    --blog-dark-radius-lg: 2rem;
    --blog-dark-radius-md: 1.35rem;
    --blog-dark-radius-sm: 0.9rem;

    --blog-dark-shadow:
        0 28px 75px rgba(0, 0, 0, 0.34),
        0 1px 0 rgba(255, 255, 255, 0.025) inset;

    color: var(--blog-dark-text);
    background:
        radial-gradient(
            circle at 86% 8%,
            rgba(97, 214, 163, 0.13),
            transparent 25rem
        ),
        radial-gradient(
            circle at 8% 42%,
            rgba(83, 171, 229, 0.085),
            transparent 24rem
        ),
        linear-gradient(
            180deg,
            #06130d 0%,
            #071710 48%,
            #06130d 100%
        );
}

html[data-theme="dark"] .blog-index main {
    overflow: hidden;
}

html[data-theme="dark"] .blog-index img {
    display: block;
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index .hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding-block:
        clamp(5.25rem, 10vw, 8rem)
        clamp(4.25rem, 8vw, 6.5rem);
    border-bottom: 1px solid rgba(124, 202, 168, 0.16);
    background:
        radial-gradient(
            circle at 77% 30%,
            rgba(182, 255, 45, 0.08),
            transparent 25rem
        ),
        linear-gradient(
            135deg,
            rgba(8, 33, 23, 0.98),
            rgba(6, 19, 13, 0.88)
        );
}

html[data-theme="dark"] .blog-index .hero::before {
    position: absolute;
    z-index: -1;
    top: -15rem;
    left: 52%;
    width: 38rem;
    height: 38rem;
    border: 1px solid rgba(97, 214, 163, 0.08);
    border-radius: 50%;
    box-shadow:
        0 0 0 5rem rgba(97, 214, 163, 0.018),
        0 0 0 10rem rgba(84, 198, 237, 0.012);
    content: "";
    pointer-events: none;
}

html[data-theme="dark"] .blog-index .hero::after {
    position: absolute;
    z-index: -1;
    right: -8rem;
    bottom: -13rem;
    width: 34rem;
    height: 34rem;
    border: 1px solid rgba(182, 255, 45, 0.17);
    border-radius: 50%;
    box-shadow:
        0 0 0 4rem rgba(182, 255, 45, 0.025),
        0 0 0 8rem rgba(84, 198, 237, 0.022);
    content: "";
    pointer-events: none;
}

html[data-theme="dark"] .blog-index .hero .container {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: start;
}

html[data-theme="dark"] .blog-index .hero .eyebrow {
    width: fit-content;
    justify-self: start;
}

html[data-theme="dark"] .blog-index .hero h1 {
    max-width: 15ch;
    margin-top: 1.1rem;
    color: var(--blog-dark-text);
    font-family: var(--blog-display, "Manrope", sans-serif);
    font-size: clamp(2.7rem, 6vw, 5.3rem);
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 0.98;
    text-wrap: balance;
}

html[data-theme="dark"] .blog-index .hero h1::after {
    display: block;
    width: clamp(4rem, 10vw, 7rem);
    height: 0.28rem;
    margin-top: 1.8rem;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            var(--blog-dark-primary),
            var(--blog-dark-secondary)
        );
    box-shadow: 0 0 25px rgba(182, 255, 45, 0.22);
    content: "";
}

html[data-theme="dark"] .blog-index .hero p {
    max-width: 62ch;
    margin-top: 1.75rem;
    color: var(--blog-dark-text-soft);
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    line-height: 1.75;
    text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Eyebrows
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index .eyebrow {
    display: inline-flex;
    gap: 0.65rem;
    align-items: center;
    color: var(--blog-dark-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    line-height: 1.3;
    text-transform: uppercase;
}

html[data-theme="dark"] .blog-index .eyebrow::before {
    width: 0.5rem;
    height: 0.5rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--blog-dark-primary);
    box-shadow: 0 0 16px rgba(182, 255, 45, 0.52);
    content: "";
}

/* --------------------------------------------------------------------------
   Filtres éventuels
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index .premium-blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

html[data-theme="dark"] .blog-index .premium-blog-filters button {
    min-height: 2.75rem;
    padding: 0.7rem 1.1rem;
    border: 1px solid rgba(159, 226, 196, 0.28);
    border-radius: 999px;
    background: rgba(15, 43, 31, 0.8);
    color: var(--blog-dark-text-soft);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

html[data-theme="dark"] .blog-index .premium-blog-filters button:hover {
    border-color: #78c4a0;
    background: #173b2d;
    transform: translateY(-2px);
}

html[data-theme="dark"]
    .blog-index
    .premium-blog-filters
    button[aria-pressed="true"] {
    border-color: var(--blog-dark-primary);
    background: var(--blog-dark-primary);
    color: var(--blog-dark-bg);
    box-shadow: 0 12px 26px rgba(182, 255, 45, 0.14);
}

/* --------------------------------------------------------------------------
   Silo principal
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index .silo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.4rem, 3vw, 2.25rem);
    padding-top: clamp(3.5rem, 7vw, 6rem);
    padding-bottom: clamp(4.5rem, 8vw, 7rem);
}

html[data-theme="dark"] .blog-index .silo-card {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--blog-dark-border) !important;
    border-radius: var(--blog-dark-radius-lg);
    background:
        linear-gradient(
            145deg,
            rgba(16, 45, 31, 0.98),
            rgba(10, 31, 21, 0.98)
        ) !important;
    box-shadow: var(--blog-dark-shadow) !important;
    transform: translateZ(0);
    transition:
        transform 240ms ease,
        border-color 240ms ease,
        box-shadow 240ms ease;
}

html[data-theme="dark"] .blog-index .silo-card:hover {
    border-color: rgba(182, 255, 45, 0.62) !important;
    box-shadow:
        0 34px 90px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(182, 255, 45, 0.05) inset !important;
    transform: translateY(-7px);
}

html[data-theme="dark"] .blog-index .silo-card > img {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
    object-position: center;
    filter:
        brightness(0.56)
        contrast(1.08)
        saturate(0.84)
        hue-rotate(10deg) !important;
    transition:
        transform 550ms cubic-bezier(0.2, 0.8, 0.2, 1),
        filter 350ms ease;
}

html[data-theme="dark"] .blog-index .silo-card:hover > img {
    filter:
        brightness(0.63)
        contrast(1.06)
        saturate(0.93)
        hue-rotate(8deg) !important;
    transform: scale(1.035);
}

html[data-theme="dark"] .blog-index .silo-card::before {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    left: 0;
    height: 16rem;
    background:
        linear-gradient(
            180deg,
            rgba(6, 19, 13, 0.02),
            rgba(6, 19, 13, 0.22) 48%,
            rgba(13, 36, 25, 0.95) 100%
        );
    content: "";
    pointer-events: none;
}

html[data-theme="dark"] .blog-index .silo-card::after {
    position: absolute;
    z-index: 2;
    top: 1.25rem;
    right: 1.25rem;
    width: 2.8rem;
    height: 2.8rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    background:
        rgba(6, 19, 13, 0.62)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b6ff2d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M7 7h10v10'/%3E%3C/svg%3E")
        center / 1rem
        no-repeat;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
    content: "";
    pointer-events: none;
    backdrop-filter: blur(10px);
}

html[data-theme="dark"] .blog-index .silo-card-body {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: clamp(1.6rem, 4vw, 2.5rem);
    background: transparent;
}

html[data-theme="dark"] .blog-index .silo-card-body > .eyebrow {
    margin-bottom: 1rem;
}

html[data-theme="dark"] .blog-index .silo-card h2 {
    max-width: 16ch;
    margin: 0;
    color: var(--blog-dark-text) !important;
    font-family: var(--blog-display, "Manrope", sans-serif);
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.08;
    text-wrap: balance;
}

html[data-theme="dark"] .blog-index .silo-card-body > p {
    margin: 1.25rem 0 1.7rem;
    color: var(--blog-dark-text-muted);
    font-size: 1rem;
    line-height: 1.72;
}

html[data-theme="dark"] .blog-index .silo-card .btn {
    display: inline-flex;
    width: fit-content;
    min-height: 3.15rem;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--blog-dark-primary);
    border-radius: 999px;
    background: var(--blog-dark-primary);
    color: var(--blog-dark-bg);
    box-shadow: 0 14px 28px rgba(182, 255, 45, 0.12);
    font-size: 0.91rem;
    font-weight: 800;
    line-height: 1.2;
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

html[data-theme="dark"] .blog-index .silo-card .btn:hover {
    border-color: var(--blog-dark-primary-hover);
    background: var(--blog-dark-primary-hover);
    box-shadow: 0 18px 36px rgba(182, 255, 45, 0.18);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Liens secondaires dans les cartes principales
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index .sat-list {
    display: grid;
    gap: 0;
    padding: 0;
    margin: 2rem 0 0;
    border-top: 1px solid rgba(117, 192, 157, 0.2);
    list-style: none;
}

html[data-theme="dark"] .blog-index .sat-list li {
    border-bottom: 1px solid rgba(117, 192, 157, 0.18) !important;
}

html[data-theme="dark"] .blog-index .sat-list li:last-child {
    border-bottom: 0 !important;
}

html[data-theme="dark"] .blog-index .sat-list a {
    position: relative;
    display: flex;
    min-height: 4rem;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem 0.9rem 0;
    color: var(--blog-dark-text-soft) !important;
    font-size: 0.93rem;
    font-weight: 600;
    line-height: 1.45;
    transition:
        color 180ms ease,
        padding-left 180ms ease;
}

html[data-theme="dark"] .blog-index .sat-list a::after {
    position: absolute;
    right: 0;
    color: var(--blog-dark-primary);
    content: "↗";
    font-size: 1rem;
    font-weight: 800;
    transition: transform 180ms ease;
}

html[data-theme="dark"] .blog-index .sat-list a:hover {
    padding-left: 0.4rem;
    color: var(--blog-dark-primary) !important;
}

html[data-theme="dark"] .blog-index .sat-list a:hover::after {
    transform: translate(0.15rem, -0.15rem);
}

/* --------------------------------------------------------------------------
   Nouveaux guides
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index .blog-latest {
    position: relative;
    overflow: hidden;
    margin-bottom: clamp(4.5rem, 9vw, 7rem);
    padding: clamp(1.6rem, 4vw, 3.25rem);
    border: 1px solid rgba(117, 192, 157, 0.2);
    border-radius: var(--blog-dark-radius-lg);
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(97, 214, 163, 0.1),
            transparent 24rem
        ),
        linear-gradient(
            145deg,
            rgba(13, 36, 25, 0.96),
            rgba(8, 26, 18, 0.97)
        );
    box-shadow:
        0 30px 85px rgba(0, 0, 0, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.025) inset;
}

html[data-theme="dark"] .blog-index .blog-latest::before {
    position: absolute;
    top: -12rem;
    right: -10rem;
    width: 26rem;
    height: 26rem;
    border: 1px solid rgba(182, 255, 45, 0.1);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

html[data-theme="dark"] .blog-index .blog-latest .section-title {
    position: relative;
    z-index: 1;
    max-width: 52rem;
    margin-bottom: 2.25rem;
}

html[data-theme="dark"] .blog-index .blog-latest h2 {
    max-width: 19ch;
    margin: 0.8rem 0 0;
    color: var(--blog-dark-text);
    font-family: var(--blog-display, "Manrope", sans-serif);
    font-size: clamp(1.95rem, 4vw, 3.35rem);
    font-weight: 800;
    letter-spacing: -0.052em;
    line-height: 1.04;
    text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Grille des nouveaux guides
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index .blog-latest .related-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

html[data-theme="dark"] .blog-index .blog-latest .mini-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 11rem;
    align-items: flex-end;
    overflow: hidden;
    padding: 1.4rem 3.2rem 1.4rem 1.4rem;
    border: 1px solid rgba(117, 192, 157, 0.22) !important;
    border-radius: var(--blog-dark-radius-md);
    background:
        linear-gradient(
            145deg,
            rgba(21, 53, 38, 0.82),
            rgba(14, 39, 27, 0.88)
        ) !important;
    color: #effaf4 !important;
    font-family: var(--blog-display, "Manrope", sans-serif);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.45;
    box-shadow:
        0 15px 34px rgba(0, 0, 0, 0.14),
        0 1px 0 rgba(255, 255, 255, 0.025) inset;
    transition:
        transform 210ms ease,
        border-color 210ms ease,
        background-color 210ms ease,
        box-shadow 210ms ease;
}

html[data-theme="dark"] .blog-index .blog-latest .mini-card::before {
    position: absolute;
    top: 1.15rem;
    left: 1.4rem;
    width: 2.4rem;
    height: 0.18rem;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            var(--blog-dark-primary),
            var(--blog-dark-secondary)
        );
    content: "";
    opacity: 0.8;
}

html[data-theme="dark"] .blog-index .blog-latest .mini-card::after {
    position: absolute;
    right: 1.2rem;
    bottom: 1.25rem;
    color: var(--blog-dark-primary);
    content: "↗";
    font-size: 1.05rem;
    font-weight: 800;
    transition: transform 180ms ease;
}

html[data-theme="dark"] .blog-index .blog-latest .mini-card:hover {
    border-color: rgba(182, 255, 45, 0.58) !important;
    background:
        linear-gradient(
            145deg,
            rgba(26, 68, 48, 0.98),
            rgba(17, 48, 33, 0.98)
        ) !important;
    box-shadow:
        0 24px 50px rgba(0, 0, 0, 0.26),
        0 0 0 1px rgba(182, 255, 45, 0.03) inset;
    transform: translateY(-5px);
}

html[data-theme="dark"] .blog-index .blog-latest .mini-card:hover::after {
    transform: translate(0.2rem, -0.2rem);
}

/* Différenciation légère des cartes */

html[data-theme="dark"]
    .blog-index
    .blog-latest
    .mini-card:nth-child(3n + 2)::before {
    background:
        linear-gradient(
            90deg,
            var(--blog-dark-blue),
            var(--blog-dark-secondary)
        );
}

html[data-theme="dark"]
    .blog-index
    .blog-latest
    .mini-card:nth-child(3n + 3)::before {
    background:
        linear-gradient(
            90deg,
            var(--blog-dark-secondary),
            var(--blog-dark-primary)
        );
}

/* --------------------------------------------------------------------------
   Accessibilité
   -------------------------------------------------------------------------- */

html[data-theme="dark"] .blog-index :is(a, button):focus-visible {
    outline: 3px solid var(--blog-dark-primary);
    outline-offset: 4px;
}

html[data-theme="dark"] .blog-index ::selection {
    color: var(--blog-dark-bg);
    background: var(--blog-dark-primary);
}

/* --------------------------------------------------------------------------
   Responsive tablette
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
    html[data-theme="dark"] .blog-index .silo-grid {
        grid-template-columns: 1fr;
        max-width: 48rem;
    }

    html[data-theme="dark"] .blog-index .silo-card h2 {
        max-width: 19ch;
    }

    html[data-theme="dark"] .blog-index .blog-latest .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --------------------------------------------------------------------------
   Responsive mobile
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    html[data-theme="dark"] .blog-index .hero {
        padding-block: 4.5rem 3.75rem;
    }

    html[data-theme="dark"] .blog-index .hero::before {
        top: -11rem;
        width: 26rem;
        height: 26rem;
    }

    html[data-theme="dark"] .blog-index .hero::after {
        right: -10rem;
        bottom: -9rem;
        width: 22rem;
        height: 22rem;
    }

    html[data-theme="dark"] .blog-index .hero h1 {
        max-width: 12ch;
        font-size: clamp(2.45rem, 12vw, 3.65rem);
    }

    html[data-theme="dark"] .blog-index .hero h1::after {
        margin-top: 1.4rem;
    }

    html[data-theme="dark"] .blog-index .hero p {
        font-size: 1rem;
        line-height: 1.7;
    }

    html[data-theme="dark"] .blog-index .silo-grid {
        gap: 1.35rem;
        padding-top: 3rem;
        padding-bottom: 4.25rem;
    }

    html[data-theme="dark"] .blog-index .silo-card {
        border-radius: 1.45rem;
    }

    html[data-theme="dark"] .blog-index .silo-card::before {
        height: 12rem;
    }

    html[data-theme="dark"] .blog-index .silo-card::after {
        top: 0.9rem;
        right: 0.9rem;
        width: 2.45rem;
        height: 2.45rem;
    }

    html[data-theme="dark"] .blog-index .silo-card-body {
        padding: 1.45rem;
    }

    html[data-theme="dark"] .blog-index .silo-card h2 {
        max-width: 15ch;
        font-size: clamp(1.55rem, 8vw, 2rem);
    }

    html[data-theme="dark"] .blog-index .silo-card .btn {
        width: 100%;
        padding-inline: 1rem;
        text-align: center;
    }

    html[data-theme="dark"] .blog-index .sat-list {
        margin-top: 1.6rem;
    }

    html[data-theme="dark"] .blog-index .sat-list a {
        min-height: 3.8rem;
        font-size: 0.88rem;
    }

    html[data-theme="dark"] .blog-index .blog-latest {
        margin-inline: 0.75rem;
        margin-bottom: 4.5rem;
        padding: 1.35rem;
        border-radius: 1.45rem;
    }

    html[data-theme="dark"] .blog-index .blog-latest h2 {
        font-size: clamp(1.85rem, 9vw, 2.55rem);
    }

    html[data-theme="dark"] .blog-index .blog-latest .related-grid {
        grid-template-columns: 1fr;
    }

    html[data-theme="dark"] .blog-index .blog-latest .mini-card {
        min-height: 9.5rem;
        padding: 1.3rem 3rem 1.3rem 1.3rem;
    }
}

/* --------------------------------------------------------------------------
   Réduction des animations
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] .blog-index *,
    html[data-theme="dark"] .blog-index *::before,
    html[data-theme="dark"] .blog-index *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}