/* ============================================================================
   Los Santos News - editorial stylesheet (LA-Times-inspired)
   Display: Playfair Display · Body: Source Serif 4 · UI: system sans
   ========================================================================== */
:root {
  --ink:      #15110c;
  --ink-soft: #4a443c;
  --muted:    #7c756a;
  --line:     #e0dcd3;
  --line-strong: #15110c;
  --paper:    #ffffff;
  --paper-2:  #f7f4ee;
  --accent:   #b01217;      /* newspaper red - for kickers/breaking */
  --accent-2: #9a6c00;      /* deep gold - links/hover, RR brand */
  --gold:     #f9aa01;
  --max:      1200px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.content { padding-top: 28px; padding-bottom: 56px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.cap { text-transform: capitalize; }
.icon { width: 20px; height: 20px; vertical-align: -.18em; stroke-width: 1.8; }
.icon-sm { width: 16px; height: 16px; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.inline { display: inline; }

/* ── Masthead ──────────────────────────────────────────────────────────── */
.masthead { border-bottom: 3px double var(--line-strong); }
.masthead-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 24px 10px;
}
.masthead-date {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(28px, 5vw, 52px);
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
}
.masthead-acct {
  font-family: var(--sans);
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.masthead-acct .acct-link { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.masthead-acct .acct-link:hover { text-decoration: underline; }
.masthead-acct .acct-name { color: var(--ink-soft); }
.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--accent-2); font-weight: 600;
}
.linklike:hover { text-decoration: underline; }

/* ── Ribbon nav ────────────────────────────────────────────────────────── */
.ribbon { border-top: 1px solid var(--line); background: var(--paper); }
.ribbon-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ribbon-links { display: flex; flex-wrap: wrap; gap: 4px; }
.ribbon-links a {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 12px;
  border-bottom: 3px solid transparent;
}
.ribbon-links a:hover { color: var(--accent-2); }
.ribbon-links a.is-active { border-bottom-color: var(--gold); }
.ribbon-search { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.ribbon-search input {
  border: 0; border-bottom: 1px solid var(--line); background: transparent;
  font-family: var(--sans); font-size: .85rem; padding: 6px 2px; outline: none; width: 130px;
}
.ribbon-search input:focus { border-bottom-color: var(--gold); }

/* ── Kicker / byline ───────────────────────────────────────────────────── */
.kicker {
  font-family: var(--sans);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 6px;
}
.byline, .story-byline {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--muted);
}

/* ── Home grid ─────────────────────────────────────────────────────────── */
.home-grid { display: grid; grid-template-columns: 1fr 300px; gap: 40px; }
.home-side { border-left: 1px solid var(--line); padding-left: 24px; }

.lead { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.lead-media, .card-media { display: block; overflow: hidden; background: var(--paper-2); }
.lead-media img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.lead-headline {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  margin: 12px 0 10px;
}
.lead-headline a { text-decoration: none; }
.lead-headline a:hover { color: var(--accent-2); }
.lead-deck { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 12px; }

.card-media-ph {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16/9; color: #c9c2b6; background: var(--paper-2);
}
.card-media-ph .icon { width: 40px; height: 40px; }
.lead-ph { aspect-ratio: 16/9; }

/* card grids */
.cards { display: grid; gap: 28px 24px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.topborder { border-top: 1px solid var(--line); padding-top: 26px; }

.card .card-media img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card-headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.2;
  margin: 10px 0 6px;
}
.card-headline a { text-decoration: none; }
.card-headline a:hover { color: var(--accent-2); }
.card-deck { font-size: .95rem; color: var(--ink-soft); margin: 0 0 8px; }

/* Most read rail */
.rail-title, .section-title, .section-title-big {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.rail-title { font-size: .8rem; border-bottom: 2px solid var(--line-strong); padding-bottom: 8px; margin: 0 0 14px; }
.ranklist { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.ranklist li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ranklist a { text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.ranklist a:hover { color: var(--accent-2); }
.rank-num { font-family: var(--display); font-weight: 900; font-size: 1.4rem; color: var(--gold); line-height: 1; }

.more { margin-top: 44px; }
.section-title { font-size: .85rem; border-bottom: 2px solid var(--line-strong); padding-bottom: 8px; margin: 0 0 22px; }

/* ── Section page ──────────────────────────────────────────────────────── */
.section-head { border-bottom: 3px double var(--line-strong); margin-bottom: 28px; }
.section-title-big { font-family: var(--display); font-weight: 900; font-size: clamp(28px, 4vw, 40px); text-transform: none; letter-spacing: 0; margin: 0 0 12px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 40px; }
.pager-info { font-family: var(--sans); font-size: .85rem; color: var(--muted); }

/* ── Story page ────────────────────────────────────────────────────────── */
.story { max-width: 720px; margin: 0 auto; }
.story-headline { font-family: var(--display); font-weight: 900; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; margin: 8px 0 14px; }
.story-deck { font-size: 1.25rem; color: var(--ink-soft); margin: 0 0 16px; }
.story-byline { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.story-media { margin: 0 0 22px; }
.story-media img { width: 100%; }
.story-body { font-size: 1.16rem; line-height: 1.74; overflow-wrap: break-word; word-break: break-word; }
.story-body p { margin: 0 0 1.1em; }
.story-body h2, .story-body h3, .story-body h4 { font-family: var(--display); line-height: 1.2; margin: 1.4em 0 .5em; }
.story-body h2 { font-size: 1.7rem; }
.story-body h3 { font-size: 1.4rem; }
.story-body blockquote { margin: 1.3em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--gold); font-style: italic; color: var(--ink-soft); }
.story-body a { color: var(--accent-2); text-underline-offset: 2px; }
.story-body ul, .story-body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.story-body li { margin: .3em 0; }

/* ── Comments ──────────────────────────────────────────────────────────── */
.comments { max-width: 720px; margin: 48px auto 0; }
.comment-form { margin: 0 0 28px; }
.comment-form textarea, .article-form textarea, .article-form input, .article-form select,
.search-page-form input, .field input, .field select, .field textarea {
  width: 100%; font-family: var(--sans); font-size: .95rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fff; outline: none;
}
.comment-form textarea:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(249,170,1,.18); }
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 16px 0; border-top: 1px solid var(--line); }
.comment-head { display: flex; gap: 12px; align-items: baseline; font-family: var(--sans); }
.comment-author { font-weight: 700; font-size: .9rem; }
.comment-date { font-size: .76rem; color: var(--muted); }
.comment-body { margin-top: 4px; }

/* ── Buttons / badges / alerts ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--sans); font-weight: 600; font-size: .88rem;
  border: 1px solid transparent; border-radius: 6px; padding: 9px 16px;
  text-decoration: none; transition: background .12s, border-color .12s;
}
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: var(--gold); color: #1a1d24; }
.btn-primary:hover { background: #e59a00; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-danger { color: var(--accent); }
.btn-danger.btn-primary, .danger-zone .btn-danger { background: var(--accent); color: #fff; border-color: var(--accent); }
.danger-zone .btn-danger:hover { background: #8c0e12; }

.badge { font-family: var(--sans); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; }
.badge-published { background: #e6f4ea; color: #1b6b34; }
.badge-draft { background: #fdf3d8; color: #8a6500; }
.badge-archived { background: #efe9e2; color: #7c756a; }

.alert { font-family: var(--sans); font-size: .9rem; border-radius: 6px; padding: 12px 14px; margin-bottom: 20px; }
.alert-error { background: #fceaea; color: #8c1c1c; border: 1px solid #f3c9c9; }
.alert-ok { background: #e8f5ec; color: #1b6b34; border: 1px solid #c4e6cf; }

/* ── Auth ──────────────────────────────────────────────────────────────── */
.auth-body { background: var(--paper-2); min-height: 100vh; display: flex; }
.auth-wrap { margin: auto; width: 100%; max-width: 420px; padding: 24px; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 32px; box-shadow: 0 10px 40px rgba(0,0,0,.06); }
.auth-brand { display: block; text-align: center; font-family: var(--display); font-weight: 900; font-size: 30px; text-decoration: none; color: var(--ink); margin-bottom: 22px; }
.auth-title { font-family: var(--display); font-size: 1.7rem; margin: 0 0 6px; }
.auth-sub { color: var(--ink-soft); margin: 0 0 20px; font-size: .96rem; }
.auth-note { font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-top: 18px; }
.auth-back { font-family: var(--sans); font-size: .82rem; margin-top: 10px; }
.auth-back a { color: var(--accent-2); text-decoration: none; }

/* ── Forms (shared) ────────────────────────────────────────────────────── */
.form, .article-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-family: var(--sans); font-weight: 600; font-size: .82rem; color: var(--ink-soft); }
.field small { font-weight: 400; color: var(--muted); }
.field-inline { max-width: 240px; }
.article-form textarea { font-family: var(--sans); line-height: 1.6; resize: vertical; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 6px; }
.search-page-form { display: flex; gap: 12px; max-width: 560px; margin: 0 0 22px; }
.search-summary { margin: 0 0 18px; }
.edit-thumb { max-width: 240px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }

/* ── Newsroom ──────────────────────────────────────────────────────────── */
.newsroom-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; margin-bottom: 26px; }
.newsroom-bar-title { font-family: var(--sans); font-weight: 700; }
.newsroom-links { display: flex; gap: 6px; font-family: var(--sans); }
.newsroom-links a { text-decoration: none; font-weight: 600; font-size: .85rem; padding: 6px 12px; border-radius: 6px; color: var(--ink-soft); }
.newsroom-links a:hover { background: #fff; }
.newsroom-links a.is-active { background: var(--ink); color: #fff; }

.page-title { font-family: var(--display); font-weight: 900; font-size: clamp(26px, 3.5vw, 36px); margin: 0; }
.nr-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.nr-stats { display: flex; gap: 18px; margin-bottom: 22px; }
.stat { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px 24px; min-width: 120px; }
.stat-num { font-family: var(--display); font-weight: 900; font-size: 2rem; line-height: 1; }
.stat-label { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 6px; }

.nr-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .9rem; }
.nr-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 2px solid var(--line-strong); padding: 8px 10px; }
.nr-table td { border-bottom: 1px solid var(--line); padding: 12px 10px; vertical-align: middle; }
.nr-headline a { text-decoration: none; font-weight: 600; }
.nr-headline a:hover { color: var(--accent-2); }
.nr-row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.mod-item.is-hidden { opacity: .6; }
.mod-meta { font-family: var(--sans); font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.mod-meta a { color: var(--accent-2); text-decoration: none; }
.mod-body { margin: 8px 0; }
.mod-actions { display: flex; gap: 8px; }
.danger-zone { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ── Error / footer ────────────────────────────────────────────────────── */
.plain .content { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.error-page { text-align: center; padding: 60px 0; }
.error-code { font-family: var(--display); font-weight: 900; font-size: 76px; color: var(--gold); line-height: 1; }
.error-title { font-family: var(--display); font-size: 1.8rem; margin: 8px 0; }
.error-msg { color: var(--ink-soft); margin-bottom: 24px; }
.empty-hero { text-align: center; padding: 80px 0; }
.empty-hero h1 { font-family: var(--display); font-weight: 900; font-size: 2.4rem; margin: 0 0 10px; }

.paper-foot { border-top: 3px double var(--line-strong); margin-top: 40px; padding: 22px 0; font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.foot-sep { margin: 0 6px; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .masthead-top { grid-template-columns: 1fr; text-align: center; gap: 6px; }
  .masthead-acct { justify-content: center; }
  .masthead-date { text-align: center; }
  .ribbon-inner { flex-direction: column; align-items: stretch; }
  .ribbon-links { justify-content: center; }
  .ribbon-search { justify-content: center; padding-bottom: 10px; }
  .cards-4, .cards-3 { grid-template-columns: 1fr; }
  .nr-table thead { display: none; }
  .nr-table, .nr-table tbody, .nr-table tr, .nr-table td { display: block; width: 100%; }
  .nr-table tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; padding: 6px 10px; }
  .nr-table td { border: 0; padding: 4px 0; }
  .nr-row-actions { justify-content: flex-start; }
}
