/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #ffffff;
  --off-white: #f8f8f6;
  --cream: #f2f0eb;
  --light-gray: #e8e6e1;
  --mid-gray: #8a8680;
  --dark-gray: #4a4845;
  --charcoal: #2a2825;
  --ink: #1a1815;
  --navy: #0a1628;
  --red: #c41e3a;
  --red-dark: #9e1830;
  --blue-tint: #eef3f8;
  --border: #d8d5ce;
  --type-source: #2c5f8a;
  --type-official: #2e7d32;
  --type-think: #6a1b9a;
  --type-influencer: #b6511e;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === MASTHEAD === */
.masthead {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.masthead-rule-top {
  height: 4px;
  background: var(--red);
}

.masthead-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6px 24px 0;
  text-align: center;
}

.masthead-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.dateline { font-weight: 600; }
.edition-tag { font-style: italic; }

.masthead-logo {
  padding: 4px 0 0;
}

.logo-wordmark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--white);
  display: block;
  line-height: 1;
}

.logo-rule {
  display: block;
  width: 60px;
  height: 3px;
  background: var(--red);
  margin: 6px auto;
}

.masthead-tagline {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  padding-bottom: 3px;
}

.masthead-tagline span:first-child {
  font-style: italic;
  font-family: 'Libre Baskerville', Georgia, serif;
  letter-spacing: 0.05em;
  text-transform: none;
}

.tagline-sep { margin: 0 8px; opacity: 0.3; }

.masthead-rule-bottom {
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.masthead-nav {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
}

.masthead-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 20px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.masthead-nav a:hover {
  color: var(--white);
  border-bottom-color: var(--red);
}

/* Site-wide search input in the masthead — desktop inline, mobile drawer. */
.masthead-search {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 4px 24px 6px;
  max-width: 1100px;
  margin: 0 auto;
}
.masthead-search input[type=search] {
  flex: 1;
  max-width: 360px;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 12px;
  font: inherit;
  font-size: 0.85rem;
  border-radius: 2px;
}
.masthead-search input[type=search]::placeholder {
  color: rgba(255,255,255,0.55);
}
.masthead-search input[type=search]:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-color: var(--red);
}
.masthead-search-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.masthead-search-btn:hover { border-color: var(--red); }
.masthead-search-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.masthead-search--mobile { display: none; }
/* On desktop the mobile search wrapper is dead weight — hide it so the nav row stays clean. */
.drawer-search { display: none; }

/* Mobile menu toggle — desktop hidden, mobile reveals (set in @media block below) */
.masthead-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  border-radius: 2px;
  transition: border-color 0.2s;
}
.masthead-menu-toggle:hover { border-color: var(--red); }
.masthead-menu-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Site-wide share row — anchor in the same header corner as the hamburger.
   Desktop default: positioned top-right so the three share buttons + the
   "Help us spread the word" label sit next to the masthead meta row.
   The mobile media query below repositions / hides the label to avoid
   colliding with the hamburger. */
.masthead-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 0 6px;
}

.masthead-share-label {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.7rem;
  font-style: italic;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.share-group--header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.share-group--header .share-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: border-color 0.2s;
}

.share-group--header .share-btn:hover { border-color: var(--red); }
.share-group--header .share-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Default (desktop): the drawer-nav is always visible regardless of the
   hidden attribute — at desktop the toggle is hidden and the nav is the
   horizontal menu. The mobile media query later overrides [hidden] so the
   drawer stays hidden until opened. */
.masthead-nav[hidden] {
  display: flex;
}

/* === SECTION HEADERS === */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid-gray);
  white-space: nowrap;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* === FEED === */
.feed {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px 48px;
}

.feed .section-header { padding: 0 0 24px; }

/* Featured card */
.featured-card {
  background: var(--navy);
  color: var(--white);
  padding: 32px 36px 28px;
  border-left: 4px solid var(--red);
  margin-bottom: 28px;
  position: relative;
}

.featured-badge {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 3px 8px;
  margin-bottom: 14px;
}

.featured-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 14px;
  color: var(--white);
}

.featured-excerpt {
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  max-width: 720px;
  margin-bottom: 20px;
}

/* Feed grid */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.feed-card {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 22px 24px 18px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.feed-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.card-category {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}

.card-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 10px;
}

.card-excerpt {
  font-size: 0.85rem;
  color: var(--dark-gray);
  line-height: 1.55;
  margin-bottom: 16px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
}

.source-tag {
  color: var(--type-source);
  font-weight: 600;
}

.card-time { color: var(--mid-gray); }

/* Source type pills */
.source-types {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.type-tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
}

.type-tag.official { background: #e8f5e9; color: var(--type-official); }
.type-tag.think-tank { background: #f3e5f5; color: var(--type-think); }
.type-tag.media { background: var(--blue-tint); color: var(--type-source); }
.type-tag.influencer { background: #fff3e0; color: var(--type-influencer); }

/* === SOURCES === */
.sources {
  background: var(--white);
  padding: 48px 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.sources .section-header { margin-bottom: 36px; }

.sources-categories {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
}

.source-group {}

.group-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid-gray);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--light-gray);
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  column-gap: 8px;
}

.source-list span {
  font-size: 0.82rem;
  color: var(--dark-gray);
  padding: 2px 0;
  line-height: 1.8;
}

.source-list span::after {
  content: '  /';
  color: var(--border);
  margin-left: 4px;
  font-size: 0.7rem;
}

.source-list span:last-child::after { content: ''; }

/* === PHILOSOPHY === */
.philosophy {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 48px;
}

.philosophy .section-header { margin-bottom: 36px; }

.pull-quote {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  max-width: 800px;
  margin: 0 auto 28px;
  text-align: center;
  padding: 0 24px;
  position: relative;
}

.pull-quote::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--red);
  margin: 0 auto 18px;
}

.philosophy-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--dark-gray);
  max-width: 680px;
  margin: 0 auto 16px;
  text-align: center;
}

.philosophy-text:last-of-type { margin-bottom: 48px; }

.feature-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.pillar {
  text-align: center;
  padding: 24px 20px;
  background: var(--white);
  border: 1px solid var(--border);
}

.pillar-icon {
  width: 44px;
  height: 44px;
  background: var(--navy);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.pillar h4 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 8px;
}

.pillar p {
  font-size: 0.85rem;
  color: var(--dark-gray);
  line-height: 1.55;
}

/* === CLOSING === */
.closing {
  background: var(--navy);
  color: var(--white);
  padding: 64px 32px;
  text-align: center;
}

.closing-inner {
  max-width: 700px;
  margin: 0 auto;
}

.closing-rule-top {
  width: 40px;
  height: 3px;
  background: var(--red);
  margin: 0 auto 32px;
}

/* American flag stripe block */
.flag-stripe {
  height: 8px;
  background: var(--red);
  margin-bottom: 2px;
}
.flag-stripe:nth-child(2) { background: var(--white); height: 8px; }
.flag-stripe:nth-child(3) { background: var(--navy); height: 8px; margin-bottom: 32px; }

.closing-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--white);
  margin-bottom: 16px;
}

.closing-sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}

.closing-rule-bottom {
  width: 80px;
  height: 2px;
  background: rgba(255,255,255,0.15);
  margin: 0 auto;
}

/* === FOOTER === */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.4);
  padding: 40px 32px 32px;
  text-align: center;
}

.footer-inner { max-width: 600px; margin: 0 auto; }

.footer-masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--white);
}

.footer-tagline {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-style: italic;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}

.footer-note {
  font-size: 0.82rem;
  line-height: 1.65;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.45);
}

.footer-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  margin-bottom: 24px;
}

.footer-rule {
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 0 auto 20px;
}

.footer-copy { font-size: 0.72rem; color: rgba(255,255,255,0.25); }

.fair-use-link {
  color: var(--red) !important;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  letter-spacing: 0.03em;
}
.fair-use-link:hover {
  color: #e85a75 !important;
  text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .masthead-inner { padding: 16px 20px 0; }
  .masthead-meta { font-size: 0.6rem; }
  .feed { padding: 28px 20px 36px; }
  .feed-grid { grid-template-columns: 1fr; }
  .sources { padding: 36px 20px; }
  .sources-categories { grid-template-columns: 1fr; }
  .philosophy { padding: 40px 20px 36px; }
  .feature-pillars { grid-template-columns: 1fr; }
  .pull-quote { font-size: 1.15rem; padding: 0; }
  .closing { padding: 48px 20px; }
  .section-header { padding: 0 0 18px; }
  .feed .section-header { padding: 0 0 18px; }
  .section-rule { display: none; }
  .masthead-tagline .tagline-sep { display: none; }
  .masthead-tagline span:first-child { display: block; }
  .masthead-tagline span:last-child { display: none; }

  /* Mobile hamburger — sits to the right of the rule-bottom divider */
  .masthead-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 28px;
    right: 20px;
    z-index: 2;
  }
  .masthead-share-label { display: none; }
  /* Hide horizontal nav links at all times on mobile — drawer is the only nav */
  .masthead-nav {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px;
    gap: 0;
    background: var(--navy);
  }
  .masthead-nav[hidden] { display: none; }
  .masthead-nav:not([hidden]) {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 60px 24px 24px;
    gap: 4px;
    background: var(--navy);
    overflow-y: auto;
  }
  .masthead-nav:not([hidden]) a {
    padding: 16px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .masthead-nav:not([hidden]) a:hover {
    border-bottom-color: var(--red);
  }
  .masthead-nav .drawer-section { display: flex; flex-direction: column; margin-bottom: 8px; }
  /* Hide the inline desktop search bar; the drawer-mounted mobile form takes over. */
  .masthead-search--desktop { display: none; }
  /* The mobile form inherits the drawer's hidden state above 768px. */
  .drawer-search { display: flex; padding: 0 0 12px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 8px; }
  .masthead-search--mobile { display: flex; flex-direction: column; gap: 6px; padding: 0; max-width: none; }
  .masthead-search--mobile input[type=search] { max-width: none; }
  .masthead-search--mobile .masthead-search-btn { align-self: stretch; }
}

@media (max-width: 480px) {
  .masthead-tagline { max-width: 100%; }
  .logo-wordmark { font-size: clamp(2.1rem, 11.5vw, 3rem); letter-spacing: 0.12em; }
  .masthead-logo { padding: 10px 0 2px; }
  .logo-rule { width: 40px; height: 2px; margin: 6px auto; }
  .masthead-tagline { font-size: 0.66rem; letter-spacing: 0.08em; padding-bottom: 8px; line-height: 1.4; }
  .masthead-inner { padding: 14px 44px 0 16px; }
  .masthead-meta { flex-direction: row; gap: 12px; font-size: 0.6rem; }
  .dateline, .edition-tag { white-space: nowrap; }
  .featured-card { padding: 24px 20px 20px; }
  .featured-headline { font-size: 1.2rem; }
  .masthead-menu-toggle { width: 44px; height: 44px; }
}

@media (max-width: 360px) {
  .logo-wordmark { font-size: clamp(1.9rem, 12vw, 2rem); letter-spacing: 0.1em; }
  .masthead-inner { padding: 12px 44px 0 14px; }
  .dateline, .edition-tag { font-size: 0.58rem; }
}

@media (max-width: 375px) {
  /* Tighter BUGLER wordmark so the homepage hero fits at iPhone-class
     viewports without overflowing the masthead. */
  .logo-wordmark { font-size: clamp(1.7rem, 11.5vw, 2.15rem); letter-spacing: 0.08em; }

  /* Shrink the homepage's text-only featured card body padding
     to match the feed.css change. */
  .featured-card { padding: 20px 18px 18px; }

  /* Explicit 44px on each drawer link so the mobile audit passes
     without relying on font-size + padding derivation. */
  .masthead-nav:not([hidden]) a {
    padding: 14px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Tighter dateline/edition tag row so the hamburger isn't pushed. */
  .masthead-meta { font-size: 0.55rem; gap: 8px; }

  /* Make the hamburger tap-target explicit even though the 480px
     rule already sets it. */
  .masthead-menu-toggle { width: 44px; height: 44px; }
}

/* === POLISH === */
::selection { background: var(--red); color: var(--white); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--mid-gray); }
