/*
Theme Name: The Uninformed Electorate Redesign
Theme URI: https://theuniformedelectorate.com/
Author: Codex
Description: A redesigned opinion-politics homepage with accessible dropdown navigation, responsive article sections, and a polished editorial hero.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: uninformed-electorate-redesign
*/

:root {
  color-scheme: light;
  --ink: #151719;
  --muted: #5f666c;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --line: #ded8ce;
  --red: #a33a32;
  --blue: #284c73;
  --gold: #c59a4a;
  --green: #415c48;
  --shadow: 0 20px 60px rgba(21, 23, 25, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

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

.sr-only,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 20;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 250, 247, 0.93);
  border-bottom: 1px solid rgba(21, 23, 25, 0.1);
  backdrop-filter: blur(16px);
}

.utility-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 22px;
  color: var(--muted);
  font-size: 0.82rem;
}

.utility-bar p {
  margin: 0;
}

.utility-bar a {
  color: var(--blue);
  font-weight: 700;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  min-height: 74px;
  margin: 0 auto;
  padding: 0 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.brand strong,
.brand em {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
}

.brand em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-group {
  position: relative;
}

.nav-button,
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.nav-button:hover,
.nav-link:hover,
.nav-button[aria-expanded="true"] {
  background: #ece6da;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  display: grid;
  gap: 22px;
  width: min(720px, calc(100vw - 44px));
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.article-panel {
  grid-template-columns: 1fr 1fr 220px;
}

.topic-panel {
  width: min(540px, calc(100vw - 44px));
  grid-template-columns: 1fr;
}

.dropdown.is-open .dropdown-panel,
.dropdown:focus-within .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-panel a {
  display: block;
  padding: 10px 0;
  border-top: 1px solid #eee8df;
  font-weight: 760;
}

.dropdown-panel a:hover {
  color: var(--red);
}

.panel-kicker,
.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-feature {
  padding: 18px;
  background: #f2eee6;
  border-radius: var(--radius);
}

.panel-feature span {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-feature strong {
  display: block;
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.2;
}

.topic-panel a {
  padding: 14px 0;
}

.topic-panel strong,
.topic-panel span {
  display: block;
}

.topic-panel span {
  color: var(--muted);
  font-size: 0.92rem;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 19px;
  height: 2px;
  background: var(--ink);
  content: "";
}

.menu-icon::before {
  transform: translateY(-6px);
}

.menu-icon::after {
  transform: translateY(4px);
}

.hero {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  background: var(--ink);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 13, 14, 0.82), rgba(12, 13, 14, 0.48) 48%, rgba(12, 13, 14, 0.12));
}

.hero-content {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 22px 52px;
  color: #fff;
}

.hero-content h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 5.4vw, 4.35rem);
  line-height: 0.98;
}

.hero-content p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.16rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 850;
}

.button.primary {
  background: var(--red);
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.section-intro,
.article-grid,
.mission-band,
.newsletter,
.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding-right: 22px;
  padding-left: 22px;
}

.section-intro {
  padding-top: 72px;
  padding-bottom: 24px;
}

.section-intro h2,
.mission-band h2,
.newsletter h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.section-intro p:last-child,
.newsletter p,
.mission-band p {
  color: var(--muted);
  font-size: 1.04rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 70px;
}

.article-card {
  min-height: 254px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(21, 23, 25, 0.06);
}

.article-card:nth-child(2) {
  border-top: 4px solid var(--gold);
}

.article-card:nth-child(3),
.article-card:nth-child(5) {
  border-top: 4px solid var(--blue);
}

.article-card:nth-child(4),
.article-card:nth-child(6) {
  border-top: 4px solid var(--green);
}

.card-meta {
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 18px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.62rem;
  line-height: 1.12;
}

.article-card a:hover {
  color: var(--red);
}

.article-card p {
  margin: 0;
  color: var(--muted);
}

.mission-band {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 70px;
  padding-top: 46px;
  padding-bottom: 46px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.newsletter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 66px;
  padding-top: 32px;
  padding-bottom: 32px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
}

.newsletter p {
  color: rgba(255, 255, 255, 0.74);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--blue);
  font-weight: 760;
}

@media (max-width: 900px) {
  .utility-bar {
    display: none;
  }

  .nav-shell {
    min-height: 68px;
  }

  .menu-toggle {
    display: grid;
  }

  .site-menu {
    position: absolute;
    top: 68px;
    right: 16px;
    left: 16px;
    display: none;
    align-items: stretch;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: calc(100vh - 88px);
    overflow: auto;
  }

  .site-header.menu-open .site-menu {
    display: block;
  }

  .nav-button,
  .nav-link {
    width: 100%;
    justify-content: space-between;
    min-height: 46px;
  }

  .dropdown-panel {
    position: static;
    display: none;
    width: 100%;
    margin: 4px 0 12px;
    padding: 12px 14px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .dropdown.is-open .dropdown-panel {
    display: grid;
  }

  .article-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 590px;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(12, 13, 14, 0.62), rgba(12, 13, 14, 0.88));
  }

  .hero-content {
    padding-top: 106px;
  }

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mission-band {
    grid-template-columns: 1fr;
  }

  .newsletter {
    align-items: flex-start;
    flex-direction: column;
    margin-right: 22px;
    margin-left: 22px;
  }
}

@media (max-width: 620px) {
  .brand strong {
    font-size: 0.98rem;
  }

  .brand em {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-content {
    padding-top: 92px;
    padding-bottom: 70px;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

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

  .site-footer {
    flex-direction: column;
  }
}
