/* =============================================================
   Eklakhi Kishalaya Vidyapith — Homepage styles
   ============================================================= */

/* ---- S2 · Hero ----------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background-color: #3d0a12;
}
.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  will-change: opacity;
  animation: heroKenBurns 24s ease-in-out infinite alternate;
}
.hero-slide.is-active { opacity: 1; }
@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 90% 116%, rgba(168, 123, 60, 0.22), transparent 60%),
    linear-gradient(100deg, rgba(52, 10, 17, 0.97) 0%, rgba(52, 10, 17, 0.93) 42%, rgba(52, 10, 17, 0.84) 60%, rgba(52, 10, 17, 0.52) 100%);
}
.hero-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(72px);
  pointer-events: none;
}
.hero-orb-1 { width: 360px; height: 360px; background: rgba(155, 27, 51, 0.5); top: -130px; right: -70px; }
.hero-orb-2 { width: 320px; height: 320px; background: rgba(201, 162, 75, 0.18); bottom: -130px; left: -60px; }
.hero-watermark {
  position: absolute;
  right: 3%;
  bottom: 7rem;
  font-size: clamp(3rem, 11vw, 8.5rem);
  color: rgba(230, 207, 142, 0.055);
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}

.hero-stack { padding: 1.6rem 0.6rem; }
.hero-badge {
  position: absolute;
  top: -22px;
  left: -16px;
  z-index: 20;
  width: 94px;
  height: 94px;
  border-radius: 9999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #3d0a12;
  background: linear-gradient(150deg, #e6cf8e, #c9a24b 58%, #a87b3c);
  border: 3px solid rgba(255, 253, 248, 0.9);
  box-shadow: 0 16px 32px -10px rgba(168, 123, 60, 0.7), inset 0 2px 5px rgba(255, 255, 255, 0.55);
}
.hero-chip {
  position: absolute;
  bottom: -18px;
  right: -10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3d0a12;
}

.hero-marquee {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(230, 207, 142, 0.18);
}

/* ---- Campus highlight cards --------------------------------------------- */
.campus-card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.campus-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card-hover:hover .campus-card-img img { transform: scale(1.06); }

/* ---- Glimpse photo tiles (About page) ---------------------------------- */
.glimpse-tile {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #e7ddcb;
  background: #f7eedd;
  box-shadow: 0 12px 28px -16px rgba(61, 10, 18, 0.35);
  cursor: pointer;
}
.glimpse-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.glimpse-tile:hover img { transform: scale(1.07); }
.glimpse-tile::after {
  content: "\f00e";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #fbf6ec;
  background: rgba(61, 10, 18, 0.36);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.glimpse-tile:hover::after,
.glimpse-tile:focus-visible::after { opacity: 1; }

/* ---- Featured headmaster card (Our Faculty) ---------------------------- */
.hm-feature-photo {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  background: #f7eedd;
}
.hm-feature-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
@media (max-width: 767px) {
  .hm-feature-photo { min-height: 0; aspect-ratio: 4 / 3; }
}
.marquee-track {
  display: flex;
  gap: 2.75rem;
  width: max-content;
  animation: marqueeMove 36s linear infinite;
}
.marquee-track span {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f7eedd;
}
.hero-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeMove { to { transform: translateX(-50%); } }

/* ---- S3 · Stats ---------------------------------------------------------- */
.stats-panel { box-shadow: 0 30px 60px -28px rgba(61, 10, 18, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.7); }

/* ---- S4 · About image cluster ------------------------------------------- */
.about-img-main {
  width: 84%;
  margin-left: auto;
  aspect-ratio: 4 / 5;
}
.about-img-main img { width: 100%; height: 100%; object-fit: cover; }
.about-img-sub {
  position: absolute;
  left: 0;
  bottom: -1.75rem;
  width: 52%;
  aspect-ratio: 16 / 11;
  z-index: 3;
}
.about-img-sub img { width: 100%; height: 100%; object-fit: cover; }
.about-vision-chip {
  position: absolute;
  top: 1.25rem;
  left: -0.75rem;
  z-index: 4;
  max-width: 190px;
}
.about-deco-ring {
  position: absolute;
  top: -1.5rem;
  right: 0.5rem;
  width: 150px;
  height: 150px;
  border: 2px dashed rgba(201, 162, 75, 0.45);
  border-radius: 9999px;
  z-index: 0;
}

/* ---- S6 · Programme cards ----------------------------------------------- */
.programme-card {
  display: block;
  background: #fffdf8;
  border: 1px solid #e7ddcb;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}
.programme-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 50px -18px rgba(61, 10, 18, 0.34);
}
.programme-card-top {
  position: relative;
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #7a1226, #3d0a12);
  overflow: hidden;
}
.programme-card-top::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(230, 207, 142, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
}
.programme-num {
  position: absolute;
  top: 0.3rem;
  right: 1rem;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 2.7rem;
  color: rgba(230, 207, 142, 0.2);
}
.programme-card-top .icon-ring { position: relative; z-index: 1; }

/* ---- S7 · Notice board -------------------------------------------------- */
.notice-board {
  position: relative;
  background:
    radial-gradient(80% 60% at 90% 0%, rgba(155, 27, 51, 0.45), transparent 60%),
    rgba(61, 10, 18, 0.78);
}
.notice-frame {
  position: relative;
}
.notice-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(to top, rgba(61, 10, 18, 0.92), transparent);
  pointer-events: none;
  z-index: 2;
}
.notice-viewport {
  height: 318px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0 0.55rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.notice-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.notice-list { display: flex; flex-direction: column; gap: 0.55rem; padding: 0.25rem 0; }
.notice-skeleton {
  list-style: none;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.notice-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(230, 207, 142, 0.15);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.notice-item:hover {
  background: rgba(230, 207, 142, 0.12);
  border-color: rgba(230, 207, 142, 0.3);
  transform: translateX(3px);
}
.notice-item .notice-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #c9a24b, #a87b3c);
  color: #3d0a12;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.notice-item .notice-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #f7eedd;
  line-height: 1.4;
}
.notice-item .notice-meta {
  font-size: 0.74rem;
  color: rgba(247, 238, 221, 0.55);
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ---- S8 · Gallery grid -------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
  grid-auto-rows: 150px;
}
.gallery-grid > * { border-radius: 18px; }
.gallery-grid > *:nth-child(1) { grid-column: span 2; grid-row: span 2; }
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 168px; gap: 1rem; }
  .gallery-grid > *:nth-child(6) { grid-column: span 2; }
}
.gallery-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.4rem 0.9rem 0.8rem;
  background: linear-gradient(to top, rgba(61, 10, 18, 0.92), transparent);
  color: #f7eedd;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.gallery-tile:hover .gallery-cap { transform: translateY(0); opacity: 1; }
.gallery-cap .cap-title { font-weight: 600; font-size: 0.86rem; line-height: 1.3; }
.gallery-cap .cap-meta { font-size: 0.72rem; color: rgba(247, 238, 221, 0.7); margin-top: 0.15rem; }
.gallery-tile .play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.gallery-tile .play-badge i {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  background: rgba(201, 162, 75, 0.92);
  color: #3d0a12;
  font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* ---- S9 · Faculty ------------------------------------------------------- */
.faculty-card .faculty-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.faculty-card .faculty-photo img { width: 100%; height: 100%; object-fit: cover; }
.faculty-card .faculty-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(61, 10, 18, 0.4), transparent 45%);
}
.faculty-card .faculty-body { padding: 1.1rem 1.15rem 1.25rem; }

/* ---- S10 · Admission CTA ------------------------------------------------ */
.admission-cta {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 12% 10%, rgba(155, 27, 51, 0.6), transparent 60%),
    radial-gradient(60% 50% at 95% 95%, rgba(168, 123, 60, 0.3), transparent 60%),
    linear-gradient(155deg, #5a0e1c, #3d0a12 65%, #2a0810);
}
.cta-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(4rem, 16vw, 13rem);
  color: rgba(230, 207, 142, 0.045);
  white-space: nowrap;
  pointer-events: none;
}

/* ---- Form message ------------------------------------------------------ */
.form-msg {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.form-msg.is-success { background: #e6f0e9; color: #2d5d40; border: 1px solid #b9d6c5; }
.form-msg.is-error { background: #f7e2df; color: #8f2c22; border: 1px solid #e2b6b0; }

/* ---- Invalid form field ------------------------------------------------ */
.field-input.is-invalid {
  border-color: #b23a2e;
  background: #fffaf9;
  box-shadow: 0 0 0 4px rgba(178, 58, 46, 0.14);
}

/* ---- S11 · Testimonials ------------------------------------------------- */
.testimonial-quote {
  position: absolute;
  top: 1.3rem;
  right: 1.5rem;
  font-size: 2.6rem;
  color: rgba(201, 162, 75, 0.22);
}
.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #3d0a12;
  background: linear-gradient(150deg, #e6cf8e, #c9a24b);
  flex-shrink: 0;
}
.testimonial-avatar.is-bn {
  font-family: "Noto Serif Bengali", serif;
  font-size: 1.15rem;
}

/* ---- Lightbox ---------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: rgba(36, 10, 14, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox-stage { max-width: 980px; width: 100%; text-align: center; }
.lightbox-stage img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 14px;
  border: 1px solid rgba(230, 207, 142, 0.3);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}
.lightbox-caption { color: #f7eedd; margin-top: 0.9rem; font-size: 0.92rem; }
.lightbox-close {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f7eedd;
  border: 1px solid rgba(230, 207, 142, 0.3);
  font-size: 1.1rem;
  transition: background-color 0.2s ease;
}
.lightbox-close:hover { background: rgba(230, 207, 142, 0.2); }
.lightbox-nav {
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f7eedd;
  border: 1px solid rgba(230, 207, 142, 0.3);
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}
.lightbox-nav:hover { background: rgba(230, 207, 142, 0.2); }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1023px) {
  .about-deco-ring { display: none; }
}
@media (max-width: 480px) {
  .hero-badge { width: 78px; height: 78px; top: -14px; left: -8px; }
  .hero-badge .text-2xl { font-size: 1.25rem; }
  .hero-chip { font-size: 0.74rem; padding: 0.55rem 0.85rem; right: 0; }
  .notice-viewport { height: 280px; }
}

/* ---- SPA navigation (View Transitions) --------------------------------- */
/* A quick, soft cross-fade between pages — feels instant, not flashy. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: ease;
}

/* After an SPA navigation the pointer is still over the menu item, so the
   :hover dropdown would otherwise stay open (no reload resets :hover).
   nav.js adds .nav-dismissed on click; it is cleared on mouseleave. */
.nav-item.nav-dismissed .nav-dropdown {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateX(-50%) translateY(12px) !important;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}
