@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Cinzel:wght@700;900&display=swap');

:root {
    --fire-red: #aa1212;
    --bg: #e0e0e0;
    --card-bg: #ffffff;
    --text-main: #0f1d5e;
    --text-dim: #344080;
    --border: #b8c4dc;
    --accent: #aa1212;
}
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: url('attached_assets/skyline-bg-v2.png') center bottom / auto 115% no-repeat;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: inset 0 0 0 4px #aa1212, inset 0 0 0 9px #0f1d5e;
    pointer-events: none;
    z-index: 9999;
}

body > * {
    position: relative;
    z-index: 1;
}
.container { width: 100%; max-width: 800px; flex: 1; }

/* ── Sticky footer ── */
.site-footer { width: 100%; }

header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 0 20px;
    border-bottom: 2px solid var(--fire-red);
    margin-bottom: 0;
}
.site-logo {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #091530;
    filter: drop-shadow(0 2px 8px rgba(170,18,18,0.25));
}
.header-text {
    text-align: left;
}
h1 {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 2.8rem;
    font-weight: 900;
    margin: 0;
    color: var(--fire-red);
    letter-spacing: 3px;
}

.header-sub {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 500px) {
    header { flex-direction: column; gap: 14px; }
    .header-text { text-align: center; }
    .site-logo { width: 72px; height: 72px; }
}

/* ── Page nav ── */
.page-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 0 30px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text-main); border-color: var(--fire-red); }
.nav-link.active { color: white; background: var(--fire-red); border-color: var(--fire-red); }

/* ── Search panel ── */
.search-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(60,80,130,0.10);
    border: 1px solid var(--border);
    margin-bottom: 30px;
    text-align: center;
}
label { display: block; margin-bottom: 15px; font-size: 1.1rem; color: var(--text-dim); }
.date-inputs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
select#historyMonth, input#historyDay {
    background: var(--bg); border: 2px solid var(--border); color: var(--text-main);
    padding: 12px 16px; border-radius: 8px; font-size: 1.1rem;
    outline: none; transition: border-color 0.3s; font-family: inherit;
}
select#historyMonth { cursor: pointer; min-width: 160px; }
input#historyDay { width: 100px; text-align: center; -moz-appearance: textfield; }
input#historyDay::-webkit-outer-spin-button,
input#historyDay::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select#historyMonth:focus, input#historyDay:focus { border-color: var(--fire-red); }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 30px; border-left: 2px solid var(--border); }
.event-card {
    background: var(--card-bg); border-radius: 8px;
    border: 1px solid var(--border);
    padding: 20px; padding-right: 50px;
    margin-bottom: 25px; position: relative; transition: transform 0.2s;
    box-shadow: 0 2px 10px rgba(60,80,130,0.07);
}
.event-card:hover { transform: translateX(5px); }
.event-card::before {
    content: ''; position: absolute; left: -41px; top: 24px;
    width: 20px; height: 20px; background: var(--fire-red);
    border-radius: 50%; border: 4px solid var(--bg);
}
.year-tag { font-size: 1.5rem; font-weight: 900; color: var(--fire-red); display: block; }
.event-title { font-size: 1.2rem; font-weight: bold; margin: 10px 0; color: var(--text-main); }

/* ── Category tags ── */
.cat-tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.cat-tag {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; padding: 3px 9px; border-radius: 4px;
    border: 1px solid; white-space: nowrap;
}
.cat-tag--wildfire       { background:#fff3e6; color:#9a3800; border-color:#e06020; }
.cat-tag--structure-fire { background:#e8f0ff; color:#1a3d99; border-color:#2255cc; }
.cat-tag--conflagration  { background:#fff0e6; color:#8a2c00; border-color:#cc4400; }
.cat-tag--hazmat         { background:#eaf7ea; color:#1a6020; border-color:#2d8a3a; }
.cat-tag--terrorism      { background:#f3e8ff; color:#6200b0; border-color:#8833cc; }
.cat-tag--aircraft       { background:#e0f3ff; color:#004d8a; border-color:#0066aa; }
.cat-tag--lodd           { background:#ffecec; color:#880000; border-color:#cc2222; }
.cat-tag--mass-casualty  { background:#fff8e0; color:#6a4800; border-color:#997700; }

/* ── Card text ── */
.description { color: var(--text-dim); line-height: 1.6; margin: 0 0 16px 0; }
.lessons { background: rgba(176,16,16,0.05); border-left: 3px solid var(--fire-red); padding: 12px 14px; margin: 0 0 16px 0; border-radius: 0 6px 6px 0; }
.lessons-label { display: block; color: var(--fire-red); font-size: 0.7rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 6px; }
.lessons-text { color: var(--text-main); font-size: 0.9rem; line-height: 1.5; margin: 0; }
.learn-more { display: inline-block; background: transparent; color: var(--fire-red); border: 1px solid var(--fire-red); padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; text-decoration: none; transition: background 0.2s, color 0.2s; }
.learn-more:hover { background: var(--fire-red); color: white; }
.learn-more::after { content: ' →'; }
.no-results { text-align: center; color: var(--text-dim); font-style: italic; margin-top: 50px; }

/* ── Headings ── */
h2 { color: var(--text-main); font-size: 1.4rem; text-transform: uppercase; letter-spacing: 2px; border-left: 4px solid var(--fire-red); padding-left: 12px; margin: 0 0 20px 0; }
.week-heading, .search-heading, .random-heading { margin-top: 50px; }

/* ── Name search ── */
.name-search-section { margin-top: 0; }
.name-search-row { display: flex; gap: 10px; align-items: center; }
.name-search-input { flex: 1; background: var(--bg); color: var(--text-main); border: 1px solid var(--border); padding: 10px 12px; border-radius: 6px; font-size: 1rem; font-family: inherit; }
.name-search-input:focus { outline: none; border-color: var(--fire-red); }
.name-search-clear { background: transparent; color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px; font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 6px 12px; transition: color 0.15s, border-color 0.15s; }
.name-search-clear:hover { color: var(--fire-red); border-color: var(--fire-red); }
.name-search-clear.hidden { display: none; }
.name-search-heading { margin-top: 30px; }
.name-search-heading.hidden, #nameSearchTimeline.hidden { display: none; }

/* ── Nearby note ── */
.nearby-note { background: #d4d4d4; border-left: 3px solid var(--fire-red); padding: 12px 16px; margin: 0 0 20px 0; border-radius: 4px; color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }
.nearby-note strong { color: var(--text-main); display: block; margin-bottom: 4px; }
.nearby-note.hidden { display: none; }

/* ── Visibility helpers ── */
.search-heading.hidden, #timeline.hidden, #bookmarksSection.hidden,
.random-heading.hidden, #randomTimeline.hidden,
#categoryTimeline.hidden { display: none; }

/* ── Random button ── */
.random-row { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.divider-text { color: var(--text-dim); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 2px; }
.random-btn { background: var(--fire-red); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: bold; text-transform: uppercase; letter-spacing: 1.5px; cursor: pointer; font-family: inherit; transition: background 0.15s, transform 0.15s; }
.random-btn:hover { background: #880e0e; transform: translateY(-1px); }
.random-btn:active { transform: translateY(0); }

/* ── Archive divider ── */
.archive-divider { display: flex; align-items: center; gap: 14px; margin: 0 0 32px; }
.archive-divider-line { flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--accent), transparent); opacity: 0.4; }
.archive-divider-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); opacity: 0.85; white-space: nowrap; }

/* ── Date tag ── */
.date-tag { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px; display: block; margin-bottom: 4px; }
.date-tag.today { color: var(--fire-red); font-weight: bold; }

/* ── Bookmarks ── */
.bookmarks-section { margin-top: 60px; padding-top: 40px; border-top: 2px solid var(--fire-red); }
.bookmarks-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px !important; }
.clear-link { background: none; border: none; color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; font-family: inherit; padding: 4px 8px; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.clear-link:hover { color: var(--fire-red); background: rgba(176,16,16,0.07); }
.bookmark-btn { position: absolute; top: 16px; right: 16px; background: none; border: none; color: #aab4c8; font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: color 0.15s, background 0.15s, transform 0.15s; }
.bookmark-btn:hover { color: var(--fire-red); background: rgba(176,16,16,0.07); }
.bookmark-btn.active { color: var(--fire-red); }
.bookmark-btn:active { transform: scale(0.92); }

/* ── Filter chips ── */
.filter-section { margin-bottom: 30px; }
.filter-label { display:block; margin-bottom:12px; font-size:.95rem; color:var(--text-dim); text-align:center; }
.filter-chips { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.chip { background:var(--bg); color:var(--text-dim); border:1px solid var(--border); padding:6px 14px; border-radius:999px; font-size:.85rem; cursor:pointer; transition:background .15s,color .15s,border-color .15s; font-family:inherit; }
.chip:hover { border-color:var(--fire-red); color:var(--text-main); }
.chip.active { background:var(--fire-red); color:white; border-color:var(--fire-red); font-weight:bold; }

/* ── Site footer disclaimer ── */
.site-footer {
    max-width: 800px;
    margin: 48px auto 0;
    padding: 20px 24px 28px;
    border-top: 1px solid var(--border);
    text-align: center;
    box-sizing: border-box;
}
.site-footer p {
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.7;
    letter-spacing: 0.02em;
    font-style: italic;
    margin: 0;
}
