/* ==========================================================================
   De Facto Daily — practical explainers
   Emulates the card-grid publication pattern: Space Grotesk + Inter,
   white page, deep teal ink, marigold accent.
   ========================================================================== */

:root {
  --page: #FFFFFF;
  --card: #FFFFFF;
  --panel: #F5F8F9;
  --dark: #0B1B21;
  --ink: #0B1B21;
  --ink-2: #3E5A63;
  --ink-3: #7C96A0;
  --on-dark: #FFFFFF;
  --on-dark-muted: #C9D8DC;
  --accent: #B36A00;
  --accent-bright: #E8960C;
  --accent-wash: #FDF3E3;
  --rule: #E4ECEF;
  --shadow: 0 1px 3px rgba(11,27,33,.08), 0 4px 14px rgba(11,27,33,.06);
  --shadow-hover: 0 4px 10px rgba(11,27,33,.10), 0 14px 34px rgba(11,27,33,.12);
  --r: 14px;
  --display: "Space Grotesk", "Inter", sans-serif;
  --body: "Inter", -apple-system, sans-serif;
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* reading progress, scales with scroll position */
.progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  z-index: 60;
  transition: width .08s linear;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 34px;
  height: 66px;
}

.site-header .wordmark { color: var(--on-dark); }

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.wordmark em { font-style: normal; color: var(--accent-bright); }

.nav { display: flex; gap: 26px; align-items: center; flex: 1; }
.nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--on-dark-muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav a:hover { color: var(--on-dark); }
.nav a[aria-current="page"] { color: var(--on-dark); border-bottom-color: var(--accent-bright); }

.nav a.nav-search,
.nav-search {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-width: 178px;
  height: 40px;
  line-height: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-dark-muted);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 0 20px;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.nav a.nav-search:hover,
.nav-search:hover { border-color: var(--accent-bright); color: var(--on-dark); }
.nav-search svg { width: 14px; height: 14px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  color: var(--on-dark);
  align-items: center;
  gap: 9px;
}
.nav-toggle-bars { display: inline-flex; flex-direction: column; justify-content: space-between; width: 15px; height: 11px; }
.nav-toggle-bars span { height: 2px; border-radius: 2px; background: var(--on-dark); transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- hero carousel ---------- */

.hero {
  position: relative;
  background: var(--dark);
  overflow: hidden;
  height: 480px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(78deg, rgba(11,27,33,.88) 8%, rgba(11,27,33,.55) 46%, rgba(11,27,33,.12) 78%);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.hero-eyebrow {
  display: inline-block;
  width: fit-content;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 14px;
}

.hero h2 {
  font-size: 42px;
  color: var(--on-dark);
  max-width: 620px;
  margin-bottom: 14px;
}
.hero p { color: var(--on-dark-muted); max-width: 520px; margin: 0 0 24px; font-size: 17px; }

.hero-cta {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  background: var(--accent-bright);
  color: var(--dark);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 999px;
  transition: background .15s ease;
}
.hero-cta:hover { background: #F5A623; }

.hero-dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
}
.hero-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(255,255,255,.38);
  transition: background .2s ease, transform .2s ease;
}
.hero-dot.active { background: var(--accent-bright); transform: scale(1.25); }

/* ---------- section bands ---------- */

.band { padding: 8px 0 44px; }
.band--tint { background: var(--panel); }
.band .section-head { margin-top: 40px; }

/* ---------- sections ---------- */

main { padding: 34px 0 30px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 46px 0 22px;
}
.section-head h2 { font-size: 27px; margin: 0; }
.see-all {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}
.see-all:hover { color: var(--accent-bright); }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.cards-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.thumb {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--panel);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: filter .3s ease; }
.card:hover .thumb img { filter: brightness(.93); }

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .02em;
}
.eyebrow .ref-tag {
  margin-left: 8px;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  background: var(--accent-wash);
  color: var(--accent);
  border-radius: 4px;
  padding: 2px 7px;
}

.card h3 {
  font-size: 18.5px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.dek {
  font-size: 14.5px;
  color: var(--ink-2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  margin-top: auto;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- trending ---------- */

.trending {
  background: var(--panel);
  border-radius: 18px;
  padding: 34px 34px 26px;
  margin-top: 56px;
}
.trending h2 { font-size: 24px; margin-bottom: 20px; }
.trending-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 40px;
}
.trending-item {
  display: flex;
  gap: 16px;
  align-items: baseline;
  padding: 11px 4px;
  border-bottom: 1px solid var(--rule);
  transition: color .15s;
}
.trending-item:hover .trending-title { color: var(--accent); }
.trending-item:nth-last-child(-n+2) { border-bottom: none; }
.trending-rank {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-bright);
  min-width: 26px;
}
.trending-title { font-weight: 500; font-size: 15.5px; transition: color .15s; }

/* ---------- article ---------- */

.crumbs {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 0 0 18px;
}
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 7px; }

.article-head { max-width: 780px; }
.article-head .eyebrow { font-size: 14px; }
.article-head h1 { font-size: 38px; margin: 10px 0 14px; }
.standfirst { font-size: 18.5px; color: var(--ink-2); margin: 0 0 18px; line-height: 1.55; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--ink-3);
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 26px;
}
.byline-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--ink-2);
}
.byline-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--accent-bright);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
}

.article-figure {
  border-radius: var(--r);
  overflow: hidden;
  margin: 0 0 30px;
}

.article-body { max-width: 720px; font-size: 17px; }
.article-body h2 { font-size: 26px; margin: 38px 0 14px; }
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 24px; }
.article-body li { margin-bottom: 9px; }
.article-body a { color: var(--accent); font-weight: 500; }
.article-body a:hover { text-decoration: underline; }

.toc {
  background: var(--panel);
  border-radius: var(--r);
  padding: 20px 22px;
  margin: 0 0 30px;
}
.toc-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin: 7px 0; font-size: 14.5px; }
.toc a { color: var(--ink-2); font-weight: 500; }
.toc a:hover { color: var(--accent); }

.facts {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 26px;
  font-size: 15px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  overflow: hidden;
}
.facts th, .facts td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--rule); }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: none; }
.facts th { background: var(--panel); font-family: var(--display); font-weight: 600; width: 42%; }

.note {
  background: var(--accent-wash);
  border-left: 3px solid var(--accent-bright);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 16px 20px;
  margin: 0 0 22px;
  font-size: 15.5px;
}
.note-label {
  font-weight: 700;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 5px;
}

.ai-note {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 18px 22px;
  margin: 34px 0 0;
  font-size: 14.5px;
  color: var(--ink-2);
  background: var(--panel);
}
.ai-note strong { color: var(--ink); }

.sidebar { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 26px; }
.side-box { border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 22px; }
.side-box h3 { font-size: 16px; margin-bottom: 12px; }
.side-item { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; font-weight: 500; }
.side-item:last-child { border-bottom: none; }
.side-item:hover { color: var(--accent); }
.side-rank { font-family: var(--display); font-weight: 700; color: var(--accent-bright); font-size: 13px; }

/* ---------- category page ---------- */

.cat-head { margin: 40px 0 26px; max-width: 720px; }
.cat-head h1 { font-size: 40px; }
.cat-head p { color: var(--ink-2); font-size: 17px; margin: 0; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 70px;
  background: var(--dark);
  color: var(--on-dark-muted);
  padding: 46px 0 34px;
  font-size: 14.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 34px;
}
.site-footer .wordmark { color: var(--on-dark); font-size: 21px; }
.footer-tag { margin: 12px 0 0; max-width: 240px; font-size: 14px; line-height: 1.6; }
.footer-col h4 { color: var(--on-dark); font-size: 14.5px; margin-bottom: 12px; }
.footer-col a { display: block; padding: 4px 0; color: var(--on-dark-muted); font-size: 14px; }
.footer-col a:hover { color: var(--accent-bright); }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 22px;
  font-size: 13px;
  line-height: 1.7;
}
.footer-legal a { color: var(--on-dark-muted); text-decoration: underline; }

/* ---------- search ---------- */

.search-page { max-width: 720px; }
.search-input {
  width: 100%;
  font-family: var(--body);
  font-size: 17px;
  padding: 14px 18px;
  border: 1.5px solid var(--rule);
  border-radius: 12px;
  margin: 8px 0 26px;
}
.search-input:focus { outline: none; border-color: var(--accent-bright); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   RESPONSIVE — must remain the LAST block in this file
   ========================================================================== */

@media (max-width: 960px) {
  .header-bar { height: 60px; gap: 18px; }
  .nav {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--dark);
    border-bottom: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 14px 30px rgba(11,27,33,.30);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 24px 16px;
  }
  .nav.open { display: flex; }
  .nav a {
    padding: 14px 2px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    border-left: 2px solid transparent;
    font-size: 15px;
    color: var(--on-dark);
  }
  .nav a:hover { color: var(--accent-bright); }
  .nav a[aria-current="page"] {
    border-bottom-color: rgba(255,255,255,.1);
    border-left-color: var(--accent-bright);
    padding-left: 10px;
    color: var(--accent-bright);
  }
  .nav a.nav-search,
  .nav-search {
    margin: 14px 0 0;
    justify-content: center;
    color: var(--on-dark);
    border: 1px solid rgba(255,255,255,.25);
  }
  .nav-toggle { display: inline-flex; }

  .hero { height: 430px; }
  .hero h2 { font-size: 31px; }

  .cards, .cards-4 { grid-template-columns: 1fr 1fr; }

  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .sidebar { position: static; margin-top: 40px; }

  .trending-grid { grid-template-columns: 1fr; }
  .trending-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .trending-item:last-child { border-bottom: none; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 18px; }
  .hero { height: 470px; }
  .hero h2 { font-size: 27px; }
  .hero p { font-size: 15.5px; }

  .cards, .cards-4 { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 22px; }

  .article-head h1 { font-size: 29px; }
  .article-body { font-size: 16.5px; }
  .article-body h2 { font-size: 22px; }
  .article-meta { flex-wrap: wrap; gap: 8px 14px; }

  .trending { padding: 24px 20px 16px; margin-top: 40px; }
  .cat-head h1 { font-size: 30px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

.no-results {
  grid-column: 1 / -1;
  color: var(--ink-2);
  padding: 20px 0;
}

/* homepage bands manage their own spacing */
.home-main { padding: 0; }
.home-main .band:first-child { padding-top: 34px; }
.home-main .band:first-child .section-head { margin-top: 0; }
.home-main .trending { margin-top: 0; }
.home-main .band:last-child { padding: 44px 0; }

/* visually hidden, still read by assistive tech and crawlers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
