/* ==========================================================================
   Bipolar Voices — thème Ghost
   Palette : bleu marine → turquoise → jaune-orange → orange → rose → violet
   ========================================================================== */

:root {
    --navy: #1b2a6b;
    --teal: #17a2b8;
    --yellow: #f7a823;
    --orange: #f26b3a;
    --pink: #e8408f;
    --violet: #6a2c9e;

    --ink: #1a1d33;
    --ink-soft: #4b4f6b;
    --line: #e7e8f1;
    --bg: #ffffff;
    --bg-soft: #f7f7fc;

    --gradient: linear-gradient(90deg, var(--navy) 0%, var(--teal) 22%, var(--yellow) 45%, var(--orange) 62%, var(--pink) 82%, var(--violet) 100%);

    --font: var(--gh-font-body, "Avenir Next"), "Nunito Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(27, 42, 107, 0.10);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--violet); }

h1, h2, h3, h4 { font-family: var(--gh-font-heading, var(--font)); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; color: var(--navy); }

.container { width: min(1180px, 100% - 3rem); margin-inline: auto; }
.container-narrow { width: min(720px, 100% - 2.5rem); margin-inline: auto; }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

/* Dégradé signature ---------------------------------------------------- */
.bar { height: 6px; background: var(--gradient); }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.wordmark {
    font-weight: 800;
    font-size: 1.55rem;
    letter-spacing: -0.03em;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.wordmark.small { font-size: 1.3rem; }

/* Header --------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-block: 0.9rem;
}
.brand-logo { height: 38px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav .nav { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-nav .nav a { color: var(--ink); font-weight: 600; font-size: 0.97rem; }
.site-nav .nav a:hover,
.site-nav .nav-current a { color: var(--pink); }
.nav-actions { display: flex; gap: 0.6rem; align-items: center; }

.nav-toggle { display: none; background: none; border: 0; padding: 0.5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--navy); border-radius: 2px; }

/* Boutons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.15rem;
    border-radius: 999px;
    border: 2px solid transparent;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }

.btn-solid {
    color: #fff;
    background: linear-gradient(90deg, var(--navy), var(--violet) 55%, var(--pink));
    box-shadow: 0 6px 18px rgba(106, 44, 158, 0.28);
}
.btn-solid:hover { color: #fff; box-shadow: 0 8px 22px rgba(232, 64, 143, 0.35); }

.btn-outline { color: var(--navy); border-color: var(--navy); background: transparent; }
.btn-outline:hover { color: #fff; background: var(--navy); }

.btn-ghost { color: var(--navy); background: transparent; }
.btn-ghost:hover { color: var(--pink); }

/* Hero ----------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(6rem, 12vw, 9rem);
    background:
        radial-gradient(circle at 12% 15%, rgba(23, 162, 184, 0.14), transparent 40%),
        radial-gradient(circle at 88% 10%, rgba(232, 64, 143, 0.14), transparent 40%),
        radial-gradient(circle at 60% 90%, rgba(247, 168, 35, 0.14), transparent 45%),
        var(--bg);
}
.hero-wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 55%; }
.hero-inner { position: relative; text-align: center; max-width: 820px; }
.hero-title { font-size: clamp(2.6rem, 7vw, 5rem); font-weight: 800; margin-bottom: 0.4em; }
.hero-text { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--ink-soft); max-width: 640px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* Liste d'articles ----------------------------------------------------- */
.feed { padding-block: 3.5rem 4rem; }
.section-title { font-size: 1.6rem; margin-bottom: 1.75rem; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }

.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-image { display: block; aspect-ratio: 16 / 10; background: var(--bg-soft); overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { display: block; width: 100%; height: 100%; background: var(--gradient); opacity: 0.85; }
.card-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.card-title { font-size: 1.3rem; margin: 0; }
.card-title a { color: var(--navy); }
.card-title a:hover { color: var(--pink); }
.card-excerpt { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

.tag-pill {
    align-self: flex-start;
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--violet);
    background: rgba(106, 44, 158, 0.10);
}
.tag-pill:hover { color: #fff; background: var(--violet); }

.meta { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: 0.85rem; color: var(--ink-soft); margin-top: auto; }

/* Pagination ----------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 3rem; gap: 1rem; }
.pagination-info { font-size: 0.9rem; color: var(--ink-soft); }

/* Article -------------------------------------------------------------- */
.article { padding-bottom: 4rem; }
.article-header { text-align: center; padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.article-header .tag-pill { margin-bottom: 1rem; }
.article-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
.lead { font-size: 1.25rem; color: var(--ink-soft); }
.article-header .meta { justify-content: center; margin-top: 1rem; }
.article-image { width: min(1100px, 100% - 2.5rem); margin: 2.5rem auto; }
.article-image img { width: 100%; border-radius: var(--radius); }
.article-image figcaption { text-align: center; font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.6rem; }
.article-footer { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 3rem; }

.gh-content { font-size: 1.15rem; line-height: 1.75; }
.gh-content > * + * { margin-top: 1.5em; }
.gh-content h2 { font-size: 1.9rem; margin-top: 2.2em; }
.gh-content h3 { font-size: 1.45rem; margin-top: 1.8em; }
.gh-content a { color: var(--pink); text-decoration: underline; text-underline-offset: 3px; }
.gh-content a:hover { color: var(--violet); }
.gh-content blockquote {
    margin-inline: 0;
    padding: 0.4rem 0 0.4rem 1.5rem;
    border-left: 5px solid transparent;
    border-image: linear-gradient(180deg, var(--teal), var(--pink), var(--violet)) 1;
    font-size: 1.3rem;
    font-style: italic;
    color: var(--navy);
}
.gh-content hr { border: 0; height: 4px; border-radius: 4px; background: var(--gradient); }
.gh-content img { border-radius: 12px; }
.gh-content pre { background: var(--bg-soft); padding: 1rem; border-radius: 12px; overflow-x: auto; font-size: 0.95rem; }
.gh-content code { background: var(--bg-soft); padding: 0.1em 0.35em; border-radius: 6px; font-size: 0.9em; }
.gh-content pre code { background: none; padding: 0; }

/* Cartes éditeur Koenig ------------------------------------------------ */
.kg-width-wide { width: min(1000px, 100vw - 2.5rem); position: relative; left: 50%; transform: translateX(-50%); }
.kg-width-full { width: 100vw; position: relative; left: 50%; transform: translateX(-50%); }
.kg-width-full img { border-radius: 0; }
.kg-image { margin-inline: auto; }
.kg-card figcaption { text-align: center; font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.6rem; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.kg-gallery-row { display: flex; gap: 0.75rem; }
.kg-gallery-image { flex: 1 1 0; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; }
.kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.kg-bookmark-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kg-bookmark-container { display: flex; color: var(--ink); }
.kg-bookmark-content { padding: 1rem 1.25rem; flex: 1; }
.kg-bookmark-title { font-weight: 700; color: var(--navy); }
.kg-bookmark-description, .kg-bookmark-metadata { font-size: 0.85rem; color: var(--ink-soft); }
.kg-bookmark-thumbnail { width: 30%; position: relative; }
.kg-bookmark-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.kg-bookmark-icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; margin-right: 0.4rem; }
.kg-button-card { display: flex; justify-content: center; }
.kg-btn { display: inline-block; padding: 0.7rem 1.5rem; border-radius: 999px; color: #fff !important; background: var(--gradient); font-weight: 700; text-decoration: none !important; }
.kg-callout-card { display: flex; gap: 0.75rem; padding: 1.2rem 1.5rem; border-radius: 12px; background: var(--bg-soft); }

/* Archives (tag / auteur / erreur) ------------------------------------- */
.archive-head { text-align: center; padding: clamp(3rem, 7vw, 5rem) 0 0; }
.archive-head .tag-pill { margin-bottom: 0.8rem; }
.archive-title { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 800; }
.author-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; border: 4px solid #fff; box-shadow: var(--shadow); }
.archive-head .lead { max-width: 640px; margin-inline: auto; }

/* Bandeau d'abonnement ------------------------------------------------- */
.cta-band {
    margin-top: 2rem;
    padding: clamp(3rem, 7vw, 4.5rem) 0;
    text-align: center;
    color: #fff;
    background: linear-gradient(110deg, var(--navy) 0%, var(--violet) 55%, var(--pink) 100%);
}
.cta-band h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.cta-band p { max-width: 560px; margin: 0 auto 1.5rem; opacity: 0.92; }
.subscribe-form { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; max-width: 520px; margin: 0 auto; }
.subscribe-form input {
    flex: 1 1 240px;
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    border: 0;
    font: inherit;
    color: var(--ink);
}
.subscribe-form .btn-solid { background: var(--yellow); color: var(--navy); box-shadow: none; }
.subscribe-form .btn-solid:hover { background: #fff; color: var(--navy); }
.subscribe-form .loading, .subscribe-form .success,
.form-msg { display: none; }
.subscribe-form.loading .default, .subscribe-form.success .default { display: none; }
.subscribe-form.loading .loading, .subscribe-form.success .success { display: inline; }
.subscribe-form.success .msg-success, .subscribe-form.error .msg-error { display: block; flex-basis: 100%; margin: 0.5rem 0 0; font-size: 0.9rem; }

/* Footer --------------------------------------------------------------- */
.site-footer { background: var(--bg-soft); margin-top: 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; padding-block: 2.5rem 1.5rem; }
.footer-brand p { margin: 0.3rem 0 0; color: var(--ink-soft); }
.footer-nav .nav { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.footer-nav a, .footer-links a { color: var(--ink-soft); font-weight: 600; font-size: 0.95rem; }
.footer-nav a:hover, .footer-links a:hover { color: var(--pink); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-copy { padding-bottom: 2rem; font-size: 0.85rem; color: var(--ink-soft); }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 980px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
        padding: 1.25rem 1.5rem 1.5rem;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }
    .site-nav.is-open { display: flex; }
    .site-nav .nav { flex-direction: column; gap: 0.9rem; }
    .grid { grid-template-columns: 1fr; }
    .kg-bookmark-container { flex-direction: column; }
    .kg-bookmark-thumbnail { width: 100%; height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
