/* ============================================================
   NHST Website — main.css
   Design System: Tokens + Reset + Boxed Layout + Typography
   Mobile-First | Noto Serif/Sans Devanagari | nhst.in
   ============================================================ */

/* ── Google Fonts imported in header.php ───────────────────── */
/* Noto Serif Devanagari 400/600/700 + Noto Sans Devanagari 400/500/600 */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Colors — vibrant orange family (UI/UX Pro Max orange scale).
     --clr-navy* names are kept for compatibility; they now hold the
     deep burnt-orange secondary tones instead of navy. */
  --clr-primary:        #C2410C;   /* orange-700 — text & white-text fills (5.2:1) */
  --clr-primary-h:      #A8380B;   /* hover, keeps white text ≥ 6:1 */
  --clr-primary-vivid:  #F97316;   /* orange-500 — accents, bars, glows only */
  --clr-primary-light:  #FFF7ED;
  --clr-navy:           #9A3412;   /* orange-800 — headings, secondary fills */
  --clr-navy-light:     #C2410C;
  --clr-navy-dim:       #7C2D12;   /* orange-900 — topbar, hero, footer */
  --clr-gold:           #FBBF24;
  --clr-gold-muted:     #F59E0B;
  --clr-gold-dim:       #B45309;
  --clr-surface:        #FFFBF5;
  --clr-surface-alt:    #FFF4E6;
  --clr-surface-card:   #FFFFFF;
  --clr-text:           #3B2416;   /* warm brown instead of black */
  --clr-text-muted:     #6B4430;
  --clr-text-light:     #8A5A3C;
  --clr-border:         #FED7AA;
  --clr-border-light:   #FFEDD5;
  --clr-success:        #2E7D32;
  --clr-success-bg:     #E8F5E9;
  --clr-error:          #C62828;
  --clr-error-bg:       #FFEBEE;
  --clr-warning:        #F57F17;
  --clr-warning-bg:     #FFF8E1;

  /* Page & Box */
  --clr-page-bg:        #FBE6D2;
  --box-max-w:          1200px;
  --box-border:         1px solid rgba(124, 45, 18, 0.10);
  --box-radius:         0px;          /* mobile: flush edges */
  --box-margin:         0px;          /* mobile: no margin */

  /* Shadows */
  --shadow-box:
    0 0 0 1px rgba(124, 45, 18, 0.06),
    0 4px 24px -4px rgba(124, 45, 18, 0.14),
    0 1px 4px rgba(230, 74, 25, 0.04);
  --shadow-card:
    0 4px 14px -2px rgba(124, 45, 18, 0.07),
    0 2px 6px -1px rgba(230, 74, 25, 0.04);
  --shadow-card-h:
    0 8px 24px -4px rgba(124, 45, 18, 0.14),
    0 3px 8px rgba(230, 74, 25, 0.08);
  --shadow-drop:
    0 10px 30px -6px rgba(124, 45, 18, 0.16),
    0 4px 10px rgba(255, 81, 0, 0.08);
  --shadow-modal:
    0 20px 60px -10px rgba(124, 45, 18, 0.28),
    0 0 0 1px rgba(255, 213, 0, 0.35);
  --shadow-nav:
    0 2px 16px -2px rgba(124, 45, 18, 0.12);

  /* Spacing (8px rhythm) */
  --sp-1:   0.25rem;    /*  4px */
  --sp-2:   0.5rem;     /*  8px */
  --sp-3:   0.75rem;    /* 12px */
  --sp-4:   1rem;       /* 16px */
  --sp-5:   1.25rem;    /* 20px */
  --sp-6:   1.5rem;     /* 24px */
  --sp-8:   2rem;       /* 32px */
  --sp-10:  2.5rem;     /* 40px */
  --sp-12:  3rem;       /* 48px */
  --sp-16:  4rem;       /* 64px */
  --sp-20:  5rem;       /* 80px */

  /* Section vertical padding (grows at breakpoints) */
  --section-py: 2.5rem;

  /* Typography */
  --ff-serif: 'Noto Serif Devanagari', 'Noto Serif', Georgia, serif;
  --ff-sans:  'Noto Sans Devanagari', 'Noto Sans', system-ui, -apple-system, sans-serif;

  /* Radii */
  --r-xs:   2px;
  --r-sm:   4px;
  --r:      8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-pill: 9999px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-mid:  250ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index scale */
  --z-base:    1;
  --z-nav:     100;
  --z-dropdown: 200;
  --z-modal:   900;
  --z-toast:   1000;

  /* Rangoli motif (circles + wave, light orange) — header strip, Narsamma card frame */
  --pattern-rangoli: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='24'%3E%3Ccircle cx='6' cy='12' r='3' fill='none' stroke='%23FB923C' stroke-width='1.5'/%3E%3Ccircle cx='6' cy='12' r='1' fill='%23FB923C'/%3E%3Cpath d='M9 12 Q18 4 30 12 Q42 20 51 12' stroke='%23FB923C' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='54' cy='12' r='3' fill='none' stroke='%23FB923C' stroke-width='1.5'/%3E%3Ccircle cx='54' cy='12' r='1' fill='%23FB923C'/%3E%3C/svg%3E");
}

/* ── CSS Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 64px;   /* keep #anchors clear of the sticky masthead */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--clr-text);
  background-color: var(--clr-page-bg);
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 18px,
      rgba(124, 45, 18, 0.015) 18px,
      rgba(124, 45, 18, 0.015) 19px
    );
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ── Boxed Layout ─────────────────────────────────────────────── */
.site-box {
  max-width: var(--box-max-w);
  margin:    var(--box-margin) auto;
  background: var(--clr-surface);
  border:     var(--box-border);
  border-radius: var(--box-radius);
  box-shadow: var(--shadow-box);
  overflow: clip;   /* not hidden — hidden would break the sticky .masthead */
  position: relative;
}

/* ── Inner Section Container ─────────────────────────────────── */
.section-inner {
  padding: var(--section-py) var(--sp-4);
}

.container {
  width: 100%;
  max-width: 100%;
  padding: 0 var(--sp-4);
}

/* ── Typography ───────────────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--ff-serif); line-height: 1.25; }

h1 { font-size: clamp(1.75rem, 5vw + 0.5rem, 3rem);   font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: calc(clamp(1.375rem, 3.5vw + 0.25rem, 2.25rem) - 3px); font-weight: 700; }
h3 { font-size: clamp(1.125rem, 2.5vw + 0.25rem, 1.75rem); font-weight: 600; }
h4 { font-size: clamp(1rem, 1.5vw + 0.25rem, 1.25rem);     font-weight: 600; font-family: var(--ff-sans); }

p { line-height: 1.75; color: var(--clr-text-muted); }

.text-serif { font-family: var(--ff-serif); }
.text-sans  { font-family: var(--ff-sans); }

/* Motto — Devanagari special treatment */
.motto-text {
  font-family: var(--ff-serif);
  font-size: clamp(0.9375rem, 1.5vw + 0.25rem, 1.25rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.65;
  font-style: italic;
}

/* Section heading with decorative underline */
.section-title {
  font-family: var(--ff-serif);
  font-weight: 700;
  color: var(--clr-navy);
  position: relative;
  display: inline-block;
  margin-bottom: var(--sp-2);
}
.section-title::after {
  content: '';
  display: block;
  width: 56px;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary-vivid), var(--clr-gold));
  margin-top: var(--sp-2);
  border-radius: var(--r-pill);
}
.section-title--center { display: block; text-align: center; }
.section-title--center::after { margin: var(--sp-2) auto 0; }

.section-subtitle {
  font-family: var(--ff-sans);
  color: var(--clr-text-muted);
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  max-width: 60ch;
  margin: 0 auto;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.65rem 1.5rem;
  border-radius: var(--r-pill);
  font-family: var(--ff-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  transition: all var(--t-mid);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}
.btn:focus-visible {
  outline: 3px solid var(--clr-gold);
  outline-offset: 2px;
}

/* Primary — Saffron */
.btn-primary {
  background: var(--clr-primary);
  color: #fff;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(230, 74, 25, 0.3);
}
.btn-primary:hover {
  background: var(--clr-primary-h);
  box-shadow: 0 4px 16px rgba(230, 74, 25, 0.45);
  transform: translateY(-1px);
}

/* Secondary — Navy */
.btn-secondary {
  background: var(--clr-navy);
  color: #fff;
  border: 2px solid transparent;
}
.btn-secondary:hover {
  background: var(--clr-navy-light);
  box-shadow: 0 4px 12px rgba(124, 45, 18, 0.3);
  transform: translateY(-1px);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--clr-navy);
  border: 2px solid var(--clr-navy);
}
.btn-outline:hover {
  background: var(--clr-navy);
  color: #fff;
}

/* Ghost white (for dark backgrounds) */
.btn-ghost {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.25);
  border-color: #fff;
}

/* Sizes */
.btn-sm { padding: 0.45rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.0625rem; }

/* ── Badges / Chips ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-gold  { background: var(--clr-gold); color: #431407; }
.badge-saffron { background: var(--clr-primary); color: #fff; }
.badge-navy  { background: var(--clr-navy); color: #fff; }

/* Estd badge */
.badge-estd {
  background: var(--clr-gold);
  color: #431407;
  font-family: var(--ff-serif);
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.25rem 0.875rem;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface-card);
  border: 1px solid var(--clr-border-light);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--t-mid), transform var(--t-mid);
}
.card:hover {
  box-shadow: var(--shadow-card-h);
  transform: translateY(-3px);
}

/* Gradient top bar on cards */
.card--accent::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary-vivid) 0%, var(--clr-gold) 50%, var(--clr-navy) 100%);
}

/* ── Grids ────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--sp-6); }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.form-label { font-family: var(--ff-sans); font-weight: 600; font-size: 0.875rem; color: var(--clr-navy); }

.form-control {
  width: 100%;
  padding: 0.65rem var(--sp-4);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r);
  font-family: var(--ff-sans);
  font-size: 0.9375rem;
  background: var(--clr-surface-card);
  color: var(--clr-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(230, 74, 25, 0.15);
}
textarea.form-control { resize: vertical; min-height: 130px; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  font-size: 0.9375rem;
  margin-bottom: var(--sp-4);
  border-left: 4px solid;
}
.alert-success { background: var(--clr-success-bg); border-color: var(--clr-success); color: #1B5E20; }
.alert-error   { background: var(--clr-error-bg);   border-color: var(--clr-error);   color: #7F0000; }
.alert-warning { background: var(--clr-warning-bg); border-color: var(--clr-warning); color: #7F4F00; }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); border: 1px solid var(--clr-border-light); }
.table-nhst { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table-nhst thead { background: var(--clr-navy); color: #fff; }
.table-nhst th { padding: var(--sp-3) var(--sp-4); font-family: var(--ff-sans); font-weight: 600; font-size: 0.875rem; text-align: left; letter-spacing: 0.03em; white-space: nowrap; }
.table-nhst td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--clr-border-light); color: var(--clr-text); }
.table-nhst tbody tr:nth-child(even) { background: var(--clr-surface-alt); }
.table-nhst tbody tr:hover { background: var(--clr-primary-light); }

/* ── Decorative Rangoli SVG Divider ─────────────────────────── */
.rangoli-divider {
  width: 100%;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='24'%3E%3Ccircle cx='6' cy='12' r='3' fill='none' stroke='%23D8CDBF' stroke-width='1.5'/%3E%3Ccircle cx='6' cy='12' r='1' fill='%23D8CDBF'/%3E%3Cpath d='M9 12 Q18 4 30 12 Q42 20 51 12' stroke='%23D8CDBF' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='54' cy='12' r='3' fill='none' stroke='%23D8CDBF' stroke-width='1.5'/%3E%3Ccircle cx='54' cy='12' r='1' fill='%23D8CDBF'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.7;
}

/* ── Utility ──────────────────────────────────────────────────── */
.text-center   { text-align: center; }
.text-left     { text-align: left; }
.text-navy     { color: var(--clr-navy); }
.text-primary  { color: var(--clr-primary); }
.text-gold     { color: var(--clr-gold-dim); }
.text-muted    { color: var(--clr-text-muted); }
.text-white    { color: #fff; }

.bg-navy       { background: var(--clr-navy); }
.bg-primary    { background: var(--clr-primary); }
.bg-surface    { background: var(--clr-surface); }
.bg-surface-alt{ background: var(--clr-surface-alt); }

.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Scroll Reveal — Framer-Motion-style micro motion ─────────────
   Uses animations (not transitions) so it never fights an element's own
   hover transition. fill-mode "backwards" holds the start frame during any
   delay, then releases the element so hover transforms keep working.
   Variants: .reveal (rise) · .reveal--left · .reveal--right · .reveal--zoom
   Stagger: main.js adds animation-delay to elements revealed together. */
:root { --ease-spring: cubic-bezier(0.22, 1, 0.36, 1); }

.reveal { opacity: 0; }
.reveal.revealed {
  opacity: 1;
  animation: reveal-up 0.8s var(--ease-spring) backwards;
}
.reveal--left.revealed  { animation-name: reveal-left; }
.reveal--right.revealed { animation-name: reveal-right; }
.reveal--zoom.revealed  { animation-name: reveal-zoom; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(28px) scale(0.98); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes reveal-left {
  from { opacity: 0; transform: translateX(-36px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes reveal-right {
  from { opacity: 0; transform: translateX(36px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes reveal-zoom {
  from { opacity: 0; transform: scale(0.92); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.2s; }
.reveal-delay-3 { animation-delay: 0.3s; }
.reveal-delay-4 { animation-delay: 0.4s; }

/* Section-title underline draws in once the title is revealed */
.section-title.reveal::after {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease-spring) 0.35s;
}
.section-title--center.reveal::after { transform-origin: center; }
.section-title.reveal.revealed::after { transform: scaleX(1); }

/* Tap feedback (Framer "whileTap") */
.btn:active,
.feature-card:active,
.glance-tile:active .glance-tile__box { transform: scale(0.97); transition-duration: 80ms; }
