/* ==========================================================================
   2027 Election Page
   Template: templates/2027-election-page.php
   Loaded only on this template (registered in the $templates array).
   Relies on tokens + fonts from main.css and .btn/.container from Bootstrap.
   ========================================================================== */

/* Page-specific token: the mockup's red button has no equivalent in main.css.
   Confirm the exact CCPSA brand red before shipping. */
:root {
  --red-color: #c8202f;
}

/* --------------------------------------------------------------------------
   Buttons — layered on Bootstrap's .btn (base padding/radius come from BS).
   Color modifiers only. Note: global `a { text-decoration: underline;
   font-weight: 700 !important }` applies since these are <a> tags, so we
   reset decoration here; the 700 weight is fine for buttons.
   -------------------------------------------------------------------------- */
.btn--red,
.btn--blue,
.btn--white,
.btn--outline {
  padding: 1.125rem 1.5rem; /* 18px / 24px */
  font-family: var(--body-font);
  font-size: 0.875rem; /* 14px */
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}

.btn--red {
  background-color: var(--red-color);
  color: var(--text-white);
}
.btn--red:hover,
.btn--red:focus-visible {
  background-color: color-mix(in srgb, var(--red-color) 85%, black);
  color: var(--text-white);
}
.btn--red:visited {
  color: var(--text-white);
}

.btn--blue {
  background-color: var(--primary-color);
  color: var(--text-white);
}
.btn--blue:hover,
.btn--blue:focus-visible {
  background-color: color-mix(in srgb, var(--primary-color) 85%, black);
  color: var(--text-white);
}
.btn--blue:visited {
  color: var(--text-white);
}

.btn--white {
  background-color: var(--text-white);
  color: var(--primary-color);
}
.btn--white:hover,
.btn--white:focus-visible {
  background-color: color-mix(in srgb, var(--text-white) 88%, black);
  color: var(--primary-color);
}
.btn--white:visited {
  color: var(--primary-color);
}

/* Outline variant for the secondary buttons in later sections */
.btn--outline {
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}
.btn--outline:hover,
.btn--outline:focus-visible {
  background-color: var(--primary-color);
  color: var(--text-white);
}
.btn--outline:visited {
  color: var(--primary-color);
}
.btn--outline:visited:hover {
  color: var(--text-white);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 670px;
  padding: 4rem 1.25rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-align: center;
  overflow: hidden;
}

/* Dark tint so the white text stays readable over the photo */
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.2)),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 14.63%, rgba(0, 0, 0, 0.5) 102.39%);
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1200px;
  color: var(--text-white);
}

.hero__heading {
  margin: 0 0 1.188rem;
  color: var(--text-white);
  font-size: 4.25rem; /* 68px */
  font-weight: 700;
  line-height: 1.1;
}

/* !important needed only to defeat main.css's global `p { margin: ... !important }`
   which would otherwise clamp the subheading spacing. */
.hero__subheading {
  margin: 0 0 3.875rem !important;
  color: var(--text-white);
  font-family: var(--heading-font); /* <p> defaults to body font, override */
  font-size: 2.4375rem; /* 39px */
  font-weight: 600;
  line-height: 1.25;
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero__heading {
    font-size: 3.5rem; /* 56px */
  }
  .hero__subheading {
    font-size: 2rem; /* 32px */
  }
}

@media (max-width: 768px) {
  .hero__heading {
    font-size: 2.75rem; /* ~44px */
  }
  .hero__subheading {
    font-size: 1.75rem; /* ~28px */
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 520px;
  }
  .hero__buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn--red,
  .btn--blue,
  .btn--outline {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Shared WYSIWYG output (.election-rte)
   Lists typed in a WYSIWYG field come out as plain <ul>, so re-apply the
   red star bullet here. NOTE: path is ../../images/ because this file lives
   in /css/page/ (main.css uses ../images/ from /css/).
   -------------------------------------------------------------------------- */
.election-rte p {
  font-size: 16px;
}
.election-rte ul {
  list-style: none;
  padding-left: 0;
  margin-left: 20px;
}
.election-rte ul li {
  position: relative;
  margin-bottom: 10px;
}
.election-rte ul li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 6px;
  width: 16px;
  height: 16px;
  background-image: url(../../images/star.svg);
  background-size: contain;
  background-repeat: no-repeat;
}

/* --------------------------------------------------------------------------
   Section 2 — About / Community Leaders
   -------------------------------------------------------------------------- */
.about {
  padding-block: 4.375rem;
}

.about__header {
  display: flex;
  align-items: center;
  gap: 2.125rem;
  margin-bottom: 2rem;
}
.about__icon {
  width: 110px;
  height: auto;
  flex-shrink: 0;
}
.about__heading {
  margin: 0;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem; /* 40px */
  line-height: 54px;
  max-width: 750px;
}

.about__intro .col-md-6 p {
  font-size: 16px;
  max-width: 550px;
}

/* 60px spacing between columns (intro pair + feature image/text) */
.about__intro,
.about__feature {
  --bs-gutter-x: 60px;
}

/* .row already carries margin-bottom: 40px from main.css */
.about__feature-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.about__feature-heading {
  margin: 0 0 1rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 54px;
}

.about__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.125rem;
}

@media (max-width: 768px) {
  .about__header {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .about__heading {
    font-size: 2rem;
  }
  .about__feature-image {
    margin-bottom: 1.5rem;
  }
  .about__buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   Section 3 — What are District Councils
   -------------------------------------------------------------------------- */
.what-dcs {
  padding-block: 4.375rem;
  background-color: #f5f7fa;
  padding-block: 4.375rem;
}

.what-dcs__row {
  --bs-gutter-x: 60px;
}

.what-dcs__heading {
  margin: 0 0 1rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem; /* 40px */
  line-height: 54px;
}

.what-dcs__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.what-dcs__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.125rem;
}

@media (max-width: 768px) {
  .what-dcs__heading {
    font-size: 2rem;
  }
  .what-dcs__image {
    margin-top: 1.5rem;
  }
  .what-dcs__buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   Section 4 — What do District Councilors do
   -------------------------------------------------------------------------- */
.what-do {
  padding-block: 4.375rem;
}

.what-do__header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}
.what-do__heading {
  margin: 0 0 1rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem; /* 40px */
  line-height: 54px;
}

.what-do__grid {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 1.5rem;
}

.what-do__card {
  height: 100%;
  padding: 2rem 1.5rem;
  text-align: center;
  background-color: var(--text-white);
  border: 1px solid #245391;
  border-radius: 12px;
}
.what-do__icon {
  display: block;
  margin-inline: auto;
  width: 65px;
  height: 65px;
}
.what-do__intro p {
  font-size: 20px;
}
.what-do__card-title {
  margin: 1rem 0 0.75rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.25rem; /* 20px */
  line-height: 1.3;
}
.what-do__card-desc {
  color: var(--text-color);
  font-size: 16px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .what-do__heading {
    font-size: 2rem;
  }
}

/* --------------------------------------------------------------------------
   Section 5 — How to Decide if You Should Run
   -------------------------------------------------------------------------- */
.decide {
  background-color: #f5f7fa;
  padding-block: 4.375rem;
}

/* Absorb the 60px row gutter's -30px negative margins so it doesn't
   overflow Bootstrap's default ~12px container padding. */
.decide > .container {
  padding-inline: 30px;
}

.decide__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.decide__heading {
  margin: 0 0 1rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem; /* 40px */
  line-height: 54px;
}

.decide__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.125rem;
}

@media (max-width: 768px) {
  .decide__heading {
    font-size: 2rem;
  }
  .decide__image {
    margin-bottom: 1.5rem;
  }
  .decide__buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (min-width: 768px) {
  .decide__row > .col-lg-6:first-child {
    padding-right: 30px;
  }
  .decide__row > .col-lg-6:last-child {
    padding-left: 30px;
  }
}

/* --------------------------------------------------------------------------
   Section 6 — Legal Eligibility Requirements
   -------------------------------------------------------------------------- */
.legal {
  padding-block: 4.375rem;
}

.legal__heading {
  margin: 0 0 2rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem; /* 40px */
  line-height: 54px;
}

.legal__row {
  --bs-gutter-x: 60px;
}

.legal__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.125rem;
}

@media (max-width: 768px) {
  .legal__heading {
    font-size: 2rem;
  }
  .legal__buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   Section 7 — Election Timeline & Important Dates
   -------------------------------------------------------------------------- */
.timeline {
  padding-block: 0.5rem;
}

.timeline__card {
  background-color: var(--primary-color); /* adjust if the card blue differs */
  border-radius: 20px;
  padding: 4rem 2rem;
}

.timeline__heading {
  margin: 0 0 3.5rem;
  color: var(--text-white);
  text-align: center;
  font-weight: 700;
  font-size: 2.5rem; /* 40px */
  line-height: 1.2;
}

.timeline__track {
  display: flex;
  align-items: flex-start;
}

.timeline__item {
  flex: 1;
  position: relative;
  text-align: center;
  padding-inline: 0.5rem;
}

/* Connector line between icons: spans from this icon's center to the next
   item's center. Sits behind the white icon circles, which mask it. */
.timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 40px; /* center of the 80px icon */
  left: 50%;
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.4);
  z-index: 0;
  transform: translateY(-0.5px); /* true-center the 1px line */
}

.timeline__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background-color: var(--text-white);
  border-radius: 50%;
  box-shadow: 0 0 0 28px var(--primary-color); /
}
.timeline__icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.timeline__date {
  margin: 0 0 0.25rem !important; /* beats global p !important */
  color: var(--text-white);
  font-weight: 700;
  font-size: 1.25rem; /* 20px */
}
.timeline__label {
  margin: 0 !important; /* beats global p !important */
  color: var(--text-white);
  font-size: 16px;
}

@media (max-width: 768px) {
  .timeline__track {
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
  }
  /* No horizontal connectors when stacked */
  .timeline__item:not(:last-child)::before {
    display: none;
  }
  .timeline__heading {
    font-size: 2rem;
  }
}

/* --------------------------------------------------------------------------
   Section 8 — The Petition Process and Key Election Dates
   -------------------------------------------------------------------------- */
.petition {
  padding-block: 4.375rem;
}

.petition__row {
  --bs-gutter-x: 60px;
}

.petition__heading {
  margin: 0 0 1rem;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem; /* 40px */
  line-height: 54px;
}

.petition__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.petition__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 3.125rem;
}

@media (max-width: 768px) {
  .petition__heading {
    font-size: 2rem;
  }
  .petition__image {
    margin-top: 1.5rem;
  }
  .petition__buttons {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Neutralize the 60px row gutter's negative margins (the overflow source)
   and rebuild the 60px column gap with padding instead. */
@media (max-width: 991.98px) {
  .about__intro,
  .about__feature,
  .what-dcs__row,
  .decide__row,
  .legal__row,
  .petition__row {
    --bs-gutter-x: 0;
  }

  .about__feature-image,
  .what-dcs__image,
  .decide__image,
  .petition__image {
    margin-bottom: 1.5rem;
  }
}
