/* ===== St. Sophia School, Hisar — theme ===== */
:root {
  --navy: #0e2f5a;
  --navy-2: #16407a;
  --maroon: #8a1c2b;
  --maroon-2: #a8283a;
  --gold: #c8a24a;
  --gold-soft: #e7cf95;
  --ink: #1f2733;
  --muted: #5b6675;
  --line: #e5e2da;
  --bg: #ffffff;
  --bg-soft: #f7f4ee;
  --bg-cream: #faf7f1;
  --shadow: 0 10px 30px rgba(14, 47, 90, 0.10);
  --shadow-sm: 0 4px 14px rgba(14, 47, 90, 0.08);
  --radius: 14px;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}
img { max-width: 100%; display: block; }
a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-2); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
section { padding: 72px 0; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--maroon); color: #fff; padding: 13px 26px;
  border-radius: 40px; font-weight: 600; border: 0; cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-sm); font-size: 1rem;
}
.btn:hover { background: var(--maroon-2); color: #fff; transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); box-shadow: none; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-soft); color: var(--navy); }

.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .8rem;
  font-weight: 700; color: var(--maroon); margin-bottom: .6rem; display: inline-block;
}
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head p { color: var(--muted); }

/* ===== Header ===== */
.topbar { background: var(--navy); color: #dbe4f0; font-size: .85rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; flex-wrap: wrap; gap: 6px; }
.topbar a { color: #dbe4f0; margin-right: 16px; }
.topbar a:hover { color: #fff; }
.topbar-social a { margin: 0 0 0 14px; }

.site-header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: var(--shadow-sm); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--navy); }
.brand-logo { height: 58px; width: auto; }
.brand-text strong { display: block; font-family: var(--serif); font-size: 1.3rem; color: var(--navy); line-height: 1.12; white-space: nowrap; }
.brand-text small { display: block; color: var(--muted); font-size: .76rem; letter-spacing: .01em; white-space: nowrap; }

.main-nav { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.main-nav a, .nav-parent {
  color: var(--ink); font-weight: 600; padding: 9px 12px; border-radius: 8px;
  font-size: .93rem; transition: background .15s, color .15s; position: relative;
  white-space: nowrap; background: none; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
.main-nav a:hover, .nav-parent:hover { background: var(--bg-soft); color: var(--navy); }
.main-nav > a.active, .nav-item.active .nav-parent { color: var(--maroon); }
.main-nav > a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; background: var(--maroon); border-radius: 2px;
}
.nav-parent .caret { font-size: .7rem; opacity: .7; transition: transform .2s; }

/* Dropdowns */
.nav-item { position: relative; }
.nav-item .dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 236px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 8px; opacity: 0; visibility: hidden;
  transform: translateY(6px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 60;
}
.nav-item .dropdown::before {
  content: ""; position: absolute; top: -6px; left: 18px; width: 12px; height: 12px;
  background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-item:hover .caret { transform: rotate(180deg); }
.nav-item .dropdown a {
  display: block; padding: 10px 14px; border-radius: 8px; font-size: .92rem;
  color: var(--ink); font-weight: 600; white-space: nowrap;
}
.nav-item .dropdown a:hover { background: var(--bg-soft); color: var(--maroon); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--navy); border-radius: 2px; transition: .25s; }

/* ===== Hero ===== */
.hero {
  position: relative; color: #fff; text-align: center;
  background: linear-gradient(rgba(10,30,60,.72), rgba(10,30,60,.78)), url('/uploads/blog/campus02.jpg') center/cover;
  padding: 120px 0 130px;
}
.hero h1 { color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.hero .eyebrow { color: var(--gold-soft); }
.hero p { max-width: 640px; margin: 0 auto 30px; color: #eef2f8; font-size: 1.15rem; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3); padding: 6px 16px; border-radius: 30px;
  font-size: .85rem; margin-bottom: 18px; backdrop-filter: blur(4px);
}

/* quick strip */
.quick-strip { background: var(--maroon); color: #fff; }
.quick-strip .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 26px 22px; }
.quick-item { text-align: center; }
.quick-item .num { font-family: var(--serif); font-size: 2rem; font-weight: 800; color: var(--gold-soft); }
.quick-item .lbl { font-size: .9rem; opacity: .92; }

/* ===== About ===== */
.about { background: var(--bg-cream); }
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.about-copy :where(p) { color: #3a4452; }
.about-media { position: relative; }
.about-media img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4/3; object-fit: cover; }
.about-media .motto-card {
  position: absolute; bottom: -26px; left: -18px; background: var(--navy); color: #fff;
  padding: 18px 24px; border-radius: 12px; box-shadow: var(--shadow); max-width: 240px;
}
.about-media .motto-card span { color: var(--gold-soft); font-family: var(--serif); font-size: 1.1rem; }

/* ===== Facility cards ===== */
.fac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.fac-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.fac-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.fac-card .fac-img { height: 180px; background: var(--bg-soft); overflow: hidden; }
.fac-card .fac-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.fac-card:hover .fac-img img { transform: scale(1.06); }
.fac-body { padding: 22px 22px 26px; }
.fac-body h3 { font-size: 1.28rem; margin-bottom: .4rem; }
.fac-body p { color: var(--muted); font-size: .96rem; margin: 0; }
.fac-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-soft); color: var(--maroon); font-size: 1.3rem; margin-bottom: 14px;
}

/* ===== Gallery ===== */
.gallery-section { background: var(--bg-cream); }
.gallery-filters { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.gallery-filters a {
  padding: 8px 18px; border-radius: 30px; border: 1px solid var(--line); background: #fff;
  color: var(--navy); font-weight: 600; font-size: .9rem;
}
.gallery-filters a.active, .gallery-filters a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery-grid .g-item {
  position: relative; overflow: hidden; border-radius: 10px; aspect-ratio: 1/1; cursor: pointer;
  box-shadow: var(--shadow-sm); background: #ddd;
}
.gallery-grid .g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-grid .g-item:hover img { transform: scale(1.08); }
.gallery-grid .g-cap {
  position: absolute; inset: auto 0 0 0; background: linear-gradient(transparent, rgba(10,30,60,.8));
  color: #fff; padding: 22px 12px 10px; font-size: .82rem; opacity: 0; transition: opacity .2s;
}
.gallery-grid .g-item:hover .g-cap { opacity: 1; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8,18,35,.92); display: none; place-items: center; z-index: 100; padding: 30px; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox .lb-close { position: absolute; top: 20px; right: 28px; color: #fff; font-size: 2.4rem; cursor: pointer; line-height: 1; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 3rem; cursor: pointer; user-select: none; padding: 0 18px; opacity: .8; }
.lightbox .lb-prev { left: 6px; } .lightbox .lb-next { right: 6px; }

/* ===== Posts / news ===== */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.post-card .p-img { height: 200px; overflow: hidden; background: var(--bg-soft); }
.post-card .p-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .p-img img { transform: scale(1.05); }
.post-card .p-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.post-card .p-date { color: var(--maroon); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.post-card h3 { font-size: 1.3rem; margin: 8px 0 10px; }
.post-card p { color: var(--muted); font-size: .95rem; flex: 1; }
.post-card .read-more { font-weight: 700; margin-top: 12px; }
.sticky-tag { display: inline-block; background: var(--gold); color: var(--navy); font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; margin-left: 6px; }

/* ===== Page banner ===== */
.page-banner {
  background: linear-gradient(rgba(10,30,60,.82), rgba(10,30,60,.86)), url('/uploads/facilities/f05.jpg') center/cover;
  color: #fff; padding: 66px 0; text-align: center;
}
.page-banner h1 { color: #fff; margin-bottom: 6px; }
.page-banner p { color: #dbe4f0; margin: 0; }
.breadcrumb { font-size: .85rem; color: #cdd8e8; margin-top: 10px; }
.breadcrumb a { color: var(--gold-soft); }

/* ===== Article / prose ===== */
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { margin-top: 1.8em; color: var(--maroon); font-size: 1.7rem; }
.prose h3 { margin-top: 1.4em; font-size: 1.3rem; }
.prose p, .prose li { color: #37414f; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .4em 0; }
.prose blockquote {
  border-left: 4px solid var(--gold); background: var(--bg-cream); margin: 1.4em 0;
  padding: 14px 22px; border-radius: 0 10px 10px 0; color: #3a4452; font-style: italic;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .96rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--navy); color: #fff; font-family: var(--sans); }
.prose tr:nth-child(even) td { background: var(--bg-cream); }
.prose img { border-radius: 10px; margin: 1.2em 0; }
.prose strong { color: var(--navy); }

/* two-column content + sidebar */
.content-layout { display: grid; grid-template-columns: 1fr 320px; gap: 46px; align-items: start; }
.sidebar { position: sticky; top: 110px; }
.sidebar-card { background: var(--bg-cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }
.sidebar-card h4 { color: var(--maroon); font-size: 1.1rem; margin-bottom: 14px; }
.sidebar-card ul { list-style: none; padding: 0; margin: 0; }
.sidebar-card li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sidebar-card li:last-child { border-bottom: 0; }

/* ===== Forms ===== */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); }
.form-row { margin-bottom: 16px; }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); font-size: .92rem; }
input, select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 1rem; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(14,47,90,.12); }
textarea { resize: vertical; min-height: 120px; }
.alert { padding: 13px 18px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }
.alert-success { background: #e6f4ea; color: #1e6b3a; border: 1px solid #b7e0c4; }
.alert-error { background: #fdecec; color: #a12626; border: 1px solid #f2c2c2; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-info .info-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-info .info-item .ic { font-size: 1.4rem; }
.contact-info .info-item strong { color: var(--navy); display: block; }
.map-embed { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin-top: 24px; }
.map-embed iframe { width: 100%; height: 300px; border: 0; display: block; }

/* CTA band */
.cta-band { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #d7e0ee; max-width: 560px; margin: 0 auto 26px; }

/* ===== Footer ===== */
.site-footer { background: #0b2547; color: #c4d0e2; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; padding: 56px 22px 40px; }
.footer-col h4 { color: #fff; font-family: var(--sans); font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { padding: 5px 0; }
.footer-col a { color: #c4d0e2; }
.footer-col a:hover { color: var(--gold-soft); }
.footer-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.footer-logo { height: 54px; background: #fff; border-radius: 8px; padding: 4px; }
.footer-brand strong { color: #fff; font-family: var(--serif); font-size: 1.15rem; }
.footer-brand .motto { color: var(--gold-soft); font-style: italic; margin: 2px 0 0; font-size: .9rem; }
.footer-about { font-size: .9rem; line-height: 1.6; }
.footer-social a { margin-right: 14px; font-size: .9rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); }
.footer-bottom .wrap { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; font-size: .85rem; flex-wrap: wrap; gap: 8px; }
.admin-link { color: #8fa3c0; }

/* ===== PWA install button ===== */
.pwa-install {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  background: var(--maroon); color: #fff; border: 0; border-radius: 30px;
  padding: 12px 20px; font-weight: 700; font-size: .95rem; font-family: inherit;
  box-shadow: 0 8px 24px rgba(138, 28, 43, .4); cursor: pointer;
  opacity: 0; transform: translateY(20px); transition: opacity .3s, transform .3s, background .2s;
}
.pwa-install.show { opacity: 1; transform: translateY(0); }
.pwa-install:hover { background: var(--maroon-2); }
@media (max-width: 760px) { .pwa-install { right: 14px; bottom: 14px; padding: 11px 18px; } }
@media (prefers-reduced-motion: reduce) { .pwa-install { transition: none; } }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .fac-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 10px 16px 18px; box-shadow: var(--shadow); gap: 2px;
    max-height: 0; overflow: hidden; transition: max-height .3s ease; border-top: 1px solid var(--line);
  }
  .main-nav.open { max-height: 90vh; overflow-y: auto; }
  .main-nav a, .nav-parent { padding: 12px 10px; border-radius: 8px; width: 100%; justify-content: flex-start; }
  .main-nav > a.active::after { display: none; }
  /* Flatten dropdowns: show parent as a section label with its links indented */
  .nav-item { width: 100%; }
  .nav-parent { pointer-events: none; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding-bottom: 4px; }
  .nav-parent .caret { display: none; }
  .nav-item .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; padding: 0 0 6px 10px; min-width: 0;
  }
  .nav-item .dropdown::before { display: none; }
  .nav-item .dropdown a { padding: 10px; }
  .quick-strip .wrap { grid-template-columns: repeat(2, 1fr); }
  .fac-grid, .news-grid, .form-grid2 { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  section { padding: 52px 0; }
  .about-media .motto-card { position: static; margin-top: 16px; max-width: none; }
  body { font-size: 16px; }
}
