/* =====================================================================
   Oregon Aero Academy — "Sectional Chart" design system
   Bold aviation-inspired: navy + high-vis runway amber + instrument mono
   ===================================================================== */

:root {
  /* Palette */
  --navy:        #0A1A2F;   /* deep aviation navy */
  --navy-800:    #0F2641;   /* panel */
  --navy-700:    #163356;
  --charcoal:    #11151C;   /* instrument panel */
  --amber:       #FFB300;   /* high-vis runway amber (signature accent) */
  --amber-700:   #E09600;
  --cyan:        #4FC3E8;   /* sky cyan, secondary accent */
  --paper:       #F4F6F9;   /* off-white */
  --paper-dim:   #C9D4E0;
  --ink:         #0A1A2F;
  --line:        rgba(255,255,255,0.10);

  /* Type */
  --display: "Oswald", "Bebas Neue", "Arial Narrow", sans-serif;
  --body:    "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:    "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --maxw: 1200px;
  --radius: 4px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---- Type scale ---------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: 0.01em; text-transform: uppercase; }
h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: 1.5rem; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 500;
}

/* ---- Buttons ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 1.05rem; font-weight: 600;
  padding: 0.85em 1.8em;
  border-radius: var(--radius);
  border: 2px solid var(--amber);
  background: var(--amber); color: var(--navy);
  cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--amber-700); border-color: var(--amber-700); }
.btn--ghost { background: transparent; color: var(--paper); border-color: rgba(255,255,255,0.4); }
.btn--ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--paper); color: var(--paper); }

/* ---- Header / nav -------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy); color: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--paper); white-space: nowrap; }
.nav nav { flex: 0 1 auto; min-width: 0; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--amber); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
  box-shadow: 0 0 0 4px rgba(255,179,0,0.18);
}
.brand small { display:block; font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.3em; color: var(--cyan); }
.brand-logo { height: 46px; width: auto; max-width: 240px; object-fit: contain; display: block; }

.menu { display: flex; align-items: center; gap: 2px; list-style: none; }
.menu > li { position: relative; }
.menu > li > a {
  display: block; padding: 10px 12px; font-family: var(--display);
  text-transform: uppercase; font-size: 0.9rem; letter-spacing: 0.04em;
  color: var(--paper); border-radius: var(--radius); white-space: nowrap;
}
.menu > li > a:hover, .menu > li.has-children:hover > a { color: var(--amber); }

.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 280px;
  background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; list-style: none; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .18s ease; box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.has-children:hover > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: 9px 12px; font-size: 0.9rem; color: var(--paper-dim); border-radius: var(--radius); }
.dropdown a:hover { background: var(--navy-700); color: var(--amber); }
.dropdown .group-label { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; color: var(--cyan); padding: 10px 12px 4px; text-transform: uppercase; }

/* Second-level flyout (sub-submenu) — opens to the right of its parent item */
.dropdown li { position: relative; }
.dropdown .has-sub > a { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dropdown--sub {
  position: absolute; top: -9px; left: 100%; min-width: 240px;
  background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; list-style: none; opacity: 0; visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease; box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
/* Invisible bridge so moving the mouse from the parent item into the
   flyout never crosses an un-hovered gap (which would close the menu). */
.dropdown .has-sub::after {
  content: ""; position: absolute; top: 0; right: -14px; width: 14px; height: 100%;
}
.dropdown .has-sub:hover > .dropdown--sub,
.dropdown--sub:hover { opacity: 1; visibility: visible; }

/* When near the right screen edge, JS adds .flip-left so the flyout opens
   to the LEFT of its parent instead of running off-screen. */
.dropdown .has-sub.flip-left > .dropdown--sub { left: auto; right: 100%; }
.dropdown .has-sub.flip-left::after { right: auto; left: -14px; }

.nav-toggle { display: none; background: none; border: 0; color: var(--paper); cursor: pointer; }
.nav-toggle svg { width: 30px; height: 30px; }

/* ---- Hero ---------------------------------------------------------- */
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; color: var(--paper); overflow: hidden; background: var(--navy); }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(10,26,47,0.55) 0%, rgba(10,26,47,0.75) 60%, rgba(10,26,47,0.95) 100%);
}
.hero__inner { position: relative; z-index: 2; padding: 80px 0; max-width: 760px; }
.hero h1 { margin: 0.2em 0 0.3em; text-shadow: 0 4px 30px rgba(0,0,0,0.4); }
.hero h1 .amber { color: var(--amber); }
.hero p { font-size: 1.2rem; color: var(--paper-dim); max-width: 56ch; margin-bottom: 2rem; }
/* altitude-tape detail down the side of the hero */
.hero__tape { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; gap: 10px; font-family: var(--mono); font-size: 0.7rem; color: rgba(255,255,255,0.5); text-align: right; }
.hero__tape span { border-right: 2px solid var(--amber); padding-right: 10px; }

/* ---- Section scaffolding ------------------------------------------ */
.section { padding: 96px 0; }
.section--navy { background: var(--navy); color: var(--paper); }
.section--charcoal { background: var(--charcoal); color: var(--paper); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { margin: 0.3em 0; }
.section-head p { color: var(--paper-dim); font-size: 1.1rem; }
.section--light .section-head p { color: #51637a; }

/* ---- Program cards ------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.pcard {
  background: var(--navy-800); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, border-color .2s ease;
}
.pcard:hover { transform: translateY(-6px); border-color: var(--amber); }
.pcard__img { aspect-ratio: 16/10; overflow: hidden; }
.pcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pcard:hover .pcard__img img { transform: scale(1.06); }
.pcard__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard__dur { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.15em; color: var(--cyan); text-transform: uppercase; }
.pcard h3 { color: var(--paper); font-size: 1.3rem; }
.pcard p { color: var(--paper-dim); font-size: 0.95rem; flex: 1; }
.pcard__link { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--amber); font-size: 0.95rem; }

/* ---- Stats (instrument gauges) ------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--navy); padding: 44px 24px; text-align: center; }
.stat__value { font-family: var(--mono); font-weight: 700; font-size: clamp(2.6rem, 5vw, 3.6rem); color: var(--amber); line-height: 1; letter-spacing: -0.02em; }
.stat__label { margin-top: 12px; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.92rem; color: var(--paper-dim); }

/* ---- Testimonials -------------------------------------------------- */
.tgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.tcard { background: var(--navy-800); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius); padding: 28px; }
.tcard .stars { color: var(--amber); letter-spacing: 2px; margin-bottom: 12px; }
.tcard blockquote { font-size: 1.02rem; color: var(--paper); line-height: 1.7; }
.tcard .who { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.tcard .who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.tcard .who b { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.tcard .who span { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--cyan); }

/* ---- Gallery ------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.gallery figure.is-hidden { display: none; }
.gallery figure { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery figure:hover img { transform: scale(1.08); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; font-size: 0.8rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.7)); opacity: 0; transition: opacity .2s; }
.gallery figure:hover figcaption { opacity: 1; }

/* ---- Content pages (program detail) -------------------------------- */
.page-hero { background: var(--navy); color: var(--paper); padding: 80px 0 64px; border-bottom: 4px solid var(--amber); }
.page-hero .eyebrow { margin-bottom: 12px; }
.content { padding: 72px 0; }
.content .prose { max-width: 760px; font-size: 1.05rem; }
.prose h2 { margin: 1.6em 0 0.5em; color: var(--navy); }
.prose h3 { margin: 1.4em 0 0.4em; color: var(--navy); }
.prose ul { margin: 0.6em 0 1.2em 1.2em; }
.prose ol { margin: 0.6em 0 1.2em 1.2em; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: 0.3em 0 0.3em 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--navy); }
.prose blockquote { margin: 1.4em 0; padding: 10px 22px; border-left: 4px solid var(--navy); color: #3a4a5c; font-style: italic; }
.prose hr { border: 0; border-top: 2px solid rgba(10,26,47,0.15); margin: 2em 0; }
.callout { background: var(--paper); border-left: 4px solid var(--amber); padding: 18px 22px; border-radius: var(--radius); margin: 1.5em 0; font-family: var(--mono); }

/* ---- Footer -------------------------------------------------------- */
.site-footer { background: var(--charcoal); color: var(--paper-dim); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.site-footer h4 { color: var(--paper); font-size: 1rem; letter-spacing: 0.1em; margin-bottom: 16px; }
.site-footer a { color: var(--paper-dim); display: block; padding: 4px 0; font-size: 0.86rem; }
.site-footer a:hover { color: var(--amber); }
.socials { display: flex; gap: 12px; margin-top: 16px; }
.socials a { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; }
.socials a:hover { background: var(--amber); color: var(--navy); border-color: var(--amber); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 24px; font-family: var(--mono); font-size: 0.78rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---- Forms (public contact) ---------------------------------------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid rgba(0,0,0,0.15); border-radius: var(--radius);
  font-family: var(--body); font-size: 1rem; background: #fff;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--amber); border-color: var(--amber); }

.flash { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 500; }
.flash--ok { background: #e6f6ec; color: #1a7a3c; border: 1px solid #b6e2c5; }
.flash--err { background: #fbe9e9; color: #a33; border: 1px solid #f0c2c2; }

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .menu {
    position: fixed; inset: 76px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--navy-800); padding: 12px; gap: 2px; max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .menu.open { max-height: 80vh; overflow-y: auto; }
  .menu > li > a { white-space: normal; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: var(--navy-700); margin: 4px 0; }
  .dropdown--sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; left: 0; top: 0; background: var(--navy); margin: 4px 0 4px 12px; }
  .hero__tape { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
