/*
Theme Name: TNM School Theme
Author: Tanmay
Description: Clean Tailwind-powered WordPress theme for Tagore Public Senior Secondary School, Takhatgarh.
Text Domain: tnm-school
Version: 2.0.0
*/

/* ─── Design Tokens ──────────────────────────────────────── */
:root {
  /* Brand */
  --primary:       #0D4C92;
  --primary-deep:  #1E3A5F;
  --primary-tint:  #EAF1FB;
  --accent:        #E8A317;
  --accent-dark:   #D4930F;
  --accent-tint:   #FEF6E4;
  --success:       #1F8A70;

  /* Surface & text */
  --surface:       #FAFBFC;
  --surface-soft:  #F4F6F9;
  --ink:           #2D3748;
  --ink-soft:      #4A5568;
  --mute:          #718096;
  --rule:          #E2E8F0;

  /* Legacy aliases — existing templates reference these */
  --p-bg:       #FAFBFC;
  --p-surface:  #F4F6F9;
  --p-ink:      #2D3748;
  --p-inkMut:   #718096;
  --p-line:     #E2E8F0;
  --p-primary:  #0D4C92;
  --p-accent:   #E8A317;
  --ink-soft:   #4A5568;

  /* Typography */
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Fluid type scale */
  --step--1: clamp(0.8125rem, 0.77rem + 0.22vw, 0.9375rem);
  --step-0:  clamp(1rem,      0.94rem + 0.31vw, 1.125rem);
  --step-1:  clamp(1.125rem,  1.01rem + 0.57vw, 1.375rem);
  --step-2:  clamp(1.25rem,   1.09rem + 0.82vw, 1.75rem);
  --step-3:  clamp(1.5rem,    1.25rem + 1.27vw, 2.25rem);
  --step-4:  clamp(1.875rem,  1.5rem  + 1.88vw, 3rem);
  --step-5:  clamp(2.25rem,   1.72rem + 2.63vw, 3.75rem);

  /* Spacing */
  --gutter:      clamp(1.25rem, 4vw, 2.5rem);
  --section-pad: clamp(3.75rem, 7vw, 7.5rem);

  /* Radius */
  --radius-btn:  8px;
  --radius-card: 12px;
  --radius-img:  16px;

  /* Shadow */
  --shadow-soft: 0 2px 8px -2px rgb(13 76 146 / 0.08), 0 1px 3px -1px rgb(13 76 146 / 0.05);
  --shadow-card: 0 4px 24px -4px rgb(13 76 146 / 0.12), 0 1px 4px -1px rgb(13 76 146 / 0.06);
  --shadow-lift: 0 8px 32px -4px rgb(13 76 146 / 0.18), 0 2px 8px -2px rgb(13 76 146 / 0.08);
}

/* ─── Base ───────────────────────────────────────────────── */
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--primary); color: #fff;
  font-size: 0.875rem; font-weight: 600; font-family: var(--font-body);
  border-radius: var(--radius-btn); text-decoration: none; border: none; cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--primary-deep); box-shadow: var(--shadow-card); transform: translateY(-1px); }

.btn-accent {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: var(--accent); color: #fff;
  font-size: 0.875rem; font-weight: 700; font-family: var(--font-body);
  border-radius: var(--radius-btn); text-decoration: none; border: none; cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.btn-accent:hover { background: var(--accent-dark); box-shadow: var(--shadow-card); transform: translateY(-1px); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: transparent; color: var(--primary);
  font-size: 0.875rem; font-weight: 600; font-family: var(--font-body);
  border: 2px solid var(--primary); border-radius: var(--radius-btn); text-decoration: none; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-outline-white {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: transparent; color: #fff;
  font-size: 0.875rem; font-weight: 600; font-family: var(--font-body);
  border: 2px solid rgba(255,255,255,0.45); border-radius: var(--radius-btn); text-decoration: none; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.8); }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-3px); }

/* ─── Section label ──────────────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}

/* ─── Top bar ────────────────────────────────────────────── */
#top-bar {
  background: var(--primary-deep);
  font-size: 0.75rem;
  line-height: 1;
}
#top-bar a { color: rgba(255,255,255,0.7); text-decoration: none; transition: color 0.15s; }
#top-bar a:hover { color: #fff; }
#top-bar .tb-icon { display: inline-flex; align-items: center; gap: 0.4rem; color: rgba(255,255,255,0.7); }

.admissions-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.2rem 0.65rem; border-radius: 4px;
  animation: badge-pulse 2.8s ease-in-out infinite;
}
@keyframes badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ─── Header ─────────────────────────────────────────────── */
#site-header { position: sticky; top: 0; z-index: 50; }

#main-header {
  background: #fff;
  border-bottom: 1px solid var(--rule);
  transition: box-shadow 0.3s ease;
}
#main-header.is-scrolled { box-shadow: 0 2px 20px -4px rgb(13 76 146 / 0.14); }

#main-header #menu-primary li a {
  font-size: 0.8125rem;
  font-family: var(--font-display);
  letter-spacing: 0.02em; font-weight: 500;
  color: var(--ink); text-decoration: none;
  transition: color 0.2s;
}
#main-header #menu-primary li a:hover { color: var(--primary); }
#main-header #menu-primary li { display: flex; align-items: center; }
#main-header #menu-primary li.current-menu-item > a,
#main-header #menu-primary li.current_page_item > a { color: var(--primary); font-weight: 600; }

/* Over-dark hero mode */
#main-header.over-dark { background-color: rgb(0 0 0 / 0.18) !important; border-bottom-color: rgb(255 255 255 / 0.1) !important; }
#main-header.over-dark #menu-primary li a { color: #fff !important; }
#main-header.over-dark #menu-primary li a:hover { color: rgba(255,255,255,0.7) !important; }
.logo-light { display: none; }
#main-header.over-dark .logo-dark  { display: none; }
#main-header.over-dark .logo-light { display: block; }

/* ─── Mobile drawer ──────────────────────────────────────── */
#tablet-drawer {
  top: var(--drawer-top, 64px);
  transform: translateX(-100%);
  transition: transform 200ms ease;
}
#tablet-drawer.is-open { transform: translateX(0); }
#tablet-backdrop { opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
#tablet-backdrop.is-open { opacity: 1; pointer-events: auto; }
#tablet-drawer .menu a {
  display: flex; align-items: center; min-height: 52px;
  border-bottom: 1px solid var(--rule);
  color: inherit; text-decoration: none;
  font-family: var(--font-display); font-weight: 500; font-size: 0.9375rem;
}

/* ─── Footer ─────────────────────────────────────────────── */
.hairline {
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}
.eyebrow {
  display: block;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255,255,255,0.4);
  margin-bottom: 1.25rem;
}
.link-row {
  display: block; font-size: 0.875rem; color: rgba(255,255,255,0.55);
  text-decoration: none; padding: 0.2rem 0; transition: color 0.2s;
}
.link-row:hover { color: rgba(255,255,255,0.9); padding-left: 4px; }

/* ─── Scroll reveal ──────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
[data-reveal].in { opacity: 1; transform: none; }

/* ─── Gallery grid ───────────────────────────────────────── */
.gallery-item { overflow: hidden; border-radius: var(--radius-card); }
.gallery-item img { transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.05); }

/* ─── Placeholder ────────────────────────────────────────── */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      rgb(13 76 146 / 0.06) 0, rgb(13 76 146 / 0.06) 1px,
      transparent 1px, transparent 9px),
    linear-gradient(160deg, rgb(13 76 146 / 0.07) 0%, rgb(13 76 146 / 0.15) 100%);
}
.ph-dark {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg,
    rgba(255,255,255,0.025) 0, rgba(255,255,255,0.025) 1px,
    transparent 1px, transparent 9px);
}

/* ─── Stat counters ──────────────────────────────────────── */
.stat-num {
  font-family: var(--font-display); font-size: var(--step-4);
  font-weight: 700; color: var(--primary); line-height: 1.1;
  display: block;
}

/* ─── Hero tags ──────────────────────────────────────────── */
.hero-tag {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.8125rem; font-weight: 500; color: rgba(255,255,255,0.8);
}
.hero-tag::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); flex-shrink: 0;
}

/* ─── Feature icon box ───────────────────────────────────── */
.icon-box {
  width: 3rem; height: 3rem; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-tint);
}

/* ─── Page hero ──────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 100%);
  padding: 5rem 0;
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg,
    rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 1px,
    transparent 1px, transparent 12px);
}

/* ─── Timeline (admissions page) ─────────────────────────── */
.timeline-step {
  position: relative;
  padding-left: 3.5rem;
}
.timeline-step::before {
  content: attr(data-step);
  position: absolute; left: 0; top: 0;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-family: var(--font-display); font-size: 0.875rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute; left: 1.1rem; top: 2.25rem;
  width: 2px; height: calc(100% + 1rem);
  background: var(--rule);
}
