/* ============================================================
   Land & Sea Journal — style.css
   ============================================================ */

/* Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
    font-family: 'Cinzel';
    src: url('fonts/Cinzel-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    background: linear-gradient(
        to bottom,
        #9fa6ae 0%,
        #9fa6ae 10%,
        #6784a2 30%,
        #6784a2 90%,
        #9fa6ae 100%
    );
    background-attachment: fixed;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

body > main { flex: 1; }

/* ---- Header (edition palette) ---- */
#site-header {
    background-color: #1e3040;
    padding: 12px 20px 14px;
    position: relative;
}

#site-header h1 {
    font-family: 'Cinzel', Georgia, serif;
    font-style: italic;
    font-size: 2.6em;
    color: #fff;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

#site-header h1 a {
    text-decoration: none;
    color: inherit;
}

.header-icons {
    position: absolute;
    top: 18px;
    right: 22px;
    display: flex;
    gap: 14px;
    align-items: center;
}

.header-icons a {
    color: #d0dce8;
    font-size: 22px;
    text-decoration: none;
    transition: color 0.2s;
}

.header-icons a:hover { color: #fff; }

/* ---- Site navigation (edition palette) ---- */
#site-nav {
    background-color: #1e3040;
    padding: 7px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

#site-nav a {
    color: #b8ccdd;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-right: 1px solid #4a6a84;
    transition: color 0.2s, background 0.2s;
}

#site-nav a:first-child { padding-left: 0; }
#site-nav a:last-of-type { border-right: none; }
#site-nav a:hover       { color: #fff; }
#site-nav a.active      { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Full Editions page ---- */
.page-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4em;
    color: #18263a;
    margin-bottom: 0.3em;
}

.page-intro {
    color: #4a6a84;
    margin-bottom: 1.2em;
}

.editions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}

.editions-list li a {
    font-family: 'Cinzel', serif;
    font-size: 1.15em;
    color: #1c3347;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.editions-list li a:hover { color: #2e7d9e; }

.current-badge {
    font-family: sans-serif;
    font-size: 0.65em;
    font-weight: normal;
    background: #c8a84b;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Edition year group (year label + indented monthly links) ---- */
.edition-year-group {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.edition-year-label {
    font-family: 'Cinzel', serif;
    font-size: 1.15em;
    color: rgba(255, 255, 255, 0.55);
    font-weight: bold;
    letter-spacing: 0.04em;
}

.edition-months {
    list-style: none;
    padding: 0 0 0 1.4em;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25em;
    border-left: 2px solid rgba(200, 168, 75, 0.35);
}

.edition-months li a {
    font-family: 'Cinzel', serif;
    font-size: 1em;
    color: #1c3347;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.edition-months li a:hover { color: #2e7d9e; }

/* ---- Category jump-link menu (edition-section-nav style) ---- */
#cat-menu {
    background-color: #1e3040;
    border-bottom: 2px solid #c8a84b;
    padding: 9px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 2px;
    justify-content: center;
    align-items: center;
}

#cat-menu a {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.68em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b8ccd8;
    text-decoration: none;
    padding: 3px 7px;
    transition: color 0.15s;
}

#cat-menu a:not(:last-child)::after {
    content: none;
}

#cat-menu a:hover { color: #c8a84b; }

/* ---- Main content area ---- */
#main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* Full Editions page: left-align content (not centered) */
.full-editions-page #main-content {
    margin-left: 20px;
    margin-right: auto;
}

/* ---- Year heading inside main ---- */
.year-heading {
    color: rgba(255,255,255,0.5);
    font-size: 0.82em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0;
    padding-top: 4px;
}

/* ---- Category sections ---- */
.cat-section {
    margin-top: 50px;
}

.cat-section:first-child { margin-top: 20px; }

.cat-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.2em;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background-color: #1e3040;
    color: #f0e8d0;
    padding: 10px 20px;
    border-left: 6px solid #c8a84b;
    margin: 0 0 14px;
    display: block;
}

/* ---- Month accordions (<details>/<summary>) ---- */
.month-accordion {
    background: #fff;
    border: 1px solid #d4cdc4;
    border-radius: 0;
    margin-bottom: 6px;
    overflow: hidden;
}

.month-accordion summary {
    cursor: pointer;
    font-family: Georgia, serif;
    font-weight: bold;
    font-size: 0.92em;
    letter-spacing: 0.04em;
    color: #1e3040;
    padding: 9px 0;
    background-color: #ede8e0;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s, color 0.15s;
}

.month-accordion summary::-webkit-details-marker { display: none; }

.month-accordion summary::before {
    content: '▶';
    font-size: 0.65em;
    color: #3a5568;
    transition: transform 0.2s;
    display: inline-block;
}

.month-accordion[open] summary { background-color: #e0d8cc; }
.month-accordion[open] summary::before { transform: rotate(90deg); }

.month-accordion summary:hover { background-color: #e8e0d4; color: #1e6b9e; }

.month-posts {
    padding: 12px 24px 16px;
    background: #f5f0e8;
    font-size: calc(var(--reading-scale, 1) * 1.2em);
    line-height: 1.58;
    font-family: Georgia, 'Times New Roman', serif;
    color: #3e3830;
}

/* Links in month-posts — match edition styling */
.month-posts a {
    color: #18263a;
    text-decoration: none;
}

.month-posts a:hover {
    color: #1a5a8e;
    text-decoration: underline;
}

/* Links inside <p> — styled like .edition-headline a */
.month-posts p a,
.post p a {
    font-family: Georgia, serif;
    font-size: 0.86em;
    font-weight: bold;
    color: #18263a;
    text-decoration: none;
}

.month-posts p a:hover,
.post p a:hover {
    color: #1a5a8e;
    text-decoration: underline;
}

/* ---- Paragraph spacing inside post content ---- */
.month-posts p { margin-bottom: 0.75em; }
.month-posts p:last-child { margin-bottom: 0; }

/* ---- Individual posts ---- */
.post {
    padding: 12px 0;
    border-bottom: 1px solid #dce6ed;
}

.post:last-child { border-bottom: none; }

.post b, .post strong {
    color: #1a2f40;
    font-size: 1.0em;
    display: block;
    margin-bottom: 4px;
}

.post p, .post div {
    margin-bottom: 4px;
    color: inherit;
}

/* .post a inherits from .month-posts a (edition-style links) */
.post a {
    color: #18263a;
    text-decoration: none;
}

.post a:hover { color: #1a5a8e; text-decoration: underline; }

/* Hashtag links — muted */
.post a[href*="hashtag"] {
    color: #6a8fa8;
    font-size: 0.85em;
}

.post img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border: 1px solid #ccd8e0;
    border-radius: 3px;
}

/* ---- Period sub-label (when merging weekly entries into a month) ---- */
.period-label {
    font-weight: bold;
    font-size: 0.82em;
    letter-spacing: 0.05em;
    color: #5a7a96;
    border-top: 1px dashed #c8d8e4;
    padding-top: 10px;
    margin: 14px 0 6px;
    text-transform: uppercase;
}

/* ---- Empty year stub ---- */
.year-stub {
    background: rgba(255,255,255,0.8);
    border: 1px solid #b8cad6;
    border-radius: 4px;
    padding: 40px 30px;
    text-align: center;
    color: #5a7a96;
    font-style: italic;
    margin-top: 40px;
}

/* ---- Footer (edition palette) ---- */
#site-footer {
    background-color: #1e3040;
    color: #b8ccd8;
    text-align: center;
    font-size: 0.82em;
    padding: 28px 20px 32px;
    margin-top: auto;
}

#site-footer .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

#site-footer .footer-brand {
    font-family: 'Cinzel', Georgia, serif;
    font-weight: bold;
    margin: 0 0 14px;
    font-size: 1.05em;
}

#site-footer .footer-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

#site-footer .footer-social a {
    color: #d0dce8;
    font-size: 16px;
    text-decoration: none;
    transition: color 0.2s;
}

#site-footer .footer-social a:hover { color: #fff; }

#site-footer .footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 6px;
    margin-bottom: 12px;
}

#site-footer .footer-nav a {
    color: #c8a84b;
    text-decoration: none;
}

#site-footer .footer-nav a:hover { color: #e0c060; }

#site-footer .footer-nav .footer-sep {
    color: #5a7a96;
    margin: 0 2px;
    user-select: none;
}

#site-footer .footer-years {
    margin: 0;
    font-size: 0.95em;
}

#site-footer a {
    color: #c8a84b;
    text-decoration: none;
}

#site-footer a:hover { color: #e0c060; }

/* ---- Breadcrumb (edition palette) ---- */
.breadcrumb {
    background: rgba(30, 48, 64, 0.95);
    border-bottom: 1px solid #3a5568;
    padding: 6px 24px;
    font-size: 0.78em;
    color: #aac0d0;
}

.breadcrumb a { color: #7aacc4; text-decoration: none; }
.breadcrumb a:hover { color: #c8a84b; }

/* ---- Journalist Resources: cards ---- */
.resource-cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.resource-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #c8d8e4;
    border-radius: 5px;
    padding: 18px 22px;
    min-width: 220px;
    max-width: 320px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.resource-card:hover {
    border-color: #1a5a8e;
    box-shadow: 0 2px 8px rgba(26,90,142,0.15);
}

.resource-card-title {
    font-family: 'Cinzel', serif;
    font-size: 1.05em;
    font-weight: bold;
    color: #18263a;
    margin-bottom: 6px;
}

.resource-card-desc {
    font-size: 0.83em;
    color: #5a7a96;
    line-height: 1.5;
}

/* ---- News Site Overview: sections & link lists ---- */
.res-section {
    background: #fff;
    border: 1px solid #d0dce8;
    border-radius: 5px;
    padding: 16px 22px 18px;
    margin-bottom: 18px;
}

.res-heading {
    font-family: 'Cinzel', serif;
    font-size: 0.95em;
    color: #1c3347;
    letter-spacing: 0.04em;
    margin: 0 0 12px;
    padding-bottom: 7px;
    border-bottom: 1px solid #e0eaf0;
    text-transform: uppercase;
}

.res-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
}

.res-links li { display: contents; }

.res-links li a {
    font-size: 0.84em;
    color: #2e5c7a;
    text-decoration: none;
    padding: 2px 10px 2px 0;
    white-space: nowrap;
}

.res-links li a::after {
    content: ' ·';
    color: #aabcca;
    margin-left: 2px;
}

.res-links li:last-child a::after { content: ''; }

.res-links li a:hover { color: #1a5a8e; text-decoration: underline; }

/* ---- PHP Games (flash-card style) ---- */
.game-stage {
    max-width: 540px;
    margin: 0 auto;
    padding: 10px 0 50px;
}

.game-card {
    background: #fff;
    border-radius: 8px;
    padding: 32px 28px 26px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.12);
    text-align: center;
}

.game-label {
    font-size: 0.75em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7a9ab8;
    margin-bottom: 10px;
}

.game-question {
    font-family: 'Cinzel', serif;
    font-size: 1.55em;
    color: #1c3347;
    margin-bottom: 26px;
    line-height: 1.3;
}

.game-flag {
    max-width: 260px;
    width: 100%;
    border: 1px solid #ccd8e4;
    border-radius: 4px;
    margin: 0 auto 26px;
    display: block;
}

.game-reveal {
    margin-bottom: 22px;
}

.game-reveal > summary {
    display: inline-block;
    background: #2e6b9e;
    color: #fff;
    padding: 10px 28px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    letter-spacing: 0.03em;
    list-style: none;
    user-select: none;
    transition: background 0.2s;
}

.game-reveal > summary::-webkit-details-marker { display: none; }
.game-reveal[open] > summary { background: #1a5070; }
.game-reveal > summary:hover { background: #245a8a; }

.game-answer {
    background: #eef7f0;
    border: 1px solid #b0d8b8;
    border-radius: 6px;
    padding: 14px 20px;
    margin-top: 14px;
    font-size: 1.15em;
    color: #1a3a1a;
    line-height: 1.5;
}

.game-answer .answer-role {
    font-size: 0.78em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #5a8a6a;
    display: block;
    margin-bottom: 4px;
}

.game-next-form { margin-top: 20px; }

.game-next-btn {
    background: #3d5a77;
    color: #fff;
    border: none;
    padding: 11px 30px;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 0.02em;
}

.game-next-btn:hover { background: #2e4a61; }

.game-meta {
    font-size: 0.72em;
    color: #a0b8c8;
    margin-top: 14px;
}

.game-note {
    font-size: 0.72em;
    color: #9ab0be;
    margin-top: 8px;
    font-style: italic;
}

/* ---- Interactive Maps ---- */
.map-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 40px;
}

#map-container {
    width: 100%;
    max-width: 920px;
    cursor: pointer;
}

#map-container svg {
    width: 100%;
    height: auto;
    display: block;
}

#map-container path {
    fill: #4d7a96;
    stroke: #1e3040;
    stroke-width: 0.5px;
    transition: fill 0.12s;
}

#map-container path:hover { fill: #c8a84b; }

#map-container path.map-selected { fill: #c8a84b; }

.map-info-box {
    background: rgba(10, 20, 30, 0.88);
    color: #f0f4f8;
    padding: 7px 14px;
    border-radius: 5px;
    font-size: 0.92rem;
    position: fixed;
    display: none;
    pointer-events: none;
    z-index: 300;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.map-hint {
    font-size: 0.82em;
    color: #a0b8c8;
    margin-bottom: 14px;
    font-style: italic;
}

/* Two-region layout for Canada + Alaska page */
.map-two-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 920px;
}

.map-sub-label {
    font-size: 0.8em;
    color: #a0b8c8;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.map-sub [id^="map-container-"] {
    width: 100%;
    cursor: pointer;
}

.map-sub [id^="map-container-"] svg {
    width: 100%;
    height: auto;
    display: block;
}

.map-sub [id^="map-container-"] path {
    fill: #4d7a96;
    stroke: #1e3040;
    stroke-width: 0.5px;
    transition: fill 0.12s;
}

.map-sub [id^="map-container-"] path:hover   { fill: #c8a84b; }
.map-sub [id^="map-container-"] path.map-selected { fill: #c8a84b; }

/* Mexico capital city dots */
.capital-ring {
    fill: rgba(255, 255, 255, 0.25);
    stroke: none;
    pointer-events: none;
}

.capital-dot {
    fill: #f0e68c;
    stroke: #1e3040;
    stroke-width: 0.8px;
    cursor: pointer;
    transition: fill 0.12s;
}

.capital-dot:hover { fill: #fff; }

.mexico-city-dot {
    fill: #e03030;
    stroke: #fff;
    stroke-width: 1px;
    pointer-events: none;
}

/* Capital dot active state (USA map — lit up when parent state is selected) */
circle.capital-dot.cap-active { fill: #fff; }

/* Mexico tooltip: two-line */
.mexico-tooltip { line-height: 1.55; padding: 8px 14px; }
.mexico-tooltip strong { display: block; font-size: 1.02em; margin-bottom: 3px; }

/* USA tooltip: three-line (state, capital, population) */
.usa-tooltip { line-height: 1.6; padding: 9px 14px; }
.usa-tooltip strong { display: block; font-size: 1.02em; margin-bottom: 3px; }

/* USSR map: republic highlighting vs dimmed non-USSR countries */
#map-container path.non-ussr         { fill: #252530; opacity: 0.6; }
#map-container path.non-ussr:hover   { fill: #252530; cursor: default; }
#map-container path.ussr-republic    { fill: #4d7a96; opacity: 1; cursor: pointer; }
#map-container path.ussr-republic:hover          { fill: #c8a84b; }
#map-container path.ussr-republic.map-selected   { fill: #c8a84b; }

/* Multi-line USSR tooltip */
.ussr-tooltip { line-height: 1.55; padding: 9px 16px; }
.ussr-tooltip strong { display: block; font-size: 1.05em; margin-bottom: 4px; }

/* ── Canada map ─────────────────────────────────────────────────────────── */
/* Map fills the available page width (same pattern as other map pages) */
.canada-map {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    cursor: pointer;
}

.canada-map svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Interactive provinces/territories.
   These paths live inside <g transform="…scale(0.31306)"> so stroke-width
   must be set high enough that it appears ~0.5px after the scale. */
#canada-map-container path.land {
    fill: #4d7a96;
    stroke: #1e3040;
    stroke-width: 1.6px;   /* 1.6 × 0.31306 ≈ 0.5px rendered */
    transition: fill 0.12s;
    cursor: pointer;
}

#canada-map-container path.land:hover        { fill: #c8a84b; }
#canada-map-container path.land.map-selected { fill: #c8a84b; }

/* Non-interactive US reference (outside province group — no scale) */
#canada-map-container path.us-region {
    fill: #2e3d4a;
    stroke: #445566;
    stroke-width: 0.35px;
    cursor: default;
    pointer-events: none;
}

/* Greenland — slightly lighter than US, clearly separate */
#canada-map-container path.greenland-region {
    fill: #334455;
    stroke: #4a6070;
    stroke-width: 0.35px;
    cursor: default;
    pointer-events: none;
}

/* Canada tooltip */
.canada-tooltip { line-height: 1.6; padding: 9px 14px; }
.canada-tooltip strong { display: block; font-size: 1.02em; margin-bottom: 3px; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    #site-header h1 { font-size: 1.9em; }
    .header-icons { top: 14px; right: 14px; }
    #cat-menu a { font-size: 0.72em; padding: 3px 5px; }
    #main-content { padding: 18px 12px 40px; }
}

/* ================================================================
   Font-sizer — injected by javascript/font-sizer.js
   ================================================================ */

/* CSS variable that font-sizer.js updates on <html> */
:root { --reading-scale: 1; }

/* Paragraphs inherit scaled size from .month-posts — no double-scaling so 2024–2026 match 2021/2022 and Monthly Edition */
.month-posts p {
    font-size: 1em;
}

/* Font-sizer control group — lives inside #site-nav, pushed to right */
#font-sizer {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.fs-label {
    font-size: 0.62em;
    color: rgba(255, 255, 255, 0.38);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-family: sans-serif;
    margin-right: 3px;
    user-select: none;
}

.fs-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.5);
    padding: 1px 8px;
    font-size: 0.76em;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1.7;
    font-family: sans-serif;
    transition: border-color 0.15s, color 0.15s;
}

.fs-btn:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.45);
    color: rgba(255, 255, 255, 0.9);
}

.fs-btn:disabled {
    opacity: 0.22;
    cursor: default;
}
