/* =============================================================================
   HPN base styles — built on tokens.css

   Fixes carried deliberately from the audit of the site this replaces:
     * ZERO :focus rules, and `outline: 0` set explicitly  -> visible focus everywhere
     * no skip link                                        -> one, first in the DOM
     * tap targets under 44px on every page                -> --tap-min enforced
     * hero text failing contrast on all 4 slides          -> scrim is mandatory
     * header position: relative on 6303px pages           -> sticky
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  /* Montserrat ships here at 400/500/600/700 only. Without this, a request for a weight
     it does not have gets a smeared synthetic bold rather than the nearest real cut. */
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, svg { max-width: 100%; height: auto; display: block; }

/* The `hidden` attribute must actually hide.
   Every author `display` declaration beats the UA stylesheet's `[hidden]{display:none}`,
   so `.venue { display: flex }` silently defeated it — the venue filter set
   card.hidden = true on every non-matching card, updated its count to match, and the
   cards stayed on screen. The filter looked like it worked and did nothing.
   !important is correct here: `hidden` is a statement about the element's existence,
   not a style suggestion. */
[hidden] { display: none !important; }

/* Display face for the two levels that carry the page; the body face, bold, for the two
   that carry content. Archivo Black is an ultra-heavy face — set at 29px across a dense
   three-up card grid it shouts and slows scanning, and h2/h3/h4 all sharing one texture
   left the hierarchy reading as size alone. */
h1, h2, h3, h4 {
  margin: 0 0 var(--space-s);
  text-wrap: balance;
}
h1, h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);   /* real 700 via the range in fonts.css, never faux */
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
}
h3, h4 {
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }

/* Measure belongs to running prose. Applying it to every `li` also capped nav items,
   card grids and the venue list, none of which are prose. */
p { max-width: var(--width-prose); margin: 0 0 var(--space-s); text-wrap: pretty; }
.prose li, .rich-text li { max-width: var(--width-prose); }

/* There is no Montserrat italic file, so `em` would render as a mechanically sheared 400.
   Weight carries the emphasis instead — and because the element is never asked for an
   italic, no synthetic slant is generated. */
em, i { font-style: normal; font-weight: var(--weight-semibold); }
strong, b { font-weight: var(--weight-bold); }

/* Prices, times, phone numbers and stats line up in columns only with lining tabular
   figures; Montserrat defaults to proportional. */
.tabular, .card__price, .stat__value, .venue__meta, .venue__time, .price {
  font-variant-numeric: tabular-nums lining-nums;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

/* --- Focus -------------------------------------------------------------------
   The single most important rule in this file. The old stylesheet had zero
   :focus rules AND removed the outline, so keyboard focus was invisible sitewide. */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ...except on the purple. The ring is brand-400, which measures 4.59:1 on white and
   4.06:1 on the near-black footer — fine. On brand-500 it is 1.65:1, and at the lightest
   point of the CTA band, where a 19% white radial lifts the purple to rgb(166,64,189), it
   is 1.12:1. Purple on purple. That is a keyboard user tabbing onto "Plan my event" — the
   single most important button on the site — and seeing nothing happen at all.

   WCAG 2.2 SC 1.4.11 asks for 3:1 against the adjacent colour. White measures 5.14:1 at
   the band's lightest point and 14.24:1 at its darkest, and outline-offset keeps a 2px
   band of purple between the ring and the white button it surrounds, so the two do not
   merge. brand-100 also passes (3.48:1) but with no margin for a future gradient tweak.

   Custom properties inherit, so redefining the token on the section is the whole fix —
   every control inside picks it up. .bg-dark is deliberately not included: brand-400
   already passes there, and changing it would be a restyle rather than a repair. */
.bg-brand, .cta-section { --focus-ring: var(--focus-ring-on-brand); }

/* --- Skip link ---------------------------------------------------------------
   None existed. On a 9350px mobile page that is a real barrier. */
.skip-link {
  position: absolute;
  left: var(--space-s);
  top: calc(-1 * var(--space-3xl));
  z-index: 100;
  padding: var(--space-2xs) var(--space-s);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  transition: top var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
}
.skip-link:focus { top: var(--space-s); }

/* --- Layout ------------------------------------------------------------------ */
.container { width: min(100% - 2rem, var(--width-contained)); margin-inline: auto; }
.container--wide { width: min(100% - 2rem, var(--width-wide)); }
.container--full { width: 100%; }

.section { padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-l); }
.section--generous { padding-block: var(--space-3xl); }

.bg-default { background: var(--surface); }
.bg-muted   { background: var(--surface-muted); }
.bg-brand   { background: var(--brand-500); color: var(--text-on-brand); }
.bg-dark    { background: var(--surface-inverse); color: var(--text-on-inverse); }
.bg-brand :is(h1,h2,h3,h4), .bg-dark :is(h1,h2,h3,h4) { color: inherit; }

/* --- Header ------------------------------------------------------------------
   Sticky. The old header was position: relative on pages up to 6303px tall, so
   the nav and any CTA were unreachable without scrolling all the way back up. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  box-shadow: var(--shadow-1);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  min-height: 72px;
}
.site-header__logo img { height: 40px; width: auto; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  padding-inline: var(--space-xs);
  color: var(--text-on-inverse);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  transition: background var(--dur) var(--ease);
}
.site-nav a:hover { background: rgba(255,255,255,.10); }
.site-nav a[aria-current="page"] { background: var(--brand-500); }

/* --- Buttons -----------------------------------------------------------------
   Every button is at least 44px tall. The CTA block also refuses to save without
   a destination, so `href="#"` buttons cannot ship. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: var(--tap-min);
  padding: var(--space-2xs) var(--space-m);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn--primary { background: var(--brand-500); color: var(--text-on-brand); }
.btn--primary:hover { background: var(--brand-600); color: var(--text-on-brand); }
.btn--secondary {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn--secondary:hover { background: rgba(255,255,255,.10); }

/* --- Hero --------------------------------------------------------------------
   The scrim is structural, not decorative. Measured contrast on the old site's
   hero failed on all four slides — worst 2.65:1 where 3.0:1 is required. */
.hero { position: relative; display: grid; isolation: isolate; }
.hero__media { grid-area: 1 / 1; position: relative; overflow: hidden; }
/* The photograph is taken OUT OF FLOW on purpose.
   The media and the body share one grid cell, so the row height is indefinite —
   which means `height: 100%` on the image cannot resolve and falls back to `auto`.
   The image then rendered at its intrinsic 2000x1200 ratio: 1139px tall on a 1900px
   viewport. The PHOTO, not the min-height, was setting the hero's height, pushing the
   headline and the paragraph below the fold on any normal desktop screen.
   Positioned absolutely it contributes nothing to row sizing, so .hero__body alone
   decides the height and object-fit crops the photo to whatever that is. */
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__body {
  grid-area: 1 / 1;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-2xl) var(--space-s);
  color: var(--ink-000);
  min-height: 60vh;
}
/* Measure lives in components.css, not here. Three rules used to set a width on the
   hero paragraph across two files (22ch, 46ch, 40ch); the winner was whichever had the
   highest specificity, not whichever was intended. Only the headline is capped here. */
.hero__body :is(h1, p) { color: inherit; }
.hero__body h1 { max-width: 24ch; }  /* holds "What are you planning?" on one line */
.hero--scrim .hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim-strong);
}
.hero__media { position: relative; }

/* --- Cards -------------------------------------------------------------------
   Every card is a link. On the old site all six cards on /weddings and all six on
   /about-us had no destination at all. */
.card-grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow-3); transform: translateY(-2px); }
.card__media { aspect-ratio: 3 / 2; background: var(--surface-sunken); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--space-s); display: flex; flex-direction: column; gap: var(--space-2xs); }
.card__title { font-family: var(--font-body); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); font-size: var(--step-1); margin: 0; }
.card__meta { color: var(--text-muted); font-size: var(--step--1); }

/* --- Venue schedule ---------------------------------------------------------- */
.venue-day { margin-block: var(--space-l); }
.venue-day__heading { font-size: var(--step-2); }
.venue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-s); }
.venue { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-s); }
.venue__name { font-family: var(--font-body); font-weight: var(--weight-bold); font-size: var(--step-1); margin: 0 0 var(--space-3xs); }
.venue__meta { color: var(--text-muted); font-size: var(--step--1); margin: 0; }
.venue a { display: inline-flex; align-items: center; min-height: var(--tap-min); }

/* --- Footer ------------------------------------------------------------------ */
.site-footer {
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  padding-block: var(--space-xl);
  margin-top: var(--space-3xl);
}
.site-footer a { color: var(--brand-200); }
.site-footer__logo img { height: 48px; width: auto; margin-bottom: var(--space-s); }

.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;
}

/* --- Footer nav --------------------------------------------------------------
   Reuses .site-nav's flex list so it does not fall back to a bulleted column. */
.site-footer .site-nav ul { margin-block: var(--space-s); }
.site-footer .site-nav a { color: var(--brand-200); }
.site-footer .site-nav a:hover { background: rgba(255,255,255,.10); color: var(--ink-000); }

/* Hero with no image yet: the brand surface still needs to read as a hero, and the
   text must stay legible. Craig supplies photography in Phase A5. */
.hero--no-media { background: var(--surface-inverse); }
.hero--no-media .hero__body { min-height: 40vh; justify-content: center; }
/* .hero__sub is styled in components.css — see the note above. */
