/* ── RS Theme — Global styles ─────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&display=swap');

/* ── Tokens ── */
:root {
    --rs-bg:          #f2f0e8;
    --rs-bg-header:   #e8e4d8;
    --rs-text:        #1a1a18;
    --rs-muted:       rgba(26,26,24,.5);
    --rs-link:        #1a3a6e;
    --rs-link-hover:  #0f2448;
    --rs-border:      rgba(26,26,24,.12);
    --rs-max-width:   900px;
    --rs-font-mono:   'Courier Prime', 'Courier New', monospace;
    --rs-font-serif:  'Source Serif 4', Georgia, serif;
}

/* ── Reset Twenty Twenty-Five header/footer ── */
.wp-site-blocks > header,
.wp-site-blocks > footer {
    display: none !important;
}

/* ── Base ── */
html, body {
    background: var(--rs-bg);
    color: var(--rs-text);
    font-family: var(--rs-font-serif);
    font-size: 19px;
    line-height: 1.7;
    margin: 0;
    padding: 0;
}

.wp-site-blocks {
    padding: 0 !important;
}

.entry-content,
.wp-block-post-content {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Box centré — ordi et tablette uniquement */
@media (min-width: 768px) {
    .entry-content,
    .wp-block-post-content {
        max-width: var(--rs-max-width) !important;
        margin: 0 auto !important;
        padding: 32px 24px 48px !important;
        box-sizing: border-box;
    }
}

/* Éléments qui dépassent hors du box (au cas par cas) */
.rs-breakout {
    width: 100vw !important;
    max-width: none !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    position: relative;
}

a {
    color: var(--rs-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
a:hover { color: var(--rs-link-hover); }

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: var(--rs-font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    line-height: 1.2;
    color: var(--rs-text);
    text-wrap: balance;
}

h1 { font-size: clamp(1.3rem, 3vw, 2rem); margin: 0 0 .75rem; }
h2 { font-size: clamp(1rem, 2.2vw, 1.4rem); margin: 2rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1.5rem 0 .25rem; }

p { margin: 0 0 1.1rem; }

/* Sources, légendes, timestamps → typewriter */
figcaption,
.rs-ssg-update,
.rs-ssg-sources,
.rs-ssg-sources a,
cite, small {
    font-family: var(--rs-font-mono);
    font-size: .8rem;
    color: var(--rs-muted);
}

/* ── Custom header ── */
#rs-header {
    background: var(--rs-bg-header);
    border-bottom: 1px solid var(--rs-border);
    text-align: center;
    padding: 18px 20px 12px;
}

#rs-header .rs-site-name {
    font-family: var(--rs-font-mono);
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--rs-text);
    text-decoration: none;
}
#rs-header .rs-site-name:hover { color: var(--rs-link); }

#rs-header nav {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 0;
}

#rs-header nav a {
    font-family: var(--rs-font-mono);
    font-size: .7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--rs-muted);
    text-decoration: none;
    padding: 3px 10px;
    border-right: 1px solid var(--rs-border);
    transition: color .15s;
}
#rs-header nav a:last-child { border-right: none; }
#rs-header nav a:hover,
#rs-header nav a[aria-current="page"] {
    color: var(--rs-link);
}

/* ── Page content wrapper ── */
#rs-page-content {
    max-width: var(--rs-max-width);
    margin: 0 auto;
    padding: 32px 24px 48px;
}

/* Widget pleine largeur — le globe JS sort du max-width */
.rs-widget-wrap {
    max-width: 100vw;
    margin: 0 -24px;
    position: relative;
}

/* ── Custom footer ── */
#rs-footer {
    background: var(--rs-bg-header);
    border-top: 1px solid var(--rs-border);
    text-align: center;
    padding: 18px 20px;
    font-family: var(--rs-font-mono);
    font-size: .75rem;
    color: var(--rs-muted);
}

#rs-footer a {
    color: var(--rs-muted);
    text-decoration: none;
    margin: 0 10px;
}
#rs-footer a:hover { color: var(--rs-link); }

#rs-footer .rs-footer-sep {
    margin: 0 4px;
    opacity: .4;
}

/* ── Section statique SEO (rs-ssg) ── */
.rs-ssg-static {
    margin-top: 40px;
    padding: 18px 20px 16px;
    background: rgba(26,26,24,.06);
    border-radius: 8px;
    font-family: var(--rs-font-serif);
    font-size: .95rem;
}

.rs-ssg-h2 {
    font-family: var(--rs-font-mono);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--rs-muted);
    margin: 0 0 10px;
}

.rs-ssg-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--rs-font-serif);
    font-size: .9rem;
    color: var(--rs-text);
}

.rs-ssg-table thead th {
    font-family: var(--rs-font-mono);
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--rs-muted);
    text-align: left;
    padding: 0 12px 8px 0;
    border-bottom: 1px solid var(--rs-border);
}

.rs-ssg-table tbody td {
    padding: 7px 12px 7px 0;
    border-bottom: 1px solid rgba(26,26,24,.06);
    vertical-align: top;
    line-height: 1.5;
}

.rs-ssg-table tbody tr:last-child td {
    border-bottom: none;
}

.rs-ssg-table td:first-child {
    color: var(--rs-text);
    width: 42%;
}

.rs-ssg-table td:nth-child(2) a {
    color: var(--rs-link);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.rs-ssg-table td:nth-child(3) {
    font-family: var(--rs-font-mono);
    font-size: .78rem;
    color: var(--rs-muted);
    white-space: nowrap;
    width: 22%;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    #rs-header nav a {
        font-size: .65rem;
        padding: 3px 7px;
    }
    #rs-page-content {
        padding: 20px 16px 40px;
    }
    .rs-widget-wrap {
        margin: 0 -16px;
    }
}
