/* ==========================================================================
   Shared interior-page styles: page hero, prose, grant list, timeline,
   partner cards, values, contact, event list, LinkedIn wall.
   ========================================================================== */

/* ---- Interior page hero ---- */
.page-hero { position: relative; overflow: clip; padding-block: clamp(3rem, 2.5rem + 4vw, 5.5rem); }
.page-hero.section--dark .page-hero__bg,
.page-hero .page-hero__bg { position: absolute; inset: 0; background: var(--grad-hero); z-index: -2; }
.page-hero.section--dark .page-hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(38% 50% at 88% 12%, rgba(236, 43, 52, 0.20), transparent 70%),
    radial-gradient(34% 46% at 5% 95%, rgba(22, 184, 102, 0.15), transparent 70%);
}
.page-hero__inner { max-width: 780px; }
/* Photo backdrop variant (darkened for legibility; course shows through on the right) */
.page-hero--photo.section--dark .page-hero__bg { background: linear-gradient(100deg, rgba(11,13,38,0.97) 30%, rgba(11,13,38,0.45) 78%, rgba(11,13,38,0.30) 100%), url("/assets/img/events/events-hero.jpg") center 62%/cover no-repeat; }
.page-hero--photo.section--dark .page-hero__bg::after { display: none; }
.page-hero h1 { font-size: var(--fs-h1); margin: var(--space-4) 0 var(--space-4); }
.page-hero .lead { max-width: 62ch; }
.section--dark .lead { color: #cdd3f0; }
.page-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }

/* Brand logo to the right of the heading.
   Applied via a pseudo-element so every page-hero picks it up without per-page
   markup. The photo hero (events) keeps its image clean. */
@media (min-width: 1000px) {
  .page-hero .container { position: relative; }
  .page-hero__inner { max-width: 640px; }
  .page-hero .container::after {
    content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 280px; height: 215px;
    background: url("/assets/img/btt-logo-outline.png") no-repeat center / contain;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.45)); /* lifts it off the photo hero too */
    pointer-events: none;
  }
}

/* Mobile / tablet: the logo sits in the blue space beside the heading, with the
   eyebrow and title flowing around it.
   Uses ::before (not ::after) because a float only affects content that comes
   after it in source order — an ::after would sit below the text and wrap
   nothing. Sized in vw so it never crowds the heading on narrow phones. */
@media (max-width: 999px) {
  .page-hero__inner::before {
    content: ""; float: right;
    width: clamp(72px, 23vw, 104px); aspect-ratio: 1200 / 923;
    background: url("/assets/img/btt-logo-outline.png") no-repeat center / contain;
    margin: 0 0 var(--space-3) var(--space-4);
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35));
  }
  /* .eyebrow is inline-flex, which makes it an atomic box: it cannot flow
     beside a float and gets pushed below it, leaving the logo stranded in the
     corner. Rendering it as plain inline text lets it sit next to the logo. */
  .page-hero__inner .eyebrow { display: inline; }
  .page-hero__inner .eyebrow::before {
    display: inline-block; vertical-align: middle; margin-right: var(--space-2);
  }
  /* The eyebrow is inline now, so the h1 needs to start a new line itself. */
  .page-hero__inner h1 { margin-top: var(--space-4); }
}

/* ---- Prose (privacy, long text) ---- */
.prose { max-width: 72ch; }
.prose h2 { font-size: var(--fs-h3); margin: var(--space-7) 0 var(--space-3); }
.prose h3 { font-size: var(--fs-h4); margin: var(--space-5) 0 var(--space-2); }
.prose p, .prose li { color: var(--ink-700); }
.prose ul { padding-left: 1.25rem; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }
.prose a { text-decoration: underline; }
.prose .prose__meta { color: var(--ink-500); font-size: var(--fs-small); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-7) 0; }

/* ---- Grant list (clickable accordions) ---- */
.grant-list { display: grid; gap: var(--space-4); }
.grant-row {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.grant-row:hover { box-shadow: var(--shadow); border-color: var(--blue-200); }
.grant-row[open] { border-color: var(--blue-200); box-shadow: var(--shadow-sm); }
.grant-row__summary {
  display: grid; grid-template-columns: 96px 1fr auto auto; gap: var(--space-5); align-items: center;
  padding: var(--space-5) var(--space-6); cursor: pointer; list-style: none;
}
.grant-row__summary::-webkit-details-marker { display: none; }
.grant-row__summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius-lg); }
.grant-row__date { font-size: var(--fs-small); color: var(--ink-500); }
.grant-row__body h3 { font-size: var(--fs-h4); margin-bottom: 4px; }
.grant-row__body p { color: var(--ink-500); font-size: var(--fs-small); }
.grant-row__amount { font-family: var(--font-display); font-size: var(--fs-h3); color: var(--green-700); white-space: nowrap; }
.grant-row__chev { width: 22px; height: 22px; color: var(--blue-500); flex-shrink: 0; transition: transform var(--dur) var(--ease-out); }
.grant-row[open] .grant-row__chev { transform: rotate(180deg); }
.grant-row__detail { padding: 0 var(--space-6) var(--space-5); }
.grant-row__detail p { color: var(--ink-700); max-width: 72ch; font-size: var(--fs-small); }
.grant-row__detail p + p { margin-top: var(--space-3); }
.grant-row__quote { border-left: 3px solid var(--blue-300); padding-left: var(--space-4); color: var(--ink-600); font-style: italic; margin-top: var(--space-3); }
@media (max-width: 640px) {
  .grant-row__summary { grid-template-columns: 1fr auto auto; gap: var(--space-3) var(--space-4); padding: var(--space-5); }
  .grant-row__date { grid-column: 1 / -1; }
  .grant-row__detail { padding: 0 var(--space-5) var(--space-5); }
}

/* ---- Category chips filter row ---- */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; margin-bottom: var(--space-6); }

/* ---- Timeline (About story / how it works) ---- */
.timeline { position: relative; display: grid; gap: var(--space-6); margin-top: var(--space-6); }
.timeline::before { content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px; background: var(--line-strong); }
.timeline__item { position: relative; padding-left: 56px; }
.timeline__dot { position: absolute; left: 8px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--blue-700); color: #fff; display: grid; place-items: center; }
.timeline__dot svg { width: 14px; height: 14px; }
.timeline__item h3 { font-size: var(--fs-h4); margin-bottom: var(--space-1); }
.timeline__item p { color: var(--ink-500); }

/* ---- Trustees ---- */
.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
@media (max-width: 800px) { .people { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; } }
.person { text-align: center; }
.person__avatar { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto var(--space-4); background: var(--grad-brand); display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-size: var(--fs-h3); }
.person h3 { font-size: var(--fs-h4); }
.person p { color: var(--ink-500); font-size: var(--fs-small); }

/* ---- Partner cards ---- */
.partner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
@media (max-width: 800px) { .partner-grid { grid-template-columns: 1fr; } }
.partner { display: flex; flex-direction: column; gap: var(--space-3); }
.partner__logo { height: 52px; display: flex; align-items: center; margin-bottom: var(--space-1); }
.partner__logo img { max-height: 46px; max-width: 190px; width: auto; object-fit: contain; }
.partner p { color: var(--ink-500); font-size: var(--fs-small); }
.partner .link-arrow { margin-top: auto; color: var(--blue-700); font-size: var(--fs-small); }

/* ---- Value / feature list ---- */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
@media (max-width: 800px) { .values { grid-template-columns: 1fr; } }

/* ---- Event list ---- */
.event-list { display: grid; gap: var(--space-5); }
.event-item { display: grid; grid-template-columns: 120px 1fr auto; gap: var(--space-5); align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-6); }
.event-item__date { text-align: center; background: var(--blue-050); border-radius: var(--radius); padding: var(--space-3); }
.event-item__date .d { font-family: var(--font-display); font-size: var(--fs-h3); color: var(--blue-700); line-height: 1; }
.event-item__date .m { font-size: var(--fs-small); color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.08em; }
.event-item__body h3 { font-size: var(--fs-h4); margin-bottom: 4px; }
.event-item__body p { color: var(--ink-500); font-size: var(--fs-small); }
.event-item__meta { font-size: var(--fs-small); color: var(--blue-700); font-weight: var(--fw-semibold); }
@media (max-width: 700px) {
  .event-item { grid-template-columns: 72px 1fr; }
  .event-item__meta { grid-column: 2; }
}

/* ---- Event detail (upcoming event) ---- */
.event-detail { display: grid; grid-template-columns: 1.5fr 0.9fr; gap: clamp(2rem, 4vw, 3.5rem); margin-top: var(--space-6); align-items: start; }
@media (max-width: 820px) { .event-detail { grid-template-columns: 1fr; } }
.event-detail h3 { font-size: var(--fs-h4); margin: var(--space-6) 0 var(--space-3); }
.event-detail > div > p { color: var(--ink-700); }
.ticks { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
.ticks li { display: flex; gap: var(--space-3); align-items: flex-start; color: var(--ink-700); font-size: var(--fs-small); }
.ticks svg { width: 20px; height: 20px; color: var(--green-600); flex-shrink: 0; margin-top: 2px; }
.facts-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); position: sticky; top: 96px; }
.facts-card h3 { margin: 0 0 var(--space-5); font-size: var(--fs-h4); }
.facts { list-style: none; padding: 0; display: grid; gap: var(--space-4); margin: 0 0 var(--space-5); }
.facts li { display: flex; gap: var(--space-3); align-items: flex-start; }
.facts li > svg { width: 20px; height: 20px; color: var(--blue-600); flex-shrink: 0; margin-top: 2px; }
.facts .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-400); display: block; margin-bottom: 1px; }
.facts .v { font-weight: var(--fw-semibold); color: var(--ink-900); font-size: var(--fs-small); }

/* ---- Event story (rich past-event write-up) ---- */
.event-story { border-top: 1px solid var(--line); padding-top: var(--space-7); margin-top: var(--space-7); }
.event-story:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.event-story__head { display: flex; align-items: center; gap: var(--space-5); margin-bottom: var(--space-4); }
.event-logo { width: 88px; height: 88px; flex-shrink: 0; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); padding: 6px; object-fit: contain; box-shadow: var(--shadow-xs); }
.event-story__headings h3 { font-size: var(--fs-h2); margin-bottom: var(--space-2); }
@media (max-width: 520px) { .event-story__head { gap: var(--space-3); } .event-logo { width: 60px; height: 60px; } }
.event-meta { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.event-meta .badge svg { width: 14px; height: 14px; }
.event-story__body { max-width: 68ch; }
.event-story__body p { color: var(--ink-700); }
.event-story__body p + p { margin-top: var(--space-4); }

/* ---- Photo gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); margin-top: var(--space-6); }
.gallery a { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-3); cursor: zoom-in; box-shadow: var(--shadow-xs); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur) var(--ease-out); }
.gallery a:hover img { transform: scale(1.06); }

/* ---- Lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(9, 11, 26, 0.94); display: none; align-items: center; justify-content: center; padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 5vw, 4rem); }
.lightbox.is-open { display: flex; }
.lightbox__img { max-width: 100%; max-height: 82vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.lightbox__bar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-5); }
.lightbox__count { color: #cdd3f0; font-size: var(--fs-small); }
.lightbox__actions { display: flex; gap: var(--space-3); }
.lightbox__btn { background: rgba(255,255,255,0.12); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; cursor: pointer; text-decoration: none; transition: background var(--dur) var(--ease-out); }
.lightbox__btn:hover { background: rgba(255,255,255,0.26); color: #fff; }
.lightbox__btn svg { width: 22px; height: 22px; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.12); color: #fff; border: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; transition: background var(--dur) var(--ease-out); }
.lightbox__nav:hover { background: rgba(255,255,255,0.26); }
.lightbox__nav svg { width: 26px; height: 26px; }
.lightbox__prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.lightbox__next { right: clamp(0.5rem, 2vw, 1.5rem); }
@media (max-width: 600px) { .lightbox__nav { width: 44px; height: 44px; } }

/* ---- LinkedIn wall ---- */
.li-wall { min-height: 320px; display: grid; place-items: center; text-align: center; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); padding: var(--space-8) var(--space-5); }
.li-wall__inner { max-width: 46ch; }
.li-wall svg { width: 40px; height: 40px; color: var(--blue-600); margin-bottom: var(--space-4); }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { display: grid; gap: var(--space-5); margin-top: var(--space-5); }
.contact-list__item { display: flex; gap: var(--space-4); align-items: flex-start; }
.contact-list__item .card__icon { margin-bottom: 0; flex-shrink: 0; }
.contact-list__item h3 { font-size: var(--fs-h4); margin-bottom: 2px; }
.contact-list__item p, .contact-list__item a { color: var(--ink-500); font-size: var(--fs-small); }

/* ---- Form ---- */
.form { display: grid; gap: var(--space-4); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.25rem); }
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--ink-700); }
.field input, .field select, .field textarea {
  width: 100%; padding: 0.85rem 1rem; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: var(--fs-body); transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue-500); background: #fff; }
.field textarea { min-height: 130px; resize: vertical; }

/* ---- Big CTA band ---- */
.cta-band { background: var(--grad-brand); border-radius: var(--radius-xl); padding: clamp(2rem, 5vw, 3.5rem); text-align: center; color: #fff; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; margin-bottom: var(--space-3); }
.cta-band p { color: #dfe4fb; max-width: 52ch; margin: 0 auto var(--space-6); }
.cta-band .hero__actions { justify-content: center; }
