/* 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 > Medical & CCTV   (same design system as Transport, Library,
   Mess and Labs). Medical = green ribbon, CCTV = navy ribbon.
   Everything is scoped under .mc-page so it cannot leak into other pages.
   ========================================================================= */

.mc-page {
  --mc-body: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --mc-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mc-navy: #0B2F5B;
  --mc-blue: #1667B0;
  --mc-forest: #0F3D2B;
  --mc-red: #D32F2F;
  --mc-gold: #FFC400;
  --mc-soft: var(--ink-soft, #555);
  /* ribbon colours (overridden per block below) */
  --rib1: #0B2F5B;
  --rib2: #0F4C8A;
  --rib-dark: #061E3D;
  background: #fff;
  font-family: var(--mc-body);
}

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

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

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

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

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

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

/* ---------- Blocks ---------- */
.mc-page .mc-block { padding: 52px 0 56px; }
.mc-page .mc-medical {
  background: #F2F7F3;
  --rib1: #0F3D2B; --rib2: #1B6B46; --rib-dark: #082A1D;
  --c: var(--mc-forest); --ph: #9CC7AE;
}
.mc-page .mc-cctv {
  background: #F4F8FD;
  --rib1: #0B2F5B; --rib2: #0F4C8A; --rib-dark: #061E3D;
  --c: var(--mc-navy); --ph: #9DBDDD;
}

/* ---------- 3 equal photos per block ---------- */
.mc-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; perspective: 1000px; }
.mc-shot {
  position: relative; overflow: hidden; margin: 0;
  flex: 0 1 calc((100% - 48px) / 3);
  min-width: 260px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 6px solid #fff;
  background: linear-gradient(135deg, #fff, #F7F3D9);
  box-shadow: 0 24px 48px -26px rgba(11, 47, 91, 0.55);
  will-change: transform;
}
.mc-shot img {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s ease;
}
.mc-shot:hover img { transform: scale(1.08); }
.mc-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 12px 56px;
  border: 2px dashed var(--ph); border-radius: 8px; color: var(--c);
}
.mc-shot-ph i { font-size: 2.4rem; color: var(--c); opacity: 0.8; }
.mc-shot-ph b { font-size: 1.1rem; }
.mc-shot-ph span { font-size: 0.95rem; color: var(--mc-soft); line-height: 1.6; }
.mc-shot-ph code { background: #fff; padding: 2px 8px; border-radius: 6px; font-size: 0.85rem; color: var(--c); }
.mc-shot-caption {
  position: absolute; left: 0; bottom: 20px; z-index: 3;
  background: var(--c); color: #fff;
  padding: 10px 26px 10px 18px;
  border-radius: 0 999px 999px 0;
  font-weight: 700; font-size: 1.08rem;
  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 mc-rise {
  from { opacity: 0; transform: perspective(1400px) rotateX(12deg) translateY(36px); }
  to   { opacity: 1; transform: perspective(1400px) rotateX(0) translateY(0); }
}
@keyframes mc-drop {
  from { opacity: 0; transform: perspective(800px) rotateX(-50deg) translateY(22px); }
  to   { opacity: 1; transform: perspective(800px) rotateX(0) translateY(0); }
}
@keyframes mc-flip {
  from { opacity: 0; transform: perspective(900px) rotateX(-70deg) translateY(30px); }
  to   { opacity: 1; transform: perspective(900px) rotateX(0) translateY(0); }
}
@keyframes mc-unroll { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mc-slide  { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes mc-fold   { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

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

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

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

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