/* BNI Adirim site design system (direction 2).
   Pages pull this file in with a style tag carrying data-inline="shared/site.css"; build.py inlines it.
   Page-specific CSS goes in the page; tokens and shared components live here only. */

@font-face { font-family: "Polin"; src: url("/assets/fonts/Polin-Light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Polin"; src: url("/assets/fonts/Polin-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Polin"; src: url("/assets/fonts/Polin-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Polin"; src: url("/assets/fonts/Polin-Semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Polin"; src: url("/assets/fonts/Polin-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Polin"; src: url("/assets/fonts/Polin-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --paper: #FFFFFF;
  --soft: #F5F4F1;
  --ink: #161412;
  --muted: #66625D;
  --line: #E4E2DE;
  --red: #CF2030;
  --t1: #C4674B; --t2: #3F6E72; --t3: #C59E48; --t4: #4C5A6B; --t5: #87977A;
  --display: "Polin", system-ui, sans-serif;
  --sans: "Polin", system-ui, sans-serif;
  --radius: 16px;  /* design-system corner for every photo frame and content tile */
  --wrap: min(1280px, 100% - 32px);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 18px/1.6 var(--sans); }
img { display: block; max-width: 100%; }
a { color: inherit; }
b, strong, th { font-weight: 600; }
h1, h2 { font-weight: 700 !important; }  /* Yuval: H1 and H2 at 700 everywhere, over any page rule */  /* browser default is 700 */
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.wrap { width: var(--wrap); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- aurora: fixed light-red background behind the whole site (layout.js injects .aurora-bg) ---------- */
.aurora-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; isolation: isolate; }
.aurora-bg::before, .aurora-bg::after {
  content: ""; position: absolute; inset: -10px; will-change: background-position;
  --stripes: repeating-linear-gradient(100deg, #fff 0%, #fff 7%, transparent 10%, transparent 12%, #fff 16%);
  --aurora: repeating-linear-gradient(100deg, #E8505B 10%, #F7B2B7 15%, #F28B91 20%, #FBD3D5 25%, #EC7A82 30%);
  background-image: var(--stripes), var(--aurora);
  background-size: 300%, 200%; background-position: 50% 50%, 50% 50%;
  filter: blur(10px); opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%);
}
.aurora-bg::after { background-size: 200%, 100%; background-attachment: fixed; mix-blend-mode: multiply; animation: aurora 60s linear infinite; }
@keyframes aurora { from { background-position: 50% 50%, 50% 50%; } to { background-position: 350% 50%, 350% 50%; } }
@media (prefers-reduced-motion: reduce) { .aurora-bg::after { animation: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .9em 1.5em; font: 600 16px/1 var(--sans); text-decoration: none; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: 2px; cursor: pointer; }
.btn:hover { background: var(--red); border-color: var(--red); }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.red:hover { background: var(--ink); border-color: var(--ink); }
.btn.line { background: transparent; color: var(--ink); }
.btn.line:hover { background: var(--ink); color: #fff; }
.btn.white { background: #fff; color: var(--ink); border-color: #fff; }
.btn.white:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill-btn { font: 600 15px var(--sans); padding: .8em 1.3em; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; gap: .4em; }
.pill-btn:hover { background: var(--ink); color: #fff; }

/* ---------- header (rendered by shared/layout.js) ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 76px; border-bottom: 1px solid var(--ink); }
.site-header .logo img { height: 38px; width: auto; }
.site-header nav { display: flex; gap: 26px; margin-inline-start: auto; font-weight: 400; font-size: 19px; }
.site-header nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--red); }
.site-header nav a[aria-current="page"] { border-color: var(--red); }
.site-header .cta { padding: .75em 1.2em; font-size: 15px; }
.menu-btn { display: none; margin-inline-start: auto; width: 44px; height: 44px; border: 1px solid var(--ink); border-radius: 999px; background: #fff; cursor: pointer; }
.menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 4px auto; }
@media (max-width: 980px) {
  .menu-btn { display: block; }
  .site-header .cta { margin-inline-start: auto; padding: .6em .9em; font-size: 14px; white-space: nowrap; }  /* the only way to the invite page on mobile */
  .menu-btn { margin-inline-start: 10px; }
  .site-header nav { display: none; position: absolute; inset-inline: 0; top: 76px; background: #fff; flex-direction: column; gap: 0; padding: 8px 16px 20px; border-bottom: 1px solid var(--ink); box-shadow: 0 20px 40px -24px rgba(0,0,0,.35); }
  .site-header nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 20px; }
  .site-header nav a[aria-current="page"] { color: var(--red); border-color: var(--line); }
  .site-header.open nav { display: flex; }
}

/* ---------- footer (rendered by shared/layout.js) ---------- */
.site-footer { background: var(--ink); color: #fff; padding: 64px 0 28px; margin-top: 0; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.site-footer .brand img { height: 40px; width: auto; background: #fff; border-radius: 10px; padding: 6px 10px; }
.site-footer .brand p { color: #B5ADA2; font-size: 15px; max-width: 34ch; margin: 16px 0 0; }
.site-footer h2 { font: 600 14px var(--sans); color: #B5ADA2; letter-spacing: .04em; margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 16px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #FF8A93; }
.site-footer .base { margin-top: 48px; padding-top: 18px; border-top: 1px solid #3A3532; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: #8E867C; }
.site-footer .base a { display: inline-block; padding: 6px 0; } /* 24px+ tap target on phones */
@media (max-width: 860px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .brand { grid-column: 1 / -1; } }

/* ---------- type & section scaffolding ---------- */
.kicker { font: 600 14px var(--sans); color: var(--red); letter-spacing: .02em; margin: 0 0 14px; }
.section { padding: 96px 0; }
.section.soft { background: var(--soft); }
.section.dark { background: var(--ink); color: #fff; }
.section.dark .sec-head { border-color: #4A4540; }
.section.dark .sec-head p, .section.dark .muted { color: #B5ADA2; }
.muted { color: var(--muted); }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; padding-bottom: 22px; border-bottom: 1px solid var(--ink); margin-bottom: 28px; }
.sec-head h2 { font: 600 clamp(40px, 5vw, 72px)/.98 var(--display); margin: 0; letter-spacing: -.02em; }
.sec-head p { margin: 0; color: var(--muted); max-width: 46ch; }
.title { font: 600 clamp(36px, 4.4vw, 60px)/1 var(--display); letter-spacing: -.02em; margin: 0; }

/* page hero for inner pages */
.page-hero { padding: 64px 0 48px; }
.page-hero .crumbs { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.page-hero .crumbs a { text-decoration: none; }
.page-hero .crumbs a:hover { color: var(--red); }
.page-hero h1 { font: 600 clamp(48px, 7vw, 104px)/.95 var(--display); letter-spacing: -.025em; margin: 0 0 22px; max-width: 16ch; }
.page-hero .lede { font-size: clamp(19px, 1.8vw, 22px); color: var(--ink); max-width: 46ch; margin: 0 0 28px; }
.page-hero .meta { display: flex; gap: 10px 24px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.page-hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.page-hero.split .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: end; }

/* long-form text (guide chapters, legal pages) */
.prose { font-size: 19px; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font: 600 clamp(28px, 3vw, 38px)/1.15 var(--display); letter-spacing: -.01em; margin: 2.2em 0 .5em; }
.prose h3 { font: 600 22px/1.3 var(--display); margin: 1.8em 0 .4em; }
.prose p, .prose ul, .prose ol { margin-block: 0; }
.prose ul, .prose ol { padding-inline-start: 1.3em; display: grid; gap: .45em; }
.prose li::marker { color: var(--red); }
.prose a { text-decoration-color: var(--red); text-underline-offset: 4px; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.6em 0; padding: 22px 26px; background: var(--soft); border-radius: var(--radius); font-size: 20px; }
.prose blockquote p + p { margin-top: .6em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 17px; }
.prose th, .prose td { text-align: start; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; border-bottom-color: var(--ink); }
.callout { background: var(--soft); border-radius: var(--radius); padding: 24px 26px; }
.callout.red { background: var(--red); color: #fff; }

/* ---------- components ---------- */
.p { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--tone, #EEECE8); }
.p img { width: 100%; height: 100%; object-fit: cover; }
.p .ini { position: absolute; inset: 0; display: grid; place-items: center; font: 300 clamp(36px, 5vw, 72px)/1 var(--display); color: rgba(255,255,255,.9); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card h3 { margin: 0 0 6px; font: 600 20px/1.3 var(--display); }
.card p { margin: 0; color: var(--muted); }
a.card { text-decoration: none; display: block; }
a.card:hover { border-color: var(--ink); }

.tile { border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; justify-content: space-between; min-height: 180px; }
.tile b { font: 600 clamp(40px, 4.4vw, 64px)/.95 var(--display); }
.tile.red { background: var(--red); color: #fff; }
.tile.sand { background: #E6DED1; }
.tile.teal { background: var(--t2); color: #fff; }

.chip { font: 600 15px var(--sans); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip span { font-size: 12px; color: var(--muted); margin-inline-start: 4px; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip[aria-pressed="true"] span { color: #BDB6AD; }

/* accordion */
details.qa { border-bottom: 1px solid var(--line); }
details.qa summary { cursor: pointer; list-style: none; padding: 20px 0; font: 600 20px/1.35 var(--display); display: flex; justify-content: space-between; gap: 16px; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; font: 300 30px/1 var(--display); color: var(--red); }
details.qa[open] summary::after { content: "−"; }
details.qa .a { padding: 0 0 22px; color: var(--muted); max-width: 68ch; }
details.qa .a > * + * { margin-top: .7em; }
details.qa .a p { margin: 0; }

/* time-based steps (agenda, first visit) */
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.steps li { display: grid; grid-template-columns: 140px 1fr; gap: 6px 24px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.steps time, .steps .n { font: 300 44px/1 var(--display); grid-row: span 2; }
.steps h3 { margin: 0; font: 600 22px/1.3 var(--display); }
.steps p { margin: 0; color: var(--muted); }

/* honest placeholder for content we do not have yet */
.pending { border: 2px dashed #C9C3BA; border-radius: var(--radius); padding: 24px; color: var(--muted); }
.pending .tag { display: inline-block; font-size: 12px; font-weight: 600; background: var(--soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }

/* red call-to-action band */
.cta-band { background: var(--red); color: #fff; padding: 88px 0; }
.cta-band .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: end; }
.cta-band h2 { font: 600 clamp(48px, 7vw, 104px)/.92 var(--display); margin: 0; letter-spacing: -.02em; }
.cta-band p { font-size: 20px; margin: 0 0 24px; max-width: 34ch; }

/* prev / next pager (guide) */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pager a { display: block; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; color: var(--muted); font-size: 14px; }
.pager b { font: 600 20px/1.3 var(--display); }
.pager .next { text-align: end; }

@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .sec-head, .page-hero.split .wrap, .cta-band .wrap { grid-template-columns: 1fr; gap: 20px; }
  .page-hero { padding: 36px 0 32px; }
  .steps li { grid-template-columns: 88px 1fr; }
  .steps time, .steps .n { font-size: 32px; }
  .pager { grid-template-columns: 1fr; }
  .prose { font-size: 18px; }
}

/* Photo carousel (.gal): a scroll-snapped row; each photo keeps its own proportions at one height.
   Markup lives in page content; public/shared/gallery.js wires the arrows. */
.gal { margin: 28px 0 8px; }
.gal-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: var(--radius); }
.gal-track::-webkit-scrollbar { display: none; }
.gal-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.gal-item { flex: none; margin: 0; scroll-snap-align: start; height: clamp(260px, 32vw, 440px); border-radius: var(--radius); overflow: hidden; background: #EEE9E4; }
.gal-item img { display: block; height: 100%; width: auto; max-width: none; object-fit: cover; }
.gal-nav { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.gal-nav button { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.gal-nav button:hover { border-color: var(--ink); }
.gal-nav button:disabled { opacity: .35; cursor: default; border-color: var(--line); }
.gal-cap { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
@media (max-width: 640px) { .gal-item { height: 280px; } .gal-nav { display: none; } }
@media print { .gal-nav { display: none; } }
.gal-fig { margin: 32px 0; }
.gal-fits .gal-nav { display: none; }
/* A single photo in a page or chapter: natural proportions, capped height */
.photo { margin: 32px 0; }
.photo img { display: block; max-width: 100%; width: auto; height: auto; max-height: min(560px, 75vh); border-radius: var(--radius); }
.photo.wide img { width: 100%; height: clamp(260px, 40vw, 520px); max-height: none; object-fit: cover; }
