/* 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 > Mess   (same design system as the Transport and Library pages)
   Palette: deep navy + school-bus yellow. Everything is scoped under
   .mess-page so it cannot leak into other pages.
   ========================================================================= */

.mess-page {
  --m-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --m-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --m-navy: #0B2F5B;
  --m-navy-dark: #061E3D;
  --m-blue: #1667B0;
  --m-gold: #FFC400;
  --m-red: #D32F2F;
  --m-tint: #F4F8FD;
  --m-edge: #D6E2F0;
  --m-soft: var(--ink-soft, #555);
  background: #fff;
  font-family: var(--m-body);
}

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

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

/* ---------- Banner placeholder (1920 x 600) ---------- */
.mess-page .m-hero {
  position: relative;
  width: 100%;
  height: clamp(260px, 31.25vw, 600px);
  padding: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #0B2F5B 0%, #1667B0 100%);
}
.m-hero-img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;
  display: block;
}
.m-hero-ph {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 20px; text-align: center; color: #fff;
}
.m-hero-ph i { font-size: 3.8rem; color: var(--m-gold); }
.m-hero-ph b { font-size: 1.5rem; }
.m-hero-ph span { font-size: 1.05rem; color: rgba(255, 255, 255, 0.9); }
.m-hero-ph code {
  background: rgba(255, 255, 255, 0.16);
  padding: 3px 10px; border-radius: 6px; font-size: 0.9rem;
}

/* =========================================================================
   RIBBON HEADING — used for every section heading
   (notched right end + folded corner, same as the Transport page)
   ========================================================================= */
.mess-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;
}
.mess-page .ribbon-head::before {                 /* ribbon body, V-notch on the right */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, #0B2F5B 0%, #0F4C8A 100%);
  clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 50%, 100% 100%, 0 100%);
  transform-origin: left center;
}
.mess-page .ribbon-head::after {                  /* folded corner under the left edge */
  content: ""; position: absolute; left: 0; top: 100%;
  width: 24px; height: 18px;
  background: var(--m-navy-dark);
  clip-path: polygon(0 0, 100% 0, 100% 100%);     /* right angle at top-right */
}
.mess-page .ribbon-head span {
  position: relative; z-index: 1;
  display: block;
  padding: 14px 70px 14px 30px;
  font-family: inherit;
}

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

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

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

/* ---------- Interior / Exterior blocks ---------- */
.mess-page .m-block { padding: 52px 0 56px; }
.mess-page .m-interior { background: var(--m-tint); }
.mess-page .m-exterior { background: #fff; }

/* ---------- Photo (same size for both) with a yellow offset block ---------- */
.m-photo-wrap {
  position: relative;
  max-width: 980px; margin: 0 auto;
  padding: 0 24px 24px 0;
}
.m-photo-wrap::before {                           /* yellow offset block */
  content: ""; position: absolute; z-index: 0;
  top: 24px; left: 24px; right: 0; bottom: 0;
  background: var(--m-gold); border-radius: 18px;
}
.m-photo {
  position: relative; z-index: 1; overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  border: 8px solid #fff;
  background: linear-gradient(135deg, #EAF3FB, #FFF3C4);
  box-shadow: 0 30px 60px -28px rgba(11, 47, 91, 0.6);
}
.m-photo img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; object-fit: cover;
}
.m-photo-ph {
  position: absolute; inset: 14px; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 16px 16px 60px;
  border: 2px dashed #9DBDDD; border-radius: 10px; color: var(--m-navy);
}
.m-photo-ph i { font-size: 3rem; color: var(--m-blue); opacity: 0.75; }
.m-photo-ph b { font-size: 1.25rem; }
.m-photo-ph span { font-size: 1rem; color: var(--m-soft); line-height: 1.6; }
.m-photo-ph code { background: #fff; padding: 2px 8px; border-radius: 6px; font-size: 0.88rem; }
.m-photo-caption {
  position: absolute; left: 0; bottom: 24px; z-index: 3;
  background: var(--m-navy); color: #fff;
  padding: 10px 28px 10px 22px;
  border-radius: 0 999px 999px 0;
  font-weight: 700; font-size: 1.1rem;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.5);
}

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

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

/* play */
.mess-page.js .m-box.in        { animation: m-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.mess-page.js .m-title.in      { animation: m-drop 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s backwards; transform-origin: 50% 100%; }
.mess-page.js .m-photo-wrap.in { animation: m-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s backwards; }
.mess-page.js .ribbon-head.in::before { animation: m-unroll 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.mess-page.js .ribbon-head.in span    { animation: m-slide 0.6s ease 0.25s backwards; }
.mess-page.js .ribbon-head.in::after  { animation: m-fold 0.4s ease 0.6s backwards; }

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

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .mess-page .m-intro { padding: 28px 0 34px; }
  .m-box { padding: 32px 18px 34px; }
  .mess-page .m-block { padding: 36px 0 40px; }
  .mess-page .section-head { margin-bottom: 26px; }
  .mess-page .ribbon-head span { padding: 12px 52px 12px 22px; }
  .m-photo-wrap { padding: 0 14px 14px 0; }
  .m-photo-wrap::before { top: 14px; left: 14px; border-radius: 14px; }
  .m-photo { border-width: 5px; border-radius: 10px; }
  .m-tagline { font-size: 1.1rem; }
}