/* ==========================================================
   TPH ST. LOUIS — SHARED STYLESHEET
   Every page links to this one file, so changing a color or
   font here updates the entire site at once.
   ========================================================== */

/* Official TPH brand palette & typography (TPH Brand Standards) */
@import url('https://fonts.googleapis.com/css2?family=Overpass:ital,wght@0,400;0,600;0,800;0,900;1,900&family=Fjalla+One&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

:root {
  --navy: #19154c;        /* TPH Navy (primary) */
  --navy-light: #232063;
  --ink: #100d38;         /* deep ink — footers, dark sections */
  --ice: #eef0f8;         /* pale tint of TPH navy — section backgrounds */
  --accent: #b11f24;      /* TPH Red */
  --dark-red: #630000;    /* TPH Dark Red (secondary) */
  --gold: #c0a05c;        /* institutional gold — hairlines, labels, details */
  --gold-light: #dfc998;
  --silver: #9f9f9f;      /* TPH Silver */
  --steel: #3f3f3f;       /* TPH Dark Grey — secondary text */
  --white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Overpass', 'Helvetica Neue', Arial, sans-serif;
  color: #2a2833;
  font-size: 0.96rem;
  line-height: 1.68;
  background: linear-gradient(180deg, #faf8f3 0%, #f7f4ed 100%);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--navy); color: var(--white); }

/* Typography: Playfair Display serif for display headings (private-institution feel),
   Overpass for body, Fjalla One for big athletic numbers */
h1 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; }
h2, h3, h4 { font-family: 'Overpass', 'Helvetica Neue', Arial, sans-serif; font-weight: 800; }
.logo, .gate h2 { font-family: 'Fjalla One', 'Overpass', sans-serif; font-weight: 400; }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
body { animation: fadein 0.45s ease both; }

/* Refined scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: #edeae0; }
::-webkit-scrollbar-thumb { background: #19154c; border-radius: 6px; border: 2px solid #edeae0; }
::-webkit-scrollbar-thumb:hover { background: #232063; }

/* ---------- SCROLL REVEAL ----------
   Elements rise softly into view as the visitor scrolls.
   Uses scroll-driven animations; older browsers simply show
   everything normally. Opacity + translate only, so hover
   lift effects (transform) are unaffected. */
@keyframes reveal {
  from { opacity: 0; translate: 0 28px; }
  to   { opacity: 1; translate: 0 0; }
}
@supports (animation-timeline: view()) {
  .section-title, .card, .i-stat, .layer, .steps li,
  .org-card, .gallery img, .p-tile, .inquiry-form {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 42%;
  }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- NAVIGATION ---------- */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(18,14,58,0.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 5%;
  border-bottom: 1px solid rgba(192,160,92,0.4);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 4px 20px rgba(10,8,40,0.35);
}
.logo { color: var(--white); font-weight: 800; font-size: 1.2rem; letter-spacing: 1px; text-decoration: none; display: flex; align-items: center; gap: 0.55rem; }
.logo::before {
  content: ''; display: inline-block; width: 24px; height: 30px;
  background: url('img/shield-white.png') center/contain no-repeat;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4));
}
.logo span { color: var(--gold-light); }
.nav-links { display: flex; gap: 1.3rem; list-style: none; align-items: center; }
.nav-links a { color: #c3cde0; text-decoration: none; font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px; transition: color 0.25s; }
.nav-links a:hover { color: var(--white); }
.nav-links a.active { color: var(--white); border-bottom: 2px solid var(--gold); padding-bottom: 2px; }
.nav-cta { background: var(--accent); color: var(--white) !important; padding: 0.45rem 1.1rem; border-radius: 4px; border-bottom: none !important; }
.menu-btn { display: none; background: none; border: none; color: var(--white); font-size: 1.6rem; cursor: pointer; }

/* ---------- PAGE HERO (banner at top of every page) ---------- */
.hero {
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(192,160,92,0.16), transparent 60%),
    linear-gradient(180deg, #1a1550 0%, #100d38 100%);
  color: var(--white);
  text-align: center;
  padding: 3.25rem 1.5rem 2.9rem;
  position: relative;
}
.hero.tall { padding: 4.25rem 1.5rem 3.75rem; }
.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.12; margin-bottom: 0.9rem;
  letter-spacing: 0.5px; animation: rise 0.7s ease both;
}
.hero h1 em { color: var(--gold-light); font-style: italic; }
.hero p { max-width: 680px; margin: 0 auto 1.5rem; font-size: 1.1rem; color: #ccd4ea; animation: rise 0.7s 0.12s ease both; }
.hero .btn { animation: rise 0.7s 0.22s ease both; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block; background: var(--navy); color: var(--white);
  padding: 0.9rem 2.3rem; border-radius: 3px; text-decoration: none;
  font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; font-size: 0.85rem;
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(16,13,56,0.18);
}
.btn:hover { background: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,13,56,0.28); }
.btn.outline { background: transparent; border: 1px solid rgba(255,255,255,0.75); margin-left: 0.75rem; box-shadow: none; }
.btn.outline:hover { background: rgba(255,255,255,0.12); border-color: var(--gold-light); }
.btn.big { font-size: 1.15rem; padding: 1rem 2.6rem; }

/* ---------- SECTIONS ---------- */
section { padding: 2.75rem 6%; }
section.alt { background: linear-gradient(180deg, #f2efe6 0%, #ece8dc 100%); }
.section-title {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  text-align: center; margin-bottom: 0.5rem; font-size: 1.95rem; color: var(--navy);
  letter-spacing: 0.3px;
}
.section-title::after {
  content: ''; display: block; width: 64px; height: 2px;
  background: var(--gold); margin: 0.9rem auto 0;
}
.section-sub { text-align: center; color: #55524a; max-width: 660px; margin: 1rem auto 1.75rem; font-size: 0.95rem; }
.narrow { max-width: 820px; margin: 0 auto; }

/* ---------- CARDS ----------
   Column count adapts to the number of cards so rows always
   fill completely — never 4 cards + 1 orphan with blank space. */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.cards:has(> .card:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.cards:has(> .card:nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr); }
.cards:has(> .card:nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); }
.cards:has(> .card:nth-child(10):last-child) { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1180px) {
  .cards:has(> .card:nth-child(5):last-child) { grid-template-columns: repeat(3, 1fr); }
  .cards:has(> .card:nth-child(10):last-child) { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .cards:has(> .card:nth-child(3):last-child),
  .cards:has(> .card:nth-child(5):last-child),
  .cards:has(> .card:nth-child(6):last-child),
  .cards:has(> .card:nth-child(10):last-child) { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .cards:has(> .card:nth-child(3):last-child),
  .cards:has(> .card:nth-child(5):last-child),
  .cards:has(> .card:nth-child(6):last-child),
  .cards:has(> .card:nth-child(10):last-child) { grid-template-columns: 1fr; }
}
.card {
  background: var(--white); border-radius: 10px; padding: 1.55rem 1.6rem;
  border: none;
  box-shadow: 0 1px 3px rgba(20,16,60,0.05), 0 10px 30px rgba(20,16,60,0.07);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card:hover { box-shadow: 0 2px 6px rgba(20,16,60,0.06), 0 18px 44px rgba(20,16,60,0.12); transform: translateY(-3px); }
.card h3 {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 700;
  color: var(--navy); margin-bottom: 0.55rem; font-size: 1.14rem; letter-spacing: 0.2px;
}
.card p { font-size: 0.94rem; color: #45424a; }
.card .tag {
  display: inline-block; color: var(--gold); background: none; padding: 0;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 2.5px;
  margin-bottom: 0.7rem; border-bottom: 1px solid #e9e4d4; padding-bottom: 0.35rem;
}

/* ---------- STEP LIST (numbered process, e.g. admissions) ---------- */
.steps { list-style: none; counter-reset: step; max-width: 720px; margin: 0 auto; }
.steps li {
  counter-increment: step; position: relative;
  background: var(--white); border-radius: 8px; padding: 1.5rem 1.5rem 1.5rem 4.5rem;
  margin-bottom: 1rem; box-shadow: 0 3px 12px rgba(11,31,58,0.08);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 1.25rem; top: 1.4rem;
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  box-shadow: 0 0 0 2px var(--gold);
}
.steps li {
  border-radius: 10px; border: none;
  box-shadow: 0 1px 3px rgba(20,16,60,0.05), 0 10px 30px rgba(20,16,60,0.08);
}
.steps h3 { color: var(--navy); font-size: 1.05rem; margin-bottom: 0.25rem; }
.steps p { font-size: 0.94rem; color: #3d4d61; }

/* ---------- PLACEHOLDER CALLOUT ----------
   Highlights spots where real content still needs to be added.
   Delete the markup once real content is in. */
.placeholder {
  background: #fff8e1; border: 2px dashed #e0a800; border-radius: 8px;
  padding: 1.25rem; color: #7a5b00; font-size: 0.93rem; margin: 1rem 0;
}
.placeholder strong { display: block; margin-bottom: 0.25rem; }

/* ---------- TABLES ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(20,16,60,0.05), 0 10px 30px rgba(20,16,60,0.08); }
th {
  background: linear-gradient(160deg, #1e1958 0%, #120f42 100%); color: var(--white);
  text-align: left; padding: 0.85rem 1rem; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 1.8px;
  border-bottom: 2px solid var(--gold);
}
td { padding: 0.75rem 1rem; border-bottom: 1px solid #efece2; font-size: 0.92rem; }
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #faf8f2; }

/* ---------- PARTNER LOGO STRIP ---------- */
.partners {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; align-items: center;
}
.partners:has(> .p-tile:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .partners { grid-template-columns: repeat(2, 1fr) !important; } }
.partners .p-tile {
  background: var(--white); border: 1px solid #e6e3d8; border-radius: 4px;
  height: 130px; display: flex; align-items: center; justify-content: center; padding: 1.1rem 1.4rem;
}
.partners img { max-width: 100%; max-height: 96px; object-fit: contain; }

/* ---------- STAFF BIO EXPANDERS ---------- */
.bio { margin-top: 0.7rem; border-top: 1px solid #eceadf; padding-top: 0.6rem; }
.bio summary {
  cursor: pointer; color: var(--accent); font-weight: 800; font-size: 0.72rem;
  letter-spacing: 2px; text-transform: uppercase; list-style: none;
}
.bio summary::-webkit-details-marker { display: none; }
.bio summary::after { content: '  +'; }
.bio[open] summary::after { content: '  \2212'; }
.bio p { margin-top: 0.55rem; font-size: 0.9rem; color: #45424a; }

/* ---------- ORG CHART (staff page) ---------- */
.org-top { display: flex; justify-content: center; }
.org-line { width: 2px; height: 26px; background: #c9c4b4; margin: 0 auto; }
.org-line.short { height: 14px; }
.org-branches {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem; align-items: start; max-width: 1180px; margin: 0 auto;
}
.org-branch-label {
  text-align: center; font-size: 0.72rem; font-weight: 800; letter-spacing: 2.5px;
  color: var(--gold); text-transform: uppercase;
  border-top: 2px solid #d4cdb8; padding-top: 0.8rem; margin-bottom: 0.8rem;
}
.org-card {
  background: var(--white); border: 1px solid #e6e3d8; border-radius: 6px;
  padding: 0.85rem 1rem; display: flex; gap: 0.85rem; align-items: center;
  box-shadow: 0 2px 8px rgba(25,21,76,0.06); text-align: left;
}
.org-card img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: top;
  flex-shrink: 0; background: var(--ice);
}
.org-card img.crest-sm { object-fit: contain; padding: 6px; background: #f1efe8; }
.org-card h3 { font-size: 0.98rem; color: var(--navy); margin: 0; line-height: 1.3; }
.org-card .role { font-size: 0.8rem; color: #55524a; margin: 0.1rem 0 0; line-height: 1.45; }
.org-card .links { font-size: 0.74rem; margin: 0.2rem 0 0; line-height: 1.5; }
.org-card .links a { color: var(--navy); font-weight: 700; text-decoration: none; }
.org-card .links a:hover { color: var(--accent); }
.org-card .bio { margin-top: 0.45rem; border-top: 1px solid #eceadf; padding-top: 0.45rem; }
.org-card .bio p { font-size: 0.82rem; }
.org-card.lead { background: linear-gradient(160deg, #201b5e 0%, #131044 100%); border: none; border-bottom: 4px solid var(--gold); }
.org-card.lead h3 { color: var(--white); }
.org-card.lead .role { color: #cdd9e8; }
.org-card.lead .links a { color: var(--white); }
.org-card.lead .bio summary { color: #ff8a94; }
.org-card.lead .bio { border-top-color: rgba(255,255,255,0.2); }
.org-card.lead .bio p { color: #d5e0ee; }
.org-card.apex { max-width: 420px; padding: 1.1rem 1.3rem; }
.org-card.apex img { width: 74px; height: 74px; }
.org-card.apex h3 { font-size: 1.15rem; }
.org-card.head2 { border-left: 4px solid var(--gold); }
@media (max-width: 940px) {
  .org-branches { grid-template-columns: 1fr; max-width: 480px; }
  .org-branch-label { margin-top: 0.5rem; }
}

/* ---------- STAFF HEADSHOTS ---------- */
.headshot {
  width: 100%; height: 250px; object-fit: cover; object-position: top;
  border-radius: 6px; margin-bottom: 0.9rem; display: block; background: var(--ice);
}
.headshot.crest { object-fit: contain; padding: 2rem; background: #f1efe8; border: none; }

/* ---------- PHOTO GALLERY ----------
   Column count adapts to how many photos are in the gallery,
   so rows always fill completely — no orphan photo + blank space. */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.gallery:has(> img:nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.gallery:has(> img:nth-child(4):last-child),
.gallery:has(> img:nth-child(8):last-child) { grid-template-columns: repeat(4, 1fr); }
.gallery img {
  width: 100%; height: 220px; object-fit: cover; object-position: center 25%;
  border-radius: 10px; display: block;
  box-shadow: 0 2px 6px rgba(20,16,60,0.08), 0 12px 30px rgba(20,16,60,0.10);
  filter: saturate(0.92) brightness(0.95) contrast(0.98);
  transition: filter 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}
.gallery:has(> img:nth-child(4):last-child) img,
.gallery:has(> img:nth-child(8):last-child) img { height: 190px; }
.gallery img:hover {
  filter: saturate(1) brightness(1) contrast(1);
  transform: translateY(-3px) scale(1.012);
  box-shadow: 0 4px 10px rgba(20,16,60,0.10), 0 20px 44px rgba(20,16,60,0.16);
}

/* ---------- IMPACT STATS (bold numbers, Impact Report style) ---------- */
.impact-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; max-width: 1050px; margin: 0 auto;
}
.i-stat {
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, rgba(192,160,92,0.22), transparent 60%),
    linear-gradient(160deg, #221d63 0%, #100d38 100%);
  border-bottom: 4px solid var(--gold);
  border-radius: 10px; padding: 1.5rem 1rem 1.2rem; text-align: center;
  color: var(--white);
  box-shadow: 0 2px 6px rgba(20,16,60,0.14), 0 14px 34px rgba(20,16,60,0.22);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.i-stat:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(20,16,60,0.16), 0 22px 48px rgba(20,16,60,0.3); }
.i-stat .num {
  display: block; font-family: 'Fjalla One', 'Overpass', sans-serif;
  font-size: clamp(2.1rem, 4.5vw, 2.9rem); line-height: 1; font-style: italic;
  letter-spacing: 1px;
}
.i-stat .lbl {
  display: block; margin-top: 0.55rem; font-size: 0.74rem; font-weight: 800;
  letter-spacing: 2.2px; text-transform: uppercase; color: #cdd9e8;
}

/* ---------- SIX LAYERS OF SUPPORT (native, crisp, on-brand) ---------- */
.layers { max-width: 860px; margin: 0 auto; counter-reset: layer; }
.layer {
  counter-increment: layer; position: relative;
  background: var(--white); border: 1px solid #e6e3d8; border-left: 6px solid var(--navy);
  border-radius: 6px; padding: 1.1rem 1.4rem 1.1rem 4.2rem; margin-bottom: 0.7rem;
  box-shadow: 0 2px 8px rgba(25,21,76,0.06);
}
.layer::before {
  content: counter(layer);
  position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fjalla One', sans-serif; font-size: 1.05rem;
}
.layer:first-child { border-left-color: var(--gold); }
.layer:first-child::before { background: var(--gold); }
.layer h3 { color: var(--navy); font-size: 1rem; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 0.2rem; }
.layer p { font-size: 0.92rem; color: #45424a; }

/* ---------- INQUIRY FORM ---------- */
.inquiry-form { max-width: 760px; margin: 0 auto; background: var(--white); border: 1px solid #e6e3d8; border-radius: 8px; padding: 2rem; box-shadow: 0 3px 12px rgba(25,21,76,0.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
.inquiry-form label { display: block; font-size: 0.8rem; font-weight: 800; color: var(--navy); margin-bottom: 0.3rem; letter-spacing: 0.3px; }
.inquiry-form label span { color: var(--accent); }
.inquiry-form input, .inquiry-form select, .inquiry-form textarea {
  width: 100%; padding: 0.7rem 0.85rem; border: 1px solid #cfcaba; border-radius: 5px;
  font-family: inherit; font-size: 0.95rem; color: #26242c; background: #fbfaf7;
}
.inquiry-form input:focus, .inquiry-form select:focus, .inquiry-form textarea:focus {
  outline: 2px solid var(--navy); outline-offset: 0; background: var(--white);
}
.inquiry-form .form-note { font-size: 0.8rem; color: #55524a; margin-top: 1.1rem; }
.inquiry-form .btn { margin-top: 1.1rem; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- FOOTER ---------- */
footer.site {
  background: var(--ink); color: #aab4cc; text-align: center;
  padding: 2.5rem 1.5rem; font-size: 0.9rem;
  border-top: 3px solid var(--gold);
}
footer.site::before {
  content: ''; display: block; width: 30px; height: 38px; margin: 0 auto 1rem;
  background: url('img/shield-white.png') center/contain no-repeat;
  opacity: 0.9;
}
footer.site a { color: var(--white); }
footer.site .foot-links { margin: 0.75rem 0; }
footer.site .foot-links a { margin: 0 0.6rem; text-decoration: none; }
footer.site .foot-links a:hover { text-decoration: underline; }

/* ---------- MOBILE ---------- */
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--navy); flex-direction: column; padding: 1rem 5%; gap: 1rem;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .btn.outline { margin-left: 0; margin-top: 0.75rem; }
  section { padding: 2.25rem 5%; }
  .hero { padding: 2.5rem 1.25rem 2.25rem; }
  .hero.tall { padding: 3rem 1.25rem 2.75rem; }
  .hero p { font-size: 1rem; }
  .section-title { font-size: 1.6rem; }
  .gallery, .gallery:has(> img:nth-child(4):last-child),
  .gallery:has(> img:nth-child(8):last-child) { grid-template-columns: repeat(2, 1fr); }
  .gallery img { height: 150px !important; }
  .impact-stats { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .i-stat { padding: 1.1rem 0.6rem 0.9rem; }
  .i-stat .num { font-size: 1.9rem; }
  .i-stat .lbl { font-size: 0.62rem; letter-spacing: 1.4px; }
  .layer { padding: 0.9rem 1rem 0.9rem 3.6rem; }
  .btn.big { font-size: 0.95rem; padding: 0.9rem 2rem; }
}
