/* Blog, static pages and Network Pulse — "Signal Box" theme.
   Uses the design tokens defined at the top of style.css. */

body.blog-page {
  display: block;
  overflow: auto;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 85% -120px, rgba(255, 192, 46, 0.07), transparent 70%),
    radial-gradient(900px 500px at -10% 0, rgba(90, 209, 255, 0.05), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  background-repeat: no-repeat;
}
body.blog-page #topbar { position: sticky; top: 0; }
body.blog-page #stats { gap: 18px; }

.blog-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 34px 18px 60px;
}
.blog-index .blog-wrap, .pulse-page .blog-wrap { max-width: 1040px; }

.kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-cond);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.muted { color: var(--muted); }

.blog-wrap h1 {
  font-family: var(--font-cond);
  font-size: 44px; line-height: 1.02; font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}
.blog-intro { color: var(--muted); margin-bottom: 26px; line-height: 1.6; font-size: 17px; max-width: 640px; }
.blog-intro a { color: var(--accent); }

/* ---------- Hero photo with credit ---------- */
.hero-photo {
  position: relative;
  margin: 20px 0 26px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  margin: 0 !important;
  border-radius: 0 !important;
}
.hero-photo figcaption {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  line-height: 1.4;
}
.hero-photo figcaption a { color: var(--muted); }
.post-illus { margin: 26px 0; }
.post-illus img { margin: 0 !important; }

/* ---------- Guide cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.blog-card.featured { grid-column: 1 / -1; }
.blog-card.featured .card-media img { aspect-ratio: 16 / 6; }
.card-media { position: relative; background: var(--dm-bg); }
.card-media img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
}
.card-tag {
  position: absolute; left: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(2, 4, 9, 0.82);
  backdrop-filter: blur(4px);
  color: var(--dm);
  border: 1px solid rgba(255, 182, 39, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--font-cond); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.blog-card h2 { font-family: var(--font-cond); font-size: 23px; line-height: 1.1; margin-bottom: 6px; }
.blog-card.featured h2 { font-size: 30px; }
.blog-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.card-more {
  margin-top: auto; padding-top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 700; font-size: 14px;
}
.blog-thumb { display: block; width: 100%; height: auto; border-radius: 8px; margin-bottom: 12px; }

.blog-date {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Article typography ---------- */
.blog-post { line-height: 1.75; font-size: 17px; }
.blog-post h1 { margin-bottom: 8px; }
.blog-post .blog-date { margin-bottom: 6px; }
.blog-post h2 {
  font-family: var(--font-cond);
  font-size: 28px; line-height: 1.15;
  margin: 34px 0 10px;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
}
.blog-post h3 { font-family: var(--font-cond); font-size: 21px; margin: 24px 0 8px; }
.blog-post p { margin: 12px 0; }
.blog-post ul, .blog-post ol { margin: 12px 0 12px 24px; }
.blog-post li { margin: 5px 0; }
.blog-post li::marker { color: var(--accent); }
.blog-post a { color: var(--accent); }
.blog-post strong { color: #fff; }
.blog-post code { background: var(--panel-2); border-radius: 4px; padding: 1px 6px; font-size: 14px; }
.blog-post blockquote {
  border-left: 3px solid var(--route);
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  margin: 16px 0;
  padding: 8px 16px;
  color: var(--muted);
}
.blog-post table {
  border-collapse: separate; border-spacing: 0;
  margin: 18px 0; width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.blog-post th, .blog-post td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 15px;
  text-align: left;
}
.blog-post tr:last-child td { border-bottom: none; }
.blog-post th { background: var(--panel-2); font-family: var(--font-cond); letter-spacing: 0.05em; text-transform: uppercase; font-size: 14px; }
.blog-post img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 6px 0 22px;
}

/* ---------- CTAs ---------- */
.blog-cta, .blog-cta-alt {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: var(--on-accent) !important;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 999px;
  text-decoration: none !important;
  margin: 6px 8px 6px 0;
  box-shadow: 0 4px 16px rgba(255, 192, 46, 0.18);
}
.blog-cta-alt { background: var(--ok); color: #04160b !important; box-shadow: 0 4px 16px rgba(46, 227, 122, 0.16); }
.blog-cta:hover, .blog-cta-alt:hover { filter: brightness(1.08); }
.blog-ctas { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- About: feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
}
.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 12px;
  line-height: 1.55;
}
.feature h3 { margin: 10px 0 4px !important; font-size: 20px !important; }
.feature p { font-size: 15px; color: var(--muted); margin: 0 !important; }
.feature-ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--dm-bg); border: 1px solid #1a2336;
  color: var(--dm);
}
.feature-ic .ic { width: 22px; height: 22px; filter: drop-shadow(0 0 5px var(--dm-glow)); }
.feature-ic.g { color: var(--ok); } .feature-ic.g .ic { filter: drop-shadow(0 0 5px var(--ok)); }
.feature-ic.r { color: var(--route); } .feature-ic.r .ic { filter: drop-shadow(0 0 5px var(--route)); }

/* ---------- Network Pulse page ---------- */
.pulse-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 24px;
}
.pulse-meter {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.dm-panel {
  background: var(--dm-bg);
  border-radius: 12px;
  padding: 16px 12px 12px;
  text-align: center;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.95);
  border: 1px solid #141c2c;
}
.dm-huge { font-size: 76px; line-height: 0.95; }
.dm-small { font-size: 16px; opacity: 0.85; margin-top: 4px; }
.pulse-verdict {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-cond); font-size: 26px; font-weight: 700;
  margin: 14px 0 10px;
}
.lamp-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.pulse-good .lamp-dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pulse-fair .lamp-dot { background: var(--dm); box-shadow: 0 0 10px var(--dm); }
.pulse-poor .lamp-dot, .pulse-bad .lamp-dot { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.pulse-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pulse-stats div { background: var(--panel-2); border-radius: 10px; padding: 8px; text-align: center; }
.pulse-stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pulse-stats dd { font-family: var(--font-cond); font-size: 24px; font-weight: 700; }

.pulse-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.pulse-card h2 {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-cond); font-size: 26px; margin-bottom: 4px;
}
.pulse-card h2 .ic { color: var(--accent); }
.pulse-card > .muted { font-size: 14px; margin-bottom: 12px; }
.pulse-how p { line-height: 1.7; margin: 10px 0; color: #c9d2e3; }
.pulse-empty { color: var(--muted); font-size: 14px; padding: 16px 0; }

.sparkline { width: 100%; height: auto; display: block; }
.sp-grid { stroke: #1d2a44; stroke-width: 1; }
.sp-target { stroke: #3f4f70; stroke-dasharray: 5 5; }
.sp-lbl { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.sp-line { fill: none; stroke: var(--dm); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 4px var(--dm-glow)); }
.sp-area { fill: rgba(255, 182, 39, 0.09); }
.sp-dot { fill: var(--dm); filter: drop-shadow(0 0 5px var(--dm)); }

.league-wrap { overflow-x: auto; }
.league { width: 100%; border-collapse: collapse; font-size: 15px; }
.league th {
  text-align: left; font-family: var(--font-cond); font-size: 13px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.league td { padding: 8px; border-bottom: 1px solid #172238; white-space: nowrap; }
.league .rank { font-size: 17px; width: 36px; }
.toc-link { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.toc-link:hover { color: var(--accent); }
.bar { position: relative; min-width: 150px; height: 22px; border-radius: 6px; background: #172238; overflow: hidden; }
.bar span { position: absolute; inset: 0 auto 0 0; border-radius: 6px; opacity: 0.85; }
.bar b { position: relative; z-index: 1; padding-left: 8px; line-height: 22px; font-size: 13px; color: #04070d; }
.bar-good span { background: var(--ok); }
.bar-fair span { background: var(--dm); }
.bar-poor span { background: var(--danger); }
.bar-poor b { color: #fff; }

.worst { list-style: none; }
.worst li a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid #172238;
  color: var(--text); text-decoration: none;
}
.worst li a:hover .worst-od b { color: var(--accent); }
.hc-plate { background: var(--dm-bg); border-radius: 5px; padding: 2px 8px; font-size: 18px; }
.worst-od { line-height: 1.35; }
.worst-od small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.worst-late { font-family: var(--font-cond); font-size: 22px; font-weight: 700; color: var(--warn); }

/* ---------- Footer ---------- */
.blog-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg));
  color: var(--muted);
  font-size: 13px;
  padding: 26px 18px 34px;
}
.foot-inner { max-width: 1040px; margin: 0 auto; text-align: center; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; text-align: left; margin-bottom: 14px; }
.foot-brand strong { display: block; font-family: var(--font-cond); font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
.foot-brand span { font-family: var(--font-cond); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.blog-footer a { color: var(--accent); }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 14px; }
.foot-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text); font-weight: 600; text-decoration: none;
  font-family: var(--font-cond); font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase;
}
.foot-nav a .ic { color: var(--accent); }
.foot-nav a:hover { color: var(--accent); }
.foot-small { font-size: 12px; line-height: 1.7; max-width: 720px; margin: 0 auto; }

/* ---------- Admin ---------- */
.admin-form input[type=text], .admin-form input[type=date],
.admin-form input[type=password], .admin-form textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  margin: 4px 0 14px;
  font-family: inherit;
}
.admin-form textarea { min-height: 380px; font-family: ui-monospace, monospace; }
.admin-form button, .admin-btn {
  background: var(--accent);
  border: none;
  color: var(--on-accent);
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}
.admin-danger { background: #a33; color: #fff; margin-left: 8px; }
.admin-list { list-style: none; margin: 18px 0; }
.admin-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.admin-list a { color: var(--accent); text-decoration: none; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .pulse-hero { grid-template-columns: 1fr; gap: 16px; }
  .blog-wrap h1 { font-size: 34px; }
}
@media (max-width: 620px) {
  .blog-wrap { padding-top: 22px; }
  .blog-wrap h1 { font-size: 30px; }
  .blog-post { font-size: 16px; }
  .blog-post h2 { font-size: 24px; }
  .dm-huge { font-size: 60px; }
  .hide-sm { display: none; }
  .bar { min-width: 90px; }
  .card-grid { grid-template-columns: 1fr; }
  .blog-card.featured .card-media img { aspect-ratio: 16 / 9; }
  .pulse-card { padding: 14px; }
  body.blog-page #stats { gap: 12px; }
}
