/* Southern Park Music School — Tailwind-first, custom styles only */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Poppins:wght@300;400;500;600&display=swap');

:root {
  --accent:    #C2410C;
  --accent-h:  #EA580C;
  --radius:    0.6rem;
  --shadow:    0 1px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.11);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  overflow-x: hidden;
}

img, video, canvas, svg { max-width: 100%; height: auto; display: block; }

/* ===== Hero Carousel ===== */
header { position: relative; display: block; line-height: 0; font-size: 0; }

#heroCarousel {
  position: relative;
  height: 80vh;
  min-height: 520px;
  overflow: hidden;
}

#heroCarousel .carousel-item {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
#heroCarousel .carousel-item.active { opacity: 1; z-index: 1; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.60) 0%, rgba(0,0,0,0.28) 50%, rgba(0,0,0,0.05) 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  color: #fff;
  z-index: 2;
  padding: 3rem 5rem;
  animation: heroFadeIn 0.8s ease both;
}
@media (max-width: 640px) {
  .hero-overlay { padding: 2rem 1.5rem; }
  .hero-subtitle { font-size: 0.82rem; line-height: 1.6; }
  .hero-scroll-cue { display: none !important; }
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-overlay h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  line-height: 1.15;
  text-shadow: 0 2px 16px rgba(0,0,0,0.65), 0 0 40px rgba(0,0,0,0.3);
}

.hero-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 1.75rem;
  display: block;
  max-width: 600px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7), 0 0 20px rgba(0,0,0,0.5);
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.4rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  line-height: 1;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--accent-h);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(194,65,12,0.3);
}

.btn-outline-light {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.85);
  color: #fff;
}
.btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

/* ===== Hamburger Navbar ===== */
.navbar-toggler {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}

.navbar-toggler .hamburger {
  display: inline-block;
  width: 22px;
  height: 16px;
  position: relative;
}
.navbar-toggler .hamburger span {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: #fff;
  display: block;
  transform-origin: center;
  transition: transform 200ms ease, opacity 180ms ease, top 200ms ease;
}
.navbar-toggler .hamburger span:nth-child(1) { top: 0; }
.navbar-toggler .hamburger span:nth-child(2) { top: 7px; }
.navbar-toggler .hamburger span:nth-child(3) { top: 14px; }

/* X animation */
.navbar-toggler:not(.collapsed) .hamburger span:nth-child(1) { top: 7px; transform: rotate(45deg); }
.navbar-toggler:not(.collapsed) .hamburger span:nth-child(2) { opacity: 0; }
.navbar-toggler:not(.collapsed) .hamburger span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

/* ===== Navbar Collapse (mobile) ===== */
@media (max-width: 1023px) {
  .navbar-toggler { display: inline-flex; }

  .navbar-collapse {
    display: block !important; /* override Tailwind `hidden` */
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #292524; /* stone-800 */
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 1rem 0.75rem;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    transform-origin: top center;
    transform: scaleY(0);
    transition: transform 200ms ease;
    will-change: transform;
    z-index: 1056;
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  .navbar-collapse.show {
    transform: scaleY(1);
    max-height: 500px;
    padding: 0.5rem 1rem 0.75rem;
  }

  .navbar-collapse ul {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0; padding: 0;
    width: 100%;
    list-style: none;
  }
  .navbar-collapse ul li a {
    display: block;
    padding: 0.65rem 0.75rem;
    color: #e7e5e4;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 4px;
  }
  .navbar-collapse ul li a:hover { color: #fff; background: rgba(255,255,255,0.06); }
  .navbar-collapse ul .cta-item a,
  .navbar-collapse ul li:last-child a {
    display: block !important;
    text-align: center !important;
    margin: 0.5rem 0 0 !important;
    padding: 0.65rem 1rem !important;
    background: #ea580c !important;
    color: #fff !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .navbar-collapse ul li:last-child { margin-left: 0 !important; }
  .navbar-collapse ul .cta-item a:hover,
  .navbar-collapse ul li:last-child a:hover { background: #c2410c !important; }
}

/* ===== Visually hidden ===== */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}

/* ===== Flip Cards (Faculty) ===== */
.flip-card {
  background: transparent;
  width: 100%;
  height: 400px;
  perspective: 1000px;
  cursor: pointer;
}
@media (max-width: 576px) { .flip-card { height: 460px; } }

.flip-card-inner {
  position: relative;
  width: 100%; height: 100%;
  text-align: center;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.flip-card.rotate .flip-card-inner { transform: rotateY(180deg); }
.flip-card:hover .flip-card-inner { box-shadow: var(--shadow-lg); }

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%; height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius);
}

.flip-card-front {
  background: #fff;
  overflow: hidden;
}
.flip-card-front img {
  width: 100%;
  height: 60%;
  object-fit: cover;
}
.flip-card-front .p-3 { padding: 1rem; }
.flip-card-front h5 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1c1917;
  margin-bottom: 0.2rem;
}
.flip-card-front p { color: #78716c; font-size: 0.82rem; margin: 0; }

.flip-card-back {
  background: #292524;
  color: rgba(255,255,255,0.92);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.flip-card-back h5 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  color: #fb923c;
  margin-bottom: 0.65rem;
}
.flip-card-back p { font-size: 0.82rem; line-height: 1.6; flex: 1; }
.flip-card-back a.btn {
  align-self: center;
  margin-top: auto;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 0.45rem 1.2rem;
}
.flip-card-back a.btn:hover { background: var(--accent-h); }

@media (prefers-reduced-motion: reduce) { .flip-card-inner { transition: none; } }

/* ===== Gallery Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,16,8,0.88);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.modal.show { display: flex; }

.modal-content {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 90vw;
  max-height: 88vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
}
.modal-img { width: 100%; height: auto; display: block; max-height: 85vh; object-fit: contain; }
.modal-close {
  position: absolute;
  top: 0.5rem; right: 0.75rem;
  font-size: 1.5rem;
  color: #1c1917;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ===== Policy Card ===== */
.policy-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 3rem;
}
@media (max-width: 576px) { .policy-card { padding: 1.5rem 1.25rem; } }
.policy-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  margin: 1.75rem 0 0.5rem;
}
.policy-card h3:first-child { margin-top: 0; }
.policy-card p {
  color: #1c1917;
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 0;
}

/* ===== Calendar Embed ===== */
.calendar-embed {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
}
.calendar-embed iframe {
  border: 0;
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 500px;
  display: block;
}

/* ===== Gallery ===== */
.gallery-section-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 6px;
  color: #1c1917;
  margin-bottom: 2rem;
}

/* Video grid — 2-up on wide, 1-up on mobile */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: 2rem;
}

/* 16:9 responsive iframe wrapper */
.video-embed-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}
.video-embed-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-meta { padding: 0.65rem 0.1rem 0; }
.video-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1c1917;
  margin: 0 0 0.2rem;
}
.video-caption { font-size: 0.8rem; color: #78716c; margin: 0; }

/* Photo grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.gallery-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  display: block;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* ===== Faculty Page ===== */
.faculty-section { border-top: 1px solid #e7e5e4; padding-top: 2rem; }
.faculty-section:first-of-type { border-top: none; }

.faculty-section-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 6px;
  color: #1c1917;
  margin-bottom: 1.5rem;
}

.faculty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 360px) { .faculty-grid { grid-template-columns: 1fr; } }

.search-box input[type="search"] {
  border: 1px solid #d6d3d1;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  min-width: 260px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  background: #fff;
  color: #1c1917;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(194,65,12,0.12);
}
.search-box input[type="search"]::-webkit-search-decoration,
.search-box input[type="search"]::-webkit-search-cancel-button { display: none; }

/* ===== Focus / A11y ===== */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
.flip-card:focus, .flip-card:focus-visible { outline: none; }
.flip-card, a, button { -webkit-tap-highlight-color: transparent; }

/* ===== Alert Banner ===== */
#alertBanner {
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  max-height: 80px;
  overflow: hidden;
}
#alertBanner.dismissed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ===== Navbar shadow on scroll ===== */
nav.scrolled { box-shadow: 0 4px 16px rgba(0,0,0,0.25); }

/* ===== Nav link active dot (left side) ===== */
.nav-link-ul {
  position: relative;
}
.nav-link-ul.active-link::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f97316;
}

/* ===== Stacked section cards ===== */
.section-card {
  border-radius: 44px 44px 0 0;
  margin-top: 0;
  position: relative;
}

/* ===== Hero parallax ===== */
#heroCarousel .carousel-item {
  will-change: transform;
}

/* ===== Hero label (editorial) ===== */
.hero-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.85rem;
}

/* ===== Hero scroll cue ===== */
.hero-scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  animation: scrollBounce 2.2s ease-in-out infinite;
  z-index: 3;
  transition: color 0.2s;
  text-decoration: none;
  display: block;
}
.hero-scroll-cue:hover { color: rgba(255,255,255,0.9); }
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== Stat strip count ===== */
.stat-num {
  display: inline-block;
  transition: transform 0.3s ease;
}
.stat-num:hover { transform: scale(1.1); }

/* ===== Card hover lift ===== */
.card-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
