:root {
  --primary: #6a0dad; /* Purple */
  --primary-dark: #4b0082;
  --primary-soft: #f3e5f5; /* Light purple */
  --surface: #ffffff;
  --surface-alt: #faf5fc;
  --text: #18212f;
  --muted: #5f6d83;
  --border: #e1bee7;
  --shadow: 0 20px 45px rgba(106, 13, 173, 0.15);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

/* Grasslands Theme (Green/Blue) */
.theme-grasslands {
  --primary: #2e7d32; /* Dark Green */
  --primary-dark: #1b5e20;
  --primary-soft: #e8f5e9; /* Light Green */
  --surface-alt: #f1f8e9;
  --border: #c8e6c9;
  --shadow: 0 20px 45px rgba(46, 125, 50, 0.15);
}

.theme-grasslands .hero-slide {
  background: linear-gradient(135deg, var(--primary), #0288d1); /* Green to Blue gradient */
}

.theme-grasslands .institution-card::before {
  background: linear-gradient(90deg, var(--primary), #0288d1);
}

.theme-grasslands .gallery-preview div,
.theme-grasslands .map-card {
  background:
    linear-gradient(135deg, rgba(46, 125, 50, 0.12), rgba(46, 125, 50, 0.02)),
    linear-gradient(45deg, #e8f5e9, #fff);
  border-color: rgba(46, 125, 50, 0.08);
}

.theme-grasslands .gallery-image {
  box-shadow: 0 10px 25px rgba(46, 125, 50, 0.18);
}

.theme-grasslands .gallery-image:hover {
  box-shadow: 0 18px 40px rgba(46, 125, 50, 0.3);
  border-color: var(--primary);
}

.theme-grasslands .institution-logo-container {
  border-color: rgba(46, 125, 50, 0.15);
  box-shadow: 0 12px 30px rgba(46, 125, 50, 0.12);
  background: linear-gradient(135deg, var(--primary-soft), #fff);
}

.theme-grasslands .institution-logo {
  filter: drop-shadow(0 6px 16px rgba(46, 125, 50, 0.25));
}

/* Philadelphia Senior Theme (Blue/Gold) */
.theme-philadelphia-senior {
  --primary: #1a4d91; /* Deep blue */
  --primary-dark: #0f3663;
  --primary-soft: #e8f0fa; /* Light blue */
  --surface-alt: #f5f8fd;
  --border: #c8d8f0;
  --shadow: 0 20px 45px rgba(26, 77, 145, 0.18);
}

.theme-philadelphia-senior .hero-slide {
  background: linear-gradient(135deg, var(--primary), #d4af37); /* Blue to gold gradient */
}

.theme-philadelphia-senior .institution-card::before {
  background: linear-gradient(90deg, var(--primary), #d4af37);
}

.theme-philadelphia-senior .gallery-preview div,
.theme-philadelphia-senior .map-card {
  background:
    linear-gradient(135deg, rgba(26, 77, 145, 0.12), rgba(212, 175, 55, 0.08)),
    linear-gradient(45deg, var(--primary-soft), #fff);
  border-color: rgba(26, 77, 145, 0.12);
}

.theme-philadelphia-senior .gallery-image {
  box-shadow: 0 10px 25px rgba(26, 77, 145, 0.2);
}

.theme-philadelphia-senior .gallery-image:hover {
  box-shadow: 0 18px 40px rgba(26, 77, 145, 0.35);
  border-color: var(--primary);
}

.theme-philadelphia-senior .institution-logo-container {
  border-color: rgba(26, 77, 145, 0.18);
  box-shadow: 0 12px 30px rgba(26, 77, 145, 0.15);
  background: linear-gradient(135deg, var(--primary-soft), #fff);
}

.theme-philadelphia-senior .institution-logo {
  filter: drop-shadow(0 6px 16px rgba(26, 77, 145, 0.28));
}

/* Philadelphia Junior Theme (Bright Blue/Orange) */
.theme-philadelphia-junior {
  --primary: #0066cc; /* Bright blue */
  --primary-dark: #004c99;
  --primary-soft: #e6f2ff; /* Very light blue */
  --surface-alt: #f8fcff;
  --border: #b3d9ff;
  --shadow: 0 20px 45px rgba(0, 102, 204, 0.18);
}

.theme-philadelphia-junior .hero-slide {
  background: linear-gradient(135deg, var(--primary), #ff8c00); /* Blue to bright orange gradient */
}

.theme-philadelphia-junior .institution-card::before {
  background: linear-gradient(90deg, var(--primary), #ff8c00);
}

.theme-philadelphia-junior .gallery-preview div,
.theme-philadelphia-junior .map-card {
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.14), rgba(255, 140, 0, 0.08)),
    linear-gradient(45deg, var(--primary-soft), #fff);
  border-color: rgba(0, 102, 204, 0.14);
}

.theme-philadelphia-junior .gallery-image {
  box-shadow: 0 10px 25px rgba(0, 102, 204, 0.22);
}

.theme-philadelphia-junior .gallery-image:hover {
  box-shadow: 0 18px 40px rgba(0, 102, 204, 0.38);
  border-color: var(--primary);
}

.theme-philadelphia-junior .institution-logo-container {
  border-color: rgba(0, 102, 204, 0.2);
  box-shadow: 0 12px 30px rgba(0, 102, 204, 0.18);
  background: linear-gradient(135deg, var(--primary-soft), #fff);
}

.theme-philadelphia-junior .institution-logo {
  filter: drop-shadow(0 6px 16px rgba(0, 102, 204, 0.32));
}

/* Eyestone Junior Theme (Warm Brown/Green) */
.theme-eyestone-junior {
  --primary: #5d4037; /* Warm brown */
  --primary-dark: #3e2723;
  --primary-soft: #f5f0ed; /* Light beige/brown */
  --surface-alt: #faf8f6;
  --border: #d7ccc8;
  --shadow: 0 20px 45px rgba(93, 64, 55, 0.18);
}

.theme-eyestone-junior .hero-slide {
  background: linear-gradient(135deg, var(--primary), #4caf50); /* Brown to green gradient */
}

.theme-eyestone-junior .institution-card::before {
  background: linear-gradient(90deg, var(--primary), #4caf50);
}

.theme-eyestone-junior .gallery-preview div,
.theme-eyestone-junior .map-card {
  background:
    linear-gradient(135deg, rgba(93, 64, 55, 0.12), rgba(76, 175, 80, 0.08)),
    linear-gradient(45deg, var(--primary-soft), #fff);
  border-color: rgba(93, 64, 55, 0.12);
}

.theme-eyestone-junior .gallery-image {
  box-shadow: 0 10px 25px rgba(93, 64, 55, 0.2);
}

.theme-eyestone-junior .gallery-image:hover {
  box-shadow: 0 18px 40px rgba(93, 64, 55, 0.35);
  border-color: var(--primary);
}

.theme-eyestone-junior .institution-logo-container {
  border-color: rgba(93, 64, 55, 0.18);
  box-shadow: 0 12px 30px rgba(93, 64, 55, 0.15);
  background: linear-gradient(135deg, var(--primary-soft), #fff);
}

.theme-eyestone-junior .institution-logo {
  filter: drop-shadow(0 6px 16px rgba(93, 64, 55, 0.28));
}

/* Buffalo Downs Theme (Bold Red/Gold) */
.theme-buffalo-downs {
  --primary: #c62828; /* Bold red */
  --primary-dark: #8e0000;
  --primary-soft: #ffebee; /* Light red/beige */
  --surface-alt: #fff8f8;
  --border: #ffcdd2;
  --shadow: 0 20px 45px rgba(198, 40, 40, 0.2);
}

.theme-buffalo-downs .hero-slide {
  background: linear-gradient(135deg, var(--primary), #ffd700); /* Red to gold gradient */
}

.theme-buffalo-downs .institution-card::before {
  background: linear-gradient(90deg, var(--primary), #ffd700);
}

.theme-buffalo-downs .gallery-preview div,
.theme-buffalo-downs .map-card {
  background:
    linear-gradient(135deg, rgba(198, 40, 40, 0.14), rgba(255, 215, 0, 0.08)),
    linear-gradient(45deg, var(--primary-soft), #fff);
  border-color: rgba(198, 40, 40, 0.14);
}

.theme-buffalo-downs .gallery-image {
  box-shadow: 0 10px 25px rgba(198, 40, 40, 0.24);
}

.theme-buffalo-downs .gallery-image:hover {
  box-shadow: 0 18px 40px rgba(198, 40, 40, 0.4);
  border-color: var(--primary);
}

.theme-buffalo-downs .institution-logo-container {
  border-color: rgba(198, 40, 40, 0.22);
  box-shadow: 0 12px 30px rgba(198, 40, 40, 0.18);
  background: linear-gradient(135deg, var(--primary-soft), #fff);
}

.theme-buffalo-downs .institution-logo {
  filter: drop-shadow(0 6px 16px rgba(198, 40, 40, 0.32));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.65;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--surface-alt);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(10, 61, 145, 0.08);
}

.inner-header {
  position: relative;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 82px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-copy strong,
h1,
h2,
h3,
h4 {
  font-family: "Poppins", Arial, sans-serif;
}

.brand-copy small {
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--primary);
  transform: translateY(-1px);
}

.nav-cta {
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff !important;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--primary-soft);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--primary);
}

.hero,
.page-hero {
  background:
    radial-gradient(circle at top left, rgba(10, 61, 145, 0.12), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.hero {
  padding: 5.5rem 0 4rem;
}

.page-hero {
  padding: 3.5rem 0 2.5rem;
}

.hero-grid,
.split-section,
.contact-layout,
.admin-shell {
  display: grid;
  gap: 2rem;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.85rem;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4.3rem);
  line-height: 1.1;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  line-height: 1.15;
}

h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.hero-copy > p {
  font-size: 1.05rem;
  max-width: 60ch;
}

.hero-actions,
.button-group-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

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

.hero-stats,
.stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 2rem;
}

.hero-stats article,
.stats-grid div {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(10, 61, 145, 0.08);
  box-shadow: var(--shadow);
}

.hero-stats strong,
.stats-grid strong {
  display: block;
  color: var(--primary);
  font-size: 1.6rem;
  font-family: "Poppins", Arial, sans-serif;
}

.slider-card,
.info-card,
.feature-card,
.detail-card,
.cta-shell,
.news-card,
.institution-card {
  background: #fff;
  border: 1px solid rgba(10, 61, 145, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.slider-card {
  padding: 1.4rem;
}

.slider-badge,
.card-type {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
}

.hero-slide {
  min-height: 290px;
  padding: 1.8rem;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), #9c27b0); /* Purple gradient */
  color: #fff;
}

.hero-slide p,
.hero-slide h3,
.hero-slide li {
  color: inherit;
}

.slider-controls {
  display: flex;
  gap: 0.55rem;
  margin-top: 1rem;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0;
  background: rgba(10, 61, 145, 0.22);
}

.slider-dot.active {
  background: var(--primary);
}

.split-section,
.contact-layout,
.admin-shell {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.search-box input,
.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.chip {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(10, 61, 145, 0.14);
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

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

.card-grid,
.feature-grid,
.info-grid,
.two-up-detail,
.profile-summary {
  display: grid;
  gap: 1.4rem;
}

.card-grid,
.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.two-up-detail,
.profile-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.institution-card,
.news-card,
.feature-card,
.info-card,
.detail-card {
  padding: 1.5rem;
}

.institution-card {
  position: relative;
  overflow: hidden;
}

.institution-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), #9c27b0);
}

.card-accent {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 800;
  font-family: "Montserrat", Arial, sans-serif;
}

.card-link,
.text-link {
  font-weight: 700;
  color: var(--primary);
}

.simple-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.numbered {
  padding-left: 1.35rem;
}

.testimonial-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.testimonial {
  padding: 1.25rem 1.35rem;
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.testimonial strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--primary);
}

.gallery-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.gallery-preview div,
.map-card {
  min-height: 120px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(106, 13, 173, 0.12), rgba(106, 13, 173, 0.02)),
    linear-gradient(45deg, #f8eaf9, #fff);
  border: 1px solid rgba(106, 13, 173, 0.08);
}

.compact div {
  min-height: 100px;
}

.cta-shell {
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: linear-gradient(135deg, #fff, #edf3ff);
}

.site-footer {
  padding-top: 2rem;
  background: #08182f;
  color: rgba(255, 255, 255, 0.86);
}

.site-footer p,
.site-footer a,
.site-footer h3,
.site-footer h4 {
  color: inherit;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}

.footer-grid a {
  display: block;
  margin-bottom: 0.6rem;
}

.footer-bottom {
  padding: 1rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-form {
  display: grid;
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
}

.admin-panels {
  display: grid;
  gap: 1.4rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: var(--delay, 0ms);
}

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

.institution-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary-soft), #fff);
  border: 2px solid rgba(106, 13, 173, 0.15);
  box-shadow: 0 12px 30px rgba(106, 13, 173, 0.12);
}

.institution-logo {
  max-width: 240px;
  max-height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(106, 13, 173, 0.25));
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.gallery-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(106, 13, 173, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.gallery-image:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 40px rgba(106, 13, 173, 0.3);
  border-color: var(--primary);
}

.image-modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
}

.image-modal.active {
  display: flex;
}

.image-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.modal-image {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.close-modal {
  position: absolute;
  top: -50px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 3rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.2s ease;
}

.close-modal:hover {
  transform: scale(1.2);
}

@media (max-width: 960px) {
  .hero-grid,
  .split-section,
  .contact-layout,
  .admin-shell,
  .two-up-detail,
  .profile-summary,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    position: absolute;
    top: 82px;
    left: 1rem;
    right: 1rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow);
  }

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

  .static-nav {
    position: static;
    display: flex;
    flex-direction: row;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-toggle {
    display: inline-block;
  }

  .section-top,
  .cta-shell {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .section {
    padding: 4rem 0;
  }

  h1 {
    font-size: 2.3rem;
  }

  .brand-copy small {
    display: none;
  }

  .hero {
    padding-top: 4.5rem;
  }

  .gallery-preview,
  .two-columns {
    grid-template-columns: 1fr;
  }
}
