/* What The History Is Going On — public landing page
   Palette pulled from the brand logo: navy, gold, cream/parchment, colonial red. */
:root {
  --navy:        #0E2A57;
  --navy-deep:   #0A1E3F;
  --gold:        #C9974A;
  --gold-soft:   #E3BE7C;
  --cream:       #F5EAD6;
  --parchment:   #FBF4E4;
  --red:         #8B1A1A;
  --ink:         #14213D;
  --muted:       #5A6B86;
  --line:        rgba(14, 42, 87, 0.12);
  --shadow:      0 10px 30px rgba(10, 30, 63, 0.12);
  --serif:       'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:        'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(201, 151, 74, 0.16), transparent 70%),
    var(--parchment);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 5vw, 48px);
  background: rgba(251, 244, 228, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.brand img { display: block; }
.nav { display: flex; gap: clamp(12px, 3vw, 28px); font-weight: 500; }
.nav a { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 84px) clamp(20px, 5vw, 48px) clamp(24px, 5vw, 48px);
  text-align: center;
}
.hero-logo {
  width: min(680px, 100%);
  height: auto;
  margin: 0 auto clamp(20px, 4vw, 36px);
  filter: drop-shadow(0 14px 28px rgba(10, 30, 63, 0.22));
}
.hero-logo.is-missing { display: none; }

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 18px;
  color: var(--navy-deep);
}
.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 30px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-primary {
  background: var(--navy);
  color: var(--parchment);
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--navy-deep); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--gold);
}
.btn-ghost:hover { background: rgba(201, 151, 74, 0.14); color: var(--navy); }

/* ---------- Post sections (New / Popular) ---------- */
.post-sections { margin: clamp(20px, 4vw, 44px) 0; }
.post-block { margin-bottom: clamp(28px, 5vw, 52px); }
.section-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  color: var(--navy-deep);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(10, 30, 63, 0.20); }
.post-card-img {
  aspect-ratio: 16 / 9;
  background: var(--navy) center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.post-card-img.no-img {
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  display: flex; align-items: center; justify-content: center;
}
.post-card-img.no-img::after { content: "📜"; font-size: 2.4rem; opacity: 0.8; }
.post-card-body { padding: 18px 20px 22px; }
.post-card .post-meta { color: var(--muted); font-size: 0.78rem; margin-bottom: 6px; }
.post-card-body h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy);
  margin: 0 0 8px;
  line-height: 1.2;
}
.post-card-body p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

/* ---------- Content + right sidebar (Trending / ads) ---------- */
.content-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(20px, 3vw, 40px);
  max-width: none;
  margin: 0;
  padding: 0 clamp(20px, 6vw, 72px);  /* matches the breadcrumb + article padding */
  align-items: start;
}
.content-with-sidebar .cms-main { padding-left: 0; padding-right: 0; }
.sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 20px; }
.side-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.side-title {
  font-family: var(--serif); font-weight: 700; color: var(--navy);
  font-size: 1.1rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
}
.side-list { list-style: none; margin: 0; padding: 0; counter-reset: trend; }
.side-list li { padding: 9px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.side-list li:last-child { border-bottom: none; }
.side-list li::before {
  counter-increment: trend; content: counter(trend);
  color: var(--gold); font-family: var(--serif); font-weight: 700; font-size: 1rem; flex: 0 0 auto;
}
.side-list a { color: var(--navy); text-decoration: none; font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.side-list a:hover { color: var(--red); }
.ad-slot:empty { display: none; }
.ad-footer { max-width: 1000px; margin: 24px auto 0; padding: 0 20px; }
.wthigo-ad { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; overflow: hidden; }
.wthigo-ad a { display: block; }
.wthigo-ad img { max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 6px; }
.ad-label {
  font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-align: center; margin-bottom: 6px;
}
.ad-in-article { margin: 26px auto; max-width: 600px; }
.ad-popup-backdrop {
  position: fixed; inset: 0; background: rgba(10, 30, 63, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.ad-popup { position: relative; background: #fff; border-radius: 16px; padding: 30px 20px 20px; max-width: 480px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
.ad-popup-close {
  position: absolute; top: 8px; right: 10px; border: none; background: none;
  font-size: 1.2rem; cursor: pointer; color: var(--navy); line-height: 1;
}
.consent-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 150;
  background: var(--navy); color: var(--cream); border-radius: 12px;
  padding: 12px 16px; display: flex; gap: 14px; align-items: center; justify-content: center;
  flex-wrap: wrap; box-shadow: 0 12px 34px rgba(10, 30, 63, 0.3); font-size: 0.9rem;
}
.consent-bar a { color: var(--gold-soft); }
.consent-ok {
  background: var(--gold); color: var(--navy-deep); border: none; border-radius: 999px;
  padding: 8px 18px; font-weight: 700; cursor: pointer; font-family: inherit;
}

/* ---------- Subscribe / manage pages ---------- */
.sub-page-form { display: flex; flex-direction: column; gap: 12px; max-width: 540px; margin-top: 16px; align-items: flex-start; }
.sub-page-form input[type=email] { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 1rem; font-family: inherit; }
.sub-page-form .btn { cursor: pointer; }
.cat-list { width: 100%; box-sizing: border-box; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.cat-check { display: block; padding: 5px 0; font-size: 0.95rem; color: var(--ink); cursor: pointer; }
.cat-check input { margin-right: 6px; }
.cat-check.all { font-size: 1rem; margin-bottom: 4px; }
.sub-msg { min-height: 1.3em; font-weight: 500; margin: 0; }
.sub-msg.ok { color: #2f7d32; }
.sub-msg.err { color: var(--red); }
.mg-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.manage-existing { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; max-width: 540px; }
.manage-existing summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.pref-top { width: 100%; background: rgba(201, 151, 74, 0.1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.pref-top .cat-check { padding: 4px 0; }
.freq { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 12px; margin: 0; }
.freq legend { font-weight: 600; color: var(--navy); padding: 0 6px; font-size: 0.9rem; }
@media (max-width: 900px) {
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .sidebar .side-block { flex: 1 1 260px; }
}

/* ---------- About ---------- */
.about {
  max-width: 1100px;
  margin: clamp(24px, 6vw, 64px) auto;
  padding: clamp(28px, 5vw, 44px) clamp(24px, 5vw, 40px);
  text-align: center;
  background: var(--navy);
  color: var(--cream);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.about h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin: 0 0 14px;
  color: var(--gold-soft);
}
.about p { margin: 0; color: rgba(245, 234, 214, 0.9); font-size: 1.08rem; }

/* ---------- Subscribe ---------- */
.subscribe {
  max-width: 620px;
  margin: clamp(24px, 6vw, 64px) auto clamp(40px, 8vw, 80px);
  padding: 0 clamp(20px, 5vw, 48px);
  text-align: center;
}
.subscribe h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  margin: 0 0 8px;
  color: var(--navy-deep);
}
.subscribe > p { color: var(--muted); margin: 0 0 22px; }
.sub-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.sub-form input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: 1rem;
  font-family: var(--sans);
  background: #fff;
  color: var(--ink);
}
.sub-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 151, 74, 0.22);
}
.sub-note { min-height: 1.4em; margin: 14px 0 0; font-size: 0.95rem; font-weight: 500; }
.sub-note.ok  { color: #2f7d32; }
.sub-note.err { color: var(--red); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px clamp(20px, 5vw, 48px);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 4px 0; }
.footer-meta a { font-weight: 600; }

/* ---------- Responsive nav: hamburger + left slide-out drawer ---------- */
/* Desktop dropdowns for nested primary-menu items (multi-level flyouts) */
.nav .nav-item { position: relative; }
.nav .nav-sub {
  display: none; position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(10, 30, 63, 0.14); padding: 6px; min-width: 200px; z-index: 30;
}
.nav .nav-sub .nav-sub { top: 0; left: 100%; }            /* nested submenu flyout */
.nav .nav-item:hover > .nav-sub { display: block; }
.nav .nav-sub .nav-item > a { display: block; padding: 7px 12px; border-radius: 6px; white-space: nowrap; }
.nav .nav-sub .nav-item > a:hover { background: rgba(201, 151, 74, 0.14); }
.nav > .nav-item.has-sub > a::after { content: " \25be"; font-size: .7em; opacity: .7; }
.nav .nav-sub .nav-item.has-sub > a::after { content: "\25b8"; float: right; opacity: .7; margin-left: 12px; }
/* Flip near the right viewport edge (added by nav.js) so dropdowns stay on-screen */
.nav > .nav-item > .nav-sub.flip-left { left: auto; right: 0; }
.nav .nav-sub .nav-item > .nav-sub.flip-left { left: auto; right: 100%; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 9px; border: none; background: none; cursor: pointer;
}
.nav-toggle span { display: block; height: 2.5px; width: 100%; background: var(--navy); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.nav-scrim {
  position: fixed; inset: 0; background: rgba(10, 30, 63, 0.45);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 40;
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 82vw);
  background: var(--parchment); box-shadow: -6px 0 34px rgba(10, 30, 63, 0.28);
  transform: translateX(100%); transition: transform .28s ease; z-index: 50;
  display: flex; flex-direction: column;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-weight: 700; color: var(--navy);
}
.nav-drawer-close { background: none; border: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--navy); }
.drawer-nav { padding: 8px 0; overflow: auto; }
.drawer-list { list-style: none; margin: 0; padding: 0; }
.drawer-item > a, .drawer-row > a { display: block; padding: 12px 20px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1.02rem; }
.drawer-item > a:hover, .drawer-row > a:hover { background: rgba(201, 151, 74, 0.14); color: var(--red); }
.drawer-row { display: flex; align-items: center; }
.drawer-row > a { flex: 1; }
.drawer-toggle {
  background: none; border: none; cursor: pointer; padding: 12px 18px;
  font-size: 1rem; color: var(--navy); transition: transform .2s ease; flex: 0 0 auto;
}
.drawer-item.open > .drawer-row .drawer-toggle { transform: rotate(180deg); }
.drawer-sub { display: none; }
.drawer-item.open > .drawer-sub { display: block; }
.drawer-sub .drawer-item > a, .drawer-sub .drawer-row > a { font-size: .98rem; color: var(--muted); }

body.nav-open { overflow: hidden; }

@media (max-width: 760px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .brand span { display: none; }
}
