/* ==========================================================================
   Kings Medical College - Design System
   ========================================================================== */

:root {
  --color-primary: #398ed6;
  --color-primary-dark: #276faf;
  --color-primary-light: #eaf4fd;
  --color-accent: #de1f20;
  --color-accent-dark: #b81616;

  --color-ink: #142433;
  --color-body: #45535f;
  --color-muted: #78838d;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f8fb;
  --color-border: #e4eaf0;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --container: 1240px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  --shadow-sm: 0 2px 10px rgba(20, 36, 51, 0.07);
  --shadow-md: 0 16px 40px rgba(20, 36, 51, 0.12);

  --header-h: 128px;
}

/* -------------------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-body);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-ink);
  line-height: 1.15;
  font-weight: 600;
}

h1 { font-size: clamp(2.4rem, 4.5vw, 3.6rem); }
h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
h3 { font-size: 1.3rem; }

p { color: var(--color-body); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }

.section-alt { background: var(--color-bg-alt); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--color-accent);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.section-head p { margin-top: 14px; font-size: 1.05rem; }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(222, 31, 32, 0.28);
}
.btn-primary:hover { background: var(--color-accent-dark); transform: translateY(-2px); }

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }

.btn-ghost {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}
.btn-ghost:hover { background: var(--color-primary); color: #fff; transform: translateY(-2px); }

.btn-sm { padding: 10px 20px; font-size: 0.85rem; }

/* -------------------------------------------------------------------------
   Top utility bar
   ------------------------------------------------------------------------- */
#topbar {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

#topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  gap: 16px;
}

#topbar .topbar-contact { display: flex; align-items: center; gap: 20px; }
#topbar .topbar-contact a { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
#topbar .topbar-contact a:hover { color: #fff; }
#topbar .topbar-right { display: flex; align-items: center; gap: 16px; }
#topbar .topbar-social { display: flex; align-items: center; gap: 12px; }
#topbar .topbar-social a { color: rgba(255,255,255,0.75); }
#topbar .topbar-social a:hover { color: #fff; }
#topbar svg { width: 15px; height: 15px; flex: none; }

/* -------------------------------------------------------------------------
   Main navigation
   ------------------------------------------------------------------------- */
#mainnav {
  position: fixed;
  top: 40px;
  width: 100%;
  z-index: 999;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
  transition: top 0.3s ease, box-shadow 0.3s ease;
}

#mainnav.scrolled { box-shadow: var(--shadow-sm); }

#mainnav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  object-fit: contain;
}
.brand-text { line-height: 1.2; white-space: nowrap; }
.brand-text .name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--color-ink); white-space: nowrap; }
.brand-text .tag { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); white-space: nowrap; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  flex: 1;
  justify-content: center;
}
.nav-links a { white-space: nowrap; }

.nav-links a {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--color-ink);
  position: relative;
  padding: 6px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--color-accent);
  transition: width 0.25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--color-accent); }

.nav-actions { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--color-ink); border-radius: 2px; }

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 56px) 0 64px;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 27, 38, 0.72) 0%, rgba(15, 27, 38, 0.55) 45%, rgba(15, 27, 38, 0.85) 100%);
  z-index: -1;
}

.hero-content { max-width: 720px; color: #fff; }
.hero-content .eyebrow { color: #ffd7d7; }
.hero-content .eyebrow::before { background: #ffd7d7; }
.hero-content h1 { color: #fff; margin-bottom: 20px; }
.hero-content p.lead { font-size: 1.15rem; color: rgba(255, 255, 255, 0.88); max-width: 560px; margin-bottom: 34px; }

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.hero-meta div strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: #fff; }
.hero-meta div span { font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); text-transform: uppercase; letter-spacing: 0.05em; }

/* -------------------------------------------------------------------------
   Page header (interior pages)
   ------------------------------------------------------------------------- */
.page-header {
  position: relative;
  padding-top: calc(var(--header-h) + 90px);
  padding-bottom: 90px;
  background-size: cover;
  background-position: center;
  isolation: isolate;
  text-align: center;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 27, 38, 0.78), rgba(15, 27, 38, 0.68));
  z-index: -1;
}
.page-header h1 { color: #fff; }
.page-header .eyebrow { color: #ffd7d7; justify-content: center; }
.page-header .eyebrow::before { display: none; }
.breadcrumb {
  margin-top: 16px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}
.breadcrumb a { color: rgba(255, 255, 255, 0.95); font-weight: 600; }

/* -------------------------------------------------------------------------
   Cards & grids
   ------------------------------------------------------------------------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.program-card { padding: 34px 28px; }
.program-card .icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}
.program-card .icon svg { width: 26px; height: 26px; }
.program-card h3 { margin-bottom: 10px; }
.program-card p { font-size: 0.94rem; margin-bottom: 18px; }
.program-card .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.program-card .tags span {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  background: var(--color-bg-alt); color: var(--color-muted);
  padding: 5px 10px; border-radius: 100px;
}
.program-card .link { color: var(--color-accent); font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }
.program-card .link svg { width: 14px; height: 14px; transition: transform 0.2s ease; }
.program-card .link:hover svg { transform: translateX(3px); }

.link-arrow { color: var(--color-accent); font-weight: 600; font-size: 1rem; display: inline-flex; align-items: center; gap: 6px; }
.link-arrow svg { width: 16px; height: 16px; flex: none; transition: transform 0.2s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

.photo-card { position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 4/5; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.photo-card:hover img { transform: scale(1.06); }
.photo-card .caption {
  position: absolute; inset: auto 0 0 0;
  padding: 20px;
  background: linear-gradient(0deg, rgba(15,27,38,0.85), transparent);
  color: #fff; font-weight: 600; font-size: 0.95rem;
}

.feature-row { display: flex; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--color-border); }
.feature-row:last-child { border-bottom: none; }
.feature-row .num {
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--color-primary);
  flex: none; width: 44px;
}
.feature-row h3 { font-size: 1.1rem; margin-bottom: 6px; }
.feature-row p { font-size: 0.93rem; }

/* -------------------------------------------------------------------------
   Split section
   ------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split-media { position: relative; }
.split-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.split-media .accent-box {
  position: absolute; bottom: -24px; left: -24px;
  width: 130px; height: 130px;
  background: var(--color-accent);
  border-radius: var(--radius-md);
  z-index: -1;
}

/* -------------------------------------------------------------------------
   CTA band
   ------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(120deg, var(--color-primary-dark), var(--color-primary));
  border-radius: var(--radius-lg);
  padding: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { color: rgba(255,255,255,0.85); }
.cta-band .actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
footer { background: var(--color-ink); color: rgba(255, 255, 255, 0.65); }
.footer-top { padding: 80px 0 50px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; }
.footer-brand .brand-text .name { color: #fff; }
.footer-brand p { margin: 18px 0 22px; color: rgba(255,255,255,0.55); font-size: 0.92rem; max-width: 280px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.footer-social a:hover { background: var(--color-accent); }
.footer-social svg { width: 16px; height: 16px; color: #fff; }

footer h4 { color: #fff; font-family: var(--font-body); font-size: 0.95rem; margin-bottom: 22px; letter-spacing: 0.02em; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { font-size: 0.92rem; color: rgba(255,255,255,0.6); }
.footer-links a:hover { color: #fff; }

.footer-contact li { display: flex; gap: 12px; margin-bottom: 16px; font-size: 0.9rem; color: rgba(255,255,255,0.65); }
.footer-contact svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 24px 0;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 0.82rem; color: rgba(255,255,255,0.45);
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: #fff; }

/* -------------------------------------------------------------------------
   Scroll reveal
   ------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* -------------------------------------------------------------------------
   Back to top
   ------------------------------------------------------------------------- */
#back-to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--color-ink);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 900;
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top svg { width: 18px; height: 18px; }

/* -------------------------------------------------------------------------
   Steps list
   ------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step .step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  margin-bottom: 18px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 8px; }
.step p { font-size: 0.9rem; }

/* -------------------------------------------------------------------------
   Info cards (contact / admissions sidebar)
   ------------------------------------------------------------------------- */
.info-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 28px; }
.info-card + .info-card { margin-top: 20px; }
.info-card h3 { font-size: 1rem; margin-bottom: 14px; }
.info-list li { display: flex; gap: 12px; margin-bottom: 14px; font-size: 0.92rem; color: var(--color-body); }
.info-list li:last-child { margin-bottom: 0; }
.info-list svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--color-accent); }
.info-list a { color: var(--color-body); }
.info-list a:hover { color: var(--color-accent); }

/* -------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------- */
.form-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 44px; box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--color-ink); }
.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 13px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  background: var(--color-bg-alt);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.82rem; color: var(--color-muted); margin-top: -8px; margin-bottom: 20px; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.form-status { font-size: 0.9rem; margin-top: 16px; display: none; padding: 14px 16px; border-radius: var(--radius-sm); }
.form-status.success { display: block; background: #eafbf0; color: #1a7f4b; }
.form-status.error { display: block; background: #fdeceb; color: var(--color-accent-dark); }

/* -------------------------------------------------------------------------
   Map embed
   ------------------------------------------------------------------------- */
.map-wrap { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.map-wrap iframe { width: 100%; height: 100%; min-height: 340px; border: 0; display: block; }

/* -------------------------------------------------------------------------
   Filter tabs (gallery)
   ------------------------------------------------------------------------- */
.filter-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 44px; }
.filter-tabs button {
  font-family: var(--font-body); font-size: 0.88rem; font-weight: 600;
  padding: 10px 22px; border-radius: 100px; border: 1.5px solid var(--color-border);
  background: #fff; color: var(--color-body); cursor: pointer; transition: all 0.2s ease;
}
.filter-tabs button:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }
.filter-tabs button.active { background: var(--color-ink); border-color: var(--color-ink); color: #fff; }
.gallery-item { display: block; }
.gallery-item.hidden { display: none; }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  #topbar .topbar-contact span.label { display: none; }
}

@media (max-width: 1100px) {
  :root { --header-h: 76px; }
  #topbar { display: none; }
  /* backdrop-filter would make #mainnav the containing block for the fixed .nav-links panel */
  #mainnav { top: 0; backdrop-filter: none; }
  #mainnav .nav-inner { height: var(--header-h); }
  .nav-links { position: fixed; top: 76px; left: 0; right: 0; bottom: 0; background: #fff; flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 32px 24px; gap: 22px; transform: translateX(100%); transition: transform 0.3s ease; overflow-y: auto; z-index: 998; }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-actions .btn-sm { display: none; }
}

@media (max-width: 991px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  section { padding: 64px 0; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; }
  .cta-band { padding: 36px 24px; flex-direction: column; text-align: center; }
  .hero-meta { gap: 20px; }
  .steps { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-card { padding: 28px 22px; }
}
