/* ==========================================================================
   Shivam Public School, Khadial  -  site styles

   HOW THIS FILE IS ORGANISED (top to bottom)
     1. Variables & base      colours, fonts, resets
     2. Header & menu         top bar, nav, dropdown, Book List button
     3. Shared pieces         buttons, headings, section backgrounds
     4. Home page             hero slideshow, about, vision, counters, gallery
     5. Inner pages           page banner, facilities, videos, tables, contact
     6. About page            banner + photo/text rows
     7. Footer
     8. Responsive            ALL mobile/tablet overrides live here, by screen width

   TIP: to change the site colours, edit the variables in section 1 only.
   ========================================================================== */


/* ==========================================================================
   1. VARIABLES & BASE
   ========================================================================== */
:root {
  --blue:   #1F5DAA;   /* header, footer, blue sections */
  --blue-d: #174a8a;   /* darker blue (copyright bar, mobile menu) */
  --red:    #EC3238;   /* button hover */
  --green:  #0D995C;   /* buttons, accent lines */
  --text:   #5f6670;   /* body text */
  --ink:    #212121;   /* headings */
  --gray:   #F1F1F1;   /* light grey sections */
  --cream:  #FFF9AF;   /* active menu link, footer hover, staff section */
  --radius: 6px;
}

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

html { scroll-behavior: smooth; }

html, body { overflow-x: hidden; }   /* never allow sideways scrolling */

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: #fff;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* Centred page container */
.wrap { width: min(1240px, 94%); margin: auto; }

/* "Skip to content" link for keyboard users (hidden until focused) */
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 99; }


/* ==========================================================================
   2. HEADER & MENU
   ========================================================================== */
header {
  background: var(--blue);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.bar {                       /* logo on the left, menu on the right */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.brand img { height: 92px; width: auto; }

/* --- Menu links --- */
nav ul { display: flex; align-items: center; gap: 0; }
nav li { position: relative; }

nav a {
  display: block;
  padding: 12px 20px;
  font-size: 18px;
  font-weight: 500;
  color: #fff;
  transition: .2s;
}
nav a:hover,
nav a.on { color: var(--cream); }     /* hover + current page */

/* Little arrow after "Gallery" (it has a dropdown) */
nav li.has-sub > a::after {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 0 0 3px 12px;
}

/* --- Dropdown (Gallery > Videos) --- */
nav .sub {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  flex-direction: column;
  min-width: 160px;
  background: #fff;
  border-top: 3px solid var(--green);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}
nav li:hover > .sub,
nav li:focus-within > .sub { display: flex; }

nav .sub a { color: var(--text); }
nav .sub a:hover { color: var(--green); background: var(--gray); }

/* --- "Book List" green button --- */
nav li.bk { margin-left: 12px; }
nav li.bk a { padding: 14px 26px; background: #3f9a63; color: #fff; }
nav li.bk a:hover { background: var(--green); color: #fff; }

/* --- Hamburger button (only visible on mobile, see section 8) --- */
#tg {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}


/* ==========================================================================
   3. SHARED PIECES
   ========================================================================== */

/* Green button, turns red on hover */
.btn {
  display: inline-block;
  padding: 18px 35px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  border-radius: 0;
  transition: .25s;
}
.btn:hover {
  background: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .2);
}

/* Section wrappers: add class "blue" or "gray" for a coloured background */
.sec      { padding: 60px 0; }
.sec.blue { background: var(--blue); color: #fff; }
.sec.gray { background: var(--gray); }

h2 {
  margin-bottom: 16px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.sec.blue h2 { color: #fff; }

/* Centred heading with a small green line underneath */
.ct { text-align: center; margin-bottom: 34px; }
.ct::after {
  content: "";
  display: block;
  width: 60px; height: 4px;
  margin: 12px auto 0;
  background: var(--green);
}

.lead { margin-bottom: 22px; }
.more { text-align: center; margin-top: 30px; }   /* centred "View All" button */


/* ==========================================================================
   4. HOME PAGE
   ========================================================================== */

/* --- Hero: full-width slideshow with dark overlay (slides switch in site.js) --- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 581px;
  text-align: center;
  color: #fff;
  overflow: hidden;
}
.slides, .slide, .ov { position: absolute; inset: 0; }
.slide {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity .9s ease;
}
.slide.on { opacity: 1; }            /* the slide currently showing */
.ov { background: rgba(0, 0, 0, .46); }   /* dark overlay so text is readable */

.hero .wrap { position: relative; max-width: 900px; padding: 40px 0; }
.hero h1 {
  margin-bottom: 28px;
  font-size: 45px;
  line-height: 55px;
  font-weight: 600;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

/* --- Two-column row: photo + text (add "rev" to swap sides on desktop) --- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
}
.split p { margin-bottom: 24px; }

.cover {                              /* photo that fills its column */
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
}
.h424 { height: 424px; }
.h500 { height: 500px; }

/* --- Vision & Mission (blue band) --- */
.vm { padding: 80px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }

/* --- "Why Choose Us" facility boxes --- */
.fgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 22px 0 28px; }
.fbox {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: var(--radius);
  transition: .25s;
}
.fbox:hover {
  border-color: var(--green);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
  transform: translateY(-2px);
}
.fbox img { flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.fbox h3  { font-size: 1.05rem; font-weight: 600; line-height: 1.3; color: #000; }

/* --- Counters (450+ students etc, numbers animate in site.js) --- */
.counters { padding: 50px 0; }
.cgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: center; }
.cgrid b,
.cgrid .plus { font-size: 55px; font-weight: 600; line-height: 1.1; }
.cgrid p { font-size: 1.1rem; opacity: .95; }

/* --- Principal & Director cards --- */
.people { display: grid; grid-template-columns: repeat(2, minmax(240px, 300px)); gap: 40px; justify-content: center; }
.person { text-align: center; }
.person img {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 14px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
}
.person h3 { font-size: 24px; font-weight: 600; line-height: 1.2; color: #000; }

/* --- Google rating badge (links to the school's Google reviews page).
       The rating text + review count are typed into index.html by hand,
       so update them there when the numbers change. --- */
.reviews { padding: 40px 0; text-align: center; }
.gbadge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  padding: 16px 28px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: var(--radius);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .08);
  transition: .25s;
}
.gbadge:hover { border-color: var(--green); transform: translateY(-2px); }
.g-name  { font-size: 1.4rem; font-weight: 700; color: #4285F4; }
.g-rate  { font-size: 1.2rem; color: var(--ink); }
.g-stars { display: inline-flex; gap: 2px; }
.star     { width: 22px; height: 22px; fill: #FBBC04; }
.star.off { fill: #dcdcdc; }                       /* empty star */
.g-count { color: var(--text); }

/* --- Photo gallery grid (home + gallery page) --- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #dcdcdc; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.grid a:hover img { transform: scale(1.08); }   /* zoom on hover */


/* ==========================================================================
   5. INNER PAGES  (Facilities, Gallery, Videos, CBSE Corner, Contact, ...)
   ========================================================================== */

/* Blue title banner at the top of each page */
.pagehead {
  padding: 46px 0;
  text-align: center;
  color: #fff;
  background: var(--blue);
  border-bottom: 4px solid var(--green);
}
.pagehead h1 { font-size: 38px; font-weight: 700; }

/* White card with a green top edge (used by Facilities + Contact) */
.card {
  padding: 26px;
  background: #fff;
  border-radius: var(--radius);
  border-top: 4px solid var(--green);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .08);
}
.card h3 { margin-bottom: 8px; font-size: 1.3rem; color: var(--ink); }

/* Facilities page */
.fac { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.fac .card { padding: 0; overflow: hidden; }
.fac img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.fac h3 { margin: 0; padding: 16px; }

/* Videos page: every video box is the same height, video fits inside */
.vids { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.vids video {
  display: block;
  width: 100%;
  height: 480px;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius);
}

/* CBSE Corner + Public Disclosure tables */
table { width: 100%; border-collapse: collapse; box-shadow: 0 6px 22px rgba(0, 0, 0, .08); }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #e6e6e6; }
th { color: #fff; background: var(--blue); }
td a { font-weight: 700; color: var(--green); }
td a:hover { color: var(--red); }

/* Contact page */
.cinfo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }

/* Google map */
iframe { width: 100%; height: 380px; border: 0; border-radius: var(--radius); }


/* ==========================================================================
   6. ABOUT PAGE   (photo on the left ~30%, text on the right ~70%)
   ========================================================================== */
.abbanner {                          /* top banner with school photo behind */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 50px 10px;
  background-size: cover;
  background-position: center;
}
.abov { position: absolute; inset: 0; background: rgba(0, 0, 0, .17); }   /* light overlay */
.abbanner h1 { position: relative; font-size: 45px; font-weight: 600; color: #fff; }

.abrow { padding: 50px 10px; background: #fff; }
.abrow.bluebg { color: #fff; background: var(--blue); }   /* Principal section */

.abin {                              /* row holding photo + text */
  display: flex;
  align-items: center;
  gap: 40px;
  width: min(1240px, 100%);
  margin: auto;
}
.abimg { flex: 0 0 30%; min-width: 0; }          /* photo column (30%) */
.abimg.half { flex: 1 1 0; }                     /* ...or 50% for the first row */
.abtxt { flex: 1 1 0; min-width: 0; line-height: 1.5; }   /* text column */

.abimg img { width: 100%; object-fit: cover; object-position: center; }
.abimg .h466 { height: 466px; }
.abimg .h416 { height: 416px; }
.abimg .top  { object-position: top center; }    /* crop from the top (faces) */

.abtxt h2 { color: var(--ink); }
.abtxt h2.blk { color: #000; }
.abrow.bluebg .abtxt h2 { color: #fff; }
.abtxt p { margin-bottom: 12px; }
.abrow.bluebg .abtxt p { color: #fff; }
.abtxt p.mut { color: #7D7D7D; }                 /* "Director" label */

.yours { margin-top: 18px; }                     /* "Your sincerely" */
.script {                                        /* handwritten-style name */
  font-family: 'Bad Script', cursive;
  font-size: 35px;
  line-height: 1.3;
  color: #fff;
}
.abrow .script.blue { color: var(--blue); }

/* Staff photos (yellow section) */
.staffsec { padding: 50px 15px 60px; background: var(--cream); }
.staffsec h2.center { margin: 20px 0 40px; text-align: center; color: #000; }
.staff2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; width: min(1240px, 100%); margin: auto; }
.staff2 img { width: 100%; height: auto; }


/* ==========================================================================
   7. FOOTER
   ========================================================================== */
footer { color: #fff; background: var(--blue); }
footer .wrap { padding: 40px 0; }
footer .cols { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1.6fr; gap: 34px; }   /* logo | links | contact | map */
footer h4 { margin-bottom: 12px; font-size: 24px; font-weight: 600; }
footer li { margin: 6px 0; }
footer a:hover { color: var(--cream); }
footer iframe { height: 200px; border-radius: 0; }

.flogo { max-width: 80%; padding: 6px; background: #fff; border-radius: var(--radius); }

.soc { display: flex; gap: 10px; margin-top: 12px; }   /* Facebook / Instagram */
.soc a { padding: 4px 14px; font-size: .9rem; border: 1px solid rgba(255, 255, 255, .6); }
.soc a:hover { color: var(--blue); background: #fff; }

.cp { padding: 14px 10px; font-size: .92rem; text-align: center; background: var(--blue-d); }   /* copyright bar */


/* ==========================================================================
   8. RESPONSIVE  -  everything for smaller screens
      Each block only lists what CHANGES at that width.
   ========================================================================== */

/* ---- Small laptops / tablets landscape (up to 1150px): tighter menu ---- */
@media (max-width: 1150px) {
  .brand img { height: 78px; }
  nav a { padding: 12px 11px; font-size: 16px; }
  nav li.bk { margin-left: 6px; }
  nav li.bk a { padding: 12px 18px; }
}

/* ---- Tablets & phones (up to 900px) ---- */
@media (max-width: 900px) {

  /* Header: logo + hamburger; menu opens as a full-width list */
  .bar { padding: 8px 0; }
  #tg { display: block; padding: 6px 10px; line-height: 1; }

  nav {
    display: none;                    /* hidden until hamburger is tapped */
    position: absolute;
    top: 100%; left: 0; right: 0;
    text-align: left;
    background: var(--blue-d);
  }
  nav.open { display: block; }        /* site.js adds "open" on tap */
  nav ul { flex-direction: column; align-items: stretch; padding: 8px 0; }
  nav a { padding: 14px 18px; font-size: 17px; }
  nav a.on { background: rgba(255, 255, 255, .12); }

  nav li.has-sub > a::after { float: right; margin-top: 8px; }
  nav .sub {                          /* dropdown becomes an indented list */
    display: flex;
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  nav .sub a { padding: 12px 18px 12px 34px; font-size: 16px; color: #fff; }

  nav li.bk { align-self: flex-start; margin: 8px 18px 12px; }
  nav li.bk a { display: inline-block; padding: 12px 26px; }

  /* Spacing + type sizes */
  .sec, .vm { padding: 40px 0; }
  .counters { padding: 36px 0; }
  h2 { font-size: 26px; }
  .btn { padding: 15px 28px; }
  .pagehead { padding: 34px 0; }
  .pagehead h1 { font-size: 30px; }
  th, td { padding: 12px 14px; }
  iframe { height: 300px; }

  /* Hero */
  .hero { min-height: 440px; }
  .hero .wrap { padding: 30px 0; }
  .hero h1 { font-size: 34px; line-height: 40px; }

  /* Two-column layouts stack into one column (photo first) */
  .split, .two-col { grid-template-columns: 1fr; }
  .split.rev > img { order: -1; }
  .h424, .h500 { height: 250px; }

  .cgrid b, .cgrid .plus { font-size: 44px; }
  .grid   { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: 1fr 1fr; gap: 18px; }

  /* Videos: 2 per row */
  .vids { grid-template-columns: repeat(2, 1fr); }
  .vids video { height: 380px; }

  /* About page: photo on top, text below */
  .abbanner h1 { font-size: 34px; }
  .abrow, .staffsec { padding: 36px 12px; }
  .abin { flex-direction: column; gap: 20px; }
  .abimg, .abimg.half, .abtxt { flex: none; width: 100%; }
  .abimg .h466 { height: 250px; }
  .abimg .h416 { height: 340px; }
  .staff2 { grid-template-columns: 1fr; }

  /* Footer stacks */
  footer .wrap { padding: 30px 0; }
  footer .cols { grid-template-columns: 1fr; }
  footer h4 { font-size: 22px; }
  footer iframe { height: 220px; }
  .flogo { max-width: 200px; }
}

/* ---- Phones (up to 560px): videos one per row ---- */
@media (max-width: 560px) {
  .vids { grid-template-columns: 1fr; }
  .vids video { height: 420px; }
}

/* ---- Small phones (up to 520px) ---- */
@media (max-width: 520px) {
  .wrap { width: 92%; }
  .hero h1 { font-size: 28px; line-height: 34px; }
  .grid { gap: 8px; }                 /* still 2 per row, tighter gap */
  .fgrid, .cgrid, .people, .fac, .cinfo { grid-template-columns: 1fr; }
  .cgrid { gap: 28px; }
  td a { white-space: nowrap; }
}
