/* ============================================================
   Shree Swaminarayan Gurukul, Bhusawal — light orange theme
   ============================================================ */
:root {
  --maroon: #c2570b;
  --maroon-dark: #9a3f06;
  --saffron: #fb923c;
  --saffron-dark: #ea580c;
  --cream: #fff7ed;
  --sand: #ffedd5;
  --ink: #431407;
  --muted: #9c6b4f;
  --white: #ffffff;
  --green: #166534;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(154, 63, 6, 0.12);
  --font-head: "Poppins", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container { width: min(1180px, 92%); margin: 0 auto; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; color: var(--maroon-dark); }

.section { padding: 72px 0; }
.section.alt { background: var(--white); }
.section.sand { background: var(--sand); }

.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--saffron-dark);
  margin-bottom: 10px;
}
.section-title { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 0; }
.section-title + .section-sub { margin-top: 0; }
.section-sub { color: var(--muted); max-width: 640px; margin-bottom: 36px; }
.center { text-align: center; }
.center .section-sub { margin-left: auto; margin-right: auto; }

/* ---------- Top bar ---------- */
.topbar { background: var(--maroon-dark); color: #ffedd5; font-size: 13.5px; }
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; padding-bottom: 8px; gap: 12px; flex-wrap: wrap;
}
.topbar a:hover { color: var(--saffron); }
.topbar .tb-group { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.topbar .tb-item { display: inline-flex; align-items: center; gap: 7px; }
.topbar svg { width: 15px; height: 15px; fill: var(--saffron); flex: none; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 14px rgba(154, 63, 6, 0.1);
}
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img.logo { height: 52px; width: auto; }
/* Round reviewer photos */
.tphoto { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; border: 3px solid var(--saffron); }
.brand .brand-name { font-family: var(--font-head); font-weight: 800; font-size: 18px; color: #431407; line-height: 1.2; letter-spacing: 0.2px; white-space: nowrap; }
.brand .brand-tag { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; font-weight: 600; white-space: nowrap; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  font-weight: 600; font-size: 15px; padding: 9px 15px; border-radius: 8px; color: var(--ink);
}
.nav-links a:hover { background: var(--sand); color: var(--maroon-dark); }
.nav-links a.active { background: var(--maroon); color: #fff; }
.btn {
  display: inline-block; font-weight: 700; font-size: 15px;
  padding: 12px 26px; border-radius: 999px; border: none; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--maroon); color: #fff; box-shadow: 0 6px 18px rgba(194, 87, 11, 0.35); }
.btn-primary:hover { background: var(--maroon-dark); transform: translateY(-2px); }
.btn-saffron { background: var(--saffron); color: #431407; }
.btn-saffron:hover { background: var(--saffron-dark); color: #fff; transform: translateY(-2px); }
.btn-outline { border: 2px solid var(--maroon); color: var(--maroon); background: transparent; }
.btn-outline:hover { background: var(--maroon); color: #fff; }
.nav-cta { margin-left: 8px; }
/* ---------- Contributions dropdown (auto popup submenu) ---------- */
.nav-links { flex-wrap: nowrap; }
.nav-links > a, .nav-links .nav-dropbtn { white-space: nowrap; }
.nav-dropdown { position: relative; display: flex; align-items: stretch; }
.nav-dropdown .nav-dropbtn { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.nav-dropdown .nav-dropbtn .caret { font-size: 11px; transition: transform 0.2s ease; }
.nav-dropdown.open .nav-dropbtn .caret,
.nav-dropdown:hover .nav-dropbtn .caret { transform: rotate(180deg); }
.nav-dropmenu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 120;
  min-width: 210px; padding: 6px; background: #fff; border-radius: 12px;
  box-shadow: 0 14px 34px rgba(154, 63, 6, 0.22); border: 1px solid #fed7aa;
}
.nav-dropmenu a { display: block; padding: 10px 16px; border-radius: 8px; font-size: 15px; }
.nav-dropmenu a:hover { background: var(--sand); color: var(--maroon-dark); }
.nav-dropmenu a.active { background: var(--maroon); color: #fff; }
/* desktop: open on hover (auto popup), JS .open class covers touch/click */
@media (min-width: 721px) {
  .nav-dropdown:hover .nav-dropmenu,
  .nav-dropdown.open .nav-dropmenu,
  .nav-dropdown:focus-within .nav-dropmenu { display: block; }
}
@media (max-width: 1020px) and (min-width: 721px) {
  .nav-links { gap: 2px; }
  .nav-links > a, .nav-links .nav-dropbtn { padding: 8px 10px; font-size: 14px; }
  .nav-cta { margin-left: 2px; }
  .brand .brand-name { font-size: 16px; }
  .brand img.logo { height: 46px; }
}
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { display: block; width: 26px; height: 3px; background: var(--maroon-dark); border-radius: 2px; margin: 5px 0; transition: 0.25s; }

/* ---------- Hero slider ---------- */
.hero { position: relative; overflow: hidden; background: var(--maroon-dark); }
.hero-slide {
  display: none; position: relative; min-height: 520px;
  align-items: center; color: #fff;
}
.hero-slide.active { display: flex; animation: fadeSlide 0.7s ease; }
@keyframes fadeSlide { from { opacity: 0; } to { opacity: 1; } }
.hero-slide .hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.hero-slide .hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(67, 20, 7, 0.88) 20%, rgba(194, 87, 11, 0.65) 55%, rgba(194, 87, 11, 0.25) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 640px; padding: 70px 0; }
.hero-content .pill {
  display: inline-block; background: var(--saffron); color: #431407;
  font-weight: 700; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 6px 16px; border-radius: 999px; margin-bottom: 18px;
}
.hero-content h1 { color: #fff; font-size: clamp(30px, 4.6vw, 54px); margin-bottom: 16px; }
.hero-content h1 em { font-style: normal; color: var(--saffron); }
.hero-content p { color: #ffedd5; font-size: 17px; margin-bottom: 28px; }
.hero-points { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-points span {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.hero-points svg { width: 16px; height: 16px; fill: var(--saffron); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 3; }
.hero-dots button {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff;
  background: transparent; cursor: pointer; padding: 0;
}
.hero-dots button.on { background: var(--saffron); border-color: var(--saffron); width: 32px; border-radius: 999px; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.25); color: #fff; font-size: 20px; cursor: pointer;
}
.hero-arrow:hover { background: var(--saffron); border-color: var(--saffron); color: #431407; }
.hero-arrow.prev { left: 18px; } .hero-arrow.next { right: 18px; }

/* ---------- Quick info strip ---------- */
.quick-strip { background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); }
.quick-strip .container {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: -46px; position: relative; z-index: 5;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.quick-card { display: flex; gap: 14px; align-items: flex-start; padding: 24px 26px; }
.quick-card + .quick-card { border-left: 1px solid #fed7aa; }
.quick-card .qicon {
  flex: none; width: 48px; height: 48px; border-radius: 12px;
  background: var(--sand); display: flex; align-items: center; justify-content: center;
}
.quick-card .qicon svg { width: 24px; height: 24px; fill: var(--maroon); }
.quick-card h4 { font-size: 16px; margin-bottom: 2px; }
.quick-card p, .quick-card a { font-size: 14px; color: var(--muted); }
.quick-card a:hover { color: var(--maroon); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 24px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.fac-card {
  background: var(--white); border-radius: var(--radius); padding: 30px 26px;
  box-shadow: 0 4px 16px rgba(154, 63, 6, 0.07);
  border-top: 4px solid var(--saffron);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.fac-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.fac-card .fic {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--maroon), var(--saffron-dark));
  display: flex; align-items: center; justify-content: center;
}
.fac-card .fic svg { width: 28px; height: 28px; fill: #fff; }
.fac-card h3 { font-size: 18px; margin-bottom: 8px; }
.fac-card p { font-size: 14.5px; color: var(--muted); }

/* ---------- Stats band ---------- */
.stats-band { background: linear-gradient(120deg, var(--maroon-dark), var(--maroon) 60%, #f97316); color: #fff; }
.stats-band .grid { text-align: center; }
.stat h3 { color: var(--saffron); font-size: clamp(30px, 4vw, 46px); margin-bottom: 4px; }
.stat p { color: #fed7aa; font-size: 15px; }

/* ---------- Founders ---------- */
.founder-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 16px rgba(154, 63, 6, 0.07); text-align: center;
  height: 100%; display: flex; flex-direction: column;
}
.founder-card .fbody { display: flex; flex-direction: column; flex: 1; }
.founder-card .fphoto { height: 300px; background-size: cover; background-position: top center; }
.founder-card .fbody { padding: 24px; }
.founder-card .role {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--saffron-dark); text-transform: uppercase; margin: 6px 0 10px;
}
.founder-card p { font-size: 14.5px; color: var(--muted); }

/* ---------- Testimonials ---------- */
.testi-wrap { position: relative; max-width: 760px; margin: 0 auto; }
.testi-slide { display: none; text-align: center; padding: 10px 20px; }
.testi-slide.active { display: block; animation: fadeSlide 0.5s ease; }
.testi-slide .stars { color: var(--saffron); font-size: 20px; letter-spacing: 3px; margin-top: 14px; }
.testi-slide blockquote { font-size: 19px; font-style: italic; color: var(--ink); margin-bottom: 20px; }
.testi-slide .tname { font-weight: 700; color: var(--maroon-dark); }
.testi-slide .trole { font-size: 13px; color: var(--muted); }
.testi-nav { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.testi-nav button {
  width: 12px; height: 12px; border-radius: 50%; border: none; cursor: pointer;
  background: #fdba74; padding: 0;
}
.testi-nav button.on { background: var(--maroon); width: 30px; border-radius: 999px; }

/* ---------- Blog cards ---------- */
.blog-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 16px rgba(154, 63, 6, 0.07);
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.blog-card .bimg { height: 210px; background-size: cover; background-position: center; position: relative; }
.blog-card .bdate {
  position: absolute; left: 16px; bottom: -18px;
  background: var(--maroon); color: #fff; border-radius: 10px;
  padding: 6px 14px; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.3;
}
.blog-card .bbody { padding: 30px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.blog-card .bauthor { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.blog-card h3 { font-size: 19px; margin-bottom: 10px; }
.blog-card h3 a:hover { color: var(--saffron-dark); }
.blog-card p { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; flex: 1; }
.readmore { font-weight: 700; color: var(--maroon); font-size: 15px; }
.readmore:hover { color: var(--saffron-dark); }

/* ---------- Gallery ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 34px; }
.filter-bar button {
  border: 2px solid #fed7aa; background: var(--white); color: var(--ink);
  font-weight: 600; font-size: 14px; padding: 9px 22px; border-radius: 999px; cursor: pointer;
}
.filter-bar button.on, .filter-bar button:hover { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gal-item {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  height: 250px; background-size: cover; background-position: center;
  box-shadow: 0 4px 14px rgba(154, 63, 6, 0.1);
}
.gal-item .cap {
  position: absolute; inset: auto 0 0 0; padding: 34px 18px 14px; color: #fff;
  background: linear-gradient(transparent, rgba(67, 20, 7, 0.85));
  font-weight: 600; font-size: 15px;
  transform: translateY(8px); opacity: 0.95;
}
.gal-item:hover { transform: scale(1.02); }
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(67, 20, 7, 0.92); align-items: center; justify-content: center; flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 88%; max-height: 76vh; border-radius: 10px; }
.lightbox .lcap { color: #ffedd5; margin-top: 14px; font-weight: 600; }
.lightbox .lclose {
  position: absolute; top: 22px; right: 30px; background: none; border: none;
  color: #fff; font-size: 40px; cursor: pointer; line-height: 1;
}
.lightbox .lclose:hover { color: var(--saffron); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(120deg, var(--maroon-dark), var(--maroon));
  color: #fff; padding: 56px 0; position: relative; overflow: hidden;
}
.page-hero::after {
  content: "ॐ"; position: absolute; right: 4%; top: 50%; transform: translateY(-50%);
  font-size: 180px; opacity: 0.08; color: #fff;
}
.page-hero h1 { color: #fff; font-size: clamp(28px, 4vw, 42px); margin-bottom: 8px; }
.page-hero .crumbs { color: #fed7aa; font-size: 14.5px; }
.page-hero .crumbs a:hover { color: var(--saffron); }

/* ---------- About extras ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.split .simg { border-radius: var(--radius); min-height: 380px; background-size: cover; background-position: center; box-shadow: var(--shadow); }
.check-list li { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; }
.check-list svg { width: 22px; height: 22px; fill: var(--green); flex: none; margin-top: 3px; }
.timeline { border-left: 3px solid var(--saffron); margin: 10px 0 0 8px; padding-left: 28px; }
.timeline .t-item { position: relative; margin-bottom: 28px; }
.timeline .t-item::before {
  content: ""; position: absolute; left: -38px; top: 4px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--maroon); border: 3px solid var(--saffron);
}
.timeline .tyear { font-weight: 800; color: var(--maroon); font-size: 18px; }

/* ---------- Blog detail ---------- */
.article { max-width: 800px; margin: 0 auto; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.article .aimg { height: 340px; background-size: cover; background-position: center; }
.article .abody { padding: 40px 44px; }
.article .ameta { color: var(--muted); font-size: 14px; margin-bottom: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.article h1 { font-size: clamp(24px, 3.4vw, 34px); margin-bottom: 18px; }
.article p { margin-bottom: 16px; color: #4a3f35; }
.article h2 { font-size: 22px; margin: 26px 0 12px; }
/* Dynamic CMS content (BlogMessage HTML) — normalize + responsive */
.blog-richtext { color: #4a3f35; font-size: 15.5px; line-height: 1.7; overflow-wrap: break-word; }
.blog-richtext h1, .blog-richtext h2, .blog-richtext h3, .blog-richtext h4 { color: var(--maroon-dark); margin: 22px 0 10px; line-height: 1.3; }
.blog-richtext p { margin-bottom: 14px; }
.blog-richtext img { max-width: 100%; height: auto; border-radius: 10px; margin: 12px 0; }
.blog-richtext iframe { max-width: 100%; width: 100%; height: 340px; border: 0; border-radius: 10px; margin: 12px 0; }
.blog-richtext ul, .blog-richtext ol { padding-left: 24px; margin-bottom: 14px; }
.blog-richtext table { width: 100%; border-collapse: collapse; margin-bottom: 14px; display: block; overflow-x: auto; }
.share-row { display: flex; gap: 10px; align-items: center; margin-top: 28px; padding-top: 22px; border-top: 1px solid #fed7aa; flex-wrap: wrap; }
.share-row .lbl { font-weight: 700; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
.info-card { background: var(--white); border-radius: var(--radius); padding: 30px; box-shadow: 0 4px 16px rgba(154,63,6,0.07); margin-bottom: 20px; }
.info-row { display: flex; gap: 14px; margin-bottom: 18px; align-items: flex-start; }
.info-row:last-child { margin-bottom: 0; }
.info-row .iicon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--sand); display: flex; align-items: center; justify-content: center; }
.info-row .iicon svg { width: 22px; height: 22px; fill: var(--maroon); }
.info-row h4 { font-size: 15px; margin-bottom: 2px; }
.info-row p, .info-row a { font-size: 14.5px; color: var(--muted); }
.info-row a:hover { color: var(--maroon); }
.form-card { background: var(--white); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.form-card h2 { margin-bottom: 6px; }
.form-card > p { color: var(--muted); font-size: 14.5px; margin-bottom: 22px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fgroup { margin-bottom: 16px; }
.fgroup label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.fgroup input, .fgroup select, .fgroup textarea {
  width: 100%; border: 2px solid #fed7aa; border-radius: 10px;
  padding: 11px 14px; font-size: 15px; font-family: inherit; background: #fffdf8; color: var(--ink);
}
.fgroup input:focus, .fgroup select:focus, .fgroup textarea:focus { outline: none; border-color: var(--saffron); }
.fgroup .err { color: #b91c1c; font-size: 13px; margin-top: 4px; display: none; }
.fgroup.invalid input, .fgroup.invalid textarea { border-color: #b91c1c; }
.fgroup.invalid .err { display: block; }
.form-ok { display: none; background: #dcfce7; border: 1px solid #86efac; color: #166534; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.map-frame { border: none; width: 100%; height: 320px; border-radius: var(--radius); box-shadow: var(--shadow); }
.hours-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.hours-table td { padding: 9px 4px; border-bottom: 1px dashed #fdba74; }
.hours-table tr td:last-child { text-align: right; font-weight: 600; color: var(--maroon-dark); }

/* ---------- Footer ---------- */
.site-footer { background: #431407; color: #d8c3ab; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr; gap: 36px; padding: 60px 0 40px; }
.site-footer h4 { color: #fff; font-size: 17px; margin-bottom: 18px; }
.site-footer .flinks li { margin-bottom: 10px; font-size: 14.5px; }
.site-footer .flinks a:hover { color: var(--saffron); padding-left: 4px; }
.site-footer .fcontact li { display: flex; gap: 10px; margin-bottom: 12px; font-size: 14px; }
.site-footer .fcontact svg { width: 17px; height: 17px; fill: var(--saffron); flex: none; margin-top: 3px; }
.news-form { display: flex; margin-top: 6px; }
.news-form input {
  flex: 1; border: none; border-radius: 999px 0 0 999px; padding: 11px 18px; font-size: 14px; min-width: 0;
}
.news-form button {
  border: none; background: var(--saffron); color: #431407; font-weight: 700;
  padding: 11px 20px; border-radius: 0 999px 999px 0; cursor: pointer; font-size: 14px;
}
.news-form button:hover { background: var(--saffron-dark); color: #fff; }
.news-ok { display: none; font-size: 13.5px; color: #86efac; margin-top: 8px; }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
}
.socials a svg { width: 18px; height: 18px; fill: #fff; }
.socials a:hover { background: var(--saffron); }
.socials a:hover svg { fill: #431407; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 18px 0; font-size: 13.5px; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.footer-bottom a { color: var(--saffron); }
.back-top {
  position: fixed; right: 22px; bottom: 90px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--maroon); color: #fff; font-size: 20px; display: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.back-top.show { display: block; }
.back-top:hover { background: var(--saffron); color: #431407; }

/* ---------- Floating Call Button (like gurukul.org, all pages) ---------- */
.call-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 96;
  width: 56px; height: 56px; border-radius: 50%;
  background: #CC0000; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(204,0,0,0.45);
  transition: transform .2s ease, background .2s ease;
}
.call-fab svg { width: 26px; height: 26px; fill: #fff; }
.call-fab:hover { background: #a30000; transform: scale(1.06); }
.call-fab::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #CC0000; animation: call-pulse 1.8s ease-out infinite;
  pointer-events: none;
}
@keyframes call-pulse {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ---------- Campus Visit modal (like gurukul.org) ---------- */
.call-fab { border: none; cursor: pointer; }
.visit-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(20, 8, 2, 0.65);
  align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.visit-overlay.open { display: flex; }
.visit-modal {
  position: relative; width: min(430px, 100%);
  background: #eef1f4; border-radius: 10px; padding: 34px 34px 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  animation: visitIn 0.25s ease;
}
@keyframes visitIn { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
.visit-modal h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 27px; color: #222; margin-bottom: 6px; }
.visit-sub { color: #555; font-size: 15px; margin-bottom: 20px; }
.visit-close {
  position: absolute; top: 8px; right: 14px; background: none; border: none;
  font-size: 34px; line-height: 1; color: #888; cursor: pointer;
}
.visit-close:hover { color: #CC0000; }
.visit-field { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e2e2e2; padding: 0 14px; margin-bottom: 18px; }
.visit-field svg { width: 18px; height: 18px; fill: #333; flex: none; }
.visit-field input, .visit-field select {
  flex: 1; border: none; background: transparent; padding: 14px 0;
  font-size: 16px; font-family: inherit; color: #222; min-width: 0;
}
.visit-field input:focus, .visit-field select:focus { outline: none; }
.visit-apply {
  width: 100%; border: none; cursor: pointer; background: #CC0000; color: #fff;
  font-size: 19px; font-weight: 500; padding: 13px; font-family: Georgia, serif;
}
.visit-apply:hover { background: #a30000; }
.visit-apply:disabled { cursor: wait; opacity: 0.9; }
.visit-apply .spin {
  display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px;
  border: 3px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%;
  animation: visitSpin 0.8s linear infinite;
}
@keyframes visitSpin { to { transform: rotate(360deg); } }
/* toast validation / success message */
.visit-toast {
  position: fixed; top: 84px; right: 22px; z-index: 400;
  transform: translateX(24px);
  background: #7f1d1d; color: #fff; font-size: 14.5px; font-weight: 600;
  padding: 12px 22px; border-radius: 10px; max-width: min(360px, 90%); text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.visit-toast.show { opacity: 1; transform: translateX(0); }
.visit-toast.ok { background: #166534; }
.visit-call { display: block; text-align: center; margin-top: 14px; font-weight: 700; color: var(--maroon); font-size: 15px; }
.visit-call:hover { color: var(--saffron-dark); }
@media (max-width: 720px) {
  .call-fab { width: 52px; height: 52px; right: 16px; bottom: 16px; }
  .call-fab svg { width: 24px; height: 24px; }
  .back-top { right: 16px; bottom: 80px; }
}

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(110deg, #fbbf24, #fb923c); border-radius: 20px; padding: 44px 48px; color: #431407; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; box-shadow: var(--shadow); }
.cta-band h2 { color: #431407; font-size: clamp(22px, 3vw, 32px); }
.cta-band p { font-weight: 600; }

/* ---------- Prose pages ---------- */
.prose { background: var(--white); border-radius: var(--radius); padding: 40px 44px; box-shadow: 0 4px 16px rgba(154,63,6,0.07); max-width: 860px; margin: 0 auto; }
.prose h2 { font-size: 22px; margin: 26px 0 10px; }
.prose p, .prose li { color: #4a3f35; font-size: 15.5px; margin-bottom: 12px; }
.prose ul { list-style: disc; padding-left: 24px; }

/* ---------- Pagination (all pages) ---------- */
.pager, .pagination {
  display: flex; gap: 10px; list-style: none; flex-wrap: wrap;
  padding: 0; margin: 0; justify-content: center; align-items: center;
}
.pager li, .pagination .page-item { margin: 0; }
.pager a, .pagination .page-link {
  display: inline-block; min-width: 44px; text-align: center;
  font-weight: 700; font-size: 14px; color: var(--maroon);
  background: var(--white); border: 2px solid var(--maroon);
  padding: 8px 18px; border-radius: 999px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.pager a:hover, .pagination .page-link:hover { background: var(--maroon); color: #fff; }
.pager .on span, .pagination .not-active {
  display: inline-block; min-width: 44px; text-align: center;
  font-weight: 800; font-size: 14px; color: #fff;
  background: var(--maroon); border: 2px solid var(--maroon);
  padding: 8px 18px; border-radius: 999px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .quick-strip .container { grid-template-columns: 1fr; margin-top: 24px; }
  .quick-card + .quick-card { border-left: none; border-top: 1px solid #fed7aa; }
  .hero-arrow { display: none; }
}
@media (max-width: 720px) {
  .section { padding: 52px 0; }
  .brand img.logo { height: 42px; }
  .brand .brand-name { font-size: 15px; }
  .brand .brand-tag { display: none; }
  .page-hero { padding: 40px 0; }
  .page-hero::after { font-size: 110px; }
  .split .simg { min-height: 240px; }
  .timeline { margin-left: 0; padding-left: 24px; }
  .timeline .t-item::before { left: -31px; }
  .about-cta { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
  .about-cta .btn { text-align: center; margin-left: 0 !important; }
  .blog-richtext iframe { height: 220px; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    padding: 12px 4%; box-shadow: 0 14px 24px rgba(154,63,6,0.15);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  /* mobile: submenu stacks inline under Contributions (tap to expand) */
  .nav-dropdown { flex-direction: column; align-items: stretch; }
  .nav-dropdown .nav-dropbtn { width: 100%; justify-content: space-between; }
  .nav-dropmenu {
    position: static; box-shadow: none; border: none;
    border-left: 3px solid var(--saffron); border-radius: 0;
    margin: 2px 0 2px 14px; padding: 0 0 0 6px; min-width: 0;
  }
  .nav-dropdown.open .nav-dropmenu { display: block; }
  .nav-cta { margin: 6px 0 4px; text-align: center; }
  .hamburger { display: block; }
  .site-header .navbar { position: relative; }
  .grid.cols-3, .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .gal-grid { grid-template-columns: 1fr; }
  .frow { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .topbar .container { justify-content: center; text-align: center; }
  .cta-band { padding: 32px 26px; }
  .article .abody, .prose { padding: 26px 22px; }
}

/* ============================================================
   MOBILE OVERFLOW GUARD — kills horizontal scroll + keeps the
   hamburger menu inside the viewport (no CSS logic change).
   Root causes fixed:
   1) brand name was white-space:nowrap inside a 92% container,
      pushing the hamburger button off-screen on ~320px phones.
   2) fixed visit-toast kept a 24px translateX offset off-screen.
   3) long topbar address / tables / iframes could exceed 100vw.
   ============================================================ */
html, body {
  overflow-x: clip;
  max-width: 100%;
}
body {
  overflow-wrap: break-word;
}
img, iframe, video, table {
  max-width: 100%;
}
.container, .navbar, .topbar .container, .footer-bottom .container {
  min-width: 0;
  max-width: 100%;
}

/* Header: brand stays single-line on desktop; shrinks safely on mobile */
.site-header .navbar {
  min-width: 0;
}
.brand {
  min-width: 0;
  flex: none;
}
.brand img.logo {
  flex: none;
}
.brand > span {
  min-width: 0;
  overflow: hidden;
}
.brand .brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.hamburger {
  flex: none;
  margin-left: auto;
}

@media (max-width: 720px) {
  /* Dropdown panel must never be wider than the screen */
  .nav-links {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  /* Mobile: wrap title + show sub-title (desktop stays single-line) */
  .brand { flex: 1 1 auto; }
  .brand img.logo { height: 38px; }
  .brand > span { overflow: visible; }
  .brand .brand-name {
    font-size: 14px; line-height: 1.3;
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  .brand .brand-tag {
    display: block; white-space: normal;
    font-size: 10.5px; line-height: 1.35;
  }
  /* Long topbar address wraps instead of forcing scroll */
  .topbar .tb-group { max-width: 100%; }
  .topbar .tb-item {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  /* Hero text keeps side padding on small screens */
  .hero-content { padding-left: 4%; padding-right: 4%; max-width: 100%; }
  .hero-content h1, .hero-content p { overflow-wrap: break-word; }
  /* Toast stretches within viewport, no off-screen offset */
  .visit-toast {
    left: 16px;
    right: 16px;
    top: 70px;
    max-width: none;
    transform: none;
  }
  .visit-toast.show { transform: none; }
  .visit-modal { width: 100%; max-width: 100%; padding: 26px 20px 22px; }
  /* CMS tables / iframes scroll inside, never widen the page */
  .blog-richtext table { display: block; max-width: 100%; overflow-x: auto; }
  .prose { max-width: 100%; overflow-wrap: break-word; }
  .cta-band, .contact-grid, .split { min-width: 0; max-width: 100%; }
}
