/* ============================================================
   PROTECTIONS FOR ELECTIONS — CUSTOM STYLES
   Unified green/gold brand aligned with flyer design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&display=swap');

/* ============================================================
   DESIGN SYSTEM — BRAND COLORS & CUSTOM PROPERTIES
   Palette sourced from flyer design: green-900 through green-50,
   gold-500 accents, neutral charcoal/slate
   ============================================================ */

:root {
  /* Primary brand — forest green (from flyer palette) */
  --md-primary-fg-color: #14532D;
  --md-primary-fg-color--light: #166534;
  --md-primary-fg-color--dark: #0D3B1E;
  --md-primary-bg-color: #ffffff;
  --md-accent-fg-color: #EAB308;

  /* Tier colors (centralized) */
  --tier-green: #2e7d32;
  --tier-green-bg: rgba(46, 125, 50, 0.08);
  --tier-yellow: #e65100;
  --tier-yellow-bg: rgba(230, 81, 0, 0.08);
  --tier-red: #c62828;
  --tier-red-bg: rgba(198, 40, 40, 0.08);

  /* Accent colors */
  --accent-teal: #0d9488;
  --accent-teal-hover: #0f766e;
  --accent-teal-light: rgba(13, 148, 136, 0.12);
  --accent-gold: #d97706;
  --accent-gold-hover: #b45309;
  --accent-gold-light: rgba(217, 119, 6, 0.12);

  /* Flyer surface colors */
  --surface-green-50: #F0FDF4;
  --surface-green-100: #DCFCE7;
  --surface-gold-50: #FEF9C3;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #4ADE80;
  --md-primary-fg-color--light: #22C55E;
  --md-primary-fg-color--dark: #16A34A;
  --md-primary-bg-color: #1e1e1e;
  --md-accent-fg-color: #FACC15;

  --tier-green: #4caf50;
  --tier-green-bg: rgba(76, 175, 80, 0.12);
  --tier-yellow: #ff9800;
  --tier-yellow-bg: rgba(255, 152, 0, 0.12);
  --tier-red: #ef5350;
  --tier-red-bg: rgba(239, 83, 80, 0.12);
  --accent-teal: #2dd4bf;
  --accent-teal-hover: #14b8a6;
  --accent-teal-light: rgba(45, 212, 191, 0.15);
  --accent-gold: #fbbf24;
  --accent-gold-hover: #f59e0b;
  --accent-gold-light: rgba(251, 191, 36, 0.15);
  --surface-green-50: rgba(74, 222, 128, 0.06);
  --surface-green-100: rgba(74, 222, 128, 0.1);
  --surface-gold-50: rgba(250, 204, 21, 0.08);
}

/* ============================================================
   NEUTRAL BACKGROUND — Warm off-white instead of stark white
   ============================================================ */

[data-md-color-scheme="default"] {
  --md-default-bg-color: #FAFAF5;
  --md-default-bg-color--light: #F0F0EA;
}

/* ============================================================
   TYPOGRAPHY — DM Serif Display headings + DM Sans body
   Mirrors the flyer's three-font hierarchy
   ============================================================ */

.md-typeset {
  line-height: 1.8;
}

.md-typeset h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--md-primary-fg-color--dark);
}

.md-typeset h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.005em;
  border-top: 2px solid var(--md-default-fg-color--lightest);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.md-typeset h2:first-of-type,
.md-typeset .hero-banner + * h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.md-typeset h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
}

.md-typeset p {
  margin-bottom: 1.25em;
}

/* Tighter spacing inside admonitions and cards */
.md-typeset .admonition p,
.md-typeset details p,
.md-typeset .grid.cards p {
  margin-bottom: 0.75rem;
}

/* Lead-in bold first sentence styling */
.md-typeset strong.lead-in {
  font-size: 1.05em;
  color: var(--md-default-fg-color);
}

/* ============================================================
   HEADER — Site title in DM Serif Display
   ============================================================ */

.md-header__topic .md-ellipsis {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ============================================================
   TOP TAB BAR — SPREAD ITEMS & DROPDOWN MENUS
   ============================================================ */

/* Override Material's overflow:auto so dropdowns can escape the tab bar */
.md-tabs {
  overflow: visible;
}

/* Spread tabs evenly across the full width */
.md-tabs__list {
  justify-content: center;
  gap: 2rem;
  overflow: visible;
  contain: none;
}

.md-tabs__item {
  padding: 0 1.2rem;
}

.md-tabs__link {
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.md-tabs__link:hover {
  opacity: 1;
}

/* ---- Dropdown container (injected by JS) ---- */
.md-tabs__item {
  position: relative;
}

.md-tabs__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-top: 3px solid var(--md-primary-fg-color);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  z-index: 100;
  padding: 0.5rem 0;
}

.md-tabs__item:hover > .md-tabs__dropdown {
  display: block;
}

/* Dropdown link items */
.md-tabs__dropdown > a {
  display: block;
  padding: 0.45rem 1.2rem;
  color: var(--md-default-fg-color);
  font-size: 0.82rem;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.md-tabs__dropdown > a:hover {
  background: var(--md-primary-fg-color--light);
  color: var(--md-primary-bg-color);
}

/* ---- Tier group items with nested sub-dropdown ---- */
.md-tabs__dropdown-tier {
  position: relative;
}

.md-tabs__dropdown-tier-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: background 0.1s ease;
  color: var(--md-default-fg-color);
  border-left: 4px solid transparent;
}

.md-tabs__dropdown-tier-arrow {
  font-size: 0.6em;
  margin-left: 0.8rem;
  opacity: 0.5;
}

.md-tabs__dropdown-tier:hover > .md-tabs__dropdown-tier-label {
  background: var(--md-default-bg-color--light);
}

/* Tier color accents on the left border */
.md-tabs__dropdown-tier--green > .md-tabs__dropdown-tier-label {
  border-left-color: #2e7d32;
}
.md-tabs__dropdown-tier--yellow > .md-tabs__dropdown-tier-label {
  border-left-color: #e65100;
}
.md-tabs__dropdown-tier--red > .md-tabs__dropdown-tier-label {
  border-left-color: #c62828;
}

/* ---- Nested sub-dropdown (flies out to the right) ---- */
.md-tabs__subdropdown {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 200px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-left: 3px solid var(--md-primary-fg-color);
  border-radius: 0 4px 4px 0;
  box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 101;
  padding: 0.5rem 0;
}

.md-tabs__dropdown-tier:hover > .md-tabs__subdropdown {
  display: block;
}

.md-tabs__subdropdown a {
  display: block;
  padding: 0.35rem 1rem;
  color: var(--md-default-fg-color);
  font-size: 0.8rem;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.md-tabs__subdropdown a:hover {
  background: var(--md-primary-fg-color--light);
  color: var(--md-primary-bg-color);
}

/* ============================================================
   LEGAL DISCLAIMER FOOTER
   Style the copyright area to look like a proper disclaimer
   ============================================================ */

.md-footer-copyright {
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 800px;
}

/* ============================================================
   DENSE LEGAL TABLES
   The 50-state table has 6 columns; needs horizontal scroll
   on mobile and compact typography
   ============================================================ */

.md-typeset table:not([class]) {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.84em;
}

/* Allow wrapping for content-heavy columns */
.md-typeset table:not([class]) td {
  white-space: normal;
  min-width: 100px;
}

/* Keep short columns compact */
.md-typeset table:not([class]) td:first-child {
  white-space: nowrap;
  font-weight: 600;
}

/* Alternating row colors for readability on long tables */
.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: var(--md-default-bg-color--light);
}

/* Sticky header for long scrollable tables */
.md-typeset table:not([class]) thead {
  position: sticky;
  top: 0;
  background-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
  z-index: 1;
}

.md-typeset table:not([class]) thead th {
  color: var(--md-primary-bg-color);
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.6rem 0.8rem;
}

/* ============================================================
   COALITION DIRECTORY SECTIONS
   Coalition partner contact info uses definition lists
   ============================================================ */

.md-typeset dt {
  font-weight: 700;
  color: var(--md-primary-fg-color);
  margin-top: 1rem;
  font-size: 0.95em;
}

.md-typeset dd {
  margin-left: 1.5rem;
  font-size: 0.9em;
  color: var(--md-default-fg-color--light);
  line-height: 1.6;
}

/* ============================================================
   STATUTE AND ORDINANCE TEXT
   Legal text (blockquotes) gets monospace treatment
   ============================================================ */

.md-typeset blockquote {
  border-left: 4px solid var(--md-primary-fg-color);
  background: var(--md-code-bg-color);
  padding: 0.8rem 1.2rem;
  font-size: 0.9em;
  font-family: var(--md-code-font-family);
  color: var(--md-default-fg-color);
}

.md-typeset blockquote p {
  margin: 0.4rem 0;
}

/* ============================================================
   50-STATE INTERACTIVE TABLE FILTER BAR
   ============================================================ */

#tier-filter-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1.2rem 0 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

#tier-filter-bar .filter-label {
  font-weight: 600;
  font-size: 0.875em;
  color: var(--md-default-fg-color--light);
  align-self: center;
}

.tier-filter-btn {
  padding: 5px 16px;
  border-radius: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8em;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
  line-height: 1.4;
  font-family: inherit;
}

.tier-filter-btn[data-tier="all"] {
  background: var(--md-default-bg-color--dark);
  color: var(--md-default-fg-color);
  border-color: var(--md-default-fg-color--lighter);
}

.tier-filter-btn[data-tier="GREEN"] {
  background: #1b5e20;
  color: #ffffff;
}

.tier-filter-btn[data-tier="YELLOW"] {
  background: #e65100;
  color: #ffffff;
}

.tier-filter-btn[data-tier="RED"] {
  background: #b71c1c;
  color: #ffffff;
}

.tier-filter-btn.active {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.tier-filter-btn:hover:not(.active) {
  opacity: 0.82;
  transform: translateY(-1px);
}

#tier-result-count {
  font-size: 0.8em;
  color: var(--md-default-fg-color--light);
  font-style: italic;
  align-self: center;
  margin-left: 0.25rem;
}

/* ============================================================
   HOMEPAGE ENHANCEMENTS
   ============================================================ */

/* Tier color accents on "Find Your State" grid cards */
.md-typeset .grid.cards.tier-cards > :is(ul, ol) > li:nth-child(1) {
  border-top: 3px solid #2e7d32;
}

.md-typeset .grid.cards.tier-cards > :is(ul, ol) > li:nth-child(2) {
  border-top: 3px solid #e65100;
}

.md-typeset .grid.cards.tier-cards > :is(ul, ol) > li:nth-child(3) {
  border-top: 3px solid #c62828;
}

/* Force 4-column layout for "Start Here By Role" cards on desktop */
.md-typeset .grid.cards.role-cards > :is(ul, ol) {
  grid-template-columns: repeat(4, 1fr);
}

/* Tablet: 2 columns */
@media screen and (max-width: 960px) {
  .md-typeset .grid.cards.role-cards > :is(ul, ol) {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column */
@media screen and (max-width: 600px) {
  .md-typeset .grid.cards.role-cards > :is(ul, ol) {
    grid-template-columns: 1fr;
  }
}

/* ---- State Guides mega dropdown ---- */
.md-tabs__mega-menu {
  min-width: 700px;
  padding: 0;
}

.md-tabs__mega-menu > a {
  padding: 0.6rem 1.2rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  font-weight: 600;
}

.md-tabs__mega-columns {
  display: flex;
  gap: 0;
}

.md-tabs__mega-col {
  flex: 1;
  padding: 0.5rem 0;
  border-left: 1px solid var(--md-default-fg-color--lightest);
}

.md-tabs__mega-col:first-child {
  border-left: none;
}

.md-tabs__mega-col-header {
  padding: 0.4rem 1rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  margin-bottom: 0.25rem;
}

.md-tabs__mega-col--green .md-tabs__mega-col-header {
  color: #2e7d32;
  border-bottom-color: #2e7d32;
}

.md-tabs__mega-col--yellow .md-tabs__mega-col-header {
  color: #e65100;
  border-bottom-color: #e65100;
}

.md-tabs__mega-col--red .md-tabs__mega-col-header {
  color: #c62828;
  border-bottom-color: #c62828;
}

.md-tabs__mega-col > a {
  display: block;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  color: var(--md-default-fg-color);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.md-tabs__mega-col > a:hover {
  background: var(--md-primary-fg-color--light);
  color: var(--md-primary-bg-color);
}

/* ============================================================
   NAVIGATION IMPROVEMENTS
   ============================================================ */

/* Slightly reduce sidebar font size for long nav trees */
.md-nav--secondary .md-nav__link {
  font-size: 0.78rem;
}

/* Highlight active state guide in nav */
.md-nav__item--active > .md-nav__link {
  font-weight: 700;
}

/* ============================================================
   PRINT STYLES
   Legal professionals frequently print state guides
   ============================================================ */

@media print {
  .md-header,
  .md-sidebar,
  .md-footer,
  .md-search,
  .md-tabs,
  #tier-filter-bar,
  .md-top {
    display: none !important;
  }

  .md-main__inner {
    margin: 0 !important;
  }

  .md-content {
    max-width: 100% !important;
  }

  .md-typeset {
    font-size: 11pt;
    line-height: 1.5;
  }

  .md-typeset table:not([class]) {
    white-space: normal;
    font-size: 0.75em;
    overflow: visible;
    display: table;
  }

  .md-typeset table:not([class]) thead {
    background-color: #14532D !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Append URLs after links for printed documents */
  .md-typeset a[href^="http"]::after,
  .md-typeset a[href^="https"]::after {
    content: " (" attr(href) ")";
    font-size: 0.7em;
    color: #666;
    word-break: break-all;
  }

  /* Don't append for internal/anchor links */
  .md-typeset a[href^="#"]::after,
  .md-typeset a[href^="/"]::after {
    content: none;
  }

  /* Page breaks */
  h1, h2 {
    page-break-before: auto;
    page-break-after: avoid;
  }

  table {
    page-break-inside: avoid;
  }

  .admonition {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
  }
}

/* ============================================================
   SEARCH RESULT ENHANCEMENTS
   ============================================================ */

.md-search-result__teaser mark {
  background-color: rgba(255, 235, 59, 0.4);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ============================================================
   ADMONITION REFINEMENTS FOR TIER CONTENT
   ============================================================ */

/* Admonition refinements — premium feel matching flyer style */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 0 8px 8px 0;
  border-left-width: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* Make success (GREEN tier) admonitions use green */
.md-typeset .admonition.success,
.md-typeset details.success {
  border-color: #2e7d32;
}

.md-typeset .success > .admonition-title,
.md-typeset .success > summary {
  background-color: rgba(46, 125, 50, 0.12);
}

.md-typeset .success > .admonition-title::before,
.md-typeset .success > summary::before {
  color: #2e7d32;
}

/* Code copy button enhancement */
.md-typeset .md-clipboard {
  color: var(--md-default-fg-color--lighter);
}

.md-typeset .md-clipboard:hover {
  color: var(--md-accent-fg-color);
}

/* ============================================================
   HERO BANNER — HOMEPAGE
   ============================================================ */

.hero-banner {
  background: linear-gradient(135deg,
    #0D3B1E 0%,
    #14532D 30%,
    #166534 60%,
    #1a5c2e 100%
  );
  color: #ffffff;
  padding: 2.5rem 2rem 2rem;
  margin: -0.8rem -0.8rem 1.5rem;
  border-radius: 0 0 8px 8px;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-banner h1 {
  color: #ffffff !important;
  font-family: 'DM Serif Display', Georgia, serif !important;
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  border-top: none;
  padding-top: 0;
}

.hero-banner h2 {
  color: rgba(255, 255, 255, 0.9) !important;
  font-family: 'DM Serif Display', Georgia, serif !important;
  font-size: 1.15rem;
  font-weight: 400;
  border-bottom: none;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.hero-banner p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  max-width: 800px;
}

.hero-banner .md-typeset .admonition,
.hero-banner .md-typeset .admonition.success {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.hero-banner .md-typeset .admonition .admonition-title {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.hero-banner .md-typeset .admonition p {
  color: rgba(255, 255, 255, 0.9);
}

[data-md-color-scheme="slate"] .hero-banner {
  background: linear-gradient(135deg,
    #0a1f12 0%,
    #0D3B1E 30%,
    #14532D 60%,
    #0a2a16 100%
  );
}

/* Subtle § watermark on hero */
.hero-banner::after {
  content: '\00A7';
  position: absolute;
  bottom: -1.5rem;
  right: 1.5rem;
  font-size: 10rem;
  font-family: 'DM Serif Display', Georgia, serif;
  color: rgba(255,255,255,0.035);
  pointer-events: none;
  line-height: 1;
}

/* ============================================================
   URGENCY BADGE
   ============================================================ */

.urgency-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.2rem;
  background: var(--accent-gold-light);
  border-left: 4px solid var(--accent-gold);
  border-radius: 0 6px 6px 0;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.urgency-banner strong {
  color: var(--accent-gold);
}

/* Fallback: if markdown attr wraps content in <p>, collapse it */
.urgency-banner p {
  margin: 0;
  display: contents;
}

.urgency-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  background: var(--tier-red);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  animation: urgency-pulse 2s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes urgency-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .urgency-badge { animation: none; }
}

/* ============================================================
   CTA BUTTONS — ACCENT COLORS
   ============================================================ */

.cta-primary {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: var(--accent-teal);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.15s ease;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.cta-primary:hover {
  background: var(--accent-teal-hover);
  transform: translateY(-1px);
}

.cta-secondary {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: var(--accent-gold);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 6px;
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.15s ease;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.cta-secondary:hover {
  background: var(--accent-gold-hover);
  transform: translateY(-1px);
}

/* ============================================================
   PULL QUOTES FOR LEGAL STATUTES
   ============================================================ */

.pull-quote {
  position: relative;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem 1rem 2.5rem;
  background: var(--md-code-bg-color);
  border-left: 5px solid var(--accent-teal);
  border-radius: 0 8px 8px 0;
  font-family: var(--md-code-font-family);
  font-size: 0.92em;
  line-height: 1.7;
}

/* Collapse <p> wrappers inside pull-quote from markdown processing */
.pull-quote p {
  margin: 0 0 0.5rem;
}
.pull-quote p:last-child {
  margin-bottom: 0;
}

.pull-quote::before {
  content: '\201C';
  position: absolute;
  top: 0.2rem;
  left: 0.4rem;
  font-size: 2.5rem;
  font-family: Georgia, serif;
  color: var(--accent-teal);
  opacity: 0.3;
  line-height: 1;
}

.pull-quote-citation {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.82em;
  font-weight: 700;
  color: var(--accent-teal);
  font-family: var(--md-text-font-family);
}

/* ============================================================
   HISTORICAL WATERMARK — CORE LEGAL FOUNDATION
   ============================================================ */

.legal-foundation-wrapper .admonition.success {
  position: relative;
  overflow: hidden;
  border-width: 2px;
}

.legal-foundation-wrapper .admonition.success::after {
  content: '\00A7 592';
  position: absolute;
  bottom: -0.5rem;
  right: 0.5rem;
  font-size: 5rem;
  font-weight: 900;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--tier-green);
  opacity: 0.06;
  pointer-events: none;
  line-height: 1;
}

/* ============================================================
   ROLE CARD ICON ENHANCEMENT
   ============================================================ */

.md-typeset .grid.cards.role-cards > :is(ul, ol) > li {
  border-top: 3px solid var(--accent-teal);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* Larger icons with colored circular backgrounds */
.md-typeset .grid.cards.role-cards .twemoji svg,
.md-typeset .grid.cards.role-cards .emojione svg {
  background: var(--accent-teal-light);
  border-radius: 50%;
  padding: 0.5rem;
  width: 2.8rem;
  height: 2.8rem;
}

/* Different accent colors per role card */
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(1) {
  border-top-color: var(--accent-teal);
}
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(2) {
  border-top-color: var(--accent-gold);
}
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(2) .twemoji svg,
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(2) .emojione svg {
  background: var(--accent-gold-light);
}
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(3) {
  border-top-color: #673ab7;
}
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(3) .twemoji svg,
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(3) .emojione svg {
  background: rgba(103, 58, 183, 0.12);
}
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(4) {
  border-top-color: #1565c0;
}
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(4) .twemoji svg,
.md-typeset .grid.cards.role-cards > :is(ul, ol) > li:nth-child(4) .emojione svg {
  background: rgba(21, 101, 192, 0.12);
}

/* ============================================================
   TABLE ENHANCEMENTS — ROW HOVER & AUDIENCE PILLS
   ============================================================ */

.md-typeset table:not([class]) tbody tr {
  transition: background-color 0.15s ease;
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: var(--accent-teal-light) !important;
}

.audience-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  font-size: 0.72em;
  font-weight: 600;
  white-space: nowrap;
  margin: 0.1rem;
  line-height: 1.4;
}

.audience-pill--voters {
  background: var(--accent-teal-light);
  color: var(--accent-teal);
}

.audience-pill--officials {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
}

.audience-pill--attorneys {
  background: rgba(103, 58, 183, 0.12);
  color: #673ab7;
}

.audience-pill--all {
  background: var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color--light);
}

[data-md-color-scheme="slate"] .audience-pill--attorneys {
  background: rgba(186, 146, 255, 0.15);
  color: #ba92ff;
}

/* ============================================================
   DONUT CHART STATISTIC
   ============================================================ */

.stat-callout {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--md-default-bg-color--light);
  border-radius: 8px;
  border-left: 4px solid var(--accent-teal);
  margin: 1rem 0;
}

.stat-donut {
  position: relative;
  flex-shrink: 0;
  width: 90px;
  height: 90px;
}

.stat-donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.stat-donut-bg {
  fill: none;
  stroke: var(--md-default-fg-color--lightest);
  stroke-width: 10;
}

.stat-donut-fill {
  fill: none;
  stroke: var(--accent-teal);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

.stat-donut-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-teal);
}

.stat-donut-label {
  font-size: 0.95rem;
  line-height: 1.6;
}

.stat-donut-label strong {
  font-size: 1.1em;
}

.stat-donut-label cite {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--md-default-fg-color--light);
}

@media screen and (max-width: 600px) {
  .stat-callout {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================================
   PROCESS FLOWCHART
   ============================================================ */

.flowchart {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.flowchart-phase {
  flex: 1;
  min-width: 170px;
  padding: 1rem;
  border-radius: 8px;
  border: 2px solid var(--md-default-fg-color--lightest);
  background: var(--md-default-bg-color);
}

.flowchart-phase--1 { border-top: 4px solid var(--md-primary-fg-color); }
.flowchart-phase--2 { border-top: 4px solid var(--accent-gold); }
.flowchart-phase--3 { border-top: 4px solid var(--tier-red); }

.flowchart-phase-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.3rem;
}

.flowchart-phase-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--md-default-fg-color);
}

.flowchart-phase-desc {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.5rem;
}

.flowchart-phase-timing {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--md-primary-fg-color);
  padding-top: 0.5rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.flowchart-arrow {
  display: flex;
  align-items: center;
  padding: 0 0.3rem;
  color: var(--md-default-fg-color--lighter);
  flex-shrink: 0;
}

.flowchart-arrow svg {
  width: 32px;
  height: 20px;
}

@media screen and (max-width: 768px) {
  .flowchart {
    flex-direction: column;
    gap: 0;
  }
  .flowchart-arrow {
    transform: rotate(90deg);
    padding: 0.3rem 0;
    justify-content: center;
  }
}

/* ============================================================
   RISK COMPARISON BAR CHART
   ============================================================ */

.risk-chart {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
}

.risk-chart h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.risk-bar-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.risk-bar-label {
  flex: 0 0 180px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.risk-bar-track {
  flex: 1;
  height: 24px;
  background: var(--md-default-fg-color--lightest);
  border-radius: 4px;
  overflow: hidden;
}

.risk-bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.risk-bar--extreme { background: #b71c1c; }
.risk-bar--severe  { background: #d32f2f; }
.risk-bar--high    { background: #e65100; }
.risk-bar--moderate { background: #ef6c00; }

@media screen and (max-width: 600px) {
  .risk-bar-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .risk-bar-label {
    text-align: left;
    flex: none;
  }
  .risk-bar-track {
    width: 100%;
  }
}

/* ============================================================
   DOCUMENT UI CARDS
   ============================================================ */

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.doc-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  padding: 1.2rem;
  background: var(--md-default-bg-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

.doc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.doc-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--md-primary-fg-color);
}

.doc-card-icon svg {
  width: 28px;
  height: 28px;
}

.doc-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--md-primary-fg-color);
}

.doc-card-desc {
  font-size: 0.84rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}

.doc-card-audience {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

/* ============================================================
   INTERACTIVE US MAP
   ============================================================ */

.us-map-container {
  width: 100%;
  max-width: 640px;
  margin: 1.5rem auto;
  position: relative;
}

.us-map-container svg {
  width: 100%;
  height: auto;
}

/* Tile grid map — state tiles (<g> with <rect> + <text>) */
.us-map-container .state-tile {
  cursor: pointer;
}

.us-map-container .state-tile .state-rect {
  stroke: var(--md-default-bg-color);
  stroke-width: 2;
  transition: opacity 0.15s ease, stroke 0.15s ease;
}

.us-map-container .state-tile .state-label {
  fill: #ffffff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--md-text-font-family), sans-serif;
  text-anchor: middle;
  pointer-events: none;
}

.us-map-container .state-tier-green .state-rect { fill: var(--tier-green); }
.us-map-container .state-tier-yellow .state-rect { fill: var(--tier-yellow); }
.us-map-container .state-tier-red .state-rect { fill: var(--tier-red); }

.us-map-container .state-tile:hover .state-rect {
  opacity: 0.8;
  stroke: var(--md-default-fg-color);
  stroke-width: 3;
}

.us-map-container .state-tile:focus {
  outline: none;
}

.us-map-container .state-tile:focus .state-rect {
  stroke: var(--accent-teal);
  stroke-width: 3;
}

.map-tooltip {
  position: absolute;
  padding: 0.5rem 0.8rem;
  background: var(--md-default-fg-color);
  color: var(--md-default-bg-color);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.map-tooltip.visible {
  opacity: 1;
}

.us-map-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 0.8rem;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.us-map-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.us-map-legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
}

[data-md-color-scheme="slate"] .us-map-container path.state-path {
  stroke: #1e1e1e;
}

[data-md-color-scheme="slate"] .us-map-container .state-tile .state-rect {
  stroke: var(--md-default-bg-color);
}

/* ============================================================
   STATE TOOLTIPS IN TIER CARDS
   ============================================================ */

.state-link {
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: pointer;
  position: relative;
}

.state-link:hover {
  color: var(--md-primary-fg-color);
}

/* ============================================================
   ACCORDION CONTROLS (EXPAND/COLLAPSE ALL)
   ============================================================ */

.accordion-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.accordion-controls button {
  padding: 0.4rem 1rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 4px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  transition: background 0.15s ease;
}

.accordion-controls button:hover {
  background: var(--md-default-bg-color--light);
}

/* Enhanced accordion styling for ordinance sections */
.md-typeset details.note {
  border-left: 3px solid var(--md-primary-fg-color);
  margin-bottom: 0.5rem;
}

.md-typeset details.note > summary {
  font-weight: 600;
  font-size: 0.95em;
}

/* ============================================================
   SIDEBAR COMPACT STATE SEARCH
   ============================================================ */

.mega-menu-search {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.mega-menu-search input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--md-default-fg-color--lighter);
  border-radius: 4px;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
}

.mega-menu-search input:focus {
  border-color: var(--md-primary-fg-color);
}

.mega-menu-search input::placeholder {
  color: var(--md-default-fg-color--lighter);
}

/* ============================================================
   STATE GUIDE HEADER CARD
   At-a-glance summary card at top of each state guide
   ============================================================ */

.state-header-card {
  background: linear-gradient(135deg, #0D3B1E 0%, #14532D 100%);
  color: #ffffff;
  padding: 1.2rem 1.5rem;
  border-radius: 8px;
  margin: -0.5rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.state-header-card[data-tier="yellow"] {
  background: linear-gradient(135deg, #7c2d12 0%, #9a3412 100%);
}

.state-header-card[data-tier="red"] {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
}

[data-md-color-scheme="slate"] .state-header-card {
  background: linear-gradient(135deg, #0a2a16 0%, #14532D 100%);
}

[data-md-color-scheme="slate"] .state-header-card[data-tier="yellow"] {
  background: linear-gradient(135deg, #5c1d0a 0%, #7c2d12 100%);
}

[data-md-color-scheme="slate"] .state-header-card[data-tier="red"] {
  background: linear-gradient(135deg, #5c1010 0%, #7f1d1d 100%);
}

.state-header-tier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.state-header-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.state-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.state-stat-value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.1;
  color: #EAB308;
}

.state-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  font-weight: 500;
}

@media screen and (max-width: 600px) {
  .state-header-stats {
    gap: 1rem;
  }
  .state-stat-value {
    font-size: 1.1rem;
  }
}

/* ============================================================
   BUTTON / .md-button REFINEMENTS
   Make Material button links feel more polished
   ============================================================ */

.md-typeset .md-button {
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  margin: 0.2rem 0.15rem;
}

.md-typeset .md-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.md-typeset .md-button--primary {
  background-color: var(--md-primary-fg-color);
  border-color: var(--md-primary-fg-color);
  color: #fff !important;
}

.md-typeset .md-button--primary:hover {
  background-color: var(--md-primary-fg-color--dark);
  border-color: var(--md-primary-fg-color--dark);
}

/* ============================================================
   COALITION CARD GRID
   ============================================================ */

.coalition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.coalition-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-left: 3px solid var(--md-primary-fg-color);
  border-radius: 0 6px 6px 0;
  padding: 0.8rem 1rem;
  background: var(--md-default-bg-color);
  font-size: 0.88rem;
}

.coalition-card strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--md-primary-fg-color);
}

.coalition-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.5;
}

/* ============================================================
   PRINT ADDITIONS
   Hide interactive elements in print
   ============================================================ */

@media print {
  .hero-banner {
    background: none !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .hero-banner h1,
  .hero-banner h2,
  .hero-banner p {
    color: inherit !important;
  }
  .us-map-container,
  .stat-callout,
  .urgency-banner,
  .urgency-badge,
  .risk-chart,
  .flowchart,
  .accordion-controls,
  .mega-menu-search {
    display: none !important;
  }
  .state-header-card {
    background: none !important;
    color: inherit !important;
    border: 2px solid #14532D !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .state-stat-value {
    color: #14532D !important;
  }
}
