/* ==========================================================================
   Rachel Cuevas Campaign — SHARED COMPONENTS
   Buttons, announcement bar, site header/nav, mobile menu, footer.
   Requires tokens.css, base.css, layout.css to be loaded first.

   This file backs the markup in /partials/header.html and
   /partials/footer.html. Every page that copies those partials must also
   load this stylesheet.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75em 1.5em;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-bold);
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base),
    background-color var(--transition-base), color var(--transition-base);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover-lift);
}

.btn--primary {
  background-color: var(--color-red);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-red-bright);
  color: var(--color-white);
}

.btn--secondary {
  background-color: transparent;
  border-color: var(--color-navy-primary);
  color: var(--color-navy-primary);
}

.btn--secondary:hover {
  background-color: var(--color-navy-primary);
  color: var(--color-white);
}

.btn--on-dark {
  background-color: var(--color-white);
  color: var(--color-navy-primary);
}

.btn--on-dark:hover {
  background-color: var(--color-offwhite);
}

/* Larger/wider Donate call-to-action used specifically in the site header's
   primary nav and mobile menu — kept as its own modifier so other
   .btn--primary uses (hero, forms) aren't affected. */
.btn--nav-donate {
  padding: 0.85em 2em;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   Card — generic content card used inside .grid-3 / .grid-4
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover-lift);
}

.section--navy .card,
.section--red .card {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   News card — editorial article preview, used on the homepage and news.html.
   Extends .card but overrides padding so the thumbnail image can bleed to
   the card's top/side edges, with a padded body below for text.
   -------------------------------------------------------------------------- */
.news-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-card[hidden] {
  display: none;
}

.news-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.news-card__body {
  padding: var(--space-lg);
}

.news-card__category {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-bold);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-blue);
  margin-bottom: var(--space-xs);
}

.news-card__title {
  margin-bottom: var(--space-xs);
  font-size: 1.25rem;
}

.news-card__date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.news-card__excerpt {
  margin-bottom: var(--space-sm);
}

.news-card__link {
  font-weight: var(--font-weight-body-bold);
}

/* --------------------------------------------------------------------------
   Announcement bar
   -------------------------------------------------------------------------- */
.announcement-bar {
  background-color: var(--color-navy-secondary);
  color: var(--color-white);
  font-size: 0.875rem;
  font-weight: var(--font-weight-body-medium);
}

.announcement-bar__inner {
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding: var(--space-xs) var(--container-padding-inline);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  text-align: center;
  position: relative;
}

.announcement-bar__inner p{
  padding:5px 0px;
  margin:0px 0px 0px 0px;
}

.announcement-bar__link {
  color: var(--color-white);
  text-decoration: underline;
  font-weight: var(--font-weight-body-bold);
  white-space: nowrap;
}

.announcement-bar__dismiss {
  position: absolute;
  right: var(--container-padding-inline);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-white);
  font-size: 1.1rem;
  line-height: 1;
  padding: var(--space-xs);
}

/* JS-driven hide state — the mobile-nav/scroll JS stage toggles this class */
.announcement-bar.is-dismissed {
  display: none;
}

/* --------------------------------------------------------------------------
   Site header
   -------------------------------------------------------------------------- */
.site-header {
  /* Intentionally not sticky — only the donate bar (home.css .donate-bar)
     sticks to the viewport top once scrolled. */
  z-index: var(--z-header);
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  transition: padding var(--transition-base) var(--ease-standard),
    box-shadow var(--transition-base);
}

.site-header__inner {
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding-inline);
  padding-block: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  transition: padding var(--transition-base) var(--ease-standard);
}

/* Campaign text lockup */
.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-decoration: none;
  color: var(--color-navy-primary);
}

.site-logo:hover {
  color: var(--color-navy-primary);
}

.site-logo__image {
  display: block;
  align-self: flex-start;
  height: 88px;
  width: auto;
  transition: height var(--transition-base);
}

/* --------------------------------------------------------------------------
   Primary navigation (desktop)
   -------------------------------------------------------------------------- */
.primary-nav__list {
  display: none;
}

.primary-nav__link {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-text-dark);
  font-weight: var(--font-weight-body-medium);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition-base), background-color var(--transition-base);
}

.primary-nav__link:hover {
  color: var(--color-blue);
  background-color: var(--color-offwhite);
}

.primary-nav__link.is-active,
.primary-nav__link.is-active:hover {
  color: var(--color-white);
  background-color: var(--color-blue);
  font-weight: var(--font-weight-body-bold);
}

@media (min-width: 960px) {
  .primary-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
  }
}

/* --------------------------------------------------------------------------
   Mobile menu toggle + panel
   JS stage should: toggle `is-open` on #mobile-menu-panel and the toggle
   button, swap aria-expanded on #mobile-menu-toggle, trap focus while open,
   close on Escape, and toggle aria-hidden on the panel.
   -------------------------------------------------------------------------- */
.mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--color-navy-primary);
}

.mobile-menu-toggle:hover {
  background-color: var(--color-offwhite);
}

@media (min-width: 960px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu-toggle__icon {
  width: 24px;
  height: 24px;
}

#mobile-menu-panel {
  position: fixed;
  inset: 0;
  z-index: var(--z-mobile-menu);
  background-color: var(--color-navy-primary);
  color: var(--color-white);
  padding: var(--space-2xl) var(--space-lg);
  transform: translateX(100%);
  transition: transform var(--transition-slow) var(--ease-standard);
  overflow-y: auto;
}

/* JS adds .is-open to #mobile-menu-panel to reveal it */
#mobile-menu-panel.is-open {
  transform: translateX(0);
}

@media (min-width: 960px) {
  #mobile-menu-panel {
    display: none;
  }
}

.mobile-menu__close {
  color: var(--color-white);
  font-size: 1.1rem;
  margin-bottom: var(--space-lg);
}

.mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.mobile-menu__link {
  display: block;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  text-decoration: none;
  padding-block: var(--space-xs);
  border-radius: var(--radius-sm);
}

.mobile-menu__link.is-active {
  padding-inline: var(--space-sm);
  background-color: var(--color-blue);
  font-weight: var(--font-weight-body-bold);
}

/* --------------------------------------------------------------------------
   Site footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--color-navy-primary);
  color: var(--color-white);
  padding-block: var(--space-2xl) var(--space-xl);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: var(--color-white);
}

.footer-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border-on-dark);
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-lockup__name {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-heading-black);
  font-size: 1.5rem;
  color: var(--color-white);
}

.footer-lockup__tagline {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.footer-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-contact__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-social__list {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
  display: flex;
  gap: var(--space-sm);
}

.footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color var(--transition-base);
}

.footer-social__link:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Disclaimer box — must read as a visually distinct disclosure, not blended
   into regular footer copy. */
.footer-disclaimer {
  margin-top: var(--space-xl);
  border: 1px solid var(--color-border-on-dark);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}

.footer-bottom {
  margin-top: var(--space-md);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   JS-STAGE ADDITIONS (assets/js/main.js)
   Small, minimal-scope rules the JS layer depends on that weren't already
   defined elsewhere. Added here rather than in the JS file since this is
   the shared stylesheet loaded on every page.
   ========================================================================== */

/* Mobile menu open state: prevents the page behind #mobile-menu-panel from
   scrolling while the panel is open. Toggled on <body> by main.js. */
body.no-scroll {
  overflow: hidden;
}

/* Form validation invalid-field state: applied by main.js alongside
   aria-invalid="true" whenever a required field fails validation. The
   .field-error message span already has its own styling (see home.css /
   pages.css) — this rule highlights the input/select/textarea itself. */
.form-field input.has-error,
.form-field select.has-error,
.form-field textarea.has-error {
  border-color: var(--color-red-bright);
  outline: 2px solid var(--color-red-bright);
  outline-offset: 1px;
}

/* --------------------------------------------------------------------------
   Scroll-reveal animation convention (JS stage: assets/js/main.js)
   Opt any element/section into a soft fade + upward reveal by adding
   `data-animate="fade-up"` to it in the page markup (other data-animate
   values are also accepted by the JS, which only checks for the attribute's
   presence). main.js uses IntersectionObserver to add `.is-visible` once
   the element scrolls into view, and reduces to an immediate reveal (no
   animation) when prefers-reduced-motion is set.
   -------------------------------------------------------------------------- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow) var(--ease-standard),
    transform var(--transition-slow) var(--ease-standard);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-animate] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Sample/placeholder content badge — small pill used on any card showing
   fictional sample content (news cards, endorsement cards) so it reads at a
   glance as not-yet-real. Lives here (rather than per-page stylesheets)
   because it's used on both home.css and pages.css pages, plus the shared
   modal below.
   -------------------------------------------------------------------------- */
.sample-badge--card {
  flex-shrink: 0;
  padding: 0.2em 0.6em;
  border: 1px solid var(--color-red);
  border-radius: var(--radius-full);
  color: var(--color-red);
  background-color: var(--color-white);
  font-size: 0.7rem;
  font-weight: var(--font-weight-body-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Detail modal (JS stage: assets/js/main.js)
   Generic popup used to show extra detail for a card-style trigger — first
   used for endorsement cards that carry a longer written statement. One
   .modal instance lives per page; main.js reads data-name/data-org/
   data-image/data-detail off whichever [data-modal-trigger] was clicked and
   fills in the matching [data-modal-*] slots below before opening it.
   -------------------------------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal.is-open {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(7, 27, 51, 0.75);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--color-white);
  color: var(--color-text-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  text-align: center;
}

.modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-size: 1.25rem;
  line-height: 1;
}

.modal__close:hover {
  background-color: var(--color-offwhite);
  color: var(--color-text-dark);
}

.modal__image {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin: 0 auto var(--space-md);
}

.modal__badge {
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.modal__name {
  margin-bottom: 0;
}

.modal__org {
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.modal__detail {
  margin: 0;
  padding-left: var(--space-md);
  border-left: 3px solid var(--color-red);
  text-align: left;
  font-style: italic;
  color: var(--color-text-dark);
}

@media (prefers-reduced-motion: no-preference) {
  .modal__dialog {
    animation: modal-pop var(--transition-base) var(--ease-standard);
  }
}

/* --------------------------------------------------------------------------
   Split layout — copy + image side by side. Used on the homepage (campaign
   intro, bio-split section) and Meet Rachel's biography sections. Add
   .intro-grid--reverse to move the image to the right (default puts
   whichever of .intro-grid__media / .intro-grid__body comes first in the
   markup on the left).
   -------------------------------------------------------------------------- */
.intro-grid {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 780px) {
  .intro-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .intro-grid--reverse .intro-grid__media {
    order: 2;
  }
}

.intro-grid__media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
}

.intro-grid__body h2 {
  margin-bottom: var(--space-lg);
}

.intro-grid__body .btn {
  margin-top: var(--space-sm);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
