/*
Theme Name: Journal Bricolage — GP Child
Template: generatepress
Author: Mathieu Desailly
Version: 1.0.0
Description: Thème enfant GeneratePress pour journal-bricolage.fr — design éditorial premium navy + gold, conversion-focused.
*/

/* ============================================================
   1. VARIABLES — Design tokens
   ============================================================ */
:root {
    --jb-navy: #0B2341;
    --jb-navy-2: #102A43;
    --jb-gold: #F4B731;
    --jb-gold-hover: #E0A11C;
    --jb-white: #FFFFFF;
    --jb-bg: #F8FAFC;
    --jb-border: #E5E7EB;
    --jb-text: #102A43;
    --jb-mute: #6B7280;
    --jb-hover-soft: rgba(244, 183, 49, 0.10);

    --jb-radius-sm: 8px;
    --jb-radius-md: 12px;
    --jb-radius-lg: 16px;
    --jb-radius-xl: 20px;

    --jb-shadow-sm: 0 1px 2px rgba(11, 35, 65, 0.04);
    --jb-shadow-md: 0 4px 12px rgba(11, 35, 65, 0.06);
    --jb-shadow-lg: 0 12px 32px rgba(11, 35, 65, 0.08);

    --jb-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --jb-font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

    --jb-header-h: 80px;
    --jb-container: 1200px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body,
body.generatepress {
    font-family: var(--jb-font-body);
    color: var(--jb-text);
    background: var(--jb-white);
    line-height: 1.6;
    font-size: 16px;
    padding-top: var(--jb-header-h);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--jb-font-display);
    color: var(--jb-text);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1em; }

a {
    color: var(--jb-navy);
    text-decoration: none;
    transition: color .2s ease;
}
a:hover { color: var(--jb-gold-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   3. OVERRIDE GeneratePress (one-container / containers)
   === KILL GP CONTAINERS — lesson-site §18 ===
   ============================================================ */

/* Backgrounds GP transparents — universel (toutes pages) */
html body.one-container,
html body[class].one-container,
html body.separate-containers .inside-article,
html body.separate-containers .comments-area,
html body.separate-containers .page-header,
html body.one-container .container,
html body.separate-containers .paging-navigation,
html body .inside-page-header,
html body .inside-article,
html body article,
html body .entry-content {
    background: transparent !important;
    background-color: transparent !important;
}

.site-header,
.site-footer { display: none; }

.site-content,
.content-area,
.site-main { background: transparent; }

#page.site {
    background: transparent;
}

/* === HOME UNIQUEMENT — full-width container (hero full-bleed natif) === */
html body.home #page.grid-container.container {
    max-width: 100% !important;
    width: 100% !important;
}
html body.home .site-content,
html body.home .content-area,
html body.home .site-main,
html body.home article,
html body.home .inside-article,
html body.home .entry-content {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

/* === TOUTES LES AUTRES PAGES — container GP centré 1200px + padding normal === */
html body:not(.home) #page.grid-container.container {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
}
html body:not(.home) .site-content {
    padding: 40px 24px !important;
}
html body:not(.home) .inside-article {
    padding: 0 !important;
}

/* === Full-bleed sections (hero, stats, simulators, etc.) — RÉSERVÉ à la home ===
   FIX : on n'utilise plus width:100vw + margin négatif (cassé quand le parent
   direct n'a pas de width). À la place, on force tous les parents à width:100%
   (cf. règle au-dessus) et le fullbleed prend simplement 100% du parent.
   Background full-width assuré par width:100%, content centré via -inner. */
body.home .jb-fullbleed {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}
body.home .jb-fullbleed-inner {
    max-width: var(--jb-container, 1200px);
    width: 100%;
    margin: 0 auto;
    padding: 60px 24px;
    box-sizing: border-box;
}

/* ============================================================
   4. HEADER — sticky blanc + nav
   ============================================================ */
.jb-site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--jb-header-h);
    background: var(--jb-white);
    border-bottom: 1px solid var(--jb-border);
    z-index: 1000;
    box-shadow: var(--jb-shadow-sm);
}

.jb-header-inner {
    max-width: var(--jb-container);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.jb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--jb-navy);
    flex-shrink: 0;
}

.jb-brand-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.jb-brand-text {
    font-family: var(--jb-font-display);
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--jb-navy);
}

.jb-brand-text small {
    display: block;
    font-family: var(--jb-font-body);
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--jb-mute);
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.jb-header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    justify-content: center;
}

.jb-header-nav a {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--jb-text);
    padding: 8px 2px;
    position: relative;
    white-space: nowrap;
}

.jb-header-nav a:hover { color: var(--jb-gold-hover); }

.jb-header-nav a.is-active {
    color: var(--jb-navy);
}
.jb-header-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--jb-gold);
    border-radius: 2px;
}

.jb-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.jb-search-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--jb-border);
    border-radius: 50%;
    background: var(--jb-white);
    color: var(--jb-navy);
    cursor: pointer;
    transition: all .2s ease;
}
.jb-search-btn:hover {
    background: var(--jb-hover-soft);
    border-color: var(--jb-gold);
}

.jb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--jb-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 22px;
    border-radius: var(--jb-radius-sm);
    cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
    border: 1px solid transparent;
    line-height: 1;
}

.jb-btn-primary {
    background: var(--jb-gold);
    color: var(--jb-navy);
    border-color: var(--jb-gold);
    padding: 14px 28px;
}
.jb-btn-primary:hover {
    background: var(--jb-gold-hover);
    border-color: var(--jb-gold-hover);
    color: var(--jb-navy);
    transform: translateY(-1px);
    box-shadow: var(--jb-shadow-md);
}

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

/* ============================================================
   5. MOBILE NAV (burger)
   ============================================================ */
.jb-burger {
    display: none;
    background: transparent;
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-radius-sm);
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--jb-navy);
}

.jb-mobile-nav {
    display: none;
    position: fixed;
    top: var(--jb-header-h);
    left: 0;
    right: 0;
    background: var(--jb-white);
    border-bottom: 1px solid var(--jb-border);
    padding: 20px 24px 28px;
    z-index: 999;
    box-shadow: var(--jb-shadow-lg);
    flex-direction: column;
    gap: 6px;
}
.jb-mobile-nav.is-open { display: flex; }

.jb-mobile-nav a {
    padding: 12px 8px;
    font-weight: 500;
    color: var(--jb-text);
    border-bottom: 1px solid var(--jb-border);
}
.jb-mobile-nav a:last-of-type { border-bottom: none; }

.jb-mobile-nav .jb-btn {
    margin-top: 12px;
    width: 100%;
}

@media (max-width: 900px) {
    .jb-header-nav,
    .jb-search-btn,
    .jb-header-actions .jb-btn { display: none; }
    .jb-burger { display: inline-flex; }
}

/* ============================================================
   6. CARDS génériques
   ============================================================ */
.jb-card {
    background: var(--jb-white);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-radius-lg);
    box-shadow: 0 4px 12px rgba(11, 35, 65, 0.04);
    padding: 24px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.jb-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--jb-shadow-md);
}

/* ============================================================
   7. TABLEAUX
   ============================================================ */
.jb-content table,
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-radius-md);
    overflow: hidden;
}
.jb-content thead,
.entry-content thead {
    background: var(--jb-navy);
    color: var(--jb-white);
}
.jb-content th,
.entry-content th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-family: var(--jb-font-body);
    color: var(--jb-white);
    border-bottom: 1px solid var(--jb-navy-2);
}
.jb-content td,
.entry-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--jb-border);
    color: var(--jb-text);
}
.jb-content tbody tr:nth-child(even),
.entry-content tbody tr:nth-child(even) {
    background: var(--jb-bg);
}
.jb-content tbody tr:last-child td,
.entry-content tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   8. FAQ <details>
   ============================================================ */
.jb-content details,
.entry-content details {
    background: var(--jb-white);
    border: 1px solid var(--jb-border);
    border-radius: var(--jb-radius-md);
    padding: 0;
    margin: 12px 0;
    overflow: hidden;
    box-shadow: var(--jb-shadow-sm);
}
.jb-content summary,
.entry-content summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 48px 16px 20px;
    font-weight: 600;
    color: var(--jb-text);
    position: relative;
    font-family: var(--jb-font-body);
}
.jb-content summary::-webkit-details-marker,
.entry-content summary::-webkit-details-marker { display: none; }
.jb-content summary::after,
.entry-content summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: var(--jb-gold);
    font-weight: 700;
    transition: transform .2s ease;
    line-height: 1;
}
.jb-content details[open] summary::after,
.entry-content details[open] summary::after {
    content: "−";
}
.jb-content details > *:not(summary),
.entry-content details > *:not(summary) {
    padding: 0 20px 16px;
    color: var(--jb-mute);
}

/* ============================================================
   9. FOOTER
   ============================================================ */
.jb-site-footer {
    background: var(--jb-navy);
    color: var(--jb-white);
    margin-top: 0;
    padding: 56px 0 0;
}
.jb-site-footer * { color: inherit; }

.jb-footer-inner {
    max-width: var(--jb-container);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
}

.jb-footer-col h4 {
    font-family: var(--jb-font-display);
    font-size: 1.05rem;
    color: var(--jb-gold);
    margin: 0 0 16px;
    font-weight: 600;
}

.jb-footer-col p,
.jb-footer-col li,
.jb-footer-col a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
}
.jb-footer-col a:hover { color: var(--jb-gold); }

.jb-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.jb-footer-col li { margin-bottom: 8px; }

.jb-footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.jb-footer-brand-text {
    font-family: var(--jb-font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--jb-white);
}

.jb-footer-tagline {
    color: var(--jb-gold);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.jb-footer-bottom {
    margin-top: 48px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}
.jb-footer-bottom a {
    color: rgba(255, 255, 255, 0.78);
    margin-left: 12px;
}
.jb-footer-bottom a:hover { color: var(--jb-gold); }

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

/* ============================================================
  10. UTILITIES
   ============================================================ */
.jb-container { max-width: var(--jb-container); margin: 0 auto; padding: 0 24px; }
.jb-section   { padding: 64px 0; }
.jb-text-mute { color: var(--jb-mute); }
.jb-text-gold { color: var(--jb-gold); }

@media (max-width: 600px) {
    .jb-section { padding: 40px 0; }
}

/* === FIX final 5 mai : main.jb-fp + article home ne pas contraindre à 1200 === */
html body.home main.jb-fp,
html body.home main,
html body.home article,
html body.home .inside-article {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}
