/* ==========================================================================
  Justice Campaign - Base Styles
  Re-skin per campaign by changing the semantic portal tokens below only.
  The token shape follows Tailwind v4 / shadcn-style roles while remaining
  framework-independent and runtime friendly for DB-managed presets.
   ========================================================================== */

:root {
  /* --- Semantic portal tokens (campaign-configurable) --- */
  --portal-background: #ffffff;
  --portal-foreground: #111827;
  --portal-card: #ffffff;
  --portal-card-foreground: #111827;
  --portal-muted: #f8fafc;
  --portal-muted-foreground: #4b5563;
  --portal-border: #dbe1ea;
  --portal-input: #dbe1ea;
  --portal-ring: color-mix(in srgb, #b91c1c 34%, transparent);
  --portal-brand: #1f2937;              /* header, hero, footer */
  --portal-brand-foreground: #f9fafb;
  --portal-brand-muted: #cbd5e1;
  --portal-primary: #b91c1c;            /* CTAs, links, highlights */
  --portal-primary-foreground: #ffffff;
  --portal-primary-hover: #991b1b;
  --portal-accent: color-mix(in srgb, #b91c1c 12%, #ffffff);
  --portal-accent-foreground: #1f2937;
  --portal-heading: var(--portal-brand);
  --portal-link: var(--portal-primary);

  /* --- Legacy aliases. New CSS should prefer --portal-* tokens. --- */
  --color-primary: var(--portal-brand);
  --color-primary-dark: color-mix(in srgb, var(--portal-brand) 82%, #000);
  --color-accent: var(--portal-primary);
  --color-accent-dark: var(--portal-primary-hover);
  --color-bg: var(--portal-background);
  --color-bg-alt: var(--portal-muted);
  --color-surface: var(--portal-card);
  --color-border: var(--portal-border);
  --color-text: var(--portal-foreground);
  --color-text-muted: var(--portal-muted-foreground);
  --color-text-invert: var(--portal-brand-foreground);
  --color-invert-muted: var(--portal-brand-muted);
  --color-on-accent: var(--portal-primary-foreground);
  --color-heading: var(--portal-heading);
  --color-link: var(--portal-link);

  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  /* --- Layout tokens --- */
  --max-width: 1080px;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
  --space: 1rem;
}

/* --- Reset / base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--portal-foreground);
  background: var(--portal-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--portal-link);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--portal-primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3 {
  color: var(--portal-heading);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.5rem 0;
}

.section--alt {
  background: var(--portal-muted);
}

.section__title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.section__lead {
  color: var(--portal-muted-foreground);
  max-width: 60ch;
  margin: 0 0 2rem;
}

/* --- Skip link (a11y) --- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--portal-primary);
  color: var(--portal-primary-foreground);
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-btn, var(--radius));
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--portal-primary);
  color: var(--portal-primary-foreground);
  border-color: var(--portal-primary-hover);
}

.btn--primary:hover,
.btn--primary:focus {
  background: var(--portal-primary-hover);
  color: var(--portal-primary-foreground);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--portal-brand-foreground);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn--ghost:hover,
.btn--ghost:focus {
  background: rgba(255, 255, 255, 0.12);
  color: var(--portal-brand-foreground);
  text-decoration: none;
}

.btn--outline {
  background: transparent;
  color: var(--portal-primary);
  border-color: var(--portal-primary);
}

.btn--outline:hover,
.btn--outline:focus {
  background: var(--portal-primary);
  color: var(--portal-primary-foreground);
  text-decoration: none;
}

/* ==========================================================================
   Header / Nav  (PARTIAL: header)
   ========================================================================== */
.site-header {
  background: var(--portal-brand);
  color: var(--portal-brand-foreground);
  border-bottom: 1px solid color-mix(in srgb, var(--portal-brand-foreground) 18%, transparent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--portal-brand-foreground);
}

.brand:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  color: var(--portal-brand-foreground);
  font-weight: 500;
}

.nav a:hover {
  color: var(--portal-brand-foreground);
}

.nav__language {
  position: relative;
  display: inline-block;
}

.nav__language summary {
  display: inline-flex;
  min-height: 2.2rem;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid color-mix(in srgb, var(--portal-brand-foreground) 28%, transparent);
  border-radius: 0.55rem;
  padding: 0.35rem 0.65rem;
  color: var(--portal-brand-foreground);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
}

.nav__language summary::-webkit-details-marker {
  display: none;
}

.nav__language[open] summary,
.nav__language summary:hover {
  background: var(--portal-brand-foreground);
  color: var(--portal-brand);
}

.nav__language-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 260;
  display: grid;
  min-width: 11rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--portal-brand-foreground) 18%, transparent);
  border-radius: 0.75rem;
  background: var(--portal-card);
  box-shadow: var(--shadow);
  padding: 0.35rem;
}

.nav__language-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 0.5rem;
  color: var(--portal-foreground);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 0.7rem;
}

.nav__language-menu a:hover,
.nav__language-menu a[aria-current="true"] {
  background: var(--portal-accent);
  color: var(--portal-accent-foreground);
  text-decoration: none;
}

.nav__language-code {
  color: var(--portal-muted-foreground);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--portal-brand-foreground);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

/* Offcanvas close button + backdrop (shown on mobile only) */
.nav-close {
  display: none;
}

.nav-backdrop {
  display: none;
}

/* ==========================================================================
   Hero  (PARTIAL/component: Hero)
   ========================================================================== */
.hero {
  background: linear-gradient(180deg, var(--portal-brand) 0%, var(--color-primary-dark) 100%);
  color: var(--portal-brand-foreground);
  padding: 4rem 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--portal-brand-foreground), var(--portal-primary) 50%);
  margin: 0 0 0.75rem;
}

.hero h1 {
  color: var(--portal-brand-foreground);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  margin-bottom: 0.75rem;
}

.hero__tagline {
  font-size: 1.15rem;
  color: var(--portal-brand-muted);
  max-width: 50ch;
  margin: 0 0 1.75rem;
}

.hero__actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hero__media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

.hero__placeholder {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  color: var(--portal-brand-muted);
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   Status / Timeline  (component: StatusSection)
   ========================================================================== */
.status__current {
  position: relative;
  background: color-mix(in srgb, var(--portal-card) 88%, var(--portal-muted));
  border: 1px solid color-mix(in srgb, var(--portal-border) 86%, transparent);
  border-radius: calc(var(--radius) * 0.9);
  padding: clamp(1.1rem, 2vw, 1.5rem) clamp(1.15rem, 2.5vw, 1.75rem);
  margin: 0 0 2.5rem;
  max-width: 78ch;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--portal-border) 55%, transparent);
}

.status__current::before {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 0;
  width: 3px;
  height: calc(100% - 2.5rem);
  min-height: 2.75rem;
  border-radius: 999px;
  background: var(--portal-primary);
}

.status__label {
  margin: 0 0 0.45rem;
  color: var(--portal-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.status__text {
  margin: 0;
  color: var(--portal-foreground);
  font-size: clamp(1rem, 1.1vw, 1.08rem);
  line-height: 1.75;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--portal-border);
}

.timeline__item {
  position: relative;
  padding: 0 0 1.5rem 2.25rem;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--portal-primary);
  border: 3px solid var(--portal-muted);
}

.timeline__date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--portal-primary);
  letter-spacing: 0.02em;
}

.timeline__title {
  font-size: 1.05rem;
  margin: 0.15rem 0 0.25rem;
}

.timeline__detail {
  margin: 0;
  color: var(--portal-muted-foreground);
}

.appeals {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.appeals li {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  padding-left: 2.5rem;
  position: relative;
}

.appeals li::before {
  content: "\2713";
  position: absolute;
  left: 1rem;
  color: var(--portal-primary);
  font-weight: 800;
}

/* ==========================================================================
   Support / How to help  (component: SupportSection)
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--portal-card);
  color: var(--portal-card-foreground);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.card p {
  margin: 0 0 1rem;
  color: var(--portal-muted-foreground);
}

/* ==========================================================================
   Media & Coverage  (component: MediaSection)
   ========================================================================== */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.news-item {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.news-item__link {
  font-weight: 600;
  color: var(--portal-heading);
}

.news-item__link:hover,
.news-item__link:focus {
  color: var(--portal-primary);
}

.news-item__meta {
  font-size: 0.85rem;
  color: var(--portal-muted-foreground);
}

.section__subheading {
  margin: 2.5rem 0 1rem;
  font-size: 1.25rem;
  color: var(--portal-heading);
}

/* ==========================================================================
   Image gallery
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.gallery-card {
  margin: 0;
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gallery-card__button {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-card__button img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.gallery-card__button:hover img,
.gallery-card__button:focus img {
  transform: scale(1.025);
  filter: contrast(1.04);
}

.gallery-card__caption {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem 1rem;
  color: var(--portal-muted-foreground);
  font-size: 0.92rem;
}

.gallery-card__caption strong {
  color: var(--portal-heading);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.82);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__dialog {
  position: relative;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
}

.lightbox__image {
  max-height: 82vh;
  width: auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

.lightbox__caption {
  margin: 0.75rem 2.75rem 0 0;
  color: #f9fafb;
  font-weight: 600;
}

.lightbox__close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

/* ==========================================================================
   Videos
   ========================================================================== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.video-card {
  margin: 0;
}

.video-card__title {
  margin: 0.6rem 0 0;
  font-weight: 600;
  color: var(--portal-heading);
}

/* Click-to-load YouTube facade (loads the iframe only on click) */
.yt-facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background-color: #000;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.yt-facade::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.15s ease;
}

.yt-facade:hover::after,
.yt-facade:focus::after {
  background: rgba(0, 0, 0, 0.05);
}

.yt-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  border-radius: 12px;
  background: var(--portal-primary);
  z-index: 1;
}

.yt-facade__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 52%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}

.yt-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.yt-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.yt-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-placeholder {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--portal-muted);
  border: 1px dashed var(--portal-border);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--portal-muted-foreground);
  font-size: 0.9rem;
}

/* ==========================================================================
   Contact strip
   ========================================================================== */
.contact-strip {
  background: var(--portal-brand);
  color: var(--portal-brand-foreground);
  text-align: center;
  padding: 3rem 0;
}

.contact-strip h2 {
  color: var(--portal-brand-foreground);
}

.contact-strip a.email {
  color: color-mix(in srgb, var(--portal-primary), #ffffff 55%);
  font-weight: 600;
  font-size: 1.15rem;
}

/* --- Contact form --- */
.contact-form {
  margin-top: 1.5rem;
  max-width: 640px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  font-weight: 600;
  color: var(--portal-heading);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.form-row .req {
  color: var(--portal-primary);
}

.form-row .optional {
  color: var(--portal-muted-foreground);
  font-weight: 400;
  font-size: 0.85rem;
}

.form-row input,
.form-row textarea {
  width: 100%;
  font: inherit;
  color: var(--portal-foreground);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--portal-input);
  border-radius: var(--radius);
  background: var(--portal-card);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-row textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 3px var(--portal-ring);
}

.form-row input[aria-invalid="true"],
.form-row textarea[aria-invalid="true"] {
  border-color: var(--portal-primary);
}

.form-error {
  display: block;
  min-height: 1.1em;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--portal-primary);
}

/* Honeypot: visually hidden, off-screen */
.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form button[type="submit"] {
  margin-top: 0.25rem;
}

.contact-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  margin: 1rem 0 0;
  font-weight: 600;
}

.form-status.is-success {
  color: #15803d;
}

.form-status.is-error {
  color: var(--portal-primary);
}

.note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: #92400e;
  font-size: 0.95rem;
}

/* ==========================================================================
   Footer  (PARTIAL: footer)
   ========================================================================== */
.site-footer {
  background: color-mix(in srgb, var(--portal-brand) 82%, #000);
  color: var(--portal-brand-muted);
  border-top: 1px solid color-mix(in srgb, var(--portal-brand-foreground) 14%, transparent);
  padding: 2.5rem 0 2rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: #d1d5db;
}

.site-footer__disclaimer {
  max-width: 70ch;
  margin: 0 0 1rem;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  color: color-mix(in srgb, var(--portal-brand-muted) 74%, var(--portal-brand));
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  /* Right-side offcanvas panel */
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(80vw, 320px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--portal-brand);
    padding: 3.75rem 0 1.25rem;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0.28s ease;
    z-index: 200;
    overflow-y: auto;
  }

  .nav.is-open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: -6px 0 28px rgba(0, 0, 0, 0.35);
  }

  .nav a {
    padding: 0.9rem 1.5rem;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav__language {
    display: block;
    padding: 0.9rem 1.5rem;
  }

  .nav__language summary {
    justify-content: space-between;
    width: 100%;
  }

  .nav__language-menu {
    position: static;
    margin-top: 0.55rem;
    min-width: 0;
    box-shadow: none;
  }

  .nav__language-menu a {
    width: 100%;
    border-bottom: 0;
    padding: 0.65rem 0.7rem;
  }

  .nav-close {
    display: block;
    position: absolute;
    top: 0.6rem;
    right: 0.9rem;
    background: none;
    border: 0;
    color: var(--portal-brand-foreground);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.5rem;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    z-index: 150;
  }

  .nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
  }

  .hero__grid {
    grid-template-columns: 1fr;
  }

  .hero__media {
    order: -1;
    max-width: 320px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Prevent background scroll while the offcanvas menu is open */
body.nav-lock {
  overflow: hidden;
}
