/* StationSense — styles.css */
/* Design: data-forward, instrument-inspired, clean readability */

:root {
  --sky: #1a3a5c;
  --sky-mid: #2a5298;
  --sky-light: #4a90d9;
  --cloud: #f0f5fa;
  --fog: #e2eaf3;
  --ink: #1c2b3a;
  --ink-mid: #3d5166;
  --ink-light: #5c7a96;
  --accent: #e8a020;
  --accent-light: #fdf0d5;
  --green: #2d8a4e;
  --green-light: #e8f5ed;
  --red: #c0392b;
  --white: #ffffff;
  --border: #ccdaea;
  --shadow: 0 2px 12px rgba(26,58,92,0.10);
  --shadow-lg: 0 6px 28px rgba(26,58,92,0.14);
  --radius: 8px;
  --radius-lg: 14px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Courier New', monospace;
  --max: 960px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
}

/* ── HEADER ── */
header {
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-mid) 100%);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
}

.logo-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-tag {
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.75;
  display: block;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

nav a {
  color: rgba(255,255,255,0.88);
  text-decoration: none;
  font-size: 0.87rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

nav a:hover, nav a.active {
  background: rgba(255,255,255,0.18);
  color: var(--white);
}

/* ── BREADCRUMB ── */
.breadcrumb {
  background: var(--cloud);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  font-size: 0.82rem;
  color: var(--ink-light);
}

.breadcrumb-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.breadcrumb a { color: var(--sky-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; opacity: 0.5; }

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, var(--sky) 0%, var(--sky-mid) 55%, var(--sky-light) 100%);
  color: var(--white);
  padding: 72px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 32px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 40px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* ── WEATHER STAT BAR ── */
.stat-bar {
  background: var(--sky);
  display: flex;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 24px;
  color: var(--white);
  border-right: 1px solid rgba(255,255,255,0.12);
  min-width: 110px;
}

.stat-item:last-child { border-right: none; }
.stat-num { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.7rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* ── MAIN LAYOUT ── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── SECTION LABELS ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sky-mid);
  margin-bottom: 12px;
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--sky-mid);
}

/* ── CARD GRIDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sky-light);
}

.card-icon { font-size: 2rem; margin-bottom: 12px; display: block; }
.card h3 { font-size: 1.05rem; font-weight: 700; color: var(--sky); margin-bottom: 8px; }
.card p { font-size: 0.88rem; color: var(--ink-mid); line-height: 1.6; }

.card-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 20px;
  margin-top: 10px;
  background: var(--accent-light);
  color: var(--accent);
}

.card-badge.fast { background: var(--green-light); color: var(--green); }

/* ── ARTICLE LAYOUT ── */
.article-header {
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-mid) 100%);
  color: var(--white);
  padding: 48px 24px 40px;
}

.article-header-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.article-header .article-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.75;
  margin-bottom: 12px;
  display: block;
}

.article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.article-header .article-deck {
  font-size: 1.05rem;
  opacity: 0.88;
  max-width: 640px;
  line-height: 1.6;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 0.82rem;
  opacity: 0.75;
  flex-wrap: wrap;
}

/* ── CONTENT BODY ── */
.content {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--ink);
}

.content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sky);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--fog);
}

.content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 12px;
}

.content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-mid);
  margin: 20px 0 8px;
}

.content p { margin-bottom: 18px; }

.content a {
  color: var(--sky-mid);
  text-decoration: underline;
  text-decoration-color: rgba(42,82,152,0.35);
}

.content a:hover {
  text-decoration-color: var(--sky-mid);
}

.content ul, .content ol {
  margin: 0 0 18px 24px;
}

.content li { margin-bottom: 8px; }

.content strong { color: var(--ink); font-weight: 700; }

/* ── CALLOUT BOXES ── */
.callout {
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 28px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.callout-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.callout-body { flex: 1; }
.callout-body strong { display: block; margin-bottom: 4px; font-size: 0.95rem; }
.callout-body p, .callout-body { font-size: 0.92rem; margin: 0; line-height: 1.65; }

.callout.tip { background: var(--accent-light); border-left: 4px solid var(--accent); }
.callout.info { background: #e8f0fb; border-left: 4px solid var(--sky-mid); }
.callout.warning { background: #fef0e8; border-left: 4px solid #e07820; }
.callout.success { background: var(--green-light); border-left: 4px solid var(--green); }

/* ── DATA TABLES ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th {
  background: var(--sky);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-mid);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--cloud); }
.data-table tr:hover td { background: var(--fog); }

/* ── FAQ ── */
.faq-section { margin: 48px 0 24px; }

.faq-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sky);
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--fog);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-q {
  width: 100%;
  background: var(--white);
  border: none;
  padding: 18px 20px;
  text-align: left;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
}

.faq-q:hover { background: var(--cloud); }

.faq-q::after {
  content: '▾';
  color: var(--sky-mid);
  font-size: 0.85rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-item.open .faq-q::after { transform: rotate(180deg); }
.faq-item.open .faq-q { background: var(--cloud); }

.faq-a {
  display: none;
  padding: 0 20px 18px;
  background: var(--cloud);
  font-size: 0.92rem;
  color: var(--ink-mid);
  line-height: 1.7;
}

.faq-a p { margin-bottom: 10px; }
.faq-a p:last-child { margin-bottom: 0; }
.faq-item.open .faq-a { display: block; }

/* ── STEP LIST ── */
.step-list { list-style: none; margin: 24px 0; padding: 0; counter-reset: steps; }

.step-list li {
  counter-increment: steps;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.step-list li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--sky-mid);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 2px;
}

.step-list li > div { flex: 1; }
.step-list li strong { display: block; margin-bottom: 4px; font-size: 0.97rem; color: var(--ink); }
.step-list li p { font-size: 0.9rem; color: var(--ink-mid); margin: 0; line-height: 1.65; }

/* ── TOOL WIDGET ── */
.tool-widget {
  background: linear-gradient(135deg, var(--cloud) 0%, var(--fog) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin: 40px 0;
}

.tool-widget h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sky);
  margin-bottom: 8px;
  border: none;
  padding: 0;
}

.tool-widget .tool-desc {
  font-size: 0.9rem;
  color: var(--ink-mid);
  margin-bottom: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input, .form-group select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.15s;
  font-family: var(--font);
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--sky-mid);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--sky-mid);
  color: var(--white);
  box-shadow: 0 3px 12px rgba(42,82,152,0.3);
}

.btn-primary:hover {
  background: var(--sky);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(42,82,152,0.35);
}

.btn-accent {
  background: var(--accent);
  color: var(--ink);
}

.btn-accent:hover { background: #d4900a; transform: translateY(-1px); }

.tool-result {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  display: none;
}

.tool-result.show { display: block; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.result-item {
  background: var(--cloud);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.result-item .result-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--sky);
  display: block;
  line-height: 1.1;
  margin-bottom: 4px;
}

.result-item .result-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-light);
}

.score-bar {
  height: 8px;
  background: var(--fog);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.score-fill.good { background: var(--green); }
.score-fill.ok { background: var(--accent); }
.score-fill.poor { background: var(--red); }

/* ── COMPARISON TABLE ── */
.compare-wrap { overflow-x: auto; margin: 24px 0; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 560px;
}

.compare-table th {
  background: var(--sky);
  color: var(--white);
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.compare-table th:first-child { text-align: left; }

.compare-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  color: var(--ink-mid);
}

.compare-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--ink);
  background: var(--cloud);
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table .winner { color: var(--green); font-weight: 700; }
.compare-table .check::before { content: '✓'; color: var(--green); font-weight: 700; }
.compare-table .cross::before { content: '✗'; color: var(--red); }

/* ── SIDEBAR LAYOUT ── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .page-layout { grid-template-columns: 1fr; }
}

.sidebar { position: sticky; top: 80px; }

.sidebar-box {
  background: var(--cloud);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

.sidebar-box h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sky);
  margin-bottom: 14px;
}

.sidebar-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-box ul li {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.sidebar-box ul li:last-child { border-bottom: none; }

.sidebar-box ul li a {
  color: var(--sky-mid);
  text-decoration: none;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-box ul li a:hover { color: var(--sky); text-decoration: underline; }

/* ── PDF DOWNLOAD BANNER ── */
.pdf-banner {
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-light) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 40px 0;
}

.pdf-banner-icon { font-size: 3rem; flex-shrink: 0; }
.pdf-banner-text h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.pdf-banner-text p { font-size: 0.88rem; opacity: 0.88; margin: 0 0 14px; }

.btn-white {
  background: var(--white);
  color: var(--sky);
  font-size: 0.88rem;
}

.btn-white:hover { background: var(--cloud); }

/* ── RELATED ARTICLES ── */
.related { margin-top: 56px; padding-top: 40px; border-top: 2px solid var(--fog); }
.related h2 { font-size: 1.25rem; font-weight: 700; color: var(--sky); margin-bottom: 20px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.related-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.related-card:hover {
  border-color: var(--sky-light);
  box-shadow: var(--shadow);
}

.related-card .cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sky-mid);
  margin-bottom: 6px;
}

.related-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

/* ── FOOTER ── */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.75);
  padding: 48px 24px 28px;
  margin-top: 80px;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 680px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-brand .logo { color: var(--white); margin-bottom: 12px; display: inline-flex; }
.footer-brand p { font-size: 0.85rem; line-height: 1.65; max-width: 280px; }

.footer-col h5 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--white);
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.87rem; }
.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
}

.footer-bottom a { color: rgba(255,255,255,0.55); text-decoration: none; }
.footer-bottom a:hover { color: var(--white); }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner { padding: 12px 16px; }
  nav { display: none; }
  .hero { padding: 48px 16px 44px; }
  .container, .container-narrow { padding: 32px 16px; }
  .article-header { padding: 36px 16px 32px; }
  .tool-widget { padding: 24px 16px; }
  .pdf-banner { flex-direction: column; text-align: center; }
  .stat-bar { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .card-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}

/* ── UTILITIES ── */
.text-center { text-align: center; }
.text-small { font-size: 0.85rem; color: var(--ink-light); }
.mt-0 { margin-top: 0; }
.mb-32 { margin-bottom: 32px; }
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--fog);
  color: var(--ink-mid);
}

.tag.blue { background: #ddeeff; color: var(--sky-mid); }
.tag.green { background: var(--green-light); color: var(--green); }
.tag.amber { background: var(--accent-light); color: #a06010; }

/* ── PRINT ── */
@media print {
  header, footer, nav, .sidebar, .hero-cta, .btn, .faq-q::after { display: none !important; }
  .content { font-size: 11pt; }
  .page-layout { display: block; }
}
