/* No-Clickbait News Aggregator — canonical stylesheet.
   Copied into public/assets/ on each site generation. A plain, newspaper-style
   portal: restrained serif typography, thin rules, muted newsprint palette.
   Mobile-first, fast-loading, no web fonts, no frameworks. Light + dark. */

:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e4e2dc;
  --rule: #1a1a1a;
  --accent: #7a2d1e; /* muted brick — old newsprint, not alarming */
  --hr: #2f5d50;
  --zagreb: #8a6d1f;
  --world: #3a4a7a;
  --sport: #a5540f;
  --shell: 68rem;
  --read: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --surface: #1e1e24;
    --text: #ececec;
    --muted: #a3a3a3;
    --line: #33333c;
    --rule: #c9c9c9;
    --accent: #d98b78;
    --hr: #7fbfa8;
    --zagreb: #d4b45a;
    --world: #9aa9e0;
    --sport: #e0a068;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Georgia, 'Times New Roman', serif;
  -webkit-text-size-adjust: 100%;
}

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

.site-header,
main,
.site-footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.1rem;
}

/* ---------- Masthead ---------- */
.site-header {
  padding-top: 1.6rem;
  border-bottom: 3px double var(--rule);
  margin-bottom: 1.6rem;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}

.masthead h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}
.masthead h1 a { color: inherit; text-decoration: none; }

.dateline {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
  white-space: nowrap;
}

.tagline {
  margin: 0.5rem 0 0.9rem;
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* Category navigation — plain links styled as pills (no JS filtering). */
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; padding-bottom: 0.9rem; }
.filters a {
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  text-decoration: none;
}
.filters a:hover { border-color: var(--muted); text-decoration: none; }
.filters a.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Shared story bits ---------- */
.meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.cat { font-weight: 700; }
.cat-hrvatska { color: var(--hr); }
.cat-zagreb { color: var(--zagreb); }
.cat-svijet { color: var(--world); }
.cat-sport { color: var(--sport); }

.deck { color: var(--muted); margin: 0 0 0.6rem; }

/* ---------- Featured image (hotlinked from source, credited) ---------- */
.story-image {
  margin: 0 0 0.7rem;
}
.story-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--line);
  border: 1px solid var(--line);
}
.story-image figcaption {
  margin-top: 0.3rem;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

.story h2 a,
.story h3 a { color: inherit; text-decoration: none; }
.story h2 a:hover,
.story h3 a:hover { color: var(--accent); text-decoration: none; }

.source {
  margin: 0.5rem 0 0;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
}
.source .more { color: var(--accent); }

/*
 * ---------- Story grid ----------
 * One layout everywhere — homepage sections and category pages alike: the
 * first row is 2 cards, every following row is 3 (desktop). No "hero" card;
 * sizing is the grid's job, not the card's. A 6-column base divides evenly
 * into both a 2-up first row (span 3) and 3-up rows (span 2). Because each
 * grid holds a contiguous set of cards (no client-side hiding), nth-child
 * addresses the real first row reliably.
 *   mobile  (<640px): 1 column
 *   tablet  (640-959px): 2 columns throughout
 *   desktop (>=960px): row 1 = 2 cards, rows 2+ = 3 cards
 */
.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem 1.6rem;
}
.story {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.story h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}
.story .deck { font-size: 0.95rem; }

@media (min-width: 640px) {
  .story-grid { grid-template-columns: repeat(6, 1fr); }
  .story-grid > .story { grid-column: span 3; } /* 2-up */
}
@media (min-width: 960px) {
  .story-grid > .story { grid-column: span 2; } /* rows 2+ : 3-up */
  .story-grid > .story:nth-child(1),
  .story-grid > .story:nth-child(2) { grid-column: span 3; } /* row 1 : 2-up */
}

/* ---------- Homepage sections + category pages ---------- */
.feed-section { margin-bottom: 2.4rem; }
.feed-section:last-of-type { margin-bottom: 1rem; }
.section-title {
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--rule);
}
.section-more {
  margin: 1.2rem 0 0;
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.9rem;
}
.section-more a { color: var(--accent); text-decoration: none; font-weight: 700; }
.section-more a:hover { text-decoration: underline; }

/* ---------- Article detail page ---------- */
.article-page { max-width: var(--read); }
.story.full h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
}
.story.full .deck { font-size: 1.1rem; margin-bottom: 1rem; }
.story.full .body { font-size: 1.06rem; }
.story.full .body p { margin: 0 0 0.9rem; }
.story.full .source {
  margin-top: 1.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
.disclaimer {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

.empty { color: var(--muted); font-style: italic; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 2rem;
  padding-top: 1.2rem;
  padding-bottom: 2.5rem;
  border-top: 3px double var(--rule);
  color: var(--muted);
  font-family: -apple-system, system-ui, sans-serif;
  font-size: 0.8rem;
}
.site-footer p { margin: 0 0 0.3rem; }
