/* ==========================================================================
   National English School, Chitradurga - Main Stylesheet
   ========================================================================== */

:root {
  --navy: #0b2545;
  --navy-dark: #061630;
  --navy-light: #13315c;
  --gold: #d4a373;
  --gold-bright: #f4c95d;
  --accent: #c1121f;
  --bg: #fdfcfb;
  --bg-alt: #f5f3ef;
  --text: #1c1c1c;
  --text-muted: #555;
  --border: #e4e0d8;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
  --radius: 6px;
  --radius-lg: 12px;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --container: 1200px;
  --transition: 0.25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 0.75em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
h4 { font-size: 1.15rem; }

p { margin-bottom: 1em; color: var(--text); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

/* ==========================================================================
   Top Bar
   ========================================================================== */
.topbar {
  background: var(--navy-dark);
  color: #dfe5ee;
  font-size: 0.85rem;
  padding: 0.5rem 0;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.topbar a { color: #dfe5ee; }
.topbar a:hover { color: var(--gold-bright); }
.topbar .tb-contact span { margin-right: 1rem; }
.topbar .tb-socials a { margin-left: 0.75rem; }

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
  flex: 1 1 auto;
}
.brand-text { min-width: 0; }
.brand-logo {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand-text .brand-title {
  font-family: var(--font-heading);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.1;
}
.brand-text .brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.nav a {
  padding: 0.55rem 0.7rem;
  color: var(--navy);
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: all var(--transition);
}
.nav a:hover, .nav a.active {
  background: var(--bg-alt);
  color: var(--accent);
}
.nav .cta {
  background: var(--accent);
  color: var(--white);
  margin-left: 0.4rem;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}
.nav .cta:hover { background: #9a0e19; color: var(--white); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--navy);
  cursor: pointer;
  padding: 0.5rem;
}

/* ==========================================================================
   Dropdown menus
   ========================================================================== */
.nav-item { position: relative; display: inline-flex; align-items: center; white-space: nowrap; }
.nav-item > a { padding-right: 1.35rem !important; white-space: nowrap; }
.nav-item > a::after {
  content: '';
  position: absolute;
  right: 0.55rem;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  opacity: 0.6;
  transition: transform 0.2s ease;
}
.nav-item:hover > a::after,
.nav-item.open > a::after { transform: translateY(-30%) rotate(-135deg); opacity: 1; }

.dropdown-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--navy);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 1.1rem;
  line-height: 1;
}

.nav-item .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  padding: 0.4rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 200;
  border: 1px solid var(--border);
}
.nav-item .dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  border-radius: 0;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.nav-item .dropdown a:hover,
.nav-item .dropdown a:focus {
  background: var(--bg-alt);
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 1.2rem;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Right-align dropdown for last items to prevent overflow */
.nav-item.align-right .dropdown { left: auto; right: 0; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(244,201,93,0.12) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(193,18,31,0.1) 0, transparent 50%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-tagline {
  display: inline-block;
  background: rgba(244,201,93,0.15);
  color: var(--gold-bright);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 1px;
  margin-bottom: 1.2rem;
  border: 1px solid rgba(244,201,93,0.3);
}
.hero h1 {
  color: var(--white);
  font-size: clamp(1.7rem, 5vw, 3.6rem);
  margin-bottom: 1rem;
  max-width: 900px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.hero p.lead {
  font-size: 1.15rem;
  color: #dfe5ee;
  max-width: 720px;
  margin-bottom: 2rem;
}
.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Page Banner (inner pages) */
.page-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 3.5rem 0 3rem;
  text-align: center;
}
.page-banner h1 {
  color: var(--white);
  margin-bottom: 0.5rem;
  font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.page-banner .breadcrumb {
  color: #cfd6e2;
  font-size: 0.9rem;
}
.page-banner .breadcrumb a { color: var(--gold-bright); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: #9a0e19; color: var(--white); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-gold { background: var(--gold-bright); color: var(--navy); }
.btn-gold:hover { background: #e7ba44; color: var(--navy); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--white); border-color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--navy); }
.btn-outline-dark { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-dark:hover { background: var(--navy); color: var(--white); }

/* ==========================================================================
   Sections
   ========================================================================== */
section { padding: 4rem 0; }
section.alt { background: var(--bg-alt); }

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}
.section-head .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.section-head h2 { margin-bottom: 0.75rem; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* ==========================================================================
   Cards / Features
   ========================================================================== */
.grid {
  display: grid;
  gap: 1.75rem;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.card .icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--gold-bright);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0; }

/* Feature list */
.feature-list {
  list-style: none;
  padding: 0;
}
.feature-list li {
  padding: 0.6rem 0 0.6rem 2rem;
  position: relative;
  color: var(--text);
}
.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 22px;
  height: 22px;
  background: var(--navy);
  color: var(--gold-bright);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   Two-column content block
   ========================================================================== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.split .art {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: var(--radius-lg);
  min-height: 380px;
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-family: var(--font-heading);
  font-size: 5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.split .art::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 70% 30%, rgba(244,201,93,0.15), transparent 50%),
    radial-gradient(circle at 30% 80%, rgba(193,18,31,0.1), transparent 50%);
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

/* ==========================================================================
   Article / Prose
   ========================================================================== */
.prose {
  max-width: 880px;
  margin: 0 auto;
  min-width: 0;
}
.prose * { max-width: 100%; }
.prose h2 {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.prose h3 { margin-top: 2rem; color: var(--navy-light); }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.5rem; }
.prose li { margin-bottom: 0.4rem; }
.prose blockquote {
  border-left: 4px solid var(--gold);
  padding: 0.75rem 1.2rem;
  margin: 1.5rem 0;
  background: var(--bg-alt);
  font-style: italic;
  color: var(--text-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.prose thead { background: var(--navy); color: var(--white); }
.prose th, .prose td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.prose tbody tr:nth-child(even) { background: var(--bg-alt); }
.prose tbody tr:last-child td { border-bottom: none; }

/* ==========================================================================
   Side navigation (for section pages)
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 3rem;
  padding: 4rem 0;
  align-items: start;
}
.layout > * { min-width: 0; }
.sidenav {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: sticky;
  top: 100px;
}
.sidenav h4 {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gold);
}
.sidenav ul { list-style: none; padding: 0; }
.sidenav li a {
  display: block;
  padding: 0.55rem 0.75rem;
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}
.sidenav li a:hover, .sidenav li a.active {
  background: var(--bg-alt);
  color: var(--navy);
  border-left-color: var(--accent);
  padding-left: 1rem;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidenav {
    position: static;
    padding: 0.75rem 1rem;
    min-width: 0;
    overflow: hidden;
  }
  .sidenav h4 { margin-bottom: 0.5rem; }
  .sidenav ul {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    margin: 0;
    padding: 0 0 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .sidenav li {
    flex: 0 0 auto;
    margin: 0;
  }
  .sidenav li a {
    display: inline-block;
    white-space: nowrap;
    padding: 0.45rem 0.85rem;
    border-left: none;
    border: 1px solid var(--border);
    font-size: 0.88rem;
    border-radius: 999px;
  }
  .sidenav li a:hover, .sidenav li a.active {
    border-left: 1px solid var(--accent);
    border-color: var(--accent);
    padding-left: 0.85rem;
    background: var(--accent);
    color: var(--white);
  }
}

/* ==========================================================================
   Stats / Highlights
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 2.5rem 2rem;
  background: var(--navy);
  border-radius: var(--radius-lg);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}
.stat { text-align: center; }
.stat .num {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  color: var(--gold-bright);
  font-weight: 700;
  line-height: 1;
}
.stat .label { font-size: 0.9rem; color: #dfe5ee; margin-top: 0.5rem; }

/* ==========================================================================
   CTA Band
   ========================================================================== */
.cta-band {
  background: linear-gradient(135deg, var(--accent), #9a0e19);
  color: var(--white);
  padding: 3.5rem 0;
  text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: #ffe0e2; font-size: 1.05rem; margin-bottom: 1.5rem; }
.cta-band .btn-gold { color: var(--navy); }

/* ==========================================================================
   Forms
   ========================================================================== */
.form {
  background: var(--white);
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg);
  transition: all var(--transition);
  display: block;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(11,37,69,0.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.radio-group { display: flex; gap: 1.2rem 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
  margin-bottom: 0;
  width: auto;
  justify-content: flex-start;
}
.radio-group input[type="radio"] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--navy); }
@media (max-width: 600px) { .form-row { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--navy-dark);
  color: #cfd6e2;
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer h4 {
  color: var(--gold-bright);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.2rem;
  font-family: var(--font-body);
  font-weight: 600;
}
.footer p, .footer a, .footer li { color: #cfd6e2; font-size: 0.92rem; }
.footer a:hover { color: var(--gold-bright); }
.footer ul { list-style: none; padding: 0; }
.footer li { margin-bottom: 0.5rem; }
.footer-brand .brand-title { color: var(--white); font-size: 1.15rem; font-family: var(--font-heading); }
.footer-brand .brand-sub { color: var(--gold); font-size: 0.8rem; letter-spacing: 1px; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: #9aa3b2;
}
.footer-bottom .motto { color: var(--gold-bright); font-style: italic; margin-bottom: 0.5rem; }
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Responsive Navigation
   ========================================================================== */
@media (max-width: 1200px) {
  .nav { gap: 0; }
  .nav a { padding: 0.5rem 0.55rem; font-size: 0.86rem; }
  .nav-item > a { padding-right: 1.05rem !important; }
  .nav-item > a::after { right: 0.35rem; width: 5px; height: 5px; }
  .nav .cta { padding: 0.5rem 0.85rem; margin-left: 0.3rem; }
  .brand-text .brand-title { font-size: 1rem; }
  .brand-text .brand-sub { font-size: 0.7rem; }
  .brand-logo { width: 42px; height: 42px; font-size: 0.95rem; }
}
@media (max-width: 1024px) {
  .menu-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    gap: 0.2rem;
    display: none;
    border-top: 1px solid var(--border);
    z-index: 150;
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; padding: 0.7rem 0.9rem; font-size: 0.95rem; }
  .nav .cta { margin-left: 0; margin-top: 0.5rem; text-align: center; padding: 0.7rem 1rem; }

  /* Mobile dropdown accordion */
  .nav-item { display: flex; flex-wrap: wrap; width: 100%; align-items: stretch; position: relative; }
  .nav-item > a { flex: 1; padding-right: 0.9rem !important; }
  .nav-item > a::after { display: none; }
  .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    border-left: 1px solid var(--border);
  }
  .dropdown-toggle::before {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--navy);
    border-bottom: 2px solid var(--navy);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
  }
  .nav-item.open .dropdown-toggle::before { transform: rotate(-135deg); margin-top: 3px; }
  .nav-item .dropdown {
    position: static;
    width: 100%;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--accent);
    background: var(--bg-alt);
    border-radius: 0;
    padding: 0.2rem 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    margin-left: 0.75rem;
  }
  .nav-item.open .dropdown { max-height: 600px; padding: 0.3rem 0; }
  .nav-item .dropdown a { white-space: normal; padding: 0.6rem 1rem; }
  .nav-item:hover .dropdown,
  .nav-item:focus-within .dropdown { opacity: 1; visibility: visible; transform: none; }

  .topbar { font-size: 0.78rem; }
  .topbar .tb-contact span { display: inline-block; margin-bottom: 0.2rem; }
}
/* ==========================================================================
   Utility
   ========================================================================== */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.note {
  padding: 1rem 1.25rem;
  background: #fff8e6;
  border-left: 4px solid var(--gold-bright);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #6b4e00;
  font-size: 0.93rem;
  margin: 1.5rem 0;
}

/* Animated scroll reveal (subtle) */
.reveal { opacity: 0; transform: translateY(20px); transition: all 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Scroll-to-top Button
   ========================================================================== */
.scroll-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 99;
  line-height: 1;
}
.scroll-top:hover {
  background: #9a0e19;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; }
@media (max-width: 480px) {
  .scroll-top { bottom: 1rem; right: 1rem; width: 44px; height: 44px; }
}

/* ==========================================================================
   Mobile-Responsive Enhancements
   ========================================================================== */

/* Prevent any horizontal overflow */
html, body { overflow-x: hidden; max-width: 100%; }

/* Fluid media — stop images/iframes/videos causing horizontal scroll */
img, iframe, video, svg { max-width: 100%; height: auto; }
iframe { max-width: 100%; }

/* Long URLs/words shouldn't force scroll */
p, li, h1, h2, h3, h4, h5, h6, a, td, th, blockquote, strong, em, span, div { word-wrap: break-word; overflow-wrap: break-word; min-width: 0; }
.prose, .prose * { min-width: 0; }

/* Make tables scroll horizontally on small screens instead of breaking layout */
.prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
@media (min-width: 700px) {
  .prose table { display: table; white-space: normal; }
}

/* Tablet (<=1024px) */
@media (max-width: 1024px) {
  section { padding: 3rem 0; }
  .hero { padding: 4rem 0 4.5rem; }
  .footer-grid { gap: 2rem; }
}

/* Small tablet / large phone (<=768px) */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .container { padding: 0 1rem; }
  section { padding: 2.5rem 0; }

  /* Topbar: hide socials, center contact */
  .topbar { font-size: 0.8rem; padding: 0.4rem 0; }
  .topbar .container { justify-content: center; text-align: center; }
  .topbar .tb-socials { display: none; }
  .topbar .tb-contact span { display: block; margin: 0; line-height: 1.5; }

  /* Brand text smaller */
  .brand-logo { width: 44px; height: 44px; font-size: 0.95rem; }
  .brand-text .brand-title { font-size: 1rem; }
  .brand-text .brand-sub { font-size: 0.68rem; }

  /* Hero tighter */
  .hero { padding: 3rem 0 3.5rem; }
  .hero p.lead { font-size: 1rem; }
  .hero-buttons { flex-direction: column; align-items: stretch; }
  .hero-buttons .btn { width: 100%; }

  /* Page banner */
  .page-banner { padding: 2.5rem 0 2rem; }

  /* Layout with sidenav */
  .layout { padding: 2.5rem 0; gap: 1.5rem; }
  .sidenav { padding: 1rem 1.25rem; }

  /* Section head */
  .section-head { margin-bottom: 2rem; }

  /* Cards */
  .card { padding: 1.5rem 1.25rem; }
  .grid { gap: 1.25rem; }

  /* Stats — 2 columns on tablet */
  .stats { padding: 1.5rem 1rem; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
  .stat .num { font-size: 2rem; }

  /* CTA band */
  .cta-band { padding: 2.5rem 0; }

  /* Forms */
  .form { padding: 1.5rem 1.25rem; }

  /* Footer */
  .footer { padding: 2.5rem 0 1rem; margin-top: 2.5rem; }
  .footer-grid { gap: 1.75rem; margin-bottom: 2rem; }

  /* Mobile nav scrollable if tall */
  .nav { max-height: calc(100vh - 80px); overflow-y: auto; padding-bottom: 2rem; }

  /* Touch targets: min 44px tap area (exclude radios/checkboxes) */
  .nav a, .btn, .form-group input:not([type="radio"]):not([type="checkbox"]), .form-group select, .form-group textarea { min-height: 44px; }
  .form-group input[type="radio"], .form-group input[type="checkbox"] { min-height: 0; width: auto; height: auto; margin: 0; accent-color: var(--navy); }
  .nav a { display: flex; align-items: center; }

  /* Prose adjustments */
  .prose h2 { margin-top: 2rem; }
  .prose ul, .prose ol { margin-left: 1.2rem; }
  .prose blockquote { padding: 0.6rem 1rem; margin: 1.2rem 0; }

  /* Contact grid */
  .contact-info { padding: 1.5rem 1.25rem; }
}

/* Small phone (<=480px) */
@media (max-width: 480px) {
  body { font-size: 14.5px; }
  .container { padding: 0 0.9rem; }
  section { padding: 2rem 0; }

  /* Brand on very narrow: tighter */
  .brand { gap: 0.5rem; }
  .brand-logo { width: 40px; height: 40px; font-size: 0.85rem; }
  .brand-text .brand-title { font-size: 0.92rem; line-height: 1.1; }
  .brand-text .brand-sub { font-size: 0.62rem; letter-spacing: 0.3px; }

  /* Hero */
  .hero { padding: 2.5rem 0 3rem; }
  .hero-tagline { font-size: 0.72rem; padding: 0.3rem 0.8rem; }

  /* Page banner */
  .page-banner { padding: 2rem 0 1.75rem; }

  /* Sections */
  .section-head h2 { font-size: 1.5rem; }
  .section-head p { font-size: 0.95rem; }

  /* Cards */
  .card { padding: 1.25rem 1rem; }
  .card .icon { width: 44px; height: 44px; font-size: 1.25rem; }

  /* Stats — single column on narrow phones */
  .stats { grid-template-columns: 1fr; padding: 1.5rem 1rem; }
  .stat .num { font-size: 2rem; }

  /* CTA band */
  .cta-band { padding: 2rem 0; }
  .cta-band h2 { font-size: 1.4rem; }

  /* Forms — form-row already stacks at 600px, keep single col */
  .form { padding: 1.25rem 1rem; }
  .form-group { margin-bottom: 1rem; }
  .radio-group { flex-direction: column; gap: 0.5rem; }

  /* Prose */
  .prose blockquote { font-size: 0.95rem; }
  .prose h3 { font-size: 1.1rem; }

  /* Feature list */
  .feature-list li { padding-left: 1.75rem; }
  .feature-list li::before { width: 18px; height: 18px; font-size: 0.65rem; top: 0.7rem; }

  /* Buttons */
  .btn { padding: 0.8rem 1.4rem; font-size: 0.9rem; width: 100%; }
  .hero-buttons .btn, .cta-band .btn { width: auto; max-width: 100%; }

  /* Footer */
  .footer { padding: 2rem 0 1rem; }
  .footer h4 { margin-bottom: 0.8rem; }

  /* Contact */
  .map-embed { height: 280px; padding: 1.25rem; }
  .contact-info h3 { font-size: 0.88rem; }

  /* Sticky sidenav disabled already via 900px; just tighter */
  .sidenav { padding: 0.9rem 1rem; }
  .sidenav h4 { font-size: 0.78rem; }
  .sidenav li a { font-size: 0.9rem; padding: 0.5rem 0.6rem; }
}

/* Extra-small (<=360px) — older / narrow phones */
@media (max-width: 360px) {
  .brand-text .brand-title { font-size: 0.85rem; }
  .brand-text .brand-sub { display: none; }
  .hero h1 { font-size: 1.75rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.4rem; }
}

/* Landscape phone — cap hero height so CTA is visible */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { padding: 2rem 0 2.5rem; }
  .page-banner { padding: 1.5rem 0 1.25rem; }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
