/* ============================================================
   AUDIAA — Override layer for Ghost Source theme
   Loaded AFTER screen.css in default.hbs.

   Note technique : Source applique `html { font-size: 62.5% }`,
   donc on évite les rem dans cet override (sauf scale relatif au
   contexte) et on utilise des `px` pour les font-sizes.
   ============================================================ */

/* ---- 1. Audiaa design tokens (override Source variables) ---- */

:root {
    /* Bleu cobalt — couleur signature */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #60A5FA;
    --accent: #DBEAFE;
    --accent-dark: #BFDBFE;

    /* Ink — noir profond (footer + contraste) */
    --secondary: #0F0F0F;
    --secondary-dark: #000000;
    --secondary-border: #1A1A1A;

    /* Neutres */
    --bg-white: #FFFFFF;
    --bg-cream: #F4F1EA;
    --text-dark: #0F172A;
    --text-muted: #475569;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;

    /* Ombres bleutées (rgba du primary) */
    --shadow-sm: 0 1px 3px rgba(37, 99, 235, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(37, 99, 235, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 24px rgba(37, 99, 235, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 40px rgba(37, 99, 235, 0.14), 0 8px 16px rgba(15, 23, 42, 0.06);

    /* Rayons */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* Override Source variables */
    --color-primary-text: var(--text-dark);
    --color-secondary-text: var(--text-muted);
    --color-darker-gray: var(--text-dark);
    --color-border: var(--border);
    --color-light-gray: var(--border);
    --color-mid-gray: var(--text-light);

    /* Fonts Audiaa */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Space Grotesk', Georgia, serif;

    /* Override Ghost accent color */
    --ghost-accent-color: var(--primary);

    /* Layout */
    --container-width: 1200px;
}

/* ---- 2. Globals ---- */

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.is-title {
    font-family: var(--font-display);
    color: var(--text-dark);
    letter-spacing: -0.025em;
    line-height: 1.15;
    font-weight: 600;
}

.gh-article-title.is-title { letter-spacing: -0.035em; line-height: 1.05; font-weight: 600; }

a {
    color: var(--primary);
    transition: color 0.2s ease;
}
a:hover { color: var(--primary-dark); }

/* ---- 3. Buttons (Source's .gh-button + portal) ---- */

.gh-button,
button.gh-button,
a.gh-button,
.kg-card.kg-button-card .kg-btn,
.gh-portal-button {
    background: var(--primary) !important;
    color: white !important;
    border: 1.5px solid var(--primary) !important;
    border-radius: 8px !important;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 22px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
    transition: all 0.2s ease;
}
.gh-button:hover,
button.gh-button:hover,
a.gh-button:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.40);
}

/* ---- 4. Audiaa custom navigation ---- */

.audiaa-announcement {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    line-height: 1.4;
}
.audiaa-announcement a {
    color: white;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: 6px;
}
.audiaa-announcement a:hover { color: var(--accent); }
.audiaa-announcement .audiaa-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-right: 8px;
    vertical-align: middle;
}

.audiaa-nav {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    font-family: var(--font-sans);
    font-size: 16px;
}
.audiaa-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.audiaa-nav-logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.035em;
    line-height: 1;
    flex-shrink: 0;
    text-decoration: none;
}
.audiaa-nav-logo:hover { color: var(--text-dark); }
.audiaa-nav-logo .accent { color: var(--primary); font-weight: 500; }

.audiaa-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    justify-content: center;
}
.audiaa-nav-links a {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
}
.audiaa-nav-links a:hover {
    color: var(--text-dark);
    background: var(--bg-cream);
}
.audiaa-nav-links a.is-active {
    color: var(--primary);
    font-weight: 600;
}

.audiaa-nav-actions { display: flex; align-items: center; gap: 12px; }
.audiaa-nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-sans);
}
.audiaa-nav-cta:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.40);
}

.audiaa-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.audiaa-burger span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.2s ease;
}
.audiaa-burger:hover { background: var(--bg-cream); }

.audiaa-mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-white);
    z-index: 999;
    padding: 88px 32px 40px;
    overflow-y: auto;
    flex-direction: column;
}
.audiaa-mobile-nav.is-open { display: flex; }
.audiaa-mobile-nav a:not(.audiaa-nav-cta) {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    font-family: var(--font-display);
    text-decoration: none;
}
.audiaa-mobile-nav .audiaa-nav-cta {
    margin-top: 32px;
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
}

/* Hide Source's own nav and footer since we provide our own */
#gh-navigation,
.gh-navigation { display: none !important; }
#gh-footer,
.gh-footer { display: none !important; }

/* ---- 5. Page header (hero pages secondaires Audiaa) ---- */

.gh-canvas { padding-left: 24px; padding-right: 24px; }

.gh-archive,
.gh-article-header.gh-canvas {
    background: var(--bg-cream);
    background-image: radial-gradient(circle, rgba(15, 15, 15, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    padding-top: 64px !important;
    padding-bottom: 56px !important;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.gh-archive::before,
.gh-article-header.gh-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 80% at 50% 50%, rgba(244, 241, 234, 0.2) 0%, rgba(244, 241, 234, 0.9) 70%);
    pointer-events: none;
    z-index: 0;
}
.gh-archive > *,
.gh-article-header > * { position: relative; z-index: 1; }

.gh-article-tag,
.gh-article-tag a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: var(--primary) !important;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 40px;
    border: 1px solid var(--accent-dark);
    margin-bottom: 18px;
    text-transform: none;
    letter-spacing: 0.01em;
    text-decoration: none;
}
.gh-article-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

.gh-article-title.is-title {
    font-family: var(--font-display);
    font-size: clamp(38px, 6vw, 64px);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--text-dark);
    max-width: 900px;
}

.gh-article-excerpt.is-body {
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.65;
    color: var(--text-muted);
    margin-top: 18px;
    max-width: 720px;
}

.gh-article-meta { font-family: var(--font-sans); }
.gh-article-author-name { font-family: var(--font-display); font-weight: 600; color: var(--text-dark); font-size: 16px; }
.gh-article-meta-date,
.gh-article-meta-length { color: var(--text-muted); font-size: 14px; }

/* ---- 6. Article content / prose ---- */

.gh-content {
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.75;
    color: var(--text-dark);
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}
.gh-content > h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 500;
    margin-top: 56px;
    margin-bottom: 18px;
    line-height: 1.15;
    letter-spacing: -0.035em;
}
.gh-content > h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 14px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.gh-content > p,
.gh-content > ul,
.gh-content > ol,
.gh-content > blockquote {
    margin-bottom: 24px;
}
.gh-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.gh-content a:hover { color: var(--primary-dark); text-decoration-thickness: 2px; }

.gh-content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg-cream);
    padding: 18px 24px;
    margin: 28px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-dark);
}
.gh-content blockquote p { margin-bottom: 0; }

.gh-content code,
.gh-content pre {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    background: var(--bg-cream);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.92em;
}
.gh-content code { padding: 2px 6px; }
.gh-content pre {
    padding: 18px 22px;
    overflow-x: auto;
    margin-bottom: 24px;
}
.gh-content pre code { background: none; border: none; padding: 0; }

.gh-content img,
.gh-content figure img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.gh-content figcaption {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
}

.gh-content ul,
.gh-content ol { padding-left: 24px; }
.gh-content li { margin-bottom: 8px; }

.gh-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 48px auto;
}

/* ---- 7. Post listing / cards ---- */

.gh-feed,
.gh-postfeed { max-width: 1200px; margin: 0 auto; }

.gh-card,
.post-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.35s ease;
    overflow: hidden;
}
.gh-card:hover,
.post-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-dark);
    transform: translateY(-3px);
}

.gh-card-title,
.post-card-title {
    font-family: var(--font-display);
    color: var(--text-dark);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    font-size: 22px;
}

.gh-card-excerpt,
.post-card-excerpt {
    font-family: var(--font-sans);
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 16px;
}

.gh-card-meta,
.post-card-meta {
    font-family: var(--font-sans);
    color: var(--text-muted);
    font-size: 14px;
}

.gh-card-link:hover .gh-card-title,
.post-card-link:hover .post-card-title { color: var(--primary); }

/* ---- 8. Tag / archive header ---- */

.gh-archive-wrapper { text-align: left; }
.gh-archive-wrapper .gh-article-title { font-size: clamp(28px, 4.5vw, 44px); }

/* ---- 9. Container title (related, see all) ---- */

.gh-container-title {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin-bottom: 28px;
    font-size: 22px;
}

/* ---- 10. Spacing : éviter que le content colle au footer ---- */

.gh-main {
    padding-bottom: 80px;
}

/* Footer toujours respiré du contenu qui le précède */
.audiaa-footer {
    margin-top: 96px;
}
/* Exemption : si footer suit directement .gh-main, le padding-bottom 80px suffit déjà */
main.gh-main + .audiaa-footer {
    margin-top: 0;
}

/* Section "Read more" sur les pages article : spacing autour */
.gh-container.is-grid {
    padding-top: 32px;
    padding-bottom: 72px;
    border-top: 1px solid var(--border);
    margin-top: 64px;
    background: var(--bg-cream);
}
.gh-container.is-grid .gh-container-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- 11. Audiaa custom footer ---- */

.audiaa-footer {
    background: var(--secondary);
    color: rgba(255, 255, 255, 0.7);
    padding: 56px 0 32px;
    font-family: var(--font-sans);
    font-size: 16px;
}
.audiaa-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.audiaa-footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 32px;
}
.audiaa-footer-brand .audiaa-nav-logo {
    color: white;
    margin-bottom: 12px;
    display: block;
    font-size: 24px;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.035em;
}
.audiaa-footer-brand .audiaa-nav-logo .accent { color: var(--primary-light); }
.audiaa-footer-brand p {
    font-size: 14px;
    line-height: 1.65;
    max-width: 280px;
    margin: 0;
}
.audiaa-footer-col h4 {
    font-family: var(--font-sans);
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
    line-height: 1.2;
}
.audiaa-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.audiaa-footer-col li { margin-bottom: 10px; }
.audiaa-footer-col li a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    transition: color 0.2s ease;
    text-decoration: none;
}
.audiaa-footer-col li a:hover { color: white; }

.audiaa-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.audiaa-footer-bottom p { font-size: 13px; margin: 0; }
.audiaa-footer-credit { color: rgba(255, 255, 255, 0.35); }
.audiaa-footer-credit a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}
.audiaa-footer-credit a:hover { color: white; }

/* ---- 12. Subscribe / portal ---- */

.gh-subscribe-form input[type="email"] {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border) !important;
    padding: 11px 16px !important;
    font-family: var(--font-sans) !important;
    font-size: 15px !important;
}
.gh-subscribe-form input[type="email"]:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
    outline: none !important;
}

/* ---- 13. Responsive ---- */

@media (max-width: 900px) {
    .audiaa-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .audiaa-nav-links { display: none; }
    .audiaa-nav-actions .audiaa-nav-cta { display: none; }
    .audiaa-burger { display: flex; }
    .gh-content { padding: 32px 20px 48px; font-size: 17px; }
    .gh-content > h2 { font-size: 26px; margin-top: 40px; }
    .gh-content > h3 { font-size: 20px; margin-top: 32px; }
    .gh-archive,
    .gh-article-header.gh-canvas {
        padding-top: 48px !important;
        padding-bottom: 40px !important;
    }
}

@media (max-width: 560px) {
    .audiaa-footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .audiaa-footer-bottom { flex-direction: column; text-align: center; }
    .audiaa-nav-inner { padding: 0 16px; }
}
