/* =========================================================
   COMPONENTS — reusable UI pieces
   Specificity notes are called out inline: we lean on single
   classes (specificity 0-1-0) everywhere and avoid IDs/!important
   in styling so overrides stay predictable.
   ========================================================= */

/* ---------- Buttons ----------
   .btn is the base (0-1-0 specificity). Modifiers like .btn--primary
   are also single classes, so combined with .btn they're 0-2-0 —
   just specific enough to override the base without a fight. */
.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
}

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

.btn--primary:hover,
.btn--primary:focus {
  background-color: var(--color-primary-dark);
  color: #fff;
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--ghost:hover,
.btn--ghost:focus {
  background-color: var(--color-primary);
  color: #fff;
}

/* Placed on a banner with a dark background — this is a descendant
   selector (.cta-banner .btn--primary), specificity 0-2-0, which
   correctly beats .btn--primary alone (0-1-0) when both apply. */
.cta-banner .btn--primary {
  background-color: #fff;
  color: var(--color-primary);
}

.cta-banner .btn--primary:hover,
.cta-banner .btn--primary:focus {
  background-color: var(--color-accent);
  color: var(--color-text);
}

/* ---------- Nav toggle (mobile hamburger, hidden on desktop via responsive.css) ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-toggle__bar {
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
}

/* Attribute selector: targets the toggle only while it's expanded */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

/* ---------- Cards (issue-card, theatre-card) ---------- */
.issue-card,
.theatre-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.issue-card h3,
.theatre-card h3 {
  margin-bottom: var(--space-2);
}

/* Child combinator (>) — only the DIRECT theatre-card children of
   theatre-grid get the top accent, not cards nested further inside
   another component later on. */
.theatre-grid > .theatre-card--primary {
  border-top: 4px solid var(--color-primary);
}

.theatre-card__tag {
  display: inline-block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

/* ---------- Testimonials ---------- */
.testimonial {
  background-color: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  padding: var(--space-4);
  border-radius: var(--radius);
}

.testimonial p {
  font-style: italic;
  margin-bottom: var(--space-2);
}

.testimonial cite {
  font-style: normal;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Forms ---------- */
.form-field {
  margin-bottom: var(--space-4);
}

.form-field label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 600;
}

.form-field .optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

/* Attribute selectors targeting input types directly, no classes needed */
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Only show the error text when the field carries our JS-added state class.
   Combining an attribute-style state class with a descendant selector. */
.form-field.has-error input,
.form-field.has-error textarea {
  border-color: var(--color-primary);
}

.form-error {
  color: var(--color-primary);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-top: var(--space-1);
}

.form-success {
  background-color: #eaf5ea;
  border: 1px solid #b7dcb7;
  padding: var(--space-3);
  border-radius: var(--radius);
  margin-top: var(--space-3);
}

/* ---------- Get Involved sidebar ---------- */
.ways-list li:not(:last-child) {
  margin-bottom: var(--space-4);
}

.email-template {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  font-size: 0.9rem;
}

.email-template p:first-child {
  font-weight: 700;
  margin-bottom: var(--space-2);
}


/* Alternating color wash + accent bar carry the palette through remaining whitespace */
#voices {
  background: linear-gradient(180deg, var(--color-bg) 0%, #f6ece0 100%);
}

.testimonial {
  border-left-color: var(--color-blue);
}

.section__title {
  position: relative;
  padding-bottom: var(--space-2);
}

.section__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.5rem;
  height: 4px;
  background-color: var(--color-gold);
  border-radius: 2px;
}

/* ---------- Platitude marquee (fills whitespace next to Our Ask image) ---------- */

.platitude-marquee {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
  flex: 1;
  /* Fades the edges so pills appear to scroll in/out rather than clip hard */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.platitude-row {
  display: flex;
  gap: var(--space-3);
  width: max-content;
}

.platitude-row--right {
  animation: marquee-right 22s linear infinite;
}

.platitude-row--left {
  animation: marquee-left 22s linear infinite;
}

/* Pausing on hover lets a reader actually finish a phrase mid-scroll */
.platitude-marquee:hover .platitude-row {
  animation-play-state: paused;
}

.platitude-pill {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.platitude-pill--maroon { background-color: var(--color-maroon); }
.platitude-pill--red    { background-color: var(--color-red); }
.platitude-pill--blue   { background-color: var(--color-blue); }
.platitude-pill--gold   {
  background-color: var(--color-gold);
  color: var(--color-text); /* gold is light, needs dark text for contrast */
}

@keyframes marquee-right {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); } /* -50% because content is duplicated once */
}

@keyframes marquee-left {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* Respect users who've asked their OS/browser to reduce motion */
@media (prefers-reduced-motion: reduce) {
  .platitude-row {
    animation: none;
  }
}