@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

/* JES Institute of Pharmacy - Public Stylesheet */

:root {
  --color-teal-950: #252c35;
  --color-teal-800: #3b4652;
  --color-teal-700: #687582;
  --color-teal-600: #9ca7b1;
  --color-ivory: #f8f7f4;
  --color-ivory-dark: #ece9e3;
  --color-gold: #d58a32;
  --color-gold-light: #efb45f;
  --color-charcoal: #2c3036;
  --color-grey: #6d737b;
  --color-white: #ffffff;
  --color-border: #d9dce0;

  --font-serif: 'Manrope', 'Trebuchet MS', sans-serif;
  --font-sans: 'DM Sans', 'Trebuchet MS', sans-serif;

  --max-width: 1120px;
  --radius: 12px;
  --shadow-soft: 0 14px 35px rgba(37, 44, 53, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-charcoal);
  background: var(--color-ivory);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-teal-700); text-decoration: none; }
a:hover { color: var(--color-gold); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--color-teal-950);
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { max-width: 68ch; }

:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(110deg, #202832 0%, #2c3641 58%, #35414b 100%);
  border-bottom: 3px solid var(--color-gold);
  box-shadow: 0 8px 24px rgba(20, 27, 34, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0.65rem 2rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 1.5rem;
  gap: 0.65rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.01em;
}
.logo span,
.main-nav a span {
  white-space: nowrap;
}
.logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}
.logo:hover { color: var(--color-gold-light); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-teal-600);
  color: var(--color-white);
  font-size: 1.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  margin-left: auto;
  gap: 0.45rem;
  padding-left: 1.25rem;
  border-left: 1px solid rgba(236, 233, 227, 0.2);
  min-width: 0;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--color-ivory);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.55rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nav-icon {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  flex-shrink: 0;
  opacity: 0.85;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-gold-light);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(239, 180, 95, 0.32);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 18%, rgba(226, 154, 59, 0.14), transparent 28%),
    linear-gradient(115deg, #252c35 0%, #3b4652 62%, #514a4a 100%);
  color: var(--color-ivory);
  padding: 3.25rem 1.25rem 3.5rem;
}

.hero::after {
  content: '';
  position: absolute;
  width: 28rem;
  height: 28rem;
  right: -10rem;
  bottom: -16rem;
  border: 1px solid rgba(243, 189, 104, 0.26);
  border-radius: 50%;
  box-shadow: 0 0 0 2rem rgba(243, 189, 104, 0.035), 0 0 0 4rem rgba(243, 189, 104, 0.025);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 { color: var(--color-white); }

.hero .eyebrow {
  color: var(--color-gold-light);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
  letter-spacing: 0.02em;
}

.hero p {
  color: var(--color-ivory-dark);
  margin-top: 1rem;
  font-size: 1.05rem;
  max-width: 38rem;
}

.hero-figure {
  position: relative;
  border: 1px solid rgba(245, 181, 82, 0.45);
  border-radius: 30px;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, rgba(8, 28, 34, 0.8), rgba(18, 59, 74, 0.7));
  box-shadow:
    0 22px 40px rgba(4, 33, 39, 0.28),
    0 12px 22px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: perspective(1200px) rotateX(1deg) rotateY(-3deg) rotateZ(0.4deg) translateY(0px);
  transition: transform 0.25s ease, box-shadow 0.35s ease;
  will-change: transform;
}

.hero-figure::before {
  content: '';
  position: absolute;
  inset: -18% -10% -12% -10%;
  background: radial-gradient(circle at center, rgba(246, 185, 88, 0.42) 0%, rgba(246, 185, 88, 0.18) 28%, rgba(246, 185, 88, 0.04) 52%, transparent 72%);
  z-index: 0;
  pointer-events: none;
  filter: blur(18px);
}

.hero-figure::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 22px;
  pointer-events: none;
}

.hero-figure:hover {
  box-shadow: 0 34px 60px rgba(4, 33, 39, 0.38), 0 18px 30px rgba(0, 0, 0, 0.22);
}

.hero-badge {
  position: absolute;
  right: 1rem;
  top: 1rem;
  z-index: 3;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(13, 37, 42, 0.72);
  border: 1px solid rgba(245, 181, 82, 0.7);
  color: #f8f3ea;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  animation: badgeFloat 3.2s ease-in-out infinite;
}

@keyframes badgeFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.08);
  transition: opacity 0.7s ease, visibility 0.7s ease, transform 1.1s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.hero-slide img,
.hero-figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}

.hero-slider-dots {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  display: flex;
  gap: 0.4rem;
  z-index: 2;
  transform: translateX(-50%);
}

.hero-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 1px solid var(--color-gold-light);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.85;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.hero-dot.active,
.hero-dot:hover,
.hero-dot:focus-visible {
  background: var(--color-gold-light);
  opacity: 1;
  transform: scale(1.25);
  box-shadow: 0 0 0 2px rgba(18, 59, 74, 0.35);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 1.5rem;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 20px rgba(18, 60, 70, 0.18);
}

.btn-primary {
  background: linear-gradient(135deg, #e4a74b 0%, #d7902e 100%);
  color: var(--color-teal-950);
  box-shadow: 0 12px 24px rgba(215, 144, 46, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #efb75c 0%, #d9982f 100%);
  color: var(--color-teal-950);
}

.btn-outline {
  border-color: rgba(255,255,255,0.5);
  color: var(--color-ivory);
  margin-left: 0.75rem;
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(2px);
}

.btn-outline:hover {
  border-color: rgba(245, 181, 82, 0.85);
  color: var(--color-gold-light);
  box-shadow: 0 12px 18px rgba(245, 181, 82, 0.12);
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.25rem;
}

.section-head {
  position: relative;
  margin-bottom: 2.25rem;
  padding-left: 1.15rem;
}
.section-head::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 5px;
  height: 2.35rem;
  border-radius: 999px;
  background: var(--color-gold);
}
.section-head h2 { letter-spacing: -0.025em; }
.section-kicker {
  margin-bottom: 0.45rem;
  color: var(--color-gold);
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section-lead {
  max-width: 62ch;
  margin-top: 0.7rem;
  color: var(--color-grey);
  font-size: 1rem;
  white-space: nowrap;
}

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

.history-section {
  background: linear-gradient(180deg, #edf5f0, var(--color-ivory));
}

.history-copy {
  max-width: 100%;
  margin: 0 auto 2.25rem;
}

.history-copy p {
  margin-bottom: 1rem;
  color: var(--color-grey);
  line-height: 1.8;
  font-size: 1.02rem;
  max-width: 100%;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.info-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-gold);
  border-radius: 18px;
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.info-card:hover { transform: translateY(-5px); box-shadow: 0 20px 38px rgba(18, 60, 70, 0.12); }

.info-card h3 {
  color: var(--color-teal-950);
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}

.info-card p {
  color: var(--color-grey);
  line-height: 1.75;
}

.about-page-section {
  background: linear-gradient(135deg, #f4f1e9, #edf3f1);
}

.governing-table-wrap {
  overflow-x: auto;
  background: #f9f7f3;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(37, 44, 53, 0.1);
}

.governing-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

.governing-table th,
.governing-table td {
  border: 1px solid #cfc7b7;
  padding: 1rem 1.1rem;
  text-align: left;
  vertical-align: top;
}

.governing-table th {
  background: var(--color-teal-950);
  color: var(--color-white);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.governing-table td {
  color: var(--color-charcoal);
  line-height: 1.7;
}

.board-frequency {
  margin-top: 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-teal-950);
  font-style: italic;
}

.about-message-section {
  background: linear-gradient(180deg, #ffffff, #f6f4ef);
}

.principal-message-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 2.25rem;
  align-items: flex-start;
}

.principal-photo-box {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dfe9ea, #f4f0e4);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  padding: 0;
  overflow: hidden;
}

.principal-photo {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  display: block;
}

.principal-message-content {
  color: var(--color-charcoal);
}
.principal-message-card {
  padding: 1.75rem 1.9rem;
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-gold);
  border-radius: 18px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.principal-message-content p {
  margin-bottom: 1rem;
  color: var(--color-charcoal);
  line-height: 1.85;
  font-size: 1.02rem;
}

.principal-closing {
  font-style: italic;
}

.principal-signature {
  margin-top: 1.5rem;
}

.principal-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
}

.principal-role {
  font-size: 1rem;
  color: var(--color-grey);
}

@media (max-width: 860px) {
  .principal-message-wrap {
    grid-template-columns: 1fr;
  }

  .principal-photo-box {
    min-height: 300px;
  }
}

@media (max-width: 1100px) and (min-width: 701px) {
  .header-inner { padding-left: 1.25rem; padding-right: 1.25rem; }
  .logo { font-size: 0.95rem; gap: 0.45rem; margin-right: 1rem; }
  .logo img { width: 42px; height: 42px; }
  .main-nav { gap: 0.55rem; }
  .main-nav a { font-size: 0.82rem; gap: 0.25rem; }
  .nav-icon { width: 0.9rem; height: 0.9rem; }
}

/* ---------- Grid cards (courses, faculty) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.faculty-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-teal-700);
  padding: 1.5rem;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 20px 38px rgba(18, 60, 70, 0.12); }

.card h3 { margin-bottom: 0.5rem; }
.card .meta { color: var(--color-grey); font-size: 0.9rem; margin-bottom: 0.75rem; }

.facilities-page {
  max-width: 1180px;
  padding-top: 3rem;
}

.page-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  padding: 2.2rem 2.4rem;
  border-radius: 22px;
  background: linear-gradient(120deg, #252c35, #3b4652 70%, #5b5147);
  box-shadow: 0 18px 38px rgba(37, 44, 53, 0.15);
}
.page-hero::after {
  content: '';
  position: absolute;
  width: 16rem;
  height: 16rem;
  right: -6rem;
  bottom: -10rem;
  border: 1px solid rgba(239, 180, 95, 0.42);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5rem rgba(239, 180, 95, 0.06), 0 0 0 3rem rgba(239, 180, 95, 0.04);
}
.page-hero .section-kicker { color: var(--color-gold-light); }
.page-hero .page-title {
  position: relative;
  z-index: 1;
  margin-bottom: 0.45rem;
  color: var(--color-white);
}
.page-hero > p:last-child {
  position: relative;
  z-index: 1;
  max-width: 54ch;
  color: var(--color-ivory-dark);
  font-size: 1.02rem;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 3vw, 3rem);
  font-weight: 700;
  color: var(--color-teal-950);
  margin-bottom: 2rem;
}

.facility-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.facility-card {
  background: linear-gradient(180deg, #ffffff, #f5f1e8);
  border: 1px solid rgba(18, 59, 74, 0.18);
  border-radius: 22px;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 8px 18px rgba(18, 59, 74, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-height: 100%;
}

.facility-card:hover {
  transform: translateY(-4px);
  border-color: rgba(184, 134, 63, 0.7);
  box-shadow: 0 16px 30px rgba(18, 59, 74, 0.12);
}

.facility-card h3 {
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  margin-bottom: 0.8rem;
  color: var(--color-teal-950);
}
.facility-card h3::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 0.55rem 0.18rem 0;
  border-radius: 50%;
  background: var(--color-gold);
}

.facility-card p,
.facility-card li {
  color: var(--color-charcoal);
  line-height: 1.75;
  font-size: 1rem;
}

.facility-card ul {
  list-style: square;
  padding-left: 1.2rem;
}

.facility-card li {
  margin-bottom: 0.3rem;
}

.compact-list {
  margin-top: 0.6rem;
  list-style: disc;
}

.small-note {
  font-size: 0.95rem;
  color: var(--color-grey);
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
}

.mini-table th,
.mini-table td {
  border: 1px solid rgba(18, 59, 74, 0.5);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.mini-table th {
  width: 58%;
  background: rgba(244, 239, 231, 0.7);
}

@media (max-width: 860px) {
  .faculty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facility-grid {
    grid-template-columns: 1fr;
  }
}

.course-page {
  max-width: 1180px;
  padding-top: 3rem;
}

.course-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  padding: 2.4rem 2.5rem;
  border-radius: 24px;
  background: linear-gradient(120deg, #252c35, #3b4652 68%, #5b5147);
  box-shadow: 0 20px 40px rgba(37, 44, 53, 0.16);
}
.course-hero::after {
  content: '';
  position: absolute;
  width: 18rem;
  height: 18rem;
  right: -7rem;
  bottom: -11rem;
  border: 1px solid rgba(239, 180, 95, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 0 1.5rem rgba(239, 180, 95, 0.06), 0 0 0 3rem rgba(239, 180, 95, 0.04);
}
.course-hero .section-kicker { color: var(--color-gold-light); }
.course-hero .course-page-title { position: relative; z-index: 1; color: var(--color-white); }
.course-hero-lead {
  position: relative;
  z-index: 1;
  max-width: 52ch;
  margin-top: 0.7rem;
  color: var(--color-ivory-dark);
  font-size: 1.05rem;
}

.course-page-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 3vw, 3rem);
  font-weight: 700;
  color: var(--color-teal-950);
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.course-overview {
  margin-bottom: 2.2rem;
}
.course-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}
.course-fact {
  min-height: 105px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-gold);
  border-radius: 14px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}
.course-fact-wide { grid-column: span 2; }
.course-fact strong {
  display: block;
  color: var(--color-teal-950);
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.35;
}
.course-intro-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: center;
  margin: 2.5rem 0 3rem;
  padding: 1.8rem 2rem;
  border-left: 4px solid var(--color-gold);
  border-radius: 16px;
  background: linear-gradient(135deg, #f4efe5, #ffffff);
}
.course-intro-section h2 { font-size: clamp(1.4rem, 2vw, 1.9rem); }
.course-intro-section > p { color: var(--color-grey); line-height: 1.8; }
.course-content-panel {
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-white);
  box-shadow: var(--shadow-soft);
}

.course-overview-label {
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-grey);
  margin-bottom: 0.75rem;
}

.course-overview-item {
  font-size: 1.08rem;
  color: var(--color-charcoal);
  line-height: 1.8;
}

.course-overview-item p {
  margin: 0;
  max-width: 100%;
}

.course-overview-item strong {
  font-size: 1.3rem;
  color: var(--color-teal-950);
  font-family: var(--font-serif);
}

.course-section {
  margin-bottom: 2.25rem;
}

.course-section h3 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  margin-bottom: 0.8rem;
  color: var(--color-teal-950);
}

.course-section p {
  color: var(--color-charcoal);
  line-height: 1.9;
  font-size: 1.05rem;
  max-width: 100%;
}

.course-table-panel {
  margin: 2.5rem 0;
}

.course-table-panel h4 {
  text-align: center;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  color: var(--color-teal-950);
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  letter-spacing: 0.02em;
}

.table-wrap {
  overflow-x: auto;
}

.course-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--color-white);
  border: 2px solid rgba(18, 59, 74, 0.8);
}

.course-table th,
.course-table td {
  border: 1px solid rgba(18, 59, 74, 0.85);
  padding: 0.9rem 0.8rem;
  text-align: center;
  vertical-align: middle;
  font-size: 1rem;
}

.course-table thead th {
  background: #f4efe7;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-teal-950);
}

.course-table tbody td {
  color: var(--color-charcoal);
}

.total-row td {
  font-weight: 700;
  background: #f5f4f1;
}

.marks-box {
  max-width: 780px;
  margin-top: 1.25rem;
  border: 1px solid rgba(18, 59, 74, 0.8);
  background: var(--color-white);
}

.marks-row {
  display: grid;
  grid-template-columns: 80px 1fr 150px;
  border-bottom: 1px solid rgba(18, 59, 74, 0.8);
}

.marks-row:last-child {
  border-bottom: none;
}

.marks-row > div {
  padding: 0.8rem 0.9rem;
  border-right: 1px solid rgba(18, 59, 74, 0.8);
  display: flex;
  align-items: center;
}

.marks-row > div:last-child {
  border-right: none;
}

.marks-row.header-row {
  font-weight: 700;
  font-family: var(--font-serif);
  background: #f4efe7;
  color: var(--color-teal-950);
}

.marks-row.subheader-row {
  background: #f7f5ef;
}

.opportunities-section {
  padding-top: 1rem;
  border-top: 1px solid rgba(18, 59, 74, 0.35);
}

.opportunities-list {
  margin-top: 1rem;
  padding-left: 1.4rem;
  list-style: square;
  color: var(--color-charcoal);
}

.opportunities-list li {
  margin-bottom: 0.55rem;
  line-height: 1.8;
  font-size: 1.02rem;
}

.faculty-card { text-align: left; }
.faculty-page .faculty-card {
  padding: 0.8rem 0.8rem 1rem;
  overflow: hidden;
  border-top: 3px solid var(--color-gold);
}
.faculty-page .faculty-card h3,
.faculty-page .faculty-card .meta,
.faculty-page .faculty-card > p:last-child {
  margin-left: 0.35rem;
  margin-right: 0.35rem;
}
.faculty-page .faculty-card h3 { margin-top: 0.15rem; }
.faculty-biodata-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2rem;
}
.faculty-biodata-link:hover { color: var(--color-gold); }
.faculty-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.8rem;
  background: var(--color-ivory-dark);
}

/* ---------- Notices list ---------- */
.notice-list {
  display: grid;
  gap: 0.55rem;
}
.resource-page {
  max-width: 1180px;
}
.resource-page .section-head {
  margin-bottom: 1.4rem;
}
.resource-page .notice-list {
  padding: 1.25rem;
  border: 1px solid rgba(37, 44, 53, 0.1);
  border-radius: 18px;
  background: linear-gradient(135deg, #f1f4f2, #f8f4ec);
}
.resource-page .notice-item {
  min-height: 72px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  background: var(--color-white);
}
.updates-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  align-items: start;
}
.home-updates-section {
  padding-top: 2.5rem;
  padding-bottom: 2.75rem;
}
.home-updates-section .section-head {
  margin-bottom: 1.15rem;
}
.home-updates-section .notice-item {
  padding: 0.6rem 0.8rem;
}
.updates-column {
  min-width: 0;
}
.updates-more {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}
.updates-more .btn {
  margin-top: 0;
  padding: 0.55rem 1.15rem;
  font-size: 0.84rem;
}
.notices-downloads-head {
  margin-top: 4rem;
}
.notice-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(18, 59, 74, 0.16);
  border-left: 4px solid var(--color-gold);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-white), #f8f3ea);
  box-shadow: 0 8px 20px rgba(18, 59, 74, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.notice-item:hover {
  transform: translateY(-3px);
  border-color: rgba(184, 134, 63, 0.55);
  box-shadow: 0 14px 28px rgba(18, 59, 74, 0.12);
}
.notice-content { min-width: 0; }
.notice-content h3 {
  margin: 0 0 0.2rem;
  color: var(--color-teal-950);
  font-size: 1rem;
  line-height: 1.3;
}
.notice-date { color: var(--color-grey); font-size: 0.78rem; white-space: nowrap; }
.notice-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
  align-items: center;
}
.notice-action {
  flex: 0 0 auto;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.notice-view {
  border: 1px solid var(--color-teal-700);
  color: var(--color-teal-950);
}
.notice-download {
  border: 1px solid var(--color-gold);
  background: var(--color-gold);
  color: var(--color-white);
}
.notice-view:hover,
.notice-download:hover {
  background: var(--color-teal-700);
  color: var(--color-white);
  transform: translateY(-1px);
}

@media (max-width: 560px) {
  .notice-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .notice-actions {
    width: 100%;
  }
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
  align-items: stretch;
}
.gallery-intro {
  max-width: none;
  margin-top: 0.65rem;
  color: var(--color-grey);
  font-size: 0.98rem;
  white-space: nowrap;
}
.gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(37, 44, 53, 0.14);
  border-radius: 18px;
  background: var(--color-teal-950);
  box-shadow: 0 12px 26px rgba(37, 44, 53, 0.1);
  isolation: isolate;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.45s ease;
}
.gallery-overlay {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 42%;
  padding: 2.5rem 1rem 0.9rem;
  color: var(--color-white);
  background: linear-gradient(180deg, transparent, rgba(20, 27, 34, 0.88));
  transform: translateY(0.35rem);
  transition: transform 0.3s ease;
}
.gallery-caption {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}
.gallery-view {
  flex: 0 0 auto;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(0.35rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-item:hover {
  box-shadow: 0 18px 34px rgba(37, 44, 53, 0.18);
}
.gallery-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.08) contrast(1.04);
}
.gallery-item:hover .gallery-overlay,
.gallery-item:hover .gallery-view {
  transform: translateY(0);
}
.gallery-item:hover .gallery-view { opacity: 1; }

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: rgba(15, 21, 27, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.gallery-lightbox.open {
  opacity: 1;
  visibility: visible;
}
.gallery-lightbox img {
  max-width: min(94vw, 1200px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-white);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.gallery-lightbox-close:hover { background: var(--color-gold); }
body.lightbox-open { overflow: hidden; }

@media (max-width: 860px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .gallery-intro { white-space: normal; }
  .gallery-lightbox { padding: 1rem; }
  .gallery-lightbox img { max-width: 96vw; max-height: 82vh; border-radius: 8px; }
  .gallery-lightbox-close { top: 0.75rem; right: 0.75rem; }
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--color-teal-950);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: var(--color-white);
}
.form-group input:focus,
.form-group textarea:focus { outline: 2px solid var(--color-teal-600); border-color: var(--color-teal-600); }

.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.captcha-group {
  margin-top: 1.25rem;
}

.captcha-box {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 34px 112px;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgba(24, 78, 90, 0.8);
  border-radius: 18px;
  background: linear-gradient(180deg, #f2f7f7, #eaf1f1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}

.captcha-display-wrap {
  display: contents;
  min-width: 0;
}

.captcha-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 0.34rem 0.4rem;
  border: 1px solid rgba(31, 73, 87, 0.7);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.32), rgba(214, 229, 232, 0.4));
  color: #1c2d35;
  font-size: 1.1rem;
  line-height: 1;
  letter-spacing: 0.12em;
  font-weight: 900;
  text-align: center;
  transform: skewX(-12deg) rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
  font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
  text-shadow:
    1px 0 0 rgba(32, 58, 68, 0.2),
    -1px 0 0 rgba(133, 91, 31, 0.18),
    0 1px 0 rgba(30, 88, 102, 0.2),
    2px 1px 0 rgba(177, 94, 35, 0.14),
    -2px 0 0 rgba(82, 108, 123, 0.14);
  filter: contrast(1.2) saturate(1.15) blur(0.04px);
  background-image: radial-gradient(circle at 12% 28%, rgba(44, 111, 131, 0.4) 0 1px, transparent 1.6px),
    radial-gradient(circle at 30% 76%, rgba(214, 74, 61, 0.42) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 52% 22%, rgba(45, 154, 102, 0.42) 0 1px, transparent 1.6px),
    radial-gradient(circle at 74% 70%, rgba(122, 92, 200, 0.38) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 92% 36%, rgba(216, 127, 26, 0.45) 0 1px, transparent 1.6px),
    repeating-linear-gradient(162deg, transparent 0 13px, rgba(45, 115, 132, 0.2) 14px, transparent 15px 25px),
    radial-gradient(circle at 20% 20%, rgba(246, 183, 94, 0.14), transparent 22%),
    radial-gradient(circle at 78% 32%, rgba(48, 121, 147, 0.14), transparent 22%),
    linear-gradient(135deg, rgba(255,255,255,0.35), rgba(214, 229, 232, 0.4));
  position: relative;
}

.captcha-letter {
  display: inline-block;
  color: var(--captcha-color);
  transform: rotate(var(--captcha-rotation)) translateY(var(--captcha-shift));
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.12), 1px 1px 0 rgba(255, 255, 255, 0.16);
}

.captcha-display::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(18deg, rgba(24, 32, 39, 0.09) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(24, 32, 39, 0.04) 0 1px, transparent 1px 5px);
  pointer-events: none;
  mix-blend-mode: multiply;
}

.captcha-display::after {
  content: '';
  position: absolute;
  inset: 2px;
  background-image: radial-gradient(circle, rgba(37, 82, 94, 0.48) 0 1px, transparent 1.4px);
  background-size: 13px 11px;
  background-position: 3px 2px;
  opacity: 0.65;
  pointer-events: none;
}

.captcha-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(31, 73, 87, 0.35);
  background: rgba(255,255,255,0.22);
  color: var(--color-teal-950);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
}
.captcha-refresh svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.captcha-refresh:hover {
  background: rgba(255,255,255,0.7);
  transform: rotate(25deg);
}

.captcha-box input {
  width: 100%;
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
  min-height: 40px;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.hidden-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}
.alert-success { background: #e4f0e0; color: #2c5c22; border: 1px solid #b8d8ae; }
.alert-error { background: #f6e2e0; color: #7a2a20; border: 1px solid #e3b3ac; }

/* ---------- Footer ---------- */
.site-footer {
  background: linear-gradient(135deg, var(--color-teal-950), #453d42);
  color: var(--color-ivory-dark);
  margin-top: 2rem;
  border-top: 4px solid var(--color-gold);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 2.25rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 3.5rem;
}

.footer-col h3 {
  color: var(--color-gold-light);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.footer-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.footer-brand h3 { margin: 0; }
.footer-col p, .footer-col a {
  color: var(--color-ivory-dark);
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.55rem;
}
.footer-col a:hover { color: var(--color-gold-light); }
.footer-contact {
  display: flex !important;
  align-items: flex-start;
  gap: 0.6rem;
}
.footer-icon {
  color: var(--color-gold-light);
  font-size: 1rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.footer-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  color: var(--color-gold-light) !important;
  font-weight: 700;
}
.footer-cta span { transition: transform 0.2s ease; }
.footer-cta:hover span { transform: translateX(4px); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(85, 166, 154, 0.45);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--color-ivory-dark);
}
.footer-bottom p { margin: 0; }
.footer-bottom span { color: var(--color-gold-light); }

/* ============================================
   Responsive breakpoints
   ============================================ */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-height: 340px; }
  .contact-wrap { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .nav-toggle { display: inline-block; }

  .logo span { max-width: 14rem; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-teal-950);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0;
    border-left: 0;
    border-top: 1px solid var(--color-teal-700);
  }

  .main-nav.open { display: flex; }

  .main-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-teal-700);
  }

  .footer-inner { grid-template-columns: 1fr; text-align: left; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
}

@media (max-width: 480px) {
  .section { padding: 2.25rem 1rem; }
  .hero { padding: 2.25rem 1rem 2.5rem; }
  .hero-figure { max-height: 230px; }
  .btn-outline { margin-left: 0; display: block; margin-top: 0.75rem; width: fit-content; }
}

@media (max-width: 600px) {
  body { overflow-x: hidden; }

  .section {
    width: 100%;
    padding: 3rem 1rem;
  }

  .header-inner {
    padding: 0.55rem 0.85rem;
    gap: 0.75rem;
  }

  .logo {
    min-width: 0;
    margin-right: 0;
    font-size: 0.9rem;
  }

  .logo img { width: 40px; height: 40px; }
  .logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .main-nav { padding: 0.65rem 0.85rem; }
  .main-nav a { min-height: 44px; }

  .section-lead {
    max-width: 100%;
    white-space: normal;
  }

  .hero-inner { gap: 1.5rem; }
  .hero-figure { border-radius: 20px; aspect-ratio: 4 / 3; max-height: none; }
  .hero-figure { transform: none; }
  .hero h1 { font-size: clamp(1.8rem, 9vw, 2.4rem); }
  .hero p { font-size: 0.96rem; }
  .btn-primary,
  .btn-outline { max-width: 100%; }

  .updates-grid { grid-template-columns: 1fr; gap: 2.25rem; }

  .section-head { margin-bottom: 1.5rem; }
  .section-head h2 { font-size: 1.5rem; }
  .history-grid,
  .facility-grid,
  .grid { grid-template-columns: 1fr; gap: 1rem; }
  .info-card,
  .facility-card,
  .card { padding: 1.15rem; border-radius: 14px; }

  .governing-table-wrap,
  .table-wrap { max-width: 100%; }
  .governing-table th,
  .governing-table td { padding: 0.7rem; font-size: 0.88rem; }
  .course-table th,
  .course-table td { padding: 0.65rem 0.55rem; font-size: 0.86rem; }

  .principal-photo-box,
  .principal-photo { min-height: 250px; }
  .principal-message-card { padding: 1.2rem; }
  .page-hero { margin-bottom: 1.4rem; padding: 1.5rem 1.15rem; border-radius: 17px; }
  .page-hero > p:last-child { font-size: 0.92rem; }
  .resource-page .notice-list { padding: 0.65rem; border-radius: 14px; }
  .resource-page .notice-item { min-height: 0; padding-left: 0.8rem; padding-right: 0.8rem; }
  .course-page,
  .facilities-page { padding-top: 2.25rem; }
  .page-title,
  .course-page-title { font-size: 2rem; margin-bottom: 1.4rem; }
  .course-hero { padding: 1.7rem 1.2rem; border-radius: 18px; }
  .course-hero-lead { font-size: 0.94rem; }
  .course-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 1.7rem; }
  .course-fact { min-height: 92px; padding: 0.8rem; }
  .course-fact-wide { grid-column: 1 / -1; }
  .course-intro-section { grid-template-columns: 1fr; gap: 0.8rem; margin: 1.8rem 0 2.2rem; padding: 1.2rem; }
  .course-content-panel { padding: 1.1rem; }
  .course-table-panel { margin: 2rem 0; }

  .marks-row { grid-template-columns: 55px minmax(0, 1fr) 90px; }
  .marks-row > div { padding: 0.6rem 0.5rem; font-size: 0.82rem; }

  .notice-item { padding: 0.8rem; }
  .notice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .notice-action { text-align: center; }

  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .gallery-overlay { min-height: 52%; padding: 2rem 0.65rem 0.65rem; }
  .gallery-caption { font-size: 0.78rem; }
  .gallery-view { opacity: 1; transform: none; font-size: 0.66rem; }

  .captcha-box { grid-template-columns: minmax(0, 1fr) 34px; }
  .captcha-box input { grid-column: 1 / -1; }
  .captcha-display { font-size: 1rem; letter-spacing: 0.09em; }

  .footer-inner { padding: 2rem 1rem 1.5rem; gap: 1.5rem; }
  .footer-bottom { padding: 0.9rem 1rem; }
  .footer-col p,
  .footer-col a { overflow-wrap: anywhere; }
}

@media (max-width: 400px) {
  .logo span { max-width: 11rem; }

  .hero { padding-top: 1.8rem; }
  .hero-figure { aspect-ratio: 1 / 1; }
  .hero-badge { right: 0.7rem; top: 0.7rem; font-size: 0.68rem; }

  .course-facts { grid-template-columns: 1fr; }
  .course-fact-wide { grid-column: auto; }
  .gallery-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
