/* =========================================================================
   CycloneTracks — Global Stylesheet
   Single global file per Blue Logic convention. New pages draw on these
   tokens/components rather than introducing their own.
   ========================================================================= */

:root {
    /* Ocean / storm palette */
    --color-deep-ocean:   #0b1f33;
    --color-storm-navy:   #14304d;
    --color-storm-teal:   #1c6e73;
    --color-foam:         #eef6f7;
    --color-paper:        #ffffff;
    --color-text:         #16232e;
    --color-text-muted:   #52697a;

    /* Cyclone category scale (BOM-ish 1-5) used consistently for map + UI */
    --color-cat-1: #4fb0c6;
    --color-cat-2: #f2c14e;
    --color-cat-3: #f2994a;
    --color-cat-4: #eb5757;
    --color-cat-5: #9b2c2c;

    --radius-sm: 6px;
    --radius-md: 12px;
    --shadow-panel: 0 8px 30px rgba(11, 31, 51, 0.18);

    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'Consolas', 'Menlo', monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-foam);
    line-height: 1.5;
}

a { color: inherit; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* ---- Header ------------------------------------------------------------ */
.site-header {
    background: var(--color-deep-ocean);
    color: var(--color-paper);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-paper);
    letter-spacing: 0.02em;
}

.site-logo i {
    color: var(--color-cat-3);
}

.site-nav {
    display: flex;
    gap: 28px;
}

.site-nav a {
    text-decoration: none;
    color: var(--color-paper);
    opacity: 0.85;
    font-size: 0.95rem;
    transition: opacity 0.15s ease;
}

.site-nav a:hover { opacity: 1; }

/* ---- Ad slots ------------------------------------------------------------ */
.ad-slot {
    display: flex;
    justify-content: center;
    padding: 16px 0;
    background: var(--color-foam);
}

.ad-slot__placeholder {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #b9c7cf;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.ad-slot--rectangle .ad-slot__placeholder {
    max-width: 300px;
    min-height: 250px;
}

/* ---- Hero: map front and centre ---------------------------------------- */
.hero {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    background: var(--color-deep-ocean);
}

.hero-map-wrap {
    position: relative;
    min-height: 560px;
}

#cyclone-map {
    width: 100%;
    height: 100%;
    min-height: 560px;
}

.map-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

#play-pause-btn {
    background: rgba(11, 31, 51, 0.85);
    color: var(--color-paper);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-panel);
    transition: background 0.15s ease;
}

#play-pause-btn:hover { background: var(--color-storm-teal); }

/* ---- Cyclone info panel -------------------------------------------------- */
.cyclone-info-panel {
    background: var(--color-storm-navy);
    color: var(--color-paper);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.cyclone-info-panel__loading {
    color: rgba(255,255,255,0.6);
    font-style: italic;
}

.cyclone-info-panel h2 {
    margin: 0 0 4px;
    font-size: 1.4rem;
}

.cyclone-info-panel .season {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    margin: 0 0 8px;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    width: fit-content;
}

.category-badge[data-cat="1"] { background: var(--color-cat-1); color: #06282e; }
.category-badge[data-cat="2"] { background: var(--color-cat-2); color: #3a2c00; }
.category-badge[data-cat="3"] { background: var(--color-cat-3); color: #3a1c00; }
.category-badge[data-cat="4"] { background: var(--color-cat-4); color: #3a0000; }
.category-badge[data-cat="5"] { background: var(--color-cat-5); color: #fff; }

.info-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 6px;
}

.info-stat-row span:first-child { color: rgba(255,255,255,0.6); }
.info-stat-row span:last-child  { font-family: var(--font-mono); }

/* ---- Stat strip ----------------------------------------------------------- */
.stat-strip {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat__number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-storm-teal);
}

.stat__label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ---- Intro blurb ------------------------------------------------------------ */
.intro-blurb {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px 64px;
    text-align: center;
}

.intro-blurb h1 {
    font-size: 1.9rem;
    margin-bottom: 12px;
}

.intro-blurb p {
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
    background: var(--color-storm-teal);
    color: var(--color-paper);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(28, 110, 115, 0.35);
}

/* ---- Footer ------------------------------------------------------------------ */
.site-footer {
    background: var(--color-deep-ocean);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 24px;
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--color-cat-3);
    text-decoration: none;
}

.footer-attribution { margin-bottom: 6px; }

/* ---- Responsive ---------------------------------------------------------------- */
/* =========================================================================
   Admin — Narrative Builder (mobile-first: this is meant to be run from
   a phone, one report at a time)
   ========================================================================= */

.admin-body {
    background: var(--color-foam);
}

.admin-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.admin-header__actions {
    display: flex;
    gap: 8px;
}

.admin-search-form {
    margin-bottom: 16px;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.review-item {
    display: block;
    background: var(--color-paper);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow-panel);
    text-decoration: none;
    color: var(--color-text);
}

.review-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.review-item__name { font-weight: 600; }

.review-item__meta {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin: 0 0 6px;
}

.review-item__snippet {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
    line-height: 1.4;
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
}

.admin-header h1 {
    font-size: 1.2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-header h1 i { color: var(--color-cat-3); }

.admin-progress {
    margin-bottom: 20px;
}

.admin-progress__bar {
    height: 8px;
    background: #dde6ea;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.admin-progress__fill {
    height: 100%;
    background: var(--color-storm-teal);
    transition: width 0.3s ease;
}

.admin-progress__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.admin-progress__stats strong { color: var(--color-text); }
.admin-progress__total { margin-left: auto; }

.admin-card {
    background: var(--color-paper);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-panel);
}

.admin-card--done {
    text-align: center;
    padding: 40px 20px;
}

.admin-card--done i {
    font-size: 2.5rem;
    color: var(--color-storm-teal);
    margin-bottom: 12px;
}

.admin-card__eyebrow {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin: 0 0 4px;
}

.admin-card h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
}

.admin-card__date {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0 0 12px;
}

.admin-source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--color-storm-teal);
    margin-bottom: 16px;
}

.admin-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eef1f3;
}

.admin-section h3 {
    font-size: 0.95rem;
    margin: 0 0 10px;
}

.admin-muted {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.candidate-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.candidate-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid #dde6ea;
    border-radius: var(--radius-sm);
    background: var(--color-foam);
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.candidate-btn:hover,
.candidate-btn:active {
    background: #e2f0f1;
    border-color: var(--color-storm-teal);
}

.candidate-btn__name { font-weight: 600; }
.candidate-btn__meta { font-size: 0.78rem; color: var(--color-text-muted); font-family: var(--font-mono); }

.admin-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dde6ea;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.admin-linked-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e2f0f1;
    color: var(--color-storm-navy);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    border-top: none;
    margin-top: 0;
}

.admin-generated-result {
    margin-top: 16px;
    padding: 14px;
    background: var(--color-foam);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.6;
}

.admin-generated-result p { margin-top: 0; }

.admin-generated-result__sources {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin: 0 0 10px;
}

.admin-textarea {
    width: 100%;
    min-height: 180px;
    padding: 12px;
    border: 1px solid #dde6ea;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    margin-bottom: 10px;
    background: var(--color-paper);
}

.admin-result-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.admin-result-actions .btn {
    flex: 1;
}

.admin-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.btn--large {
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 1rem;
    margin-top: 16px;
}

.btn--small {
    padding: 8px 14px;
    font-size: 0.8rem;
}

.btn--ghost {
    background: transparent;
    border: 1px solid #c8d4da;
    color: var(--color-text-muted);
}

.btn--ghost:hover {
    background: #eef1f3;
}

.fa-spin { animation: fa-spin 1s linear infinite; }
@keyframes fa-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
    }
    .hero-map-wrap, #cyclone-map {
        min-height: 380px;
    }
    .site-nav {
        gap: 16px;
        font-size: 0.85rem;
    }
}
