/* Site-wide responsive layer — loaded after the page's primary stylesheet on every
   page, so these rules can refine layout for phones, tablets, laptops, and large/
   high-resolution displays without touching the original desktop design. */

/* ============================================================================
   Sitewide typography — clean, professional base for every heading and paragraph.
   Previously almost entirely unstyled (raw browser defaults), apart from a few ad-hoc
   overrides like a bright pure-blue h2 (#1e00ff) that clashed with the site's saffron/
   maroon/gold palette entirely. Replaced with one coherent, brand-consistent system.
   ============================================================================ */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Devanagari", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.7;
  color: #3a332d;
}

h1,{
  font-family: inherit;
  color: white;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 14px;
}

h2, h3 {
  font-family: inherit;
  color: #7a1f1f;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 14px;
}
h1 { font-size: 28px; letter-spacing: 0.01em; }
h2 { font-size: 23px; }
h3 { font-size: 18px; }
/* h4 is used both as a genuine minor heading and, throughout this site's existing
   content, as a wrapper for body-length paragraphs — so it gets paragraph-friendly
   line-height/weight rather than tight heading styling, which would read as a wall of
   bold text wherever it holds real paragraph copy. */
h4 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.75;
  margin: 0 0 12px;
}

p {
  color: #4a423b;
  line-height: 1.75;
  margin: 0 0 14px;
}

ul, ol {
  line-height: 1.75;
  padding-left: 22px;
}
li {
  margin-bottom: 6px;
}

strong, b {
  font-weight: 700;
  color: #5c1717;
}

a {
  color: #c2410c;
}

::selection {
  background: rgba(255, 126, 20, 0.28);
  color: #2a2320;
}

/* Section-title accent: a short gold underline under the h2s used as section headers
   sitewide, replacing the plain (and clashing) pure-blue color with a subtle, on-brand
   cue instead. */
.about h2, .services h2, .container1 h2, .container h2 {
  display: inline-block;
  position: relative;
  padding-bottom: 10px;
  color: #7a1f1f;
}
.about h2::after, .services h2::after, .container1 h2::after, .container h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ff7e14, #d4af37);
}

/* ---------- Master Plan PDF download button (Introduction page) ---------- */
.master-plan-btn {
  display: inline-block;
  background: #ff7e14;
  color: #fff;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.master-plan-btn:hover {
  background: #ff7307;
}

/* ---------- Sticky footer: pinned to the bottom of the viewport on short pages
   (instead of floating mid-screen), scrolls with the page normally on long ones —
   never overlays content. No markup changes needed anywhere: html/body become the
   flex container and .footer's margin-top:auto absorbs the remaining space; every
   other element on the page (top-bar, header, page sections) just flows normally
   as block-level flex children, and anything position:fixed (.modal, .quick-sidebar)
   is already out of flow and unaffected. ---------- */
html {
  height: 100%;
}
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.footer {
  margin-top: auto;
}

/* ---------- Footer — clean redesign: subdued maroon-forward gradient (distinct from
   the brighter header so the two don't compete), clearer type hierarchy, gold accent
   links with underline only on hover instead of a permanently-underlined white link
   (previously unstyled entirely — default browser blue, which read poorly against the
   gradient background). ---------- */
.footer {
  background: linear-gradient(100deg, #5c1717 0%, #7a1f1f 55%, #a33a12 100%);
  padding: 22px 32px;
  font-size: 13.5px;
  line-height: 1.6;
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.15);
}
.footer-left p, .footer-right p {
  /* Explicit white — the sitewide p{color:#4a423b} rule added above is a direct match
     on these same <p> elements, which always beats an inherited color regardless of
     specificity, so without this override the footer text would render dark-on-dark
     against its own maroon gradient background. */
  color: #fff;
}
.footer-left p {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.footer-right p {
  font-weight: 400;
  opacity: 0.92;
}
.footer a {
  color: #ffd479;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.footer a:hover {
  color: #fff;
  text-decoration: underline;
}
@media only screen and (max-width: 480px) {
  .footer {
    padding: 18px 20px;
    font-size: 12.5px;
  }
}

/* ---------- Entrance notice popup (shared across all pages, some of which don't
   load index.css where this was originally defined) ---------- */
.modal {
  position: fixed;
  /* Higher than every other fixed-position layer on the site (quick-sidebar 900,
     AI chat panel 1100, mobile .sidebar 1200, .header 1250) so the popup — and its
     background blur below — actually sits above the navbar/top-bar instead of those
     poking through on top of it. */
  z-index: 1400;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding-top: 60px;
}
/* Set on <body> while the popup is open (js/index.js) — locks the background in place
   so nothing behind the blur can scroll/move until the notice is dismissed. */
body.modal-open {
  overflow: hidden;
}
.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  animation: modalFadeIn 0.4s cubic-bezier(.2,.8,.2,1) both;
}
.modal-content img {
  width: 100%;
  border-radius: 8px;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.closeb {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 25px;
  cursor: pointer;
}
.closeb:hover,
.closeb:focus {
  color: black;
  text-decoration: none;
}

/* ---------- Floating quick-access sidebar (Blog + WhatsApp), fixed to the right
   edge of the viewport on every page — circular icon buttons with a gap between them ---------- */
.quick-sidebar {
  position: fixed;
  right: 16px;
  top: 55%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quick-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.quick-sidebar-item:hover {
  transform: scale(1.08);
}
/* The label text was previously sr-only always (clipped to 1px, screen-reader only) —
   with icon-only buttons and just a native title="" tooltip (slow to appear, and
   doesn't work at all on touch devices), there was no real way for a sighted visitor to
   know what an icon does before clicking it. Now shown as a proper on-hover/focus
   tooltip instead, so both mouse and keyboard users get a visible label. */
.quick-sidebar-item {
  position: relative;
}
.quick-sidebar-item span {
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  transform: translateY(-50%) translateX(6px);
  background: #2a2320;
  color: #fff;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.quick-sidebar-item span::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #2a2320;
}
.quick-sidebar-item:hover span,
.quick-sidebar-item:focus-visible span {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}
@media (max-width: 640px) {
  /* Tooltip is a hover affordance — no hover on touch, so don't reserve space/behavior
     for it there; the clearer icon glyph is the mobile-facing cue instead. */
  .quick-sidebar-item span {
    display: none;
  }
}
.quick-sidebar-blog {
  background: linear-gradient(135deg, #ffa850, #ff7e14);
}
.quick-sidebar-whatsapp {
  background: #25d366;
}
.quick-sidebar-ai {
  background: linear-gradient(135deg, #7a1f1f, #e8760b);
  position: relative;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.ai-toggle-hidden {
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

/* ---------- संस्कृती AI floating chat widget ---------- */
.ai-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff3b30;
  border: 2px solid #fff;
  display: none;
  align-items: center;
  justify-content: center;
  animation: aiPulse 1.6s ease-in-out infinite;
}
@keyframes aiPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
}

.ai-chat-panel {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(41, 20, 10, 0.28), 0 2px 8px rgba(41, 20, 10, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 1100;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  border: 1px solid rgba(122, 31, 31, 0.08);
}
.ai-chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

.ai-chat-header {
  background: linear-gradient(120deg, #e8760b, #c2410c 55%, #7a1f1f);
  color: #fff;
  padding: 14px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.ai-chat-title {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.2;
}
.ai-chat-status {
  font-size: 11px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddc73;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(61, 220, 115, 0.25);
}
.ai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ai-chat-clear,
.ai-chat-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.15s ease;
}
.ai-chat-clear {
  font-size: 13px;
}
.ai-chat-close {
  font-size: 20px;
}
.ai-chat-clear:hover,
.ai-chat-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, #fdf6ec 0%, #fdf8f2 100%);
  scroll-behavior: smooth;
}
.ai-chat-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  animation: aiMsgIn 0.2s ease;
}
@keyframes aiMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-chat-msg-bot {
  background: #fff;
  border: 1px solid #eee0d2;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  color: #2a2320;
  box-shadow: 0 1px 3px rgba(41, 20, 10, 0.05);
}
.ai-chat-msg-user {
  background: linear-gradient(120deg, #e8760b, #c2410c);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.ai-chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}
.ai-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c2937a;
  animation: aiTypingBounce 1.2s ease-in-out infinite;
}
.ai-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ai-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
  flex-shrink: 0;
}
.ai-chat-chip {
  background: #fff;
  border: 1px solid #eadfce;
  color: #7a1f1f;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ai-chat-chip:hover {
  background: #fff6ec;
  border-color: #e8760b;
}

.ai-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eee0d2;
  background: #fff;
  flex-shrink: 0;
}
.ai-chat-input-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid #e7e0d6;
  border-radius: 999px;
  font-size: 13.5px;
  background: #fdf8f2;
}
.ai-chat-input-row input:focus {
  outline: none;
  border-color: #e8760b;
  background: #fff;
}
.ai-chat-input-row button {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(120deg, #e8760b, #c2410c);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.ai-chat-input-row button:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: scale(1.04);
}
.ai-chat-input-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media only screen and (max-width: 480px) {
  .ai-chat-panel {
    right: 8px;
    bottom: 80px;
    width: calc(100vw - 16px);
    height: min(520px, calc(100vh - 140px));
  }
}

@media only screen and (max-width: 600px) {
  .quick-sidebar {
    top: auto;
    bottom: 16px;
    right: 12px;
    transform: none;
    gap: 12px;
  }
  .quick-sidebar-item {
    width: 46px;
    height: 46px;
  }
}

/* ---------- Top utility bar (WhatsApp / email / address / social) ---------- */
.top-bar {
  background: #5a1414;
  color: #fff;
  font-size: 13px;
  padding: 6px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.top-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
}
.top-bar-item:hover {
  text-decoration: underline;
}
.top-bar-item svg {
  flex-shrink: 0;
  opacity: 0.9;
}
.top-bar-date {
  font-weight: 600;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-bar-icon {
  color: #fff;
  display: inline-flex;
  opacity: 0.85;
}
.top-bar-icon:hover {
  opacity: 1;
}
.top-bar-login {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
}
.top-bar-login:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

@media only screen and (max-width: 768px) {
  .top-bar {
    font-size: 12px;
    padding: 5px 12px;
    gap: 6px;
  }
  .top-bar-address {
    display: none;
  }
}

@media only screen and (max-width: 480px) {
  .top-bar-item span {
    display: none;
  }
  .top-bar-left {
    gap: 14px;
  }
}

/* ---------- Base: keep long lines readable on very large / high-res displays ---------- */
.header,
.about,
.services,
.separator,
.main-content,
.gallery {
  box-sizing: border-box;
}

@media only screen and (min-width: 1600px) {
  .header,
  .about,
  .service-rapper,
  .service-wrapper,
  .separator,
  .main-content > .gallery,
  #gallery {
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- Header / logo: fix illegibly small mobile text ---------- */
@media only screen and (max-width: 768px) {
  .logo h1,
  .logo #title {
    font-size: 18px;
    line-height: 1.3;
    margin: 0 0 4px;
  }
  .logo p,
  .logo #address {
    font-size: 12px;
    margin: 0;
  }
}

@media only screen and (max-width: 420px) {
  .logo h1,
  .logo #title {
    font-size: 15px;
  }
  .logo p,
  .logo #address {
    font-size: 11px;
  }
  .header {
    padding: 12px;
  }
}

/* ---------- Nav: switch to the hamburger menu earlier so it doesn't overflow/wrap
   on tablets once there are 7 nav items ---------- */
@media only screen and (max-width: 900px) {
  .nav {
    display: none !important;
  }
  .mobile-menu {
    display: block !important;
  }
}

@media only screen and (min-width: 901px) and (max-width: 1100px) {
  .nav {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .nav a {
    padding: 6px 10px;
    font-size: 14px;
  }
}

/* ---------- Homepage: photo strip + about/donation sections ---------- */
@media only screen and (max-width: 768px) {
  .photo-row a {
    flex: 1 1 calc(50% - 16px);
    max-width: calc(50% - 16px);
  }
  .photo-row img {
    height: 160px;
  }
}

@media only screen and (max-width: 480px) {
  .photo-row a {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Contact section + social/photo strip: stack on tablets and phones instead of
   squeezing side by side (no wrap rule existed before). */
@media only screen and (max-width: 900px) {
  .separator {
    flex-direction: column;
    align-items: stretch;
  }
  .photo-section {
    max-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .photo-section img {
    width: calc(33.333% - 4px);
    height: 120px;
  }
}

@media only screen and (max-width: 480px) {
  .contact h2 {
    font-size: 20px;
  }
  .contact p {
    font-size: 15px;
  }
}

/* ---------- Photo gallery: fluid grid instead of a fixed 6-column layout, so it
   adapts from phones up through large monitors without hardcoded breakpoints. ---------- */
.gallery {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
}

@media only screen and (max-width: 480px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)) !important;
    gap: 6px !important;
  }
}

.gallery-item img {
  max-width: 100% !important;
  max-height: none !important;
  aspect-ratio: 1 / 1;
}

/* ---------- CR2/RAW gallery items: no browser-renderable preview, so this is a
   file-icon placeholder with a direct download link instead of a thumbnail. ---------- */
.gallery-item-raw {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2a2320;
  color: #fff;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.raw-file-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.9;
}
.raw-file-icon span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.raw-download-link {
  color: #ffcf9e;
  font-size: 11px;
  text-decoration: underline;
}
.raw-download-link:hover {
  color: #fff;
}

/* ---------- Content pages (Introduction/Gurukul/Donation/Services/bio pages):
   .container1 already caps width on large screens; just tighten padding on phones. ---------- */
@media only screen and (max-width: 480px) {
  .container1 {
    margin: 10px;
    padding: 14px;
  }
  table {
    font-size: 13px;
  }
}

/* Staff table on gurukul.html: allow horizontal scroll instead of overflowing the
   viewport on narrow phones. */
@media only screen and (max-width: 600px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ============================================================================
   Sitewide advanced animations — this stylesheet is loaded on every public page
   and both admin pages, so rules here apply everywhere without per-page edits.
   Pure CSS (load-time + hover), no JS/IntersectionObserver dependency, so nothing
   here can silently fail to show content the way a scroll-triggered reveal could.
   ============================================================================ */
.header {
  animation: siteHeaderIn 0.7s ease both;
  /* This animation's keyframes set `transform`, and any element with a non-`none`
     transform establishes its own stacking context — even a static, unpositioned one.
     .header was position:static with no z-index, so that new stacking context sat at
     the "auto" level and lost to any sibling with an explicit z-index (the quick-sidebar
     at 900, the notice modal at 1000, the AI chat panel at 1100) — trapping the mobile
     .sidebar menu (nested inside .header) behind all of them no matter what z-index
     .sidebar itself was given, since a descendant's z-index only competes within its
     own ancestor's stacking context, not against contexts outside it. Making .header
     itself positioned with a z-index higher than all of those lets it (and everything
     nested inside, including .sidebar) render on top where it belongs. */
  position: relative;
  z-index: 1250;
}

/* ---- Header / nav — clean redesign, shared here since .header/.nav/.logo are
   near-identical across index.css/introduction.css/photo.css; overriding once in the
   stylesheet every page loads last avoids tripling the same rules three times.
   Three-stop maroon→saffron gradient matches the same brand gradient already used on
   the login page and 404/error pages, instead of the old flat two-tone orange. ---- */
.header {
  background: linear-gradient(95deg, #7a1f1f 0%, #ff7e14 55%, #e8650a 100%);
  padding: 14px 32px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}
.logo {
  margin-left: 0;
}
.logo h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  /* Explicit white, not inherited from .header — the sitewide h1{color:#7a1f1f} (maroon)
     rule added above would otherwise directly override the inherited white and make the
     title nearly invisible against the header's own maroon-toned gradient. */
  color: #fff;
}
.logo p {
  margin: 3px 0 0;
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
}

.nav {
  justify-content: flex-end;
  gap: 4px;
  padding: 0;
}
.nav a {
  position: relative;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
}
.nav a:hover {
  background-color: rgba(255, 255, 255, 0.15);
}
/* Set by markActiveNavLink() in js/index.js / js/photo.js — highlights whichever nav
   item matches the page currently open, a standard "you are here" cue most nav bars
   have that this one was missing entirely. */
.nav a.active {
  background-color: rgba(255, 255, 255, 0.18);
  font-weight: 700;
}
.nav a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: #ffd479;
}
@media (max-width: 900px) {
  .header {
    padding: 12px 16px;
  }
}

.top-bar {
  animation: siteFadeDown 0.5s ease both;
}
.footer {
  animation: siteFadeUp 0.6s ease both;
}
/* Two-side layout: copyright on the left, credits on the right — .footer .container
   covers photogallery.html specifically, the one page whose footer wraps its content
   in an extra .container div; every other page applies this to .footer directly. */
.footer, .footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  text-align: left;
}
.footer-left p, .footer-right p {
  margin: 3px 0;
}
.footer-right {
  text-align: right;
}
@media only screen and (max-width: 640px) {
  .footer, .footer .container {
    flex-direction: column;
    text-align: center;
  }
  .footer-right {
    text-align: center;
  }
}

.nav a, .sidebar a {
  transition: background-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
}
.nav a:hover {
  transform: translateX(2px);
}

/* ============================================================================
   Advanced animated mobile menu — off-canvas drawer with a spring-eased slide,
   staggered link entrance, a dismissible dimmed backdrop (injected by JS, see
   js/index.js and js/photo.js), and a spinning close button. .sidebar's own
   width/background/etc. live per-page (index.css/introduction.css/photo.css);
   this is purely the motion layer, shared everywhere so it only needs writing once.
   ============================================================================ */
.sidebar {
  transform: translateX(-100%);
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.45s cubic-bezier(.16, 1, .3, 1);
}
.sidebar.sidebar-open {
  transform: translateX(0);
}

.sidebar a {
  opacity: 0;
  transform: translateX(-16px);
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.2s ease, padding-left 0.2s ease;
}
.sidebar.sidebar-open a {
  opacity: 1;
  transform: translateX(0);
}
.sidebar.sidebar-open a:nth-child(1) { transition-delay: 0.08s; }
.sidebar.sidebar-open a:nth-child(2) { transition-delay: 0.13s; }
.sidebar.sidebar-open a:nth-child(3) { transition-delay: 0.18s; }
.sidebar.sidebar-open a:nth-child(4) { transition-delay: 0.23s; }
.sidebar.sidebar-open a:nth-child(5) { transition-delay: 0.28s; }
.sidebar.sidebar-open a:nth-child(6) { transition-delay: 0.33s; }
.sidebar.sidebar-open a:nth-child(7) { transition-delay: 0.38s; }
.sidebar.sidebar-open a:nth-child(8) { transition-delay: 0.43s; }
.sidebar a:hover {
  background-color: rgba(255, 255, 255, 0.16);
  padding-left: 22px;
}

.sidebar .close-btn {
  transition: transform 0.35s cubic-bezier(.34, 1.56, .64, 1);
}
.sidebar .close-btn:hover {
  transform: rotate(90deg) scale(1.15);
}

/* Injected once by openSidebar()/closeSidebar() (getSidebarBackdrop() in js/index.js
   and js/photo.js) rather than hand-added to all 13 public pages' markup. */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 5, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 1190;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.sidebar-backdrop.sidebar-backdrop-open {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar a, .sidebar .close-btn, .sidebar-backdrop {
    transition: none !important;
  }
}

/* Blog / WhatsApp / संस्कृती AI floating buttons: pop in on load, then keep a gentle
   continuous "look at me" idle animation — a soft glow ring (color-matched per icon via
   --quick-glow-color) plus a slow up/down float. The float uses the `translate`
   individual-transform property (not `transform`) specifically so it doesn't fight with
   the entrance keyframe's own `transform`, or with the hover scale below — all three
   compose together instead of one silently overriding another. */
.quick-sidebar-item {
  --quick-glow-color: 255, 255, 255;
  animation: siteQuickPop 0.5s cubic-bezier(.34,1.56,.64,1) both,
             quickGlowPulse 2.6s ease-in-out infinite,
             quickFloat 3.2s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.quick-sidebar-item:nth-child(1) { animation-delay: 0.1s; }
.quick-sidebar-item:nth-child(2) { animation-delay: 0.2s; }
.quick-sidebar-item:nth-child(3) { animation-delay: 0.3s; }
.quick-sidebar-item:hover {
  transform: scale(1.1);
}
.quick-sidebar-blog { --quick-glow-color: 255, 126, 20; }
.quick-sidebar-whatsapp { --quick-glow-color: 37, 211, 102; }
.quick-sidebar-ai { --quick-glow-color: 232, 118, 11; }

@keyframes quickGlowPulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(var(--quick-glow-color), 0.55); }
  50% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25), 0 0 0 9px rgba(var(--quick-glow-color), 0); }
}
@keyframes quickFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .quick-sidebar-item {
    animation: none !important;
  }
}

.container1, .container, .highlight, .highlight1, .table-container,
.contact-info, .contactinfo, .blog-card, .blog-post-body {
  animation: siteCardIn 0.7s ease both;
}

/* Excludes .card on purpose — that class sits on the homepage's photo-strip <img>
   elements, which already have their own scale-up hover in index.css; adding a
   competing translateY hover here would silently override it (later stylesheet wins
   on equal specificity) instead of complementing it. */
.gallery-item, .blog-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery-item:hover, .blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

table tbody tr {
  transition: background-color 0.15s ease;
}
table tbody tr:hover {
  background-color: rgba(232, 118, 11, 0.06);
}

button, .btn, input[type="submit"] {
  transition: filter 0.2s ease, opacity 0.2s ease;
}
button:hover, .btn:hover {
  filter: brightness(1.06);
}

@keyframes siteHeaderIn {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes siteFadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes siteFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes siteCardIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes siteQuickPop {
  from { opacity: 0; transform: scale(0.5) translateX(20px); }
  to { opacity: 1; transform: scale(1) translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .header, .top-bar, .footer, .quick-sidebar-item, .container1, .container,
  .highlight, .highlight1, .table-container, .contact-info, .contactinfo,
  .blog-card, .blog-post-body {
    animation: none !important;
  }
}

/* ============================================================================
   More sitewide animation, round 2 — lightbox/popup entrances, form focus glow,
   button press feedback, staggered highlight boxes, icon hover polish. Same rules
   as the pass above: only common cross-page selectors, pure CSS, no JS dependency.
   ============================================================================ */
.lightbox-content {
  animation: lightboxIn 0.35s cubic-bezier(.2,.8,.2,1) both;
}
.popup-content {
  animation: modalFadeIn 0.4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="date"], input[type="number"], input[type="url"], textarea, select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus,
input[type="password"]:focus, input[type="date"]:focus, input[type="number"]:focus,
input[type="url"]:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 126, 20, 0.18);
}

button:active, .btn:active, input[type="submit"]:active {
  transform: scale(0.97);
}

/* When a page has several .highlight boxes in a row (Introduction/gurukul/services/etc.),
   cascade their entrance instead of all popping in at once. */
.highlight:nth-of-type(1), .highlight1:nth-of-type(1) { animation-delay: 0s; }
.highlight:nth-of-type(2), .highlight1:nth-of-type(2) { animation-delay: 0.1s; }
.highlight:nth-of-type(3), .highlight1:nth-of-type(3) { animation-delay: 0.2s; }
.highlight:nth-of-type(4), .highlight1:nth-of-type(4) { animation-delay: 0.3s; }
.highlight:nth-of-type(5), .highlight1:nth-of-type(5) { animation-delay: 0.4s; }

.top-bar-icon {
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.top-bar-icon:hover {
  transform: scale(1.15) rotate(-6deg);
}

/* Simple, non-rotating hover for the homepage's Facebook/Maps/YouTube icons — a
   rotate here made an existing sizing bug ("bent" icons, fixed above) more obvious,
   so this stays a plain, clean lift+scale. */
.social-icon {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.social-icon:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.quick-sidebar-item svg, .top-bar-icon svg {
  transition: transform 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-content, .popup-content {
    animation: none !important;
  }
  button:active, .btn:active, input[type="submit"]:active {
    transform: none;
  }
}
