/* iAdvantage — Newspaper edition */

:root {
  --bg:            #ffffff;
  --bg-elev:       #f4f1eb;
  --bg-elev-2:     #e8e4da;
  --border:        #c4bcaa;
  --border-strong: #8a8272;
  --text:          #111111;
  --text-dim:      #3d3933;
  --text-faint:    #6b6762;
  --accent:        #1a4a2e;
  --accent-hover:  #0f3320;
  --blue:          #1a3a6e;
  --green:         #1a5e30;
  --red:           #8b1a1a;
  --radius:        2px;
  --radius-lg:     4px;
  --max:           1100px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--text-dim); }

/* ── Edition bar ─────────────────────────────────────── */
.edition-bar {
  background: var(--accent);
  color: rgba(255,255,255,0.75);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 24px;
}

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

.edition-bar a { color: rgba(255,255,255,0.75); }
.edition-bar a:hover { color: #fff; }

/* ── Navigation ──────────────────────────────────────── */
.nav {
  background: var(--accent);
  border-bottom: 2px solid rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: #ffffff;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand:hover { color: rgba(255,255,255,0.85); }

.brand-dot {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.6);
  border-radius: 1px;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 0;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px;
  height: 52px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  transition: color 0.1s, border-color 0.1s;
}

.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; border-bottom-color: rgba(255,255,255,0.7); }

/* Pipe separators between nav links */
.nav-links a + a { border-left: 1px solid rgba(255,255,255,0.2); }

/* ── Masthead ────────────────────────────────────────── */
.masthead {
  text-align: center;
  padding: 28px 24px 20px;
  border-bottom: 3px double var(--border-strong);
  background: var(--bg);
}

.masthead-rule {
  height: 2px;
  background: var(--accent);
  margin: 0 auto 14px;
  max-width: var(--max);
}

.masthead-rule.bottom { margin: 14px auto 0; }

.masthead-title {
  font-family: var(--serif);
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
  margin: 0 0 8px;
}

.masthead-tagline {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Ticker / breaking bar ───────────────────────────── */
.ticker-bar {
  background: var(--accent);
  color: #fff;
  padding: 8px 24px;
  font-size: 0.85rem;
  overflow: hidden;
}

.ticker-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ticker-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-text {
  font-family: var(--serif);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-text a { color: rgba(255,255,255,0.9); }
.ticker-text a:hover { color: #fff; }

/* ── Layout containers ───────────────────────────────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.container-narrow {
  max-width: 740px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

/* ── Hero (landing page) ─────────────────────────────── */
.hero {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.hero-image-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-image {
  width: 100%;
  height: 340px;
  background: var(--bg-elev-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  overflow: hidden;
}

.hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ── Newspaper grid ──────────────────────────────────── */
.np-grid {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.np-row {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.np-row-main {
  grid-template-columns: 1fr 1fr 1fr;
}

.np-row-three {
  grid-template-columns: 1fr 1fr 1fr;
}

.np-row-two {
  grid-template-columns: 2fr 1fr;
}

.np-col {
  padding: 28px 24px;
  border-right: 1px solid var(--border);
}

.np-col:last-child { border-right: none; }
.np-col:first-child { padding-left: 0; }
.np-col.last-in-row { padding-right: 0; border-right: none; }

.np-col-span2 { grid-column: span 2; }

.np-section-header {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-top: 3px solid var(--accent);
  padding-top: 8px;
  margin-bottom: 16px;
}

/* ── Subscribe form ──────────────────────────────────── */
.subscribe-inline {
  display: flex;
  gap: 0;
  max-width: 440px;
  margin-top: 12px;
}

.subscribe-inline input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-right: none;
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius) 0 0 var(--radius);
  font-family: var(--sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.subscribe-inline input:focus { border-color: var(--accent); }

.subscribe-inline .btn {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--sans);
  text-transform: uppercase;
}

.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover { background: var(--accent); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 8px 12px;
}

.btn-ghost:hover { color: var(--text); background: var(--bg-elev); border-color: var(--border-strong); }

.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #145228; border-color: #145228; color: #fff; }

.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #6e1414; border-color: #6e1414; color: #fff; }

.btn-small { padding: 6px 12px; font-size: 0.78rem; }

/* ── Forms ───────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field input,
.field select,
.field textarea {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 13px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); }

.field textarea { min-height: 240px; resize: vertical; line-height: 1.7; font-family: var(--serif); font-size: 1rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-strong); }

.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* ── Meta / mono labels ──────────────────────────────── */
.meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Category tags ───────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag-accent { background: rgba(26,74,46,0.08); border-color: rgba(26,74,46,0.3); color: var(--accent); }
.tag-green  { background: rgba(26,94,48,0.08); border-color: rgba(26,94,48,0.3); color: var(--green); }
.tag-red    { background: rgba(139,26,26,0.08); border-color: rgba(139,26,26,0.3); color: var(--red); }
.tag-blue   { background: rgba(26,58,110,0.08); border-color: rgba(26,58,110,0.3); color: var(--blue); }

/* ── Article styles ──────────────────────────────────── */
.article-title {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.2;
  color: var(--text);
}

.article-title a { color: var(--text); }
.article-title a:hover { color: var(--accent); }

.article-byline {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.article-byline strong { color: var(--text-dim); font-style: normal; font-weight: 600; }

.article-excerpt {
  font-family: var(--serif);
  color: var(--text-dim);
  font-size: 0.97rem;
  line-height: 1.6;
}

.article-body {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.8;
  color: var(--text);
}

.article-body p { margin-bottom: 1.1em; color: var(--text); }

/* Drop cap for first paragraph */
.article-body p:first-child::first-letter {
  font-size: 3.8em;
  font-weight: 700;
  line-height: 0.85;
  float: left;
  margin: 0 8px 0 0;
  color: var(--accent);
  font-family: var(--serif);
}

/* ── Issue / reading page ────────────────────────────── */
.issue-header {
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 3px double var(--border-strong);
}

.issue-number {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.issue-articles > .article-block {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}

.issue-articles > .article-block:last-child { border-bottom: none; }

/* ── Empty state ─────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 72px 20px;
  color: var(--text-dim);
}

.empty h3 { color: var(--text); margin-bottom: 8px; }

/* ── Footer ──────────────────────────────────────────── */
.footer {
  background: var(--accent);
  color: rgba(255,255,255,0.65);
  padding: 28px 24px;
  font-size: 0.82rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer a { color: rgba(255,255,255,0.65); }
.footer a:hover { color: #fff; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}

.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.1s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--bg-elev-2);
  border-radius: 2px;
  font-size: 0.7rem;
  color: var(--text-faint);
  font-weight: 400;
}

/* ── Stats ───────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.stat-value {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

/* ── Banner ──────────────────────────────────────────── */
.banner {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  color: var(--text-dim);
  font-size: 0.93rem;
}

.banner.success { border-left-color: var(--green); background: rgba(26,94,48,0.06); }
.banner.error   { border-left-color: var(--red);   background: rgba(139,26,26,0.06); }

/* ── Section divider ─────────────────────────────────── */
hr.sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

hr.sep-double {
  border: none;
  border-top: 3px double var(--border-strong);
  margin: 40px 0;
}

/* ── Utilities ───────────────────────────────────────── */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.text-dim   { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.hide { display: none !important; }

/* ── Hamburger nav ───────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-hamburger:hover span { background: #fff; }

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--accent-dark, #122e1e);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-mobile-menu.open { display: flex; }

.nav-mobile-menu a {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s, color 0.15s;
}

.nav-mobile-menu a:last-child { border-bottom: none; }
.nav-mobile-menu a:hover,
.nav-mobile-menu a.active { background: rgba(255,255,255,0.08); color: #fff; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 760px) {
  .np-row-main,
  .np-row-three { grid-template-columns: 1fr; }
  .np-col { border-right: none; border-bottom: 1px solid var(--border); padding: 24px 0; }
  .np-col:last-child { border-bottom: none; }
  .np-col-span2 { grid-column: span 1; }
  .masthead-title { font-size: clamp(2.5rem, 12vw, 4rem); }

  /* Hide desktop nav, show hamburger */
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Tighter masthead on mobile */
  .masthead { padding: 20px 16px 16px; }
  .masthead-tagline { font-size: 0.75rem; letter-spacing: 0.06em; }

  /* Edition bar — single line */
  .edition-bar-inner { flex-direction: column; gap: 2px; font-size: 0.7rem; }

  /* Ticker wraps cleanly */
  .ticker-bar { font-size: 0.8rem; padding: 8px 16px; }

  /* Main content padding */
  .np-grid { padding: 0 16px; }
  main { padding: 0; }

  /* Archive grid — single column */
  .archive-grid,
  [style*="grid-template-columns: 120px 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Issue number stamp — row on mobile */
  .issue-stamp-mobile { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }

  /* Subscribe form stacks vertically */
  .subscribe-inline { flex-direction: column; }
  .subscribe-inline input,
  .subscribe-inline button { width: 100%; }

  /* Buttons full-width in forms */
  .field-row { grid-template-columns: 1fr; }

  /* Article body — single column on narrow screens */
  .article-body { font-size: 0.97rem; line-height: 1.75; }

  /* Footer stacks */
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; font-size: 0.8rem; }

  /* Stat row wraps */
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; }

  /* Editor dashboard padding */
  .container, .container-narrow { padding: 0 16px; }
}

/* ── Skeleton loading ────────────────────────────────────── */
@keyframes sk-shimmer {
  0%   { background-position: -700px 0; }
  100% { background-position:  700px 0; }
}

.sk {
  display: block;
  background: linear-gradient(
    90deg,
    var(--bg-elev) 25%,
    var(--bg-elev-2) 50%,
    var(--bg-elev) 75%
  );
  background-size: 700px 100%;
  animation: sk-shimmer 1.4s infinite linear;
  border-radius: var(--radius);
}

.sk-tag  { height: 20px; width: 90px;  margin-bottom: 14px; }
.sk-h1   { height: 36px; width: 88%;   margin-bottom: 10px; }
.sk-h2   { height: 26px; width: 70%;   margin-bottom: 16px; }
.sk-h3   { height: 20px; width: 80%;   margin-bottom: 10px; }
.sk-line { height: 14px; width: 100%;  margin-bottom: 9px; }
.sk-line.w-90 { width: 90%; }
.sk-line.w-75 { width: 75%; }
.sk-line.w-55 { width: 55%; }
.sk-meta { height: 12px; width: 140px; margin-bottom: 14px; }
.sk-box  { height: 110px; width: 100%; margin-bottom: 0; }
