/* =========================================================
   Railway Higher Secondary School — Shared Stylesheet
   Theme: Navy Blue + Crimson Red | Modern Flat Design
   ========================================================= */

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

/* ── CSS Variables ── */
:root {
  --navy:      #0d2342;
  --navy-mid:  #163356;
  --navy-light:#1e4a7a;
  --crimson:   #b22222;
  --crimson-lt:#d93025;
  --gold:      #f0a500;
  --white:     #ffffff;
  --off-white: #f5f7fa;
  --text-dark: #1a1a2e;
  --text-mid:  #4a5568;
  --text-light:#718096;
  --border:    #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(13,35,66,.08);
  --shadow-md: 0 4px 20px rgba(13,35,66,.12);
  --shadow-lg: 0 8px 40px rgba(13,35,66,.18);
  --radius:    10px;
  --transition: 0.3s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--off-white);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER / BRAND BAR ── */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
  padding: 20px 40px 16px;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--crimson), var(--gold), var(--crimson));
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
  flex-shrink: 0;
  transition: transform var(--transition);
}
.header-logo:hover { transform: scale(1.05); }
.header-center { flex: 1; text-align: center; }
.school-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.school-sub {
  font-size: clamp(0.72rem, 1.4vw, 0.9rem);
  color: rgba(255,255,255,.8);
  margin-top: 6px;
  font-weight: 400;
  letter-spacing: 0.3px;
}
.school-contact {
  font-size: clamp(0.68rem, 1.2vw, 0.8rem);
  color: var(--gold);
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ── NAVBAR ── */
nav.topnav {
  background: var(--navy);
  border-bottom: 3px solid var(--crimson);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
nav.topnav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 15px 22px;
  display: inline-block;
  position: relative;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
nav.topnav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 3px;
  background: var(--gold);
  transition: left var(--transition), right var(--transition);
}
nav.topnav a:hover { color: var(--white); background: rgba(255,255,255,.07); }
nav.topnav a:hover::after { left: 0; right: 0; }
nav.topnav a.active { color: var(--white); background: var(--crimson); }
nav.topnav a.active::after { left: 0; right: 0; background: var(--gold); }

/* ── PAGE CONTENT WRAPPER ── */
.page-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 24px 60px;
}

/* ── SECTION TITLE ── */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--crimson);
  display: inline-block;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 32px;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── TABLES ── */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.styled-table thead {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
}
.styled-table thead th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.styled-table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
  vertical-align: top;
}
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table tbody tr:nth-child(even) { background: #f0f4f9; }
.styled-table tbody tr:hover { background: #e8f0fe; transition: background var(--transition); }
.styled-table td.sno { color: var(--crimson); font-weight: 700; }
.styled-table th.sno { }

/* ── DOWNLOAD LINKS ── */
a.dl-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--crimson);
  font-weight: 600;
  text-decoration: none;
  padding: 5px 14px;
  border: 1.5px solid var(--crimson);
  border-radius: 6px;
  font-size: 0.82rem;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
a.dl-link:hover { background: var(--crimson); color: var(--white); }

/* ── NOTE BOX ── */
.note-box {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  border-left: 5px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-top: 28px;
  font-size: 0.88rem;
  color: #5a4000;
  line-height: 1.7;
}
.note-box strong { color: var(--crimson); }

/* ── FOOTER ── */
footer.site-footer {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 22px 24px;
  font-size: 0.82rem;
  border-top: 3px solid var(--crimson);
  margin-top: auto;
}
footer.site-footer p { margin: 0; line-height: 1.8; }

/* ── HERO (Index Page) ── */
.hero-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-bottom: 4px solid var(--crimson);
  max-height: 540px;
}
.hero-wrapper img.hero-img {
  width: 100%;
  height: 540px;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: brightness(0.6);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.hero-badge {
  background: var(--crimson);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 30px;
  margin-bottom: 18px;
  animation: fadeDown 0.8s ease both;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  text-shadow: 0 3px 16px rgba(0,0,0,.6);
  animation: fadeUp 0.9s ease 0.2s both;
}
.hero-sub {
  color: rgba(255,255,255,.9);
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  margin-top: 14px;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  animation: fadeUp 0.9s ease 0.35s both;
}
.hero-divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 16px auto 0;
  border-radius: 2px;
  animation: grow 1s ease 0.55s both;
}

/* ── GALLERY PAGE ── */
.gallery-section { margin-bottom: 52px; }
.gallery-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--navy);
  margin-bottom: 18px;
  padding: 10px 20px;
  background: linear-gradient(90deg, #e8f0fe, var(--off-white));
  border-left: 5px solid var(--crimson);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.gallery-grid img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  box-shadow: var(--shadow-sm);
  display: block;
  margin: 0;
}
.gallery-grid img:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-lg);
  filter: brightness(1.08);
}

/* ── LIGHTBOX MODAL ── */
.lbx-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.93);
  align-items: center;
  justify-content: center;
}
.lbx-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.lbx-img {
  display: block;
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0,0,0,.8);
  margin: 0;
}
.lbx-close {
  position: fixed;
  top: 16px; right: 20px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.4);
  color: var(--white);
  font-size: 1.6rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lbx-close:hover { background: var(--crimson); border-color: var(--crimson); }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes grow {
  from { width: 0; } to { width: 60px; }
}
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .site-header { padding: 16px 20px 12px; }
  .header-inner { flex-direction: column; gap: 10px; }
  .header-logo { width: 90px; height: 90px; }
  nav.topnav a { padding: 12px 14px; font-size: 0.78rem; }
  .page-content { padding: 24px 16px 40px; }
  .card { padding: 20px 16px; }
  .hero-wrapper img.hero-img { height: 320px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid img { height: 140px; }
}
