/* Friends of St Andrew's: Proposal 4E. Phone first; wider screens from 768px. */
:root {
  --blue: #28258C;
  --deep: #1B1A5E;
  --ink: #14132B;
  --muted: #4A4A63;
  --paper: #F6F4EE;
  --rule: #DAD9E6;
  --edge: #E7E6EF;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Figtree", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--muted); background: #fff; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow > * { max-width: 720px; }
main { flex: 1; }
.stack > * + * { margin-top: 16px; }

/* Headings */
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); font-optical-sizing: auto; }
h2 { font-size: 30px; }
.h2--small { font-size: 26px; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.3; color: var(--ink); }
.stack > h3 { margin-top: 28px; }
.lead { font-family: var(--sans); font-weight: 600; font-size: 19px; line-height: 1.35; color: var(--blue); }
.eyebrow { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue); }
.small { font-size: 15px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--edge); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding-right: 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand span { font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.15; color: var(--ink); }
.nav-desktop { display: none; }
.nav-phone summary { list-style: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nav-phone summary::-webkit-details-marker { display: none; }
.nav-phone svg path { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; fill: none; }
.nav-phone .i-close, .nav-phone[open] .i-open { display: none; }
.nav-phone[open] .i-close { display: inline; }
.nav-phone nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--edge); box-shadow: 0 12px 24px rgba(20, 19, 43, 0.12); padding: 8px 0; }
.nav-phone nav a { display: flex; align-items: center; min-height: 56px; padding: 0 24px; border-left: 4px solid transparent; font-family: var(--sans); font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; }
.nav-phone nav a[aria-current] { color: var(--blue); background: #EEEFF8; border-left-color: var(--blue); }

/* Hero and page banners */
.hero, .banner { position: relative; display: flex; align-items: flex-end; overflow: hidden; background: var(--deep); }
.hero { height: 230px; }
.banner { height: 150px; }
.hero__img, .banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after, .banner::after { content: ""; position: absolute; inset: 0; background: rgba(20, 19, 43, 0.45); }
.banner::after { background: rgba(20, 19, 43, 0.5); }
.hero__text, .banner__text { position: relative; z-index: 1; padding-bottom: 26px; }
.banner__text { padding-bottom: 22px; }
.hero h1, .banner h1 { font-size: 34px; color: #fff; }
.hero p { margin-top: 8px; font-size: 17px; line-height: 1.45; color: #fff; }

/* Sections */
.section { padding: 36px 0; }
.section--paper { background: var(--paper); padding-bottom: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 16px; }

/* Events */
.event-list { list-style: none; margin: 0; padding: 0; }
.event { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.event-list li:last-child .event { border-bottom: 1px solid var(--rule); }
.event--plain { padding: 14px 0; }
.date-box { flex: 0 0 60px; height: 64px; background: #fff; border: 1px solid var(--rule); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.date-box__day { font-family: var(--sans); font-weight: 600; font-size: 22px; line-height: 1; color: var(--ink); }
.date-box__mon { font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); }
.event__body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.event__when { font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); }
.event__title { font-family: var(--sans); font-weight: 600; font-size: 18px; line-height: 1.25; color: var(--ink); }
.event__detail { font-size: 15px; line-height: 1.45; color: var(--muted); }
.event__link { font-family: var(--sans); font-weight: 600; font-size: 15px; text-underline-offset: 3px; margin-top: 2px; }
.event--link:hover .event__title { text-decoration: underline; text-underline-offset: 3px; }
.events-subhead { padding-bottom: 12px; }
.event-list + .events-subhead { margin-top: 32px; }
.events-empty { padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

/* Buttons and links */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 1px solid var(--blue); border-radius: 4px; background: var(--blue); color: #fff; font-family: var(--sans); font-weight: 600; font-size: 16px; text-decoration: none; }
.button:hover { background: var(--deep); border-color: var(--deep); }
.button--ghost { background: transparent; color: var(--blue); }
.button--ghost:hover { background: var(--blue); color: #fff; }
.button--block { display: flex; width: 100%; min-height: 52px; margin-top: 24px; border-radius: 0; }
.text-link { font-family: var(--sans); font-weight: 600; text-underline-offset: 3px; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 4px; }

/* Get involved */
.involved { display: flex; flex-direction: column; gap: 20px; }
.involved__img { width: 100%; height: 190px; object-fit: cover; object-position: center 25%; }

/* About */
.committee { list-style: none; margin: 8px 0 0; padding: 0; }
.committee li { padding: 10px 0; border-top: 1px solid var(--rule); }
.committee__name { font-family: var(--sans); font-weight: 600; color: var(--ink); }

/* Footer */
.footer { border-top: 1px solid var(--edge); padding: 28px 0 36px; font-size: 14px; line-height: 1.5; }
.footer p + p { margin-top: 8px; }
.footer__logo { width: 130px; height: 110px; object-fit: cover; margin-bottom: 16px; }
.footer__name { color: var(--ink); font-weight: 500; }

@media (min-width: 768px) {
  .wrap { padding: 0 32px; }
  .nav-phone { display: none; }
  .nav-desktop { display: flex; gap: 4px; }
  .nav-desktop a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; font-family: var(--sans); font-weight: 600; font-size: 16px; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
  .nav-desktop a:hover { color: var(--blue); }
  .nav-desktop a[aria-current] { color: var(--blue); border-bottom-color: var(--blue); }
  .topbar__inner { min-height: 72px; padding-right: 32px; }
  .brand span { font-size: 20px; }

  .hero { height: 380px; }
  .hero__text { padding-bottom: 44px; }
  .hero h1 { font-size: 52px; }
  .hero p { font-size: 20px; }
  .banner { height: 240px; }
  .banner h1 { font-size: 44px; }
  .banner__text { padding-bottom: 32px; }

  .section { padding: 64px 0; }
  .section--paper { padding-bottom: 56px; }
  h2 { font-size: 36px; }
  .h2--small { font-size: 30px; }
  .button--block { display: inline-flex; width: auto; min-width: 240px; }

  .involved { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
  .involved__img { height: 360px; }
}
