/*
Theme Name: BHHC Housing Coalition — Child
Theme URI: https://housingcoalition.co.uk
Template: bhhc-theme
Author: Brighton & Hove Housing Coalition
Author URI: https://housingcoalition.co.uk
Description: Child theme for BHHC Housing Coalition. Overrides + patch for all missing homepage classes. 10th Anniversary Edition 2016–2026.
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bhhc-child
*/

/*
 * ============================================================
 * LOAD ORDER:
 * 1. Parent theme style.css   — brand tokens, base reset, core components
 * 2. This file                — patch for 54 missing classes + child overrides
 * ============================================================
 * The parent theme's full stylesheet is loaded via functions.php
 * with wp_enqueue_style() — do NOT use @import here.
 * ============================================================
 */

/* ============================================================
   SECTION A — HOMEPAGE HERO PATCH
   Parent uses .hero / .hero-title
   HTML uses .page-hero / .hero-h1 / .hero-inner etc.
   ============================================================ */

.page-hero {
  position: relative;
  background: var(--deep-navy);
  color: #fff;
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.homepage-hero {
  min-height: 85vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(42,157,143,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 70% at 80% 30%, rgba(15,76,92,0.14) 0%, transparent 60%),
    var(--deep-navy);
}

/* Circuit grid watermark */
.homepage-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15,76,92,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,76,92,0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-12));
  padding-block: var(--space-8);
}

.hero-h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.75);
  max-width: 52ch;
  line-height: 1.65;
  margin-bottom: var(--space-8);
}

.hero-ctas {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.hero-ctas .btn {
  min-width: 200px;
  justify-content: center;
}

.anniversary-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.22);
  border-radius: var(--radius-full);
  color: rgba(255,215,0,0.8);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: var(--space-8);
}

/* ── Highlight underline ──────────────────────────────── */

.highlight-underline {
  position: relative;
  display: inline;
}
.highlight-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.05em;
  width: 100%;
  height: 0.22em;
  background: var(--color-accent);
  z-index: -1;
  border-radius: 2px;
  opacity: 0.75;
}

/* ── Exhibit stamp ────────────────────────────────────── */

.exhibit-stamp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  border: 2px solid rgba(255,215,0,0.35);
  border-radius: var(--radius-sm);
  color: var(--safety-yellow);
  background: rgba(255,215,0,0.06);
  margin-bottom: var(--space-5);
}

.exhibit-stamp--hero {
  border-color: rgba(255,215,0,0.3);
}

/* ============================================================
   SECTION B — LANGUAGE BANNER
   ============================================================ */

.language-banner {
  background: #0c1420;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-block: var(--space-2);
  position: relative;
  z-index: 101; /* above header */
}

.language-banner-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-12));
}

.lang-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  white-space: nowrap;
}

.lang-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.lang-btn {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  cursor: pointer;
  transition:
    background var(--transition-interactive),
    color var(--transition-interactive),
    border-color var(--transition-interactive);
  line-height: 1.7;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
}

.lang-btn:hover,
.lang-btn[aria-pressed="true"] {
  background: rgba(255,215,0,0.1);
  color: var(--safety-yellow);
  border-color: rgba(255,215,0,0.3);
}

.lang-btn--reset {
  color: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.06);
  margin-left: var(--space-2);
}

.lang-btn--reset:hover {
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}

/* ============================================================
   SECTION C — URGENT TICKER
   ============================================================ */

.urgent-ticker {
  background: var(--campaign-red);
  color: #fff;
  overflow: hidden;
  padding-block: var(--space-2);
  position: relative;
  z-index: 100;
}

.ticker-inner {
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.ticker-label {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.22);
  padding: 3px var(--space-4);
  flex-shrink: 0;
  margin-right: var(--space-3);
  white-space: nowrap;
}

.ticker-track {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.ticker-content {
  display: flex;
  gap: var(--space-10);
  white-space: nowrap;
  animation: ticker-scroll 45s linear infinite;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ticker-content span {
  flex-shrink: 0;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-content { animation: none; }
  .ticker-track { overflow-x: auto; }
}

/* ============================================================
   SECTION D — NAVIGATION DROPDOWN
   ============================================================ */

.nav-dropdown {
  position: relative;
}

.nav-has-dropdown {
  display: flex;
  align-items: center;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
  flex-direction: column;
  z-index: 150;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-menu a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition:
    background var(--transition-interactive),
    color var(--transition-interactive);
  white-space: nowrap;
  display: block;
}

.nav-dropdown-menu a:hover {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

/* ============================================================
   SECTION E — SECTION HEADINGS (homepage naming)
   ============================================================ */

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.section-h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.section-subhead {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 55ch;
}

/* ============================================================
   SECTION F — CAMPAIGN BADGES & CARDS (naming fix)
   ============================================================ */

.campaign-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.campaign-badge--urgent {
  background: rgba(214,40,40,0.1);
  color: var(--color-red);
  border: 1px solid rgba(214,40,40,0.25);
}

.campaign-badge--active {
  background: rgba(15,76,92,0.1);
  color: var(--color-primary);
  border: 1px solid rgba(15,76,92,0.2);
}

.campaign-badge--resolved {
  background: rgba(42,157,143,0.1);
  color: var(--color-green);
  border: 1px solid rgba(42,157,143,0.25);
}

.campaigns-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  background: var(--color-bg);
}

.campaign-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  flex: 1;
}

.campaign-card-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
  transition: color var(--transition-interactive), gap var(--transition-interactive);
}

.campaign-card-link:hover {
  color: var(--color-primary-hover);
  gap: var(--space-2);
}

/* Progress bar fill — HTML uses .progress-bar-fill not .progress-fill */
.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
}

/* ============================================================
   SECTION G — STATS GRID (4-col, colour variants)
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  line-height: 1.45;
}

.stat--red  { border-top: 3px solid var(--color-red); }
.stat--red .stat-number  { color: var(--color-red); }

.stat--yellow { border-top: 3px solid var(--color-accent); }
.stat--yellow .stat-number { color: var(--color-accent-dark); }

.stat--teal { border-top: 3px solid var(--color-primary); }
.stat--teal .stat-number { color: var(--color-primary); }

/* ============================================================
   SECTION H — INVESTIGATIONS STRIP (expose-strip)
   ============================================================ */

.expose-strip {
  background: var(--deep-navy);
  color: #fff;
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
}

.expose-strip .section-h2 { color: #fff; }
.expose-strip .section-subhead { color: rgba(255,255,255,0.65); }
.expose-strip .section-heading-row .btn { flex-shrink: 0; }

.expose-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition:
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    transform var(--transition-interactive);
}

.expose-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.expose-card-stamp {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,215,0,0.7);
}

.expose-card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.expose-card-title a {
  color: #fff;
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.expose-card-title a:hover { color: var(--safety-yellow); }

.expose-card-excerpt {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  line-height: 1.65;
  flex: 1;
}

.expose-card-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--safety-yellow);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: auto;
  transition: gap var(--transition-interactive), color var(--transition-interactive);
}

.expose-card-link:hover {
  color: #fff;
  gap: var(--space-2);
}

/* ============================================================
   SECTION I — NEWS PREVIEW CARDS
   (HTML uses .news-preview-* not .news-card)
   ============================================================ */

.news-preview-section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  background: var(--color-bg);
}

.news-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.news-preview-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.news-preview-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.news-preview-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  background: var(--color-surface-offset);
}

.news-preview-body {
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.news-preview-body time {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  font-weight: 500;
  display: block;
}

.news-preview-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
  margin: 0;
}

.news-preview-body h3 a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.news-preview-body h3 a:hover { color: var(--color-primary); }

.news-preview-body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  max-width: 100%;
}

/* ============================================================
   SECTION J — JOIN CTA STRIP
   (HTML uses .join-cta-strip not .join-strip)
   ============================================================ */

.join-cta-strip {
  background: var(--dark-teal);
  color: #fff;
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  text-align: center;
}

.join-cta-strip h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--space-4);
  max-width: 22ch;
  margin-inline: auto;
}

.join-cta-strip p {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.75);
  max-width: 52ch;
  margin-inline: auto;
  line-height: 1.65;
}

/* ============================================================
   SECTION K — BUTTON VARIANTS MISSING FROM PARENT
   ============================================================ */

/* Large size */
.btn--lg {
  font-size: var(--text-base);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-lg);
}

/* Teal outline (used in "All Campaigns →" and "All News →") */
.btn--outline-teal {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--outline-teal:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ============================================================
   SECTION L — FOOTER COL
   ============================================================ */

.footer-col {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   SECTION M — SCROLL ANIMATIONS (both class names)
   ============================================================ */

.fade-up,
.fadeup {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.is-visible,
.fadeup.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@supports (animation-timeline: view()) {
  .fade-up,
  .fadeup {
    animation: fadeup-anim linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 60%;
    opacity: 1;
    transform: none;
  }
  @keyframes fadeup-anim {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0);    }
  }
}

/* ============================================================
   SECTION N — BACK-TO-TOP BUTTON
   ============================================================ */

#back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 90;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity var(--transition-interactive),
    transform var(--transition-interactive),
    background var(--transition-interactive);
  pointer-events: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}

/* ============================================================
   SECTION O — CAMPAIGN PAGE HEADER ACCENTS (original child)
   ============================================================ */

.campaign-header-base-one     { border-top: 4px solid var(--color-red); }
.campaign-header-barts         { border-top: 4px solid var(--safety-yellow); }
.campaign-header-procurement   { border-top: 4px solid var(--dark-teal); }
.campaign-header-judicial      { border-top: 4px solid var(--hope-green); }

/* ============================================================
   SECTION P — MEMBER LOGIN PAGE (original child)
   ============================================================ */

.member-login-wrap {
  max-width: 480px;
  margin: 4rem auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.member-login-wrap h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.member-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.member-type-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition:
    border-color var(--transition-interactive),
    background var(--transition-interactive);
  text-align: center;
  background: var(--color-surface);
}

.member-type-card:hover,
.member-type-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-highlight);
}

.member-type-card .type-icon  { font-size: 1.75rem; margin-bottom: var(--space-2); }
.member-type-card .type-label { font-weight: 700; font-size: var(--text-sm); color: var(--color-primary); }

/* ============================================================
   SECTION Q — RESPONSIVE BREAKPOINTS (patch additions)
   ============================================================ */

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .news-preview-grid {
    grid-template-columns: 1fr;
  }
  .expose-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

@media (max-width: 768px) {

  /* Hero */
  .hero-h1 {
    font-size: clamp(2rem, 8vw, 3.2rem);
  }

  .hero-ctas {
    flex-direction: column;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
    min-width: 0;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  /* Section heading rows stack */
  .section-heading-row {
    flex-direction: column;
    gap: var(--space-3);
  }

  /* Language banner — compact */
  .language-banner-inner {
    gap: var(--space-2);
  }

  .lang-label {
    display: none; /* hide "Translate:" label on mobile to save space */
  }

  /* Ticker label hide */
  .ticker-label {
    display: none;
  }

  /* Join CTA */
  .join-cta-strip h2 {
    font-size: var(--text-xl);
  }

  /* Member login */
  .member-type-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 480px) {

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

  .anniversary-pill {
    font-size: 0.6rem;
  }

  /* Back to top — move inward on very small screens */
  #back-to-top {
    bottom: var(--space-4);
    right: var(--space-4);
  }
}

/* ============================================================
   SECTION R — DARK MODE EXPOSE STRIP FIX
   ============================================================ */

[data-theme="dark"] .expose-strip {
  background: #0D1017;
}

[data-theme="dark"] .expose-card {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .expose-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
}

[data-theme="dark"] .campaigns-section {
  background: var(--color-bg);
}

[data-theme="dark"] .news-preview-section {
  background: var(--color-bg);
}

/* ============================================================
   SECTION S — ARTICLE STAMP ROW (case header shortcode)
   ============================================================ */

.article-stamp-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: var(--space-4);
}

/* ============================================================
   SECTION T — PRINT OVERRIDES (child additions)
   ============================================================ */

@media print {
  .language-banner,
  .urgent-ticker,
  #back-to-top,
  .hero-ctas {
    display: none !important;
  }

  .page-hero {
    min-height: auto;
    padding-block: var(--space-8);
    background: #fff !important;
  }

  .hero-h1,
  .hero-subtitle {
    color: #000 !important;
  }
}
