/* Pisa Financial Services — site styles. Navy + gold, no frameworks. */

:root {
  --navy: #0f2542;
  --navy-deep: #0a1a30;
  --gold: #c8a04b;
  --gold-dark: #917131;   /* 4.55:1 on white (was #a9843a, 3.47:1) */
  --ink: #22303f;
  --muted: #637289;      /* 4.51:1 on --paper-alt (was #64748b, 4.40:1) */
  --muted-on-dark: #8fa0b8; /* --muted fails on the navy footer; 5.9:1 there */
  --gold-text: #8e7135;  /* --gold is 2.45:1 on white - never use it for body text */
  --paper: #ffffff;
  --paper-alt: #f4f6f9;
  --line: #e2e8f0;
}

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

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

h1, h2, h3, .site-nav, .btn, .brand, .kicker, .footer-head, .card-link, label, button {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
.muted { color: var(--muted); }
a { color: var(--navy); }

/* Header */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 2px solid var(--gold); border-radius: 4px;
  color: var(--gold); font-weight: 700; font-size: 1.3rem;
}
.brand-text { color: #fff; font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.brand-text em { color: var(--gold); font-style: normal; font-weight: 400; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: #d7e0ec; text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: #fff; }
.nav-cta {
  background: var(--gold); color: var(--navy-deep) !important;
  padding: 8px 16px; border-radius: 4px; font-weight: 600;
}
.nav-cta:hover { background: var(--gold-dark); }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; padding: 84px 0;
}
.hero-photo {
  background-size: cover;
  background-position: center;
  padding: 110px 0;
}
.kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .8rem;
  color: var(--gold); margin-bottom: 14px;
}
.kicker a { color: var(--gold); text-decoration: none; }
.hero h1 { font-size: 2.6rem; line-height: 1.15; max-width: 640px; margin-bottom: 18px; }
.hero .lede { color: #c6d2e2; max-width: 620px; font-size: 1.1rem; }
.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 24px; border-radius: 4px;
  text-decoration: none; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--gold); color: var(--navy-deep); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-ghost { border-color: currentColor; color: inherit; }
.hero .btn-ghost, .cta-band .btn-ghost { color: #fff; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--paper-alt); }
.section h2 { font-size: 1.8rem; margin-bottom: 26px; color: var(--navy); }
.page-head {
  background: var(--navy); color: #fff; padding: 56px 0;
}
.page-head h1 { font-size: 2.2rem; margin-bottom: 10px; }
.page-head .lede { color: #c6d2e2; }

/* Cards */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px;
}
.card {
  display: block; background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; padding: 22px; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: 0 6px 20px rgba(15, 37, 66, .12); transform: translateY(-2px); }
.card-photo { padding: 0; overflow: hidden; }
.card-photo .card-body { padding: 18px 22px 22px; }
.card-img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
}
.card h3 { color: var(--navy); margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }
.card-link { display: inline-block; margin-top: 12px; color: var(--gold-dark); font-weight: 600; font-size: .9rem; }

/* Three-column band */
.threecol { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.threecol h3 { color: var(--navy); margin-bottom: 8px; font-size: 1.05rem; }
.threecol p { color: var(--muted); font-size: .95rem; }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { color: #c6d2e2; margin-bottom: 22px; }

/* Programs page */
.program-list { display: flex; flex-direction: column; gap: 40px; }
.program-row {
  display: grid; grid-template-columns: 260px 1fr auto; gap: 24px; align-items: start;
  border-bottom: 1px solid var(--line); padding-bottom: 40px;
}
.program-thumb {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px;
}
.detail-banner {
  display: block; width: 100%; aspect-ratio: 21 / 9; object-fit: cover;
  border-radius: 6px; margin-bottom: 32px;
}
.about-img {
  display: block; width: 100%; aspect-ratio: 21 / 9; object-fit: cover;
  border-radius: 6px; margin: 28px 0;
}
.program-row:last-child { border-bottom: 0; padding-bottom: 0; }
.program-row h2 { margin-bottom: 4px; }
.program-row .tagline { color: var(--muted); margin-bottom: 12px; }
.program-row ul { padding-left: 20px; }
.program-row li { margin-bottom: 4px; }
.feature-list { padding-left: 20px; }
.feature-list li { margin-bottom: 8px; }
.cta-inline { margin-top: 28px; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-family: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 4px;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: 3px solid var(--navy); outline-offset: 1px;
  border-color: var(--navy);
}
.contact-form button { align-self: flex-start; }
.form-errors {
  background: #fdf1f1; border: 1px solid #e5b8b8; color: #8a2626;
  border-radius: 4px; padding: 12px 16px; margin-bottom: 20px;
}
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* Footer */
/* --muted is tuned for light backgrounds and only reaches 3.67:1 here,
   which put the LEGAL DISCLAIMER below AA. Scope the darker token to
   the footer rather than weakening it site-wide. */
.site-footer .muted { color: var(--muted-on-dark); }
.site-footer { background: var(--navy-deep); color: #b9c6d8; padding: 48px 0 32px; margin-top: 0; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.footer-brand { color: #fff; font-weight: 600; margin-bottom: 6px; }
.footer-head { color: var(--gold); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.site-footer a { color: #d7e0ec; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-legal { border-top: 1px solid #22354e; margin-top: 32px; padding-top: 20px; font-size: .85rem; }
.footer-legal p { margin-bottom: 8px; }


/* --- Team page ------------------------------------------------------- */
.team-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--rule, #e4e8ee);
}
.team-row:last-of-type { border-bottom: 0; }
.team-photo {
  width: 240px; height: 240px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.team-aside { text-align: left; grid-column: 1; grid-row: 1; }
.team-body  { grid-column: 2; grid-row: 1; }
.team-credential {
  margin-top: 14px;
  font-size: .85rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.team-contact { margin-top: 4px; font-size: .95rem; }
.team-body h2 { margin-bottom: 2px; color: var(--navy); }
.team-title {
  color: var(--gold-text);
  font-weight: 600;
  margin-bottom: 14px;
}
.team-body .tagline {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 16px;
}
.team-body p { margin-bottom: 14px; }
.team-body p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .team-row { grid-template-columns: 1fr; gap: 20px; }
  /* Single column. `order` lifts the photo block back above the name so a
     phone reader sees the face first; DOM order is untouched, so a screen
     reader still hears the name and title before the NMLS id and phone. */
  .team-aside, .team-body { grid-column: 1; grid-row: auto; }
  .team-aside { order: -1; }
  .team-photo { width: 180px; height: 180px; }
}


/* --- Accessibility ---------------------------------------------------- */
/* Skip link: off-screen until focused, then pinned top-left. Must stay
   visible on focus - a skip link that never appears fails 2.4.1 anyway. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
/* <main> takes focus after the skip link is used; never show a ring on it. */
main:focus { outline: none; }

/* WCAG 1.4.11: a focus indicator needs 3:1 against what is behind it.
   --gold is 2.45:1 on white, so the ring pairs a dark outline with a light
   offset - visible on both the navy header and the white page. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
  border-radius: 2px;
}
.site-header a:focus-visible,
.site-footer a:focus-visible,
.hero a:focus-visible,
.cta-band a:focus-visible,
.page-head a:focus-visible {
  outline-color: #fff;
}

/* 2.3.3 / prefers-reduced-motion: the card lift is decorative. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Form validation states (3.3.1). */
.field-error {
  display: block;
  color: #8a2626;
  font-size: .9rem;
  margin-top: 4px;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
.contact-form [aria-invalid="true"] { border-color: #8a2626; }

@media (max-width: 700px) {
  .hero h1 { font-size: 2rem; }
  .hero-photo { padding: 72px 0; }
  .program-row { grid-template-columns: 1fr; }
  .program-thumb { aspect-ratio: 16 / 9; }
}
