/* =====================================================================
   Valley Central Scholarship Council (VCSC)
   Main Stylesheet
   -----------------------------------------------------------------
   Serving Valley Central High School seniors since 1964.
   Design: warm, trustworthy, easy to navigate. Blue & white only.
   Mobile-first responsive.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Google Fonts
   Headings: Merriweather (friendly, readable serif)
   Body:     Source Sans 3 (clean, approachable sans-serif)
   Loaded via <link rel="preconnect"> + stylesheet in each page's <head>
   (faster than @import, which is render-blocking).
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   1. Custom Properties (Variables)
   --------------------------------------------------------------------- */
:root {
  /* Colors — blue & white family only */
  --color-royal:      #1a3a8f;   /* Valley Central Vikings royal blue */
  --color-royal-dark: #14306f;   /* hover / darker royal */
  --color-navy:       #0d1f4a;   /* deep navy for text & contrast blocks */
  --color-navy-soft:  #24325c;   /* softened navy for secondary text */
  --color-white:      #ffffff;
  --color-off-white:  #f5f7fb;   /* subtle page/section tint */
  --color-border:     #dbe2f0;   /* light blue-gray borders */
  --color-shadow:     rgba(13, 31, 74, 0.12);
  --color-accent:     #f4b400;   /* warm gold — time-sensitive callouts only */
  --color-accent-dark: #c98f00;  /* hover / darker gold */

  /* Semantic aliases */
  --color-text:       var(--color-navy);
  --color-text-muted: var(--color-navy-soft);
  --color-link:       var(--color-royal);
  --color-bg:         var(--color-white);

  /* Typography */
  --font-heading: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-body:    'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --fs-base:  1.125rem;   /* 18px — comfortable for parents on phones */
  --fs-sm:    0.9375rem;  /* 15px */
  --fs-lg:    1.25rem;    /* 20px */
  --fs-h1:    2.5rem;
  --fs-h2:    2rem;
  --fs-h3:    1.5rem;
  --lh-base:  1.65;
  --lh-heading: 1.25;

  /* Spacing scale */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;

  /* Layout */
  --max-width:     1080px;
  --content-width: 720px;   /* narrower measure for long-form text */
  --radius:        8px;
  --radius-lg:     12px;

  /* Effects */
  --shadow-sm: 0 1px 3px var(--color-shadow);
  --shadow-md: 0 4px 14px var(--color-shadow);
  --transition: 0.2s ease;

  /* Nav */
  --nav-height: 4.5rem;
}

/* ---------------------------------------------------------------------
   2. Reset & Base
   --------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  color: var(--color-navy);
  margin: 0 0 var(--space-sm);
  font-weight: 700;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  margin: 0 0 var(--space-sm);
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus {
  color: var(--color-royal-dark);
  text-decoration: underline;
}

/* Consistent, visible focus for keyboard users */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--color-royal);
  outline-offset: 2px;
}

ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 var(--space-sm);
}

li {
  margin-bottom: 0.35rem;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

/* ---------------------------------------------------------------------
   3. Layout Helpers
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* Narrower container for readable long-form text */
.container--narrow {
  max-width: var(--content-width);
}

/* Standard vertical rhythm for page sections */
.section {
  padding-block: var(--space-xl);
}

.section--tight {
  padding-block: var(--space-lg);
}

/* Alternating section background */
.section--tint {
  background-color: var(--color-off-white);
}

/* ---------------------------------------------------------------------
   4. Navigation Bar
   Horizontal on desktop, hamburger on mobile.
   --------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-white);
  border-bottom: 3px solid var(--color-royal);
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-height);
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* Brand / logo lockup */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--color-navy);
  line-height: 1.1;
  min-width: 0;
}

.navbar__brand:hover,
.navbar__brand:focus {
  color: var(--color-royal);
  text-decoration: none;
}

/* Brand images: Vikings crest + VCSC wordmark */
.navbar__crest {
  width: 2.9rem;
  height: 2.9rem;
  flex-shrink: 0;
}

.navbar__wordmark {
  height: 2.4rem;
  width: auto;
  max-width: 100%;
  display: block;
  flex-shrink: 1;
}

/* Hamburger toggle button (hidden on desktop) */
.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.navbar__toggle-bar {
  display: block;
  width: 1.6rem;
  height: 3px;
  border-radius: 2px;
  background-color: var(--color-navy);
  transition: transform var(--transition), opacity var(--transition);
}

/* Animated "X" when open */
.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}
.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Nav links */
.navbar__menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar__link {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-navy);
}

.navbar__link:hover,
.navbar__link:focus {
  background-color: var(--color-off-white);
  color: var(--color-royal);
  text-decoration: none;
}

/* Active page indicator */
.navbar__link--active {
  color: var(--color-royal);
  box-shadow: inset 0 -3px 0 var(--color-royal);
}

/* Donate call-to-action inside nav */
.navbar__link--cta {
  margin-left: 0.5rem;
  background-color: var(--color-royal);
  color: var(--color-white);
}

.navbar__link--cta:hover,
.navbar__link--cta:focus {
  background-color: var(--color-royal-dark);
  color: var(--color-white);
}

/* ---------------------------------------------------------------------
   5. Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--color-white);
  background-color: var(--color-royal);
  border: 2px solid var(--color-royal);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:hover,
.btn:focus {
  background-color: var(--color-royal-dark);
  border-color: var(--color-royal-dark);
  color: var(--color-white);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Outline variant — royal outline, transparent fill */
.btn--outline {
  background-color: transparent;
  color: var(--color-royal);
}

.btn--outline:hover,
.btn--outline:focus {
  background-color: var(--color-royal);
  color: var(--color-white);
}

/* Inverse variant — for use on blue backgrounds */
.btn--inverse {
  background-color: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-royal);
}

.btn--inverse:hover,
.btn--inverse:focus {
  background-color: var(--color-off-white);
  border-color: var(--color-off-white);
  color: var(--color-royal-dark);
}

.btn--lg {
  padding: 0.95rem 2.2rem;
  font-size: 1.125rem;
}

.btn--block {
  display: block;
  width: 100%;
}

/* ---------------------------------------------------------------------
   6. Utility Classes
   --------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Highlight box — white text on royal blue */
.highlight-box {
  background-color: var(--color-royal);
  color: var(--color-white);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.highlight-box h1,
.highlight-box h2,
.highlight-box h3,
.highlight-box p {
  color: var(--color-white);
}

.highlight-box a:not(.btn) {
  color: var(--color-white);
  text-decoration: underline;
}

/* Deep-navy variant for extra contrast */
.highlight-box--navy {
  background-color: var(--color-navy);
}

/* Card — white background, subtle shadow */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  /* Break long unbreakable strings (e.g. email addresses) so cards never overflow */
  overflow-wrap: break-word;
  transition: box-shadow var(--transition), transform var(--transition);
}

.card--hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Contact-info cards: tighter horizontal padding so a full email address
   fits on one line without wrapping (email is wider than the default box). */
.card--contact {
  padding-inline: 1.25rem;
}

.card h3 {
  margin-top: 0;
}

/* ---------------------------------------------------------------------
   Media / photos — reusable image treatment (rounded, subtle shadow)
   --------------------------------------------------------------------- */
.media {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* Wide banner photo — fills width, height capped so it never dominates */
.media--banner {
  max-height: 24rem;
  object-fit: cover;
  object-position: center 25%;
}

/* Simple responsive stack of cards/columns without heavy grid */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.stack--row {
  flex-direction: row;
  flex-wrap: wrap;
}

.stack--row > * {
  flex: 1 1 260px;
  /* Allow flex items to shrink below their content's min-width on narrow phones */
  min-width: 0;
}

/* Visually hidden but available to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
  color: var(--color-white);
}

/* ---------------------------------------------------------------------
   6b. Promo Banner
   Thin, high-contrast strip for time-sensitive callouts (e.g. an
   upcoming event). Uses the accent color so it reads as distinct from
   the site's normal royal-blue chrome.
   --------------------------------------------------------------------- */
.promo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-navy);
  text-align: center;
  padding-block: 0.65rem;
  font-weight: 700;
}

.promo-banner:hover,
.promo-banner:focus {
  background-color: var(--color-accent-dark);
  color: var(--color-navy);
  text-decoration: none;
}

.promo-banner__icon {
  vertical-align: middle;
  margin-right: 0.5rem;
}

.promo-banner__short {
  display: none;
}

@media (max-width: 480px) {
  .promo-banner__full {
    display: none;
  }

  .promo-banner__short {
    display: inline;
  }
}

/* ---------------------------------------------------------------------
   7. Hero
   --------------------------------------------------------------------- */
.hero {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding-block: var(--space-xl);
  text-align: center;
}

.hero__logo {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto var(--space-md);
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.hero p {
  color: var(--color-white);
  font-size: var(--fs-lg);
  max-width: 40ch;
  margin-inline: auto;
  margin-bottom: var(--space-lg);
  opacity: 0.92;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

/* ---------------------------------------------------------------------
   8. Countdown Timer
   Populated by main.js — see .countdown markup contract there.
   --------------------------------------------------------------------- */
.countdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-block: var(--space-md);
}

.countdown__unit {
  min-width: 5rem;
  padding: var(--space-sm);
  background-color: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.countdown__value {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--color-royal);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Ended-state message swapped in by JS */
.countdown__ended {
  font-weight: 700;
  color: var(--color-royal);
}

/* Countdown sitting on a blue highlight box inverts unit colors */
.highlight-box .countdown__unit {
  background-color: rgba(255, 255, 255, 0.12);
}
.highlight-box .countdown__value {
  color: var(--color-white);
}
.highlight-box .countdown__label {
  color: rgba(255, 255, 255, 0.8);
}

/* ---------------------------------------------------------------------
   8b. Deadline Callout
   Big, prominent deadline block (e.g. Scholarships page). Designed to
   sit inside a .highlight-box so it inherits white-on-blue coloring.
   --------------------------------------------------------------------- */
.deadline-callout__label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.deadline-callout__date {
  margin: 0.25rem 0 0;
  font-size: 2.5rem;
  line-height: 1.1;
}

@media (max-width: 480px) {
  .deadline-callout__date {
    font-size: 2rem;
  }
}

/* ---------------------------------------------------------------------
   9. Forms
   --------------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--space-md);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--color-navy);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-royal);
  box-shadow: 0 0 0 3px rgba(26, 58, 143, 0.15);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

/* ---------------------------------------------------------------------
   10. Tables (scholarship lists, event schedules)
   --------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
}

th,
td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background-color: var(--color-off-white);
  font-family: var(--font-heading);
  color: var(--color-navy);
}

/* ---------------------------------------------------------------------
   11. Footer
   --------------------------------------------------------------------- */
.site-footer {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding-block: var(--space-lg);
  margin-top: var(--space-xl);
}

.site-footer a {
  color: var(--color-white);
}

.site-footer a:hover,
.site-footer a:focus {
  color: var(--color-off-white);
  text-decoration: underline;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: space-between;
}

.site-footer__col {
  flex: 1 1 220px;
}

.site-footer__col h4 {
  color: var(--color-white);
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.site-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer__links li {
  margin-bottom: 0.4rem;
}

.site-footer__bottom {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

/* Footer "Explore" links: taller tap targets (>=44px) on touch/mobile */
@media (max-width: 800px) {
  .site-footer__links a {
    display: inline-block;
    padding-block: 0.6rem;
  }
}

/* ---------------------------------------------------------------------
   12. Responsive — Mobile-first breakpoints
   Base styles above target small screens; the query below enhances
   for tablets/desktops. Nav collapses to hamburger BELOW this width.
   --------------------------------------------------------------------- */

/* Mobile nav behavior: applies up to 800px */
@media (max-width: 800px) {
  .navbar__toggle {
    display: flex;
  }

  .navbar__menu {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    background-color: var(--color-white);
    border-bottom: 3px solid var(--color-royal);
    box-shadow: var(--shadow-md);

    /* Hidden by default; toggled open by JS adding .is-open */
    display: none;
  }

  .navbar__menu.is-open {
    display: flex;
  }

  .navbar__link {
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 1.05rem;
  }

  .navbar__link--active {
    box-shadow: inset 3px 0 0 var(--color-royal);
  }

  .navbar__link--cta {
    margin-left: 0;
    margin-top: var(--space-xs);
    text-align: center;
  }
}

/* Typography & spacing tuning for larger screens */
@media (min-width: 801px) {
  :root {
    --fs-h1: 3rem;
    --fs-h2: 2.25rem;
  }
}

/* Small phones — tighten hero + countdown */
@media (max-width: 480px) {
  :root {
    --fs-h1: 2rem;
    --fs-h2: 1.6rem;
    --space-xl: 3rem;
  }

  .countdown__unit {
    min-width: 4rem;
    padding: 0.6rem;
  }

  .countdown__value {
    font-size: 1.6rem;
  }

  .hero__actions .btn {
    width: 100%;
  }

  /* Scale the brand lockup down so crest + wordmark fit beside the toggle */
  .navbar__crest {
    width: 2.4rem;
    height: 2.4rem;
  }

  .navbar__wordmark {
    height: 1.9rem;
  }
}

/* Extra-small phones — shrink the brand lockup further so it never
   overflows beside the hamburger toggle (no horizontal scroll). */
@media (max-width: 360px) {
  .navbar__crest {
    width: 2.1rem;
    height: 2.1rem;
  }

  .navbar__wordmark {
    height: 1.55rem;
  }
}

/* ---------------------------------------------------------------------
   13. Reduced motion — respect user preference
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
