/* ---------------------------------------------------------------------
   Feedline — light editorial theme.
   Structural DNA borrowed from thed2csummit.co (sticky nav, big hero,
   card grids, chip rows) but reworked into a warm, light palette instead
   of dark/teal, with a serif display face for a bit of personality.
------------------------------------------------------------------------ */

:root {
  --bg: #faf6ef;
  --bg-alt: #f2ece0;
  --ink: #1c2430;
  --ink-soft: #565f6b;
  --line: #e3dbc9;
  --accent: #e4572e;      /* terracotta — primary CTA/highlight */
  --accent-ink: #ffffff;
  --teal: #0f5c5c;        /* nod to the reference site's teal, used sparingly */
  --card-bg: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.04), 0 8px 24px rgba(28, 36, 48, 0.06);
  --shadow-hover: 0 4px 10px rgba(28, 36, 48, 0.06), 0 16px 32px rgba(28, 36, 48, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 239, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mark {
  height: 38px;
  width: auto;
  display: block;
}

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

.dropdown { position: relative; }
.nav-link {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}
.nav-link:hover { background: var(--bg-alt); }
.nav-link.is-active { color: var(--accent); background: rgba(228, 87, 46, 0.08); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-hover);
  min-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  display: none;
  flex-direction: column;
}
.dropdown-menu--wide { min-width: 280px; column-count: 1; }
.dropdown.is-open .dropdown-menu,
.dropdown:focus-within .dropdown-menu { display: flex; }

.dropdown-menu a {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.dropdown-menu a:hover { background: var(--bg-alt); color: var(--ink); }
.dropdown-menu a.is-active { color: var(--accent); font-weight: 600; }

.nav-cta {
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 24px 48px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(228, 87, 46, 0.10), transparent),
    radial-gradient(500px 260px at 5% 0%, rgba(15, 92, 92, 0.08), transparent);
}
.hero--compact { padding: 56px 24px 36px; }
.hero-inner { max-width: 780px; margin: 0 auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(15, 92, 92, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(34px, 5.5vw, 56px);
  line-height: 1.08;
}
.hero-title .highlight { color: var(--accent); }

.hero-sub {
  margin: 18px auto 0;
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 17px;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(228, 87, 46, 0.30); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* ---------- Chip rows ---------- */
.chip-row {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip-row--wrap { flex-wrap: wrap; overflow: visible; }

.chip {
  flex: 0 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Briefing / grid ---------- */
.briefing { max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 24px 0 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-heading h2 { font-size: 26px; }
.section-sub { color: var(--ink-soft); font-size: 13.5px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(228, 87, 46, 0.35);
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-thumb-overlay { display: none; }

.card-thumb--default {
  display: flex;
  align-items: flex-end;
}
.card-thumb--default .card-thumb-overlay {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(9, 20, 20, 0.75), rgba(9, 20, 20, 0));
}
.card-thumb--default .card-thumb-source {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.card-thumb--default .card-thumb-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #ffffff;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.32;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* Randomized default-thumbnail palettes — assigned deterministically per
   article (hash of its id), applied to both card thumbnails and the
   article-detail hero when no real image is available. */
.pal-0 { background: linear-gradient(135deg, #123a3a, #0f5c5c 55%, #1c2430); }
.pal-1 { background: linear-gradient(135deg, #3a2318, #8a4a2e 55%, #24160f); }
.pal-2 { background: linear-gradient(135deg, #131c3a, #24408f 55%, #10121f); }
.pal-3 { background: linear-gradient(135deg, #2e1a35, #6e3a7a 55%, #1c1024); }
.pal-4 { background: linear-gradient(135deg, #16311d, #2e7d42 55%, #10201a); }
.pal-5 { background: linear-gradient(135deg, #232323, #4a4a4a 55%, #171717); }

.thumb-watermark { position: relative; overflow: hidden; }
.thumb-watermark::before {
  content: "iA";
  position: absolute;
  top: -10px;
  right: -6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 130px;
  font-weight: 700;
  color: #ffffff;
  opacity: 0.07;
  line-height: 1;
  pointer-events: none;
}

.card-body {
  padding: 20px;
}

.card-source {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}
.card-title {
  font-size: 17px;
  line-height: 1.35;
  margin-bottom: 8px;
}
/* If a "real" image URL fails to load at runtime, the thumbnail falls back
   to the default title-overlay treatment — hide the now-duplicate title
   that would otherwise still show below it. */
.card.thumb-failed .card-title { display: none; }
.card-snippet {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.card-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.empty-state, .empty-state-block {
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

/* ---------- Article detail page ---------- */
.article-page { max-width: 760px; padding-top: 32px; }

.back-link {
  display: inline-block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.back-link:hover { color: var(--accent); }

.article-hero-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  margin-bottom: 24px;
}
.article-hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-source {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.article-title { font-size: clamp(26px, 4vw, 38px); line-height: 1.2; margin-bottom: 12px; }
.article-meta { color: var(--ink-soft); font-size: 14px; margin-bottom: 28px; }

.article-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; }
.article-body blockquote {
  margin: 0 0 18px;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}

.article-source-link {
  margin-top: 28px;
  padding: 14px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-soft);
}
.article-source-link a { color: var(--accent); font-weight: 600; }
.article-source-link a:hover { text-decoration: underline; }

.article-note {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

/* ---------- Switcher ---------- */
.switcher { max-width: 1180px; margin: 0 auto; padding: 8px 24px 48px; }
.switcher h2 { font-size: 20px; margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 40px 24px; }
.footer-brand { height: 22px; width: auto; display: block; margin-bottom: 14px; }
.footer-links { display: flex; gap: 18px; margin-bottom: 10px; }
.footer-links a { color: var(--ink-soft); font-size: 13.5px; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { color: var(--ink-soft); font-size: 12.5px; margin: 0; }

/* ---------- Contact page ---------- */
.contact-card {
  max-width: 460px;
  margin: 0 auto 64px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  box-shadow: var(--shadow);
}
.contact-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}
.contact-email {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.contact-email:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .nav-inner { flex-wrap: wrap; row-gap: 10px; }
  .nav-links { order: 3; width: 100%; justify-content: center; }
  .nav-cta { order: 2; }
  .dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 32px);
    width: max-content;
  }
}
