/* Fonts: Montserrat (body) + Playfair Display (headings).
   Tip: for faster loading you can move this to a <link> in base.html <head>. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Playfair+Display:wght@600;700;800&display=swap');

/* =========================================================================
   Facilities > Hostel   (same design system as Transport, Library, Mess,
   Labs, Medical & CCTV and Sports & Games)
   Palette: brinjal (deep purple) + gold. Everything is scoped under
   .hostel-page so it cannot leak into other pages.
   ========================================================================= */

.hostel-page {
  --h-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --h-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --h-brinjal: #4A1D5C;
  --h-brinjal-dark: #2E1139;
  --h-purple: #7B3FA0;
  --h-gold: #FFC400;
  --h-red: #D32F2F;
  --h-tint: #F7F1FA;
  --h-edge: #E3D2EC;
  --h-soft: var(--ink-soft, #555);
  background: #fff;
  font-family: var(--h-body);
}

/* body font everywhere (icons keep their own font because they are <i>) */
.hostel-page p,
.hostel-page li,
.hostel-page a,
.hostel-page span,
.hostel-page button,
.hostel-page b,
.hostel-page figcaption { font-family: var(--h-body); }

/* headings font */
.hostel-page h1,
.hostel-page h2,
.hostel-page h3 { font-family: var(--h-head); }

/* ---------- Banner (1920 x 600) — hides itself if the image is missing ---------- */
.hostel-page .h-hero {
  position: relative;
  width: 100%;
  height: clamp(260px, 31.25vw, 600px);
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #4A1D5C 0%, #7B3FA0 100%);
}
.h-hero-img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  display: block;
}

/* =========================================================================
   RIBBON HEADING — used for every section heading
   (notched right end + folded corner, same as the Transport page)
   ========================================================================= */
.hostel-page .ribbon-head {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 0 0 30px;
  padding: 0;
  font-size: clamp(1.35rem, 2.7vw, 2.05rem);
  font-weight: 700; line-height: 1.2; letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
  color: #fff;
  border: 0;
}
.hostel-page .ribbon-head::before {               /* ribbon body, V-notch on the right */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, #4A1D5C 0%, #7B3FA0 100%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 50%, 100% 100%, 0 100%);
  transform-origin: left center;
}
.hostel-page .ribbon-head::after {                /* folded corner under the left edge */
  content: ""; position: absolute; left: 0; top: 100%;
  width: 24px; height: 18px;
  background: var(--h-brinjal-dark);
  clip-path: polygon(0 0, 100% 0, 100% 100%);     /* right angle at top-right */
}
.hostel-page .ribbon-head span {
  position: relative; z-index: 1;
  display: block;
  padding: 14px 70px 14px 30px;
  font-family: inherit;
}

/* ---------- Shared section heading wrapper ---------- */
.hostel-page .section-head { max-width: 900px; margin: 0 auto 34px; text-align: center; }
.hostel-page .section-head .ribbon-head { margin-bottom: 0; }

/* ---------- Intro: "Our Hostel" in one rectangular box ---------- */
.hostel-page .h-intro { padding: 38px 0 50px; text-align: center; }
.h-crumbs {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 600; color: var(--h-soft);
  margin: 0 0 18px;
}
.h-crumbs a:hover { color: var(--h-purple); }
.h-crumbs i { font-size: 0.6rem; }
.h-crumbs span { color: var(--h-red); }

.h-box {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, var(--h-tint) 100%);
  border: 1px solid var(--h-edge);
  border-bottom: 8px solid var(--h-brinjal);
  border-radius: 14px;
  padding: 44px 36px 46px;
  box-shadow: 0 40px 70px -44px rgba(74, 29, 92, 0.6);
}
.hostel-page .h-title {
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--h-brinjal);
  margin: 0;
}
.h-tagline {
  margin: 18px auto 0; max-width: 760px;
  font-size: 1.25rem; font-weight: 600; line-height: 1.7;
  color: var(--h-purple);
}

/* ---------- Photos ---------- */
.hostel-page .h-photos { padding: 52px 0 56px; background: var(--h-tint); }

.h-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; perspective: 1000px; }
.h-shot {
  position: relative; overflow: hidden; margin: 0;
  flex: 0 1 calc((100% - 48px) / 3);      /* 3 per row, all identical */
  min-width: 260px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 6px solid #fff;
  background: linear-gradient(135deg, #fff, #F1E4F7);
  box-shadow: 0 24px 48px -26px rgba(74, 29, 92, 0.55);
  will-change: transform;
}
.h-shot img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s ease;
}
.h-shot:hover img { transform: scale(1.08); }
.h-shot-ph {
  position: absolute; inset: 12px; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; padding: 12px;
  border: 2px dashed #C9A6DB; border-radius: 8px; color: var(--h-brinjal);
}
.h-shot-ph i { font-size: 2.6rem; color: var(--h-purple); opacity: 0.85; }
.h-shot-ph b { font-size: 1.15rem; }
.h-shot-ph span { font-size: 0.95rem; color: var(--h-soft); line-height: 1.6; }
.h-shot-ph code { background: #fff; padding: 2px 8px; border-radius: 6px; font-size: 0.85rem; color: var(--h-brinjal); }

/* =========================================================================
   ANIMATIONS (only when JS is running; reduced-motion users see no motion)
   ========================================================================= */
@keyframes h-rise {
  from { opacity: 0; transform: perspective(1400px) rotateX(12deg) translateY(36px); }
  to   { opacity: 1; transform: perspective(1400px) rotateX(0) translateY(0); }
}
@keyframes h-drop {
  from { opacity: 0; transform: perspective(800px) rotateX(-50deg) translateY(22px); }
  to   { opacity: 1; transform: perspective(800px) rotateX(0) translateY(0); }
}
@keyframes h-flip {
  from { opacity: 0; transform: perspective(900px) rotateX(-70deg) translateY(30px); }
  to   { opacity: 1; transform: perspective(900px) rotateX(0) translateY(0); }
}
@keyframes h-unroll { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes h-slide  { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes h-fold   { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* hidden until revealed */
.hostel-page.js .h-box:not(.in),
.hostel-page.js .h-title:not(.in),
.hostel-page.js .h-shot:not(.in) { opacity: 0; }
.hostel-page.js .ribbon-head:not(.in)::before { transform: scaleX(0); }
.hostel-page.js .ribbon-head:not(.in)::after,
.hostel-page.js .ribbon-head:not(.in) span { opacity: 0; }

/* play */
.hostel-page.js .h-box.in   { animation: h-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.hostel-page.js .h-title.in { animation: h-drop 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s backwards; transform-origin: 50% 100%; }
.hostel-page.js .h-shot.in {
  animation: h-flip 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 0.15s + 0.2s);
}
.h-shot:nth-child(3n+1) { --i: 0; }
.h-shot:nth-child(3n+2) { --i: 1; }
.h-shot:nth-child(3n+3) { --i: 2; }
.hostel-page.js .ribbon-head.in::before { animation: h-unroll 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.hostel-page.js .ribbon-head.in span    { animation: h-slide 0.6s ease 0.25s backwards; }
.hostel-page.js .ribbon-head.in::after  { animation: h-fold 0.4s ease 0.6s backwards; }

@media (prefers-reduced-motion: reduce) {
  .hostel-page *, .hostel-page *::before, .hostel-page *::after {
    animation: none !important; transition: none !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .h-shot { flex-basis: calc((100% - 24px) / 2); }
}
@media (max-width: 700px) {
  .hostel-page .h-intro { padding: 28px 0 34px; }
  .h-box { padding: 32px 18px 34px; }
  .hostel-page .h-photos { padding: 36px 0 40px; }
  .hostel-page .section-head { margin-bottom: 26px; }
  .hostel-page .ribbon-head span { padding: 12px 52px 12px 22px; }
  .h-tagline { font-size: 1.1rem; }
}
@media (max-width: 600px) {
  .h-shot { flex-basis: 100%; }
}