/* ═══════════════════════════════════════════════════════════════
 * Diaper Diplomacy — Brand System
 * Shared design foundation imported by all site templates.
 * Do not override these rules in page-level CSS without reason.
 * ═══════════════════════════════════════════════════════════════ */

/* ── PART 1 — CSS Custom Properties ──────────────────────────── */

:root {
  /* Core palette */
  --dd-navy: #215d89;
  --dd-red: #822a35;
  --dd-cream: #ece7d8;
  --dd-dark: #0d1b2a;
  --dd-dark2: #0d2338;

  /* Derived palette */
  --dd-red-dim: rgba(130, 42, 53, 0.18);
  --dd-navy-dim: rgba(33, 93, 137, 0.18);
  --dd-cream-70: rgba(236, 231, 216, 0.70);
  --dd-cream-40: rgba(236, 231, 216, 0.40);
  --dd-white-8: rgba(255, 255, 255, 0.08);
  --dd-white-12: rgba(255, 255, 255, 0.12);

  /* Party colors */
  --party-republican: #CC3333;
  --party-democrat: #3366CC;
  --party-independent: #888888;
  --party-world-leader: #215d89;
  --party-default: #215d89;

  /* Typography */
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-ui: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', 'Arial', sans-serif;

  /* Spacing scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;

  /* Borders */
  --border-sharp: 3px;
  --border-subtle: 1px solid var(--dd-white-8);
  --border-red: 1px solid var(--dd-red);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-med: 0.25s ease;
  --transition-lift: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ── PART 2 — Global Resets & Base ───────────────────────────── */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--dd-dark);
  color: var(--dd-cream);
  font-family: var(--font-body);
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

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

/* ── PART 3 — Typography Utilities ───────────────────────────── */

.dd-display {
  font-family: var(--font-display);
  line-height: 1.0;
  letter-spacing: 0.01em;
}

.dd-ui {
  font-family: var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dd-body {
  font-family: var(--font-body);
}

/* Chyron label — red left-border label, used to identify section type */
.dd-chyron {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dd-red);
  border-left: 3px solid var(--dd-red);
  padding-left: 10px;
  line-height: 1.2;
}

/* Broadcast headline — Bebas Neue, dominant display size */
.dd-headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  color: var(--dd-cream);
  letter-spacing: 0.01em;
}

/* Subheadline */
.dd-subhead {
  font-family: var(--font-body);
  font-size: 15px;
  font-style: italic;
  color: var(--dd-cream-70);
  line-height: 1.5;
  max-width: 640px;
}

/* Metadata tag — date, party, episode number */
.dd-meta {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--dd-cream-40);
}

/* ── PART 4 — Section Header Component ───────────────────────── */

.dd-section-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--space-lg);
}

.dd-section-header__rule {
  width: 100%;
  height: 2px;
  background: var(--dd-red);
  border: none;
  display: block;
}

.dd-section-header__label {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  color: var(--dd-cream);
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.0;
}

/* Accent rule — short red bar used as a section divider / breath mark */
.dd-rule-accent {
  width: 60px;
  height: 2px;
  background: var(--dd-red);
  border: none;
  display: block;
  margin: var(--space-lg) 5%;
}

/* Full divider — subtle full-width line between sections */
.dd-rule-full {
  width: 100%;
  height: 1px;
  background: var(--dd-white-8);
  border: none;
  display: block;
}

/* ── PART 5 — Broadcast Monitor (tweet/video embed frame) ────── */

.dd-monitor {
  background: var(--dd-dark2);
  border: 1px solid var(--dd-white-12);
  border-radius: 4px;
  padding: var(--space-md);
  box-shadow:
    0 0 0 1px rgba(33, 93, 137, 0.10),
    0 4px 32px rgba(13, 27, 42, 0.6),
    0 0 40px rgba(33, 93, 137, 0.08);
  max-width: 560px;
  margin: 0 auto;
}

.dd-monitor__label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dd-red);
  margin-bottom: var(--space-sm);
}

/* ── PART 6 — Card Base ──────────────────────────────────────── */

.dd-card {
  background: var(--dd-dark2);
  border: 1px solid var(--dd-white-8);
  border-radius: var(--border-sharp);
  overflow: hidden;
  transition: var(--transition-lift);
  position: relative;
}

.dd-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(13, 27, 42, 0.5);
}

/* Party-color top border — applied via JS by reading data-party */
.dd-card[data-party="Republican"]  { border-top: 4px solid var(--party-republican); }
.dd-card[data-party="Democrat"]    { border-top: 4px solid var(--party-democrat); }
.dd-card[data-party="Independent"] { border-top: 4px solid var(--party-independent); }
.dd-card[data-party="World Leader"]{ border-top: 4px solid var(--party-world-leader); }
.dd-card:not([data-party])         { border-top: 4px solid var(--party-default); }

/* Hover thickens the border — achieved via box-shadow top inset trick */
.dd-card[data-party="Republican"]:hover  { box-shadow: inset 0 3px 0 var(--party-republican),  0 12px 40px rgba(13,27,42,0.5); }
.dd-card[data-party="Democrat"]:hover    { box-shadow: inset 0 3px 0 var(--party-democrat),    0 12px 40px rgba(13,27,42,0.5); }
.dd-card[data-party="Independent"]:hover { box-shadow: inset 0 3px 0 var(--party-independent), 0 12px 40px rgba(13,27,42,0.5); }
.dd-card[data-party="World Leader"]:hover{ box-shadow: inset 0 3px 0 var(--party-world-leader),0 12px 40px rgba(13,27,42,0.5); }
.dd-card:not([data-party]):hover         { box-shadow: inset 0 3px 0 var(--party-default),     0 12px 40px rgba(13,27,42,0.5); }

/* ── PART 7 — Button System ──────────────────────────────────── */

/* Primary — red fill */
.dd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
}

.dd-btn--primary {
  background: var(--dd-red);
  color: var(--dd-cream);
}
.dd-btn--primary:hover {
  background: #9e3340;
}

/* Ghost — red border, no fill */
.dd-btn--ghost {
  background: transparent;
  color: var(--dd-red);
  border: 1px solid var(--dd-red);
}
.dd-btn--ghost:hover {
  background: var(--dd-red);
  color: var(--dd-cream);
}

/* Ghost cream — for dark backgrounds where red is too strong */
.dd-btn--ghost-cream {
  background: transparent;
  color: var(--dd-cream-70);
  border: 1px solid rgba(236, 231, 216, 0.25);
}
.dd-btn--ghost-cream:hover {
  border-color: var(--dd-cream);
  color: var(--dd-cream);
}

/* ── PART 8 — Live Indicator ─────────────────────────────────── */

.dd-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dd-red);
}

.dd-live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dd-red);
  animation: dd-pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dd-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.85); }
}

/* ── PART 9 — Stagger Entry Animation ────────────────────────── */

@keyframes dd-fade-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dd-fade-up {
  animation: dd-fade-up 0.45s ease both;
}

/* Stagger delays — add class dd-delay-N to child elements */
.dd-delay-1 { animation-delay: 0.05s; }
.dd-delay-2 { animation-delay: 0.10s; }
.dd-delay-3 { animation-delay: 0.15s; }
.dd-delay-4 { animation-delay: 0.20s; }
.dd-delay-5 { animation-delay: 0.25s; }
.dd-delay-6 { animation-delay: 0.30s; }
.dd-delay-7 { animation-delay: 0.35s; }
.dd-delay-8 { animation-delay: 0.40s; }

/* ── PART 10 — Nav System ────────────────────────────────────── */

.dd-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dd-dark);
  border-bottom: 2px solid var(--dd-red);
  padding: 0 var(--space-md);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.dd-nav__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.dd-nav__logo {
  height: 32px;
  width: auto;
}

.dd-nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.dd-nav__link {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--dd-cream-70);
  transition: color var(--transition-fast);
}
.dd-nav__link:hover {
  color: var(--dd-cream);
}

/* ── PART 11 — Form / Input System ───────────────────────────── */

.dd-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dd-white-12);
  border-radius: 2px;
  color: var(--dd-cream);
  outline: none;
  transition: border-color var(--transition-fast);
}
.dd-input:focus {
  border-color: var(--dd-navy);
}
.dd-input::placeholder {
  color: var(--dd-cream-40);
}

/* On cream backgrounds (email capture section) */
.dd-input--light {
  background: white;
  border-color: rgba(33, 93, 137, 0.3);
  color: var(--dd-dark);
}
.dd-input--light::placeholder {
  color: rgba(13, 27, 42, 0.4);
}
.dd-input--light:focus {
  border-color: var(--dd-navy);
}

/* ── PART 12 — Poll Result Bars ──────────────────────────────── */

.dd-poll-bar-track {
  width: 100%;
  height: 8px;
  background: var(--dd-white-8);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.dd-poll-bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.8s ease-out;
}

.dd-poll-bar-fill--a {
  background: var(--dd-red);
}

.dd-poll-bar-fill--b {
  background: var(--dd-navy);
}

/* ── PART 13 — Responsive Breakpoints ────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
  .dd-headline {
    font-size: clamp(26px, 8vw, 40px);
  }
  .dd-section-header__label {
    font-size: clamp(24px, 6vw, 34px);
  }
  .dd-nav {
    padding: 0 var(--space-sm);
  }
  .dd-monitor {
    padding: var(--space-sm);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .dd-nav__logo {
    height: 26px;
  }
}
