/* ── Earthquakes suite — page & tool styles ──────────────────────────
   Builds on css/shared.css (tokens, header, footer, Orbitron). Family
   look: dark accent icon-chip hero + card/section/faq/trust pattern.
   The live tracker calls the USGS earthquake feeds; the magnitude page is
   a static reference. Epicentres are plotted on a first-party inline SVG
   world map (js/worldmap.js) — no map tiles, no external requests. */

main { max-width: 940px; margin: 0 auto; padding: 20px; }

/* ── Tool hero: dark accent icon chip + Orbitron h1 + subtitle ──── */
.tool-hero { max-width: 940px; margin: 0 auto; padding: 36px 20px 4px; }
.tool-hero .hero-head { display: flex; align-items: center; gap: 16px; }
.tool-hero .hero-icon { flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px; background: #0f0e1d; display: flex; align-items: center; justify-content: center; }
.tool-hero .hero-icon svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; }
.tool-hero .subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 12px; max-width: 720px; }
.tool-hero .subtitle a { color: var(--accent); text-decoration: none; }
.tool-hero .subtitle a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Card ───────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-top: 24px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; font-family: inherit; font-size: .95rem; font-weight: 700; border: none; border-radius: var(--radius); cursor: pointer; background: var(--accent); color: #fff; transition: background .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: var(--accent-h); } .btn:active { transform: scale(.98); } .btn svg { width: 16px; height: 16px; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--muted); }

/* ── Trust row ──────────────────────────────────────────────────── */
.trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.trust-item { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.trust-item svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; flex-shrink: 0; }

/* ── Content sections (how-it-works / faq) ──────────────────────── */
.section { max-width: 940px; margin: 16px auto; padding: 24px 20px; }
.section > h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.section > .section-sub { color: var(--muted); margin-bottom: 20px; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.step-num { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.step-body p { font-size: .92rem; color: var(--muted); line-height: 1.6; }
.step-body a { color: var(--accent); }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq .faq-body { padding: 0 18px 16px; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.faq .faq-body a { color: var(--accent); }

/* ── Safety banner (NOT an early-warning system) ────────────────── */
.safety-note { display: flex; gap: 12px; align-items: flex-start; background: #fff7ed; border: 1px solid #fdba74; border-radius: var(--radius-lg); padding: 14px 18px; margin-top: 24px; }
.safety-note svg { flex-shrink: 0; width: 22px; height: 22px; stroke: #c2410c; fill: none; margin-top: 1px; }
.safety-note p { font-size: .9rem; color: #7c2d12; line-height: 1.6; }
.safety-note a { color: #9a3412; font-weight: 700; text-decoration: underline; }

/* ── Hub grid (cross-links to magnitude / articles) ─────────────── */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(264px, 1fr)); gap: 18px; margin-top: 8px; }
.hub-card { display: block; text-decoration: none; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); transition: transform .18s, border-color .18s, box-shadow .18s; }
.hub-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.hub-card .hub-icon { width: 48px; height: 48px; border-radius: 12px; background: #0f0e1d; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.hub-card .hub-icon svg { width: 25px; height: 25px; stroke: var(--accent); fill: none; }
.hub-card h2 { font-size: 1.15rem; color: var(--text); margin-bottom: 6px; }
.hub-card p { font-size: .9rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.hub-card .hub-open { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--accent); }

/* ── Tracker: controls ──────────────────────────────────────────── */
.eq-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.eq-field { display: flex; flex-direction: column; gap: 5px; }
.eq-field label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.eq-select { font-family: inherit; font-size: .95rem; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); outline: none; min-height: 44px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.eq-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring),.14); }
.eq-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.eq-status { min-height: 20px; margin-top: 14px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.eq-status.error { color: #b42318; }

/* ── Tracker: place search + reference bar ──────────────────────── */
.eq-loc-row { position: relative; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.eq-loc-input { flex: 1 1 260px; min-width: 0; font-family: inherit; font-size: 1rem; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.eq-loc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring),.14); }
.eq-loc-row .btn { flex-shrink: 0; }
.eq-loc-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.eq-loc-opt { display: block; width: 100%; text-align: left; padding: 12px 16px; font-family: inherit; font-size: .95rem; color: var(--text); background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; }
.eq-loc-opt:last-child { border-bottom: none; }
.eq-loc-opt:hover { background: var(--accent-bg); color: var(--accent-fg); }
.eq-refbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: .9rem; font-weight: 600; color: var(--accent-fg); background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius); padding: 9px 14px; }
.eq-ref-clear { margin-left: auto; background: none; border: 1.5px solid var(--accent); color: var(--accent-fg); border-radius: var(--radius); padding: 6px 14px; font: inherit; font-weight: 700; cursor: pointer; min-height: 34px; }
.eq-ref-clear:hover { background: var(--accent); color: #fff; }
.eq-regions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.eq-regions-label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.eq-region-select { flex: 0 1 260px; min-width: 180px; }

/* ── Tracker: summary line ──────────────────────────────────────── */
.eq-summary { margin-top: 18px; font-size: 1rem; color: var(--text); min-height: 1.5rem; }
.eq-summary strong { font-weight: 700; }
.eq-summary .eq-strong-quake { color: var(--accent-fg); }

/* ── Tracker: world map ─────────────────────────────────────────── */
.eq-map-wrap { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: #f3f5ff; aspect-ratio: 2 / 1; }
.eq-map { display: block; width: 100%; height: auto; background: linear-gradient(180deg, #eef1ff 0%, #e6ebff 100%); }
.eq-map .eq-land { fill: #d4d9f5; stroke: #c2c8ee; stroke-width: .3; }
.eq-map .eq-grid { stroke: #c8cdf0; stroke-width: .25; fill: none; }
.eq-map .eq-pt { stroke: #fff; stroke-width: .5; cursor: pointer; transition: opacity .15s; }
.eq-map .eq-pt:hover { opacity: .8; }
.eq-map .eq-me { fill: #2563eb; stroke: #fff; stroke-width: 1; }
.eq-map .eq-me-ring { fill: none; stroke: #2563eb; stroke-width: .6; opacity: .7; }
.eq-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.eq-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.eq-legend .lg-dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex-shrink: 0; }

/* ── Tracker: results list ──────────────────────────────────────── */
.eq-list { display: grid; gap: 10px; margin-top: 18px; min-height: 200px; }
.eq-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow); transition: transform .12s, border-color .15s, box-shadow .15s; }
.eq-item:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.eq-item.is-tsunami { border-left: 4px solid #0ea5e9; }
.eq-item-link { display: flex; align-items: center; gap: 14px; flex: 1 1 auto; min-width: 0; text-decoration: none; color: inherit; }
.eq-map-link { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 7px 12px; font-size: .8rem; font-weight: 700; color: var(--accent-fg); background: var(--accent-bg); border: 1px solid var(--accent); border-radius: 999px; text-decoration: none; transition: background .15s, color .15s; }
.eq-map-link:hover { background: var(--accent); color: #fff; text-decoration: none; }
.eq-map-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mag-badge { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-family: 'Orbitron', sans-serif; line-height: 1; }
.mag-badge .mag-num { font-size: 1.15rem; font-weight: 900; }
.mag-badge .mag-lbl { font-size: .52rem; font-weight: 700; letter-spacing: .04em; opacity: .92; margin-top: 2px; }
.eq-body { min-width: 0; flex: 1 1 auto; }
.eq-place { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.eq-meta { font-size: .84rem; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.eq-meta .mono { font-family: var(--mono); }
.eq-dist { color: var(--accent-fg); font-weight: 600; }
.eq-go { flex-shrink: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; }
.eq-empty { text-align: center; color: var(--muted); padding: 28px 16px; font-size: .95rem; }
.eq-empty p { margin: 0 auto; max-width: 460px; line-height: 1.6; }
.eq-empty .btn { margin-top: 16px; }

/* ── Magnitude reference page (amber accent) ────────────────────── */
body[data-tool="magnitude"] { --accent:#ea580c; --accent-h:#c2410c; --accent-bg:#ffedd5; --accent-fg:#9a3412; --ring:234,88,12; }

.ref-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.ref-table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); }
.ref-table th, .ref-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.ref-table th { background: var(--surface2); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ref-table tbody tr:last-child td { border-bottom: none; }
.ref-table tbody tr:hover { background: var(--accent-bg); }
.ref-table .mag-cell { font-family: 'Orbitron', sans-serif; font-weight: 700; white-space: nowrap; }
.ref-table .mono { font-family: var(--mono); white-space: nowrap; }
.ref-pill { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.12); }
.ref-note { font-size: .85rem; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.ref-note a { color: var(--accent); }

/* ── Per-tool sub-nav ([Tracker] | Magnitude | Articles | Blogs) ── */
.sub-link { display: inline-flex; align-items: center; min-height: 38px; padding: 6px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--muted); border: 1.5px solid var(--border); background: var(--surface); text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.sub-link:hover { color: var(--accent-fg); background: var(--accent-bg); border-color: var(--accent); text-decoration: none; }
.sub-link.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Tool pages: single contextual bar in the header (logo = back to tracker).
   On mobile the .sub-link pills collapse into the ☰ MENU hamburger; the pill
   row shows from 720px up — matching the other /tools/ suites. */
body.tool-page .site-header { height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
body.tool-page .site-nav .sub-link { display: none; }
@media (min-width: 720px) {
  body.tool-page .site-header { flex-wrap: wrap; row-gap: 8px; }
  body.tool-page .site-nav { flex-wrap: wrap; gap: 8px; }
  body.tool-page .site-nav .sub-link { display: inline-flex; min-height: 36px; }
}
.sub-link-home { margin-left: 6px; }
@media (min-width: 560px) { .sub-link-home { margin-left: 14px; } }

/* ── Articles / Blogs index + article body ──────────────────────── */
.container { max-width: 940px; margin: 0 auto; padding: 0 20px; }
.page-main { padding: 36px 0 64px; }
.page-head { margin-bottom: 28px; }
.page-head .page-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); padding: 3px 11px; border-radius: 999px; margin-bottom: 12px; }
.page-head h1 { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(1.5rem, 4.2vw, 2.1rem); letter-spacing: -.4px; line-height: 1.2; margin-bottom: 10px; }
.page-head p { color: var(--muted); font-size: 1.02rem; max-width: 680px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.post-card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow); transition: transform .18s, border-color .18s, box-shadow .18s; }
.post-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.post-card .card-tag { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); padding: 2px 9px; border-radius: 999px; margin-bottom: 10px; }
.post-card h2 { font-size: 1.12rem; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.post-card p { font-size: .92rem; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.post-card .read-more { display: inline-flex; align-items: center; gap: 5px; font-size: .85rem; font-weight: 700; color: var(--accent); }
.post-card .read-more::after { content: '→'; }
.related { margin-top: 28px; color: var(--muted); font-size: .95rem; }
.related a { color: var(--accent); }

.article-body { max-width: 720px; margin: 0 auto; }
.article-body .post-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-bg); padding: 3px 11px; border-radius: 999px; margin-bottom: 12px; }
.article-body h1 { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: clamp(1.5rem, 4.2vw, 2.1rem); letter-spacing: -.4px; line-height: 1.2; margin-bottom: 8px; }
.article-body .article-meta { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.article-body h2 { font-size: 1.3rem; font-weight: 800; margin: 28px 0 10px; line-height: 1.25; }
.article-body h3 { font-size: 1.08rem; font-weight: 700; margin: 20px 0 8px; }
.article-body p { font-size: 1.02rem; color: var(--text); line-height: 1.8; margin-bottom: 16px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 16px; }
.article-body li { font-size: 1.02rem; color: var(--text); line-height: 1.8; margin-bottom: 8px; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body strong { font-weight: 700; }
.article-body code { font-family: var(--mono); font-size: .88em; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.article-cta { background: var(--accent-bg); border: 1px solid var(--accent); border-radius: var(--radius-lg); padding: 20px 24px; margin: 28px 0; }
.article-cta p { color: var(--accent-fg); font-weight: 600; margin-bottom: 12px; }
.article-cta a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 22px; background: var(--accent); color: #fff; border-radius: var(--radius); font-weight: 700; font-size: .9rem; text-decoration: none; }
.article-cta a:hover { background: var(--accent-h); }

@media (max-width: 620px) {
  .tool-hero .hero-icon { width: 48px; height: 48px; }
  .tool-hero .hero-icon svg { width: 26px; height: 26px; }
  .eq-actions { margin-left: 0; width: 100%; }
  .mag-badge { width: 46px; height: 46px; }
}

/* Magnitude → energy calculator */
.eq-calc .calc-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.eq-calc label { font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.eq-calc .calc-input { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 200px; }
.eq-calc .calc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring), .14); }
.eq-calc .calc-range { width: 100%; max-width: 520px; accent-color: var(--accent); cursor: pointer; }
.calc-out { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 14px; }
.calc-stat { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px; text-align: center; }
.calc-stat-val { display: block; font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--accent); word-break: break-word; }
.calc-stat-lbl { display: block; margin-top: 5px; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.calc-relatable { font-size: 1.02rem; font-weight: 600; margin: 2px 0 8px; min-height: 1.4em; }
.calc-sub-h { margin-top: 28px; }
.calc-compare { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.calc-compare .calc-field { margin-bottom: 0; }
.calc-vs { font-weight: 700; color: var(--muted); padding-bottom: 14px; }
.calc-compare-out { font-size: 1.02rem; font-weight: 600; min-height: 1.4em; margin: 14px 0 6px; }
@media (max-width: 560px) { .calc-out { grid-template-columns: repeat(2, 1fr); } }
