/* ============================================================
   HADLEY ADVISORS — MAIN STYLESHEET (Cinematic)
   Full-bleed photographic hero, modern serif headlines,
   clean spaced sections after. Colours come from theme.css
   (admin-editable) so brand changes flow through.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--color-text); text-decoration: none; transition: color 200ms ease; }
a:hover { color: var(--color-accent-dark); }
img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 500;
  line-height: 1.05;
  margin: 0 0 1rem;
  color: var(--color-primary);
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(3rem, 7vw, 6rem); }
h2 { font-size: clamp(2.1rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h4 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 1.75rem; }

/* ============================================================
   HEADER / NAV
   Transparent over the home hero; solid on inner pages.
   The home body gets `has-hero` class to enable transparency.
   ============================================================ */
.site-header { position: relative; background: var(--color-bg); border-bottom: 1px solid var(--color-border); z-index: 5; }
body.has-hero .site-header { position: absolute; top: 0; left: 0; right: 0; background: transparent; border-bottom: 0; }

.nav { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 0; }
.nav__brand { font-family: 'Fraunces', Georgia, serif; font-size: 1.45rem; font-weight: 500; color: var(--color-primary); letter-spacing: -0.01em; }
body.has-hero .nav__brand { color: var(--color-text-on-dark); text-shadow: 0 1px 12px rgba(0,0,0,0.35); }
.nav__brand:hover { color: var(--color-primary); }
body.has-hero .nav__brand:hover { color: var(--color-text-on-dark); }
.nav__brand-mark { color: var(--color-accent); }

.nav__menu { list-style: none; display: flex; gap: 2rem; margin: 0; padding: 0; align-items: center; font-size: 0.92rem; font-weight: 500; }
.nav__menu a { color: var(--color-text); }
.nav__menu a:hover { color: var(--color-accent-dark); }
body.has-hero .nav__menu a { color: rgba(245, 241, 232, 0.85); text-shadow: 0 1px 8px rgba(0,0,0,0.35); }
body.has-hero .nav__menu a:hover { color: var(--color-text-on-dark); }

.nav__cta { background: var(--color-primary) !important; color: var(--color-text-on-dark) !important; padding: 0.6rem 1.3rem !important; border-radius: 9999px !important; font-weight: 600 !important; }
body.has-hero .nav__cta { background: var(--color-text-on-dark) !important; color: var(--color-primary) !important; }
.nav__cta:hover { background: var(--color-accent) !important; color: var(--color-primary) !important; }
body.has-hero .nav__cta:hover { background: var(--color-accent) !important; color: var(--color-text-on-dark) !important; }
.nav__toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: 0.5rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.95rem 1.75rem; font-family: inherit; font-weight: 600; text-decoration: none; font-size: 0.95rem; border-radius: 9999px; border: 1px solid transparent; transition: all 200ms ease; cursor: pointer; }
.btn--primary { background: var(--color-primary); color: var(--color-text-on-dark); }
.btn--primary:hover { background: var(--color-accent); color: var(--color-primary); transform: translateY(-1px); }
.btn--outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: var(--color-text-on-dark); }
.btn--accent { background: var(--color-accent); color: var(--color-primary); }
.btn--accent:hover { background: var(--color-accent-dark); color: var(--color-text-on-dark); transform: translateY(-1px); }
.btn--ghost-light { background: transparent; color: var(--color-text-on-dark); border-color: rgba(245, 241, 232, 0.5); }
.btn--ghost-light:hover { background: rgba(245, 241, 232, 0.15); color: var(--color-text-on-dark); }

/* Hero variant: light text on dark photo */
body.has-hero .hero .btn--primary { background: var(--color-text-on-dark); color: var(--color-primary); }
body.has-hero .hero .btn--primary:hover { background: var(--color-accent); color: var(--color-primary); }
body.has-hero .hero .btn--outline { color: var(--color-text-on-dark); border-color: rgba(245, 241, 232, 0.6); }
body.has-hero .hero .btn--outline:hover { background: rgba(245, 241, 232, 0.15); color: var(--color-text-on-dark); border-color: var(--color-text-on-dark); }

.btn-arrow { font-size: 1.05em; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1rem; }
.link-underline { color: var(--color-accent-dark); font-weight: 600; border-bottom: 1px solid currentColor; padding-bottom: 1px; display: inline-flex; align-items: center; gap: 0.4rem; }
.link-underline:hover { color: var(--color-primary); }

/* ============================================================
   COMMON UTILITIES
   ============================================================ */
.eyebrow { display: inline-block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; color: var(--color-accent-dark); margin-bottom: 1.25rem; }
body.has-hero .hero .eyebrow { color: var(--color-text-on-dark); background: rgba(245, 241, 232, 0.18); padding: 0.4rem 0.9rem; border-radius: 9999px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lead { font-size: 1.2rem; color: var(--color-text-muted); max-width: 62ch; line-height: 1.6; }
.section-rule { display: block; width: 48px; height: 2px; background: var(--color-accent); margin-bottom: 1.5rem; }
.section { padding: 6rem 0; }
.section--alt { background: var(--color-surface-alt); }
.section--dark { background: var(--color-primary); color: var(--color-text-on-dark); padding: 6rem 0; }
.section--dark h2 { color: var(--color-text-on-dark); }
.section--dark .lead, .section--dark p { color: rgba(245, 241, 232, 0.78); }
.section-header { margin-bottom: 3.5rem; max-width: 880px; }
.section-header--center { text-align: center; margin-left: auto; margin-right: auto; }
.section-header--center .section-rule { margin-left: auto; margin-right: auto; }

.grid { display: grid; gap: 2rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { background: var(--color-surface); padding: 2rem; border-radius: 6px; border: 1px solid var(--color-border); }

/* ============================================================
   HERO — full-bleed photographic background
   The .hero element gets its background-image set inline by the
   home template (from content.hero.image). This stylesheet adds
   the dark gradient overlay that keeps text legible.
   ============================================================ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  padding: 7rem 0 5rem;
  color: var(--color-text-on-dark);
  background-color: var(--color-primary);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
/* Gradient overlay over whatever image is set inline */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.25) 28%,
    rgba(0,0,0,0.45) 70%,
    rgba(0,0,0,0.85) 100%);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; width: 100%; }
.hero__layout { display: block; max-width: 780px; }
.hero__inner { }
.hero__title { color: var(--color-text-on-dark); margin: 0.5rem 0 1.25rem; text-shadow: 0 2px 32px rgba(0,0,0,0.3); }
.hero__subtitle { font-size: 1.2rem; color: rgba(245, 241, 232, 0.92); margin-bottom: 2rem; max-width: 54ch; line-height: 1.6; text-shadow: 0 1px 12px rgba(0,0,0,0.4); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.hero__media { display: none; } /* image is now the section background, not a contained figure */

.hero__meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(245, 241, 232, 0.25);
  max-width: 780px;
}
.hero__meta-item { padding: 0 1.5rem 0 0; }
.hero__meta-item .num { display: block; font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1.85rem; color: var(--color-text-on-dark); line-height: 1; margin-bottom: 0.4rem; }
.hero__meta-item .label { display: block; font-size: 0.85rem; color: rgba(245, 241, 232, 0.75); }

/* ============================================================
   PAGE HEADER (inner pages)
   ============================================================ */
.page-header { padding: 6rem 0 3rem; border-bottom: 1px solid var(--color-border); }
.page-header__inner { max-width: 780px; }

/* ============================================================
   SERVICE CARDS / AUDIENCE / STEPS
   ============================================================ */
.service-card { background: var(--color-surface); padding: 2.25rem; border-radius: 6px; border: 1px solid var(--color-border); position: relative; transition: transform 300ms ease, box-shadow 300ms ease; }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(15, 42, 68, 0.08); }
.service-card__num { display: block; font-family: 'Fraunces', Georgia, serif; font-size: 0.95rem; font-weight: 600; color: var(--color-accent-dark); margin-bottom: 0.5rem; }

.audience { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.audience__item { padding: 1.75rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; border-top: 3px solid var(--color-accent); transition: transform 300ms ease; }
.audience__item:hover { transform: translateY(-2px); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; counter-reset: step; }
.step { padding: 1.75rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; counter-increment: step; transition: transform 300ms ease, box-shadow 300ms ease; }
.step::before { content: '0' counter(step); display: block; font-family: 'Fraunces', Georgia, serif; font-size: 1.6rem; color: var(--color-accent-dark); margin-bottom: 0.5rem; }
.step:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 42, 68, 0.06); }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.75rem; }
.testimonial { padding: 2rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; margin: 0; }
.testimonial__quote { font-family: 'Fraunces', Georgia, serif; font-size: 1.2rem; line-height: 1.5; margin: 0 0 1.25rem; color: var(--color-primary); }
.testimonial__author { font-style: normal; }
.testimonial__name { display: block; font-weight: 600; font-size: 0.92rem; color: var(--color-primary); }
.testimonial__role { display: block; font-size: 0.85rem; color: var(--color-text-muted); }

/* ============================================================
   CTA BAND
   ============================================================ */
.cta-band { padding: 6rem 0; }

/* ============================================================
   VALUES (philosophy / how-we-help / outcomes)
   ============================================================ */
.values { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.values li { padding: 1.1rem 1.5rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; }
.values li strong { font-family: 'Fraunces', Georgia, serif; font-weight: 600; color: var(--color-accent-dark); margin-right: 0.5rem; }

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; }
.about-grid__photo { aspect-ratio: 4/5; background: var(--color-surface-alt); display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; color: var(--color-text-muted); border-radius: 6px; overflow: hidden; }
.about-grid__photo img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   INSIGHTS — list & cards
   ============================================================ */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.75rem; }
.post { display: flex; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; overflow: hidden; transition: transform 300ms ease, box-shadow 300ms ease; }
.post:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(15, 42, 68, 0.08); }
.post__image { aspect-ratio: 16/10; background: var(--color-surface-alt); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--color-text-muted); }
.post__image img { width: 100%; height: 100%; object-fit: cover; }
.post__body { padding: 1.5rem 1.75rem 1.75rem; flex: 1; display: flex; flex-direction: column; }
.post__meta { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-accent-dark); font-weight: 600; margin-bottom: 0.5rem; }
.post h3 { font-size: 1.35rem; }
.post p { color: var(--color-text-muted); flex: 1; }
.post__link { margin-top: 1rem; font-weight: 600; color: var(--color-accent-dark); display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.post__link:hover { color: var(--color-primary); }
.post__link--muted { color: var(--color-text-muted); cursor: default; font-style: italic; border: 0; }

/* Per-post detail page */
.post-header { max-width: 780px; }
.post-body { max-width: 720px; margin: 0 auto; }
.post-body__image { margin: 0 0 2.5rem; aspect-ratio: 16/9; overflow: hidden; border-radius: 6px; }
.post-body__image img { width: 100%; height: 100%; object-fit: cover; }
.post-body__content { font-size: 1.08rem; line-height: 1.85; color: var(--color-text); }
.post-body__content h2 { margin: 2.5rem 0 1rem; }
.post-body__content h3 { margin: 2rem 0 0.75rem; }
.post-body__content p { margin-bottom: 1.4rem; }
.post-body__content ul, .post-body__content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-body__content li { margin-bottom: 0.5rem; }
.post-body__content blockquote { border-left: 3px solid var(--color-accent); padding: 0.5rem 1.5rem; margin: 2rem 0; font-family: 'Fraunces', Georgia, serif; font-size: 1.4rem; line-height: 1.4; color: var(--color-primary); font-style: italic; }
.post-body__content code { background: var(--color-surface-alt); padding: 1px 6px; border-radius: 3px; font-size: 0.92em; font-family: ui-monospace, monospace; }
.post-body__content a { color: var(--color-accent-dark); border-bottom: 1px solid currentColor; }
.post-body__content--empty { background: var(--color-surface-alt); padding: 1.5rem; border-radius: 6px; color: var(--color-text-muted); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; }
.contact-info { padding: 2rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; }
.contact-info dl { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 1.5rem; margin-top: 1.25rem; }
.contact-info dt { font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-accent-dark); padding-top: 2px; }
.contact-info dd { margin: 0; }

.form { display: grid; gap: 1.1rem; padding: 2rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 6px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form__group label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 0.4rem; color: var(--color-primary); }
.form input, .form select, .form textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--color-border); background: var(--color-bg); font: inherit; color: var(--color-text); border-radius: 4px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(0,0,0,0.05); }
.form textarea { min-height: 130px; resize: vertical; }
.form__notice { font-size: 0.85rem; color: var(--color-text-muted); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--color-primary); color: var(--color-text-on-dark); padding: 5rem 0 2rem; }
.site-footer a { color: var(--color-text-on-dark); }
.site-footer a:hover { color: var(--color-accent); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
.footer-grid h5 { font-family: 'Fraunces', Georgia, serif; font-size: 0.95rem; color: var(--color-accent); margin-bottom: 0.85rem; font-weight: 500; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; font-size: 0.95rem; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 1.75rem; border-top: 1px solid rgba(245, 241, 232, 0.15); font-size: 0.85rem; opacity: 0.75; }

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal--delay-1 { transition-delay: 80ms; }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }
.reveal--delay-4 { transition-delay: 320ms; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav__menu { display: none; }
  .about-grid, .contact-grid, .footer-grid { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; }
  .hero { min-height: 78vh; padding-top: 6rem; }
  .hero__meta { grid-template-columns: 1fr 1fr; gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}
