/* ============================================================
   D.N.B. College — Main Stylesheet
   Tenuahi, Madhubani, Bihar
   Designed by iBow Solutions Pvt. Ltd.
   ============================================================ */

:root {
  --primary:        #C85212;
  --primary-dark:   #9E3D0A;
  --primary-light:  #F5813A;
  --navy:           #1B2B4B;
  --navy-light:     #2C3E6B;
  --bg:             #F7F8FB;
  --white:          #FFFFFF;
  --text:           #2D2D2D;
  --text-muted:     #5E6E82;
  --border:         #E2E4E9;
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.08);
  --shadow:         0 4px 16px rgba(0,0,0,0.10);
  --radius:         8px;
  --radius-lg:      12px;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
/* Both html AND body need overflow-x: hidden — body alone is ignored on iOS Safari */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}
body {
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }
button { cursor: pointer; }

/* ─── Layout Container ───────────────────────────────────── */
.container {
  width: 92%;
  max-width: 1140px;
  margin: 0 auto;
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--primary);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

/* Logo-only identity block — logo.png already contains the college name */
.header-identity {
  display: flex;
  align-items: center;
  flex-shrink: 1;   /* allow shrinking when viewport is narrow */
  min-width: 0;     /* flex items need this to shrink below natural content width */
}

/* The logo image IS the identity — no text alongside it */
.header-emblem {
  height: 80px;
  width: auto;
  display: block;
  flex-shrink: 1;   /* allow shrinking */
  max-width: 260px; /* explicit cap — prevents landscape logos from blowing out header */
}

/* UDISE code box — right side (single merged declaration) */
.header-udise {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 10px 16px;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 1;   /* allow shrinking — was 0, which blocked mobile layout */
  min-width: 0;     /* allow shrinking below natural content width */
  /* Number text styling — applies to the anonymous text node (the UDISE number) */
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

/* "UDISE CODE" label — small-caps, overrides parent font */
.header-udise strong {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  color: #7A92B0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  line-height: 1;
}

/* ─── Navigation ─────────────────────────────────────────── */
.site-nav {
  background: var(--primary);
  position: relative;
}

.nav-container {
  display: flex;
  align-items: stretch;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  padding: 12px 0;
  line-height: 1;
  align-self: center;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
}

.nav-list li a {
  display: block;
  color: var(--white);
  padding: 13px 18px;
  font-size: 0.92rem;
  font-weight: 500;
  border-right: 1px solid rgba(255,255,255,0.15);
  transition: background 0.18s;
  white-space: nowrap;
}

.nav-list li a:hover {
  background: var(--primary-dark);
}

.nav-list li a.active {
  background: var(--primary-dark);
  box-shadow: inset 0 -3px 0 rgba(255,255,255,0.5);
}

/* ============================================================
   HERO  (homepage only)
   ============================================================ */
.hero {
  position: relative;
  /* Fallback colour while image loads */
  background-color: var(--navy);
  /* New hero image — filename has a space, must be quoted */
  background-image: url('../images/hero shot.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
  min-height: 480px;
}

/* img tag no longer used — hidden as safety fallback */
.hero-img {
  display: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /*
    Balanced vignette overlay:
    - Lighter in the center so the building shows through clearly
    - Darker at edges/bottom so text stays crisp and readable
    - Slight warm deepening at bottom for grounding
  */
  background:
    radial-gradient(
      ellipse at 50% 42%,
      rgba(27, 43, 75, 0.28) 0%,
      rgba(27, 43, 75, 0.55) 55%,
      rgba(27, 43, 75, 0.78) 100%
    );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
}

.hero-overlay h2 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
  margin-bottom: 10px;
}

.hero-overlay .subtitle {
  font-size: 1.08rem;
  color: #CBD9EE;
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
  max-width: 560px;
  margin-bottom: 22px;
  line-height: 1.6;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(200, 82, 18, 0.90);
  color: var(--white);
  padding: 8px 20px;
  border-radius: 100px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ============================================================
   STATS BAR  (homepage — below hero)
   ============================================================ */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stats-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  padding: 22px 36px;
  border-right: 1px solid var(--border);
  flex: 1;
  min-width: 140px;
}

.stat-item:last-child {
  border-right: none;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 6px;
  font-weight: 600;
}

/* ============================================================
   PAGE BANNER  (inner pages)
   ============================================================ */
.page-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-bottom: 4px solid var(--primary);
  padding: 36px 0;
  position: relative;
  overflow: hidden;
}

/* Subtle decorative diagonal stripe for visual interest */
.page-banner::after {
  content: '';
  position: absolute;
  top: 0;
  right: -60px;
  width: 280px;
  height: 100%;
  background: rgba(255,255,255,0.03);
  transform: skewX(-15deg);
  pointer-events: none;
}

.page-banner h2 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.page-banner p {
  color: #9AADCA;
  font-size: 0.9rem;
  margin-top: 6px;
}

/* breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: #9AADCA;
}
.breadcrumb a { color: #D0DDF0; }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb span { color: #6A8AAA; }

/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
.main-content {
  padding: 52px 0 68px;
}

/* ─── Section headings ───────────────────────────────────── */
.section-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy);
  padding-left: 16px;
  border-left: 4px solid var(--primary);
  margin-bottom: 8px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  padding-left: 20px;
  margin-bottom: 32px;
  border-left: 4px solid transparent;
}

/* ─── Generic card ───────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 26px;
  border-top: 4px solid var(--primary);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 52px;
}

/* Principal card */
.principal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
  border-top: 4px solid var(--primary);
}

.principal-card img {
  width: 150px;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 auto 16px;
  border: 3px solid var(--primary);
}

.principal-card .p-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.principal-card .p-role {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
  display: block;
}

.principal-card .divider {
  height: 2px;
  background: var(--border);
  margin: 14px 0;
  border-radius: 2px;
}

.principal-card .p-subject {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* About section */
.about-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.about-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.9;
}

/* Quick links */
.quick-links {
  margin-top: 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.ql-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 4px solid var(--primary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ql-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 32px rgba(27,43,75,0.14);
  border-bottom-color: var(--primary-dark);
}

.ql-icon {
  font-size: 2rem;
  line-height: 1;
}

.ql-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
}

.ql-card p {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.ql-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  font-size: 0.87rem;
  font-weight: 600;
  transition: gap 0.2s;
}

.ql-link:hover { gap: 9px; }

/* ============================================================
   COURSES PAGE
   ============================================================ */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-bottom: 40px;
}

.stream-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stream-header {
  background: var(--navy);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stream-icon { font-size: 1.6rem; }

.stream-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
}

.stream-body {
  padding: 6px 0 4px;
}

.stream-body li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stream-body li:last-child { border-bottom: none; }

.stream-body li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-light);
  flex-shrink: 0;
}

.courses-note {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-left: 4px solid #4F46E5;
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 0.9rem;
  color: #3730A3;
  line-height: 1.7;
}

/* ============================================================
   STAFF PAGE
   ============================================================ */
.section-block {
  margin-bottom: 56px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: var(--white);
}

.staff-table {
  width: 100%;
  font-size: 0.875rem;
}

.staff-table thead tr {
  background: var(--primary);
  color: var(--white);
}

.staff-table thead th {
  padding: 14px 16px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.staff-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.staff-table tbody tr:last-child td { border-bottom: none; }
.staff-table tbody tr:nth-child(even) td { background: #FBF4F1; }
.staff-table tbody tr:hover td { background: #F5E6DE; }

.staff-table .sr { color: var(--text-muted); font-weight: 600; text-align: center; }
.staff-table .name { font-weight: 600; color: var(--navy); }
.staff-table .desig { color: var(--primary); font-weight: 500; font-size: 0.82rem; }
.staff-table .date { color: var(--text-muted); font-size: 0.82rem; white-space: nowrap; }

/* ============================================================
   GRANT-IN-AID PAGE
   ============================================================ */
.pdf-wrapper {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.pdf-wrapper iframe {
  width: 100%;
  height: 720px;
  border: none;
  border-radius: var(--radius);
}

.pdf-alt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.pdf-alt-link:hover { text-decoration: underline; }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.contact-info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header-bar {
  background: var(--primary);
  color: var(--white);
  padding: 18px 24px;
  font-size: 1rem;
  font-weight: 700;
}

.contact-row {
  display: flex;
  border-bottom: 1px solid var(--border);
}

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

.contact-row .c-label {
  width: 120px;
  flex-shrink: 0;
  padding: 13px 18px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.contact-row .c-value {
  padding: 13px 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.contact-row .c-value a {
  color: var(--primary);
  font-weight: 500;
}

.contact-row .c-value a:hover { text-decoration: underline; }

.map-placeholder {
  background: #E8ECF5;
  border-radius: var(--radius-lg);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 32px;
  border: 2px dashed var(--border);
}

.map-placeholder .map-icon { font-size: 2.5rem; }

/* ============================================================
   PAYMENT PAGE
   ============================================================ */
.payment-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 36px;
}

.payment-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.payment-card .card-header-bar {
  background: var(--navy);
}

.payment-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  align-items: stretch;
}

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

.payment-row .p-label {
  width: 180px;
  flex-shrink: 0;
  padding: 13px 18px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.payment-row .p-value {
  padding: 13px 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* QR card */
.qr-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  text-align: center;
  border-top: 4px solid var(--primary);
}

.qr-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}

.qr-box {
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.qr-box .qr-icon { font-size: 2.4rem; }

.qr-upi {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qr-upi strong {
  display: block;
  color: var(--navy);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

/* Payment instructions */
.payment-instructions {
  background: #FFF8F5;
  border: 1px solid #F5C9B0;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 22px 26px;
}

.payment-instructions h4 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
}

.payment-instructions ol {
  list-style: decimal;
  padding-left: 20px;
}

.payment-instructions ol li {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.7;
}

.payment-instructions ol li:last-child { margin-bottom: 0; }

.payment-notice {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(200, 82, 18, 0.07);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--primary-dark);
  font-weight: 500;
}

/* ============================================================
   PAGE INTRO BLOCK  (reusable intro card for inner pages)
   ============================================================ */
.page-intro {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 40px;
  border-left: 5px solid var(--primary);
}

.page-intro h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.page-intro p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.8;
}

.page-intro p + p {
  margin-top: 10px;
}

/* ============================================================
   STAFF SUMMARY STATS  (top of staff page)
   ============================================================ */
.staff-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.staff-stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 32px;
  text-align: center;
  flex: 1;
  min-width: 140px;
  border-top: 4px solid var(--primary);
}

.staff-stat-card .s-num {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.staff-stat-card .s-label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-top: 7px;
}

.staff-stat-card.total {
  border-top-color: var(--navy);
}

.staff-stat-card.total .s-num {
  color: var(--navy);
}

/* ============================================================
   DOWNLOAD BUTTON
   ============================================================ */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--primary);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.18s, transform 0.15s;
  border: none;
  cursor: pointer;
}

.btn-download:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--navy);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  border: 2px solid var(--border);
  transition: border-color 0.18s, color 0.18s;
}

.btn-secondary:hover {
  border-color: var(--navy);
  color: var(--navy-light);
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ============================================================
   ALERT / NOTICE BANNERS
   ============================================================ */
.alert {
  border-radius: var(--radius);
  padding: 14px 18px 14px 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.alert-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert.alert-warning {
  background: #FFF8F3;
  border: 1px solid #FAD5BC;
  border-left: 4px solid var(--primary);
  color: #7A3312;
}

.alert.alert-info {
  background: #F0F5FF;
  border: 1px solid #BFD0FF;
  border-left: 4px solid #3B65E8;
  color: #1E3A8A;
}

.alert.alert-success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 4px solid #16A34A;
  color: #14532D;
}

.alerts-block {
  margin-bottom: 36px;
}

/* ============================================================
   CONTACT PAGE — Enhanced Layout
   ============================================================ */
.contact-two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* Inline icon row in contact card */
.c-icon {
  font-size: 1rem;
  margin-right: 4px;
}

/* ============================================================
   GRANT-IN-AID PAGE
   ============================================================ */
.grant-viewer {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.grant-viewer-header {
  background: var(--navy);
  padding: 18px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.grant-viewer-header span {
  color: #9AADCA;
  font-size: 0.9rem;
  font-weight: 600;
}

.grant-viewer iframe {
  width: 100%;
  height: 720px;
  border: none;
  display: block;
}

/* ============================================================
   COURSES — Stream card enhancements
   ============================================================ */
.stream-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 100px;
  padding: 2px 10px;
  margin-left: auto;
}

.courses-intro {
  margin-bottom: 40px;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy);
  color: #9AADCA;
  padding: 48px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand h3 {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-brand .udise-tag {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.76rem;
  margin-bottom: 12px;
  color: #C0CEDE;
  letter-spacing: 0.05em;
}

.footer-brand p {
  font-size: 0.87rem;
  line-height: 1.85;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.footer-col ul li { margin-bottom: 9px; }

.footer-col ul li a {
  font-size: 0.87rem;
  color: #9AADCA;
  transition: color 0.18s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-col ul li a::before {
  content: "›";
  color: var(--primary-light);
  font-size: 1rem;
  line-height: 1;
}

.footer-col ul li a:hover { color: var(--primary-light); }

.footer-col p {
  font-size: 0.87rem;
  line-height: 1.85;
}

.footer-col .contact-line {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.87rem;
  align-items: flex-start;
}

.footer-col .contact-line .icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  margin-top: 1px;
}

.footer-bottom {
  padding: 16px 0;
  text-align: center;
  font-size: 0.8rem;
  color: #6A7F9A;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom a { color: #8AA0BC; }
.footer-bottom a:hover { color: var(--primary-light); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: 200px 1fr;
    gap: 24px;
  }
}

@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr;
  }

  .contact-two-col {
    grid-template-columns: 1fr;
  }

  .principal-card {
    display: flex;
    align-items: center;
    gap: 24px;
    text-align: left;
    padding: 20px 24px;
  }

  .principal-card img {
    width: 90px;
    height: 110px;
    margin: 0;
    flex-shrink: 0;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .payment-layout {
    grid-template-columns: 1fr;
  }

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

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

  .nav-list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    z-index: 1000;
    box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list li a {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 14px 20px;
  }

  .hero-overlay h2 { font-size: 1.7rem; }
  .hero {
    min-height: 360px;
    background-position: center 30%;
  }
  .stat-item { padding: 18px 20px; min-width: 100px; }
  .stat-num { font-size: 1.6rem; }

  .page-banner h2 { font-size: 1.5rem; }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

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

@media (max-width: 560px) {
  .header-top {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
  }

  /* Emblem: smaller height, explicit max-width so wide logos can't break layout */
  .header-emblem {
    height: 52px;
    max-width: 160px;
    object-fit: contain;
    object-position: left center;
  }

  /* UDISE: compact, allow wrapping, allow shrinking */
  .header-udise {
    padding: 6px 10px;
    white-space: normal;
    text-align: right;
    flex-shrink: 1;
    min-width: 0;
  }

  .header-udise strong {
    font-size: 0.60rem;
  }

  .about-card {
    padding: 24px 20px;
  }

  .main-content {
    padding: 36px 0 52px;
  }

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

  .stat-item {
    padding: 16px 12px;
    min-width: 80px;
  }

  .stat-num { font-size: 1.4rem; }
  .stat-label { font-size: 0.68rem; }

  .pdf-wrapper iframe,
  .grant-viewer iframe {
    height: 480px;
  }

  .page-intro {
    padding: 20px 20px;
  }

  .staff-stat-card {
    padding: 18px 20px;
    min-width: 100px;
  }

  .staff-stat-card .s-num {
    font-size: 1.7rem;
  }

  .grant-viewer-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .payment-row .p-label {
    width: 140px;
    font-size: 0.78rem;
  }

  /* Ensure no element causes horizontal scroll at very small screens */
  .about-card,
  .page-intro,
  .contact-info-card,
  .payment-card,
  .qr-card,
  .staff-summary,
  .stream-card,
  .grant-viewer {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* ─── 430px and below: stats bar wraps to 2×2 grid ─────── */
@media (max-width: 430px) {
  /* Force 2 stats per row instead of cramming 4 into ~330px */
  .stat-item {
    flex: 0 0 calc(50% - 0.5px); /* 2 per row; subtract half the centre border */
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  /* Re-add right border for left-column items only */
  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }

  /* Remove bottom border from the last row */
  .stat-item:nth-last-child(-n+2) {
    border-bottom: none;
  }

  /* Ensure header stays in two rows cleanly at 360px */
  .header-top {
    align-items: flex-start;
  }

  /* Further reduce emblem if needed */
  .header-emblem {
    height: 48px;
    max-width: 140px;
  }

  /* Principal card: stack vertically on tiny screens */
  .principal-card {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .principal-card img {
    margin: 0 auto;
  }
}
