/*
Theme Name: ELLFJB Theme
Theme URI: https://ellfjb.local/
Author: ELLFJB
Author URI: https://ellfjb.local/
Description: Public practical court resource hub theme for the East London Local Family Justice Board. Static JSON prototype version.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ellfjb-theme
*/

:root {
  --brand: #842A49;
  --brand-dark: #4b1427;
  --brand-deep: #2d0b17;
  --brand-soft: #fff3f6;
  --ink: #1d1720;
  --muted: #6c6268;
  --line: #eadde2;
  --paper: #fffcfd;
  --white: #ffffff;
  --gold: #c59a3d;
  --teal: #287d79;
  --blue: #315c8b;
  --green: #587a43;
  --plum: #6d315f;
  --shadow: 0 22px 58px rgba(132, 42, 73, 0.18);
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
  padding: 0.65rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 250, 248, 0.95);
  border-bottom: 1px solid rgba(132, 42, 73, 0.16);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: fit-content;
  color: var(--brand);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 48px;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--brand);
  font-size: 1rem;
  line-height: 1;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.28rem;
}

.site-nav a {
  border-radius: 999px;
  color: #4d3e46;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.5rem 0.72rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--white);
  color: var(--brand);
  font-weight: 800;
  padding: 0.55rem 0.8rem;
}

.page-section {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: clamp(1.55rem, 3vh, 2.7rem) clamp(1rem, 4vw, 3rem);
  scroll-margin-top: var(--header-height);
  scroll-snap-align: start;
}

.page-section > * {
  width: min(1180px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.section-light {
  background: linear-gradient(180deg, #ffffff, #fffcfd);
  color: var(--ink);
}

.section-dark {
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: var(--white);
}

.home-section {
  justify-content: center;
  padding-top: clamp(1rem, 2vh, 1.8rem);
  padding-bottom: clamp(1rem, 2vh, 1.8rem);
}

.home-hero {
  display: grid;
  justify-items: center;
  gap: clamp(0.55rem, 1.2vh, 0.9rem);
}

.hero-copy {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  text-align: center;
}

.hero-copy h1 {
  max-width: 1040px;
  margin: 0 auto;
  color: var(--white);
  font-size: clamp(1.85rem, 2.75vw, 2.72rem);
  line-height: 1.06;
  letter-spacing: 0;
  text-align: center;
}

.hero-copy h1 span {
  display: block;
  white-space: nowrap;
}

.hero-copy p:not(.eyebrow) {
  max-width: 660px;
  margin: 0.45rem auto 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-actions,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  justify-content: center;
}

.hero-actions {
  margin-top: 0.55rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  border-radius: 0.5rem;
  padding: 0.68rem 0.98rem;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--white);
  color: var(--brand);
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: var(--white);
}

.hero-panel {
  width: min(1020px, 100%);
  padding: 0.58rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 0.68rem;
  background: rgba(255, 255, 255, 0.1);
}

.carousel-image {
  display: block;
  width: 100%;
  height: clamp(300px, 42vh, 455px);
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, transparent, rgba(45, 11, 23, 0.84));
  color: var(--white);
}

.carousel-caption span {
  color: rgba(255, 255, 255, 0.78);
  text-align: right;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.5rem 0 0;
}

.stats div {
  padding: 0.55rem 0.78rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
}

.stats dt {
  font-size: 1.08rem;
  font-weight: 850;
}

.stats dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
}

.section-heading {
  margin-bottom: 1.15rem;
}

.section-heading h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.8rem, 3vw, 2.65rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.section-dark .section-heading h2 {
  color: var(--white);
}

.section-heading p:not(.eyebrow) {
  max-width: 570px;
  margin: 0;
  color: var(--muted);
}

.section-dark .section-heading p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.74);
}

.section-heading.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
}

.pathway-grid,
.card-grid,
.feature-grid {
  display: grid;
  gap: 0.85rem;
}

.card-grid,
.compact-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.courts-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card,
.feature-card,
.about-panel {
  border: 1px solid var(--line);
  border-radius: 0.62rem;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(132, 42, 73, 0.08);
}

.section-dark .feature-card,
.section-dark .about-panel,
.section-dark .card {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.95);
}

.section-dark .card h3,
.section-dark .feature-card h3,
.section-dark .about-panel h2 {
  color: var(--brand);
}

.section-dark .card p,
.section-dark .feature-card p,
.section-dark .about-panel p {
  color: #4f454b;
}

.section-dark .card .meta,
.section-dark .feature-card .meta,
.section-dark .about-panel .eyebrow {
  color: var(--brand-dark);
}

.card {
  display: flex;
  min-height: 0;
  max-height: 390px;
  flex-direction: column;
  overflow: hidden;
}

.card-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
}

.card h3,
.feature-card h3,
.about-panel h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 1rem;
  line-height: 1.18;
}

.card h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card p,
.feature-card p,
.about-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.court-image {
  display: block;
  width: 100%;
  height: clamp(130px, 19vh, 180px);
  object-fit: cover;
}

.content-panel {
  display: flex;
  min-height: 86px;
  align-items: end;
  padding: 0.8rem;
  color: var(--white);
  font-weight: 850;
}

.content-panel span {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.34rem 0.58rem;
  font-size: 0.78rem;
}

.panel-resource { background: linear-gradient(135deg, var(--teal), var(--blue)); }
.panel-resource-tools { background: linear-gradient(135deg, var(--green), var(--teal)); }
.panel-resource-practice { background: linear-gradient(135deg, var(--brand), var(--blue)); }
.panel-resource-guidance { background: linear-gradient(135deg, var(--brand), var(--gold)); }
.panel-article { background: linear-gradient(135deg, var(--blue), var(--plum)); }
.panel-young { background: linear-gradient(135deg, var(--green), var(--gold)); }
.panel-video { background: linear-gradient(135deg, var(--brand), var(--teal)); }
.panel-news { background: linear-gradient(135deg, var(--gold), var(--brand)); }

.meta,
.tag {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.meta {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  overflow: hidden;
}

.tag {
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 0.26rem 0.48rem;
  text-transform: none;
}

.card-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.controls label {
  display: grid;
  gap: 0.3rem;
}

.controls span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-dark .controls span {
  color: rgba(255, 255, 255, 0.8);
}

.controls input,
.controls select {
  min-width: min(260px, 82vw);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--white);
  color: var(--ink);
  padding: 0.62rem 0.72rem;
}

.compact input {
  min-width: min(320px, 82vw);
}

.feature-card {
  min-height: 210px;
  padding: 0.95rem;
}

.feature-card .number {
  display: inline-grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--white);
  font-weight: 850;
}

.section-dark .feature-card .number {
  background: var(--gold);
  color: var(--brand-deep);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.42rem;
  margin-top: 0.55rem;
}

.pagination button {
  min-width: 2.2rem;
  min-height: 2.2rem;
  border: 1px solid rgba(132, 42, 73, 0.24);
  border-radius: 0.42rem;
  background: var(--white);
  color: var(--brand);
  cursor: pointer;
  font-weight: 850;
}

.pagination button:hover,
.pagination button.active,
.pagination button[aria-current="page"] {
  background: var(--brand);
  color: var(--white);
}

.section-dark .pagination button.active,
.section-dark .pagination button[aria-current="page"] {
  background: var(--gold);
  color: var(--brand-deep);
}

.about-panel {
  display: grid;
  grid-template-columns: 0.65fr 1fr;
  gap: 1.6rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-color: rgba(132, 42, 73, 0.18);
  background: linear-gradient(180deg, #ffffff, #fffcfd);
}

.about-panel h2 {
  color: var(--brand);
  font-size: clamp(1.75rem, 3vw, 2.65rem);
}

.about-panel p {
  color: #3a3036;
  font-size: 1rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  background: var(--brand-deep);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
}

.loading,
.empty,
.error {
  grid-column: 1 / -1;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--white);
  color: var(--muted);
}

.error {
  border-color: #d28b8b;
  color: #843232;
}

@media (max-width: 980px) {
  html {
    scroll-snap-type: none;
  }

  .page-section {
    overflow: visible;
  }

  .about-panel {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .compact-grid,
  .courts-grid,
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading.split {
    align-items: start;
    flex-direction: column;
  }

  .carousel-image {
    height: clamp(300px, 46vh, 480px);
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 68px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-header {
    align-items: flex-start;
  }

  .brand-logo {
    height: 42px;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    justify-content: start;
    padding: 0.75rem 1rem 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .site-nav.open {
    display: flex;
  }

  .page-section {
    min-height: auto;
    padding-top: 2.4rem;
    padding-bottom: 2.4rem;
  }

  .card-grid,
  .compact-grid,
  .feature-grid,
  .courts-grid,
  .stats {
    grid-template-columns: 1fr;
  }

  .carousel-caption {
    position: static;
    flex-direction: column;
    background: rgba(45, 11, 23, 0.9);
  }

  .carousel-caption span {
    text-align: left;
  }

  .carousel-image {
    height: 320px;
  }
}


.reveal-section {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section:first-child {
  opacity: 1;
  transform: none;
}

.section-dark .card,
.section-dark .feature-card,
.section-dark .about-panel {
  color: var(--ink);
}

.section-dark .about-panel .eyebrow {
  color: var(--brand);
}

@media (min-width: 1080px) {
  .hero-copy h1 {
    text-wrap: balance;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .hero-copy h1 span {
    white-space: normal;
  }
}
