/* Chabad Houses directory — Institutions playbook: one big image, type does the work, clean.
   Palette sampled off award winners: #2779A7 #ECD06F #F1EADA #181818 #DF4359 #DAE2E8 #BCBFB0 */
:root {
  --paper: #F1EADA; --paper-2: #E9E0CB; --ink: #181818; --ink-2: #4A4640;
  --blue: #2779A7; --blue-text: #1B5B80; --gold: #ECD06F; --red: #C8364B;
  --mist: #DAE2E8; --stone: #BCBFB0; --line: rgba(24,24,24,.14);
  --display: "Fraunces", "Frank Ruhl Libre", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --body: "Fraunces", "Frank Ruhl Libre", Georgia, serif;
  --max: 1240px; --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #181818; --paper-2: #222; --ink: #F1EADA; --ink-2: #BCB8AE; --blue-text: #7FBEE3; --line: rgba(241,234,218,.16); --stone: #6E7168; }
}
html[dir=rtl] { --display: "Frank Ruhl Libre", "Fraunces", serif; --body: "Frank Ruhl Libre", "Fraunces", serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; font-optical-sizing: auto; }
a { color: var(--blue-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.02; letter-spacing: -0.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 7vw, 6.5rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.25rem; }
.mono { font-family: var(--mono); font-size: .74rem; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); }
html[dir=rtl] .mono { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 58px; }
.brand { font-family: var(--display); font-size: 1.25rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.brand b { color: var(--blue); font-weight: 600; }
.nav { display: flex; gap: 18px; margin-inline-start: auto; align-items: center; }
.nav a { text-decoration: none; font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
html[dir=rtl] .nav a { text-transform: none; font-size: .85rem; }
.nav a:hover { color: var(--ink); }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; font-family: var(--mono); font-size: .74rem; text-transform: uppercase; color: var(--ink-2); }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; inset-inline-end: 0; top: 130%; margin: 0; padding: 8px 0; list-style: none; background: var(--paper); border: 1px solid var(--line); min-width: 150px; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.lang li a { display: block; padding: 6px 14px; text-transform: none; font-family: var(--body); font-size: .95rem; letter-spacing: 0; }
.lang li a[aria-current] { color: var(--blue); }

/* hero — home */
.hero { padding: clamp(48px, 9vw, 120px) 0 clamp(28px, 4vw, 48px); }
.hero .kicker { margin-bottom: 18px; }
.hero h1 { max-width: 14ch; }
.hero .lede { max-width: 42ch; font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--ink-2); margin: 24px 0 0; }
.search { margin-top: 36px; position: relative; max-width: 720px; }
.search input { width: 100%; font: inherit; font-size: 1.15rem; padding: 18px 20px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); }
.search input:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.search .near { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); border: 0; background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: .72rem; text-transform: uppercase; padding: 10px 14px; cursor: pointer; }
.search .near:hover { background: var(--blue); }
.results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); background: var(--paper); display: none; max-height: 420px; overflow: auto; }
.results[data-open] { display: block; }
.results li a { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 18px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.results li a:hover { background: var(--paper-2); }
.results .m { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); white-space: nowrap; }
.results .empty { padding: 14px 18px; color: var(--ink-2); }

/* stats strip */
.stats { display: flex; gap: clamp(24px, 5vw, 72px); flex-wrap: wrap; padding: 10px 0 36px; border-bottom: 1px solid var(--line); }
.stat b { font-family: var(--display); font-size: clamp(1.8rem, 3.6vw, 3rem); font-weight: 500; display: block; line-height: 1; }

/* map */
.map { height: min(68vh, 640px); background: var(--mist); margin: 32px 0 0; }
.map.small { height: 260px; margin: 0; }
.leaflet-container { font-family: var(--body); background: var(--mist); }
.leaflet-popup-content-wrapper { border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.leaflet-popup-content { margin: 12px 16px; font-size: .95rem; }
.leaflet-popup-content a { font-family: var(--display); font-size: 1.05rem; }
.leaflet-popup-tip { background: var(--paper); }
.marker-cluster { background: rgba(39,121,167,.35); border-radius: 50%; }
.marker-cluster div { background: var(--blue); color: #fff; border-radius: 50%; width: 32px; height: 32px; margin: 4px; display: grid; place-items: center; font-family: var(--mono); font-size: .75rem; }
.pin { width: 12px; height: 12px; background: var(--blue); border: 2px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 1px var(--blue); }
.pin.me { background: var(--red); box-shadow: 0 0 0 1px var(--red); }

/* state grid */
.section { padding: clamp(40px, 7vw, 96px) 0; }
.section > .wrap > h2 { margin-bottom: 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.grid a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 16px; border-bottom: 1px solid var(--line); border-inline-end: 1px solid var(--line); text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.2rem; transition: background .18s; }
.grid a:hover { background: var(--paper-2); }
.grid a .n { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); }

/* state page */
.state-hero { padding: clamp(40px, 7vw, 96px) 0 24px; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.crumbs a { text-decoration: none; }
.crumbs span::before { content: "/"; margin-inline-end: 10px; color: var(--stone); }
.cities { position: sticky; top: 58px; background: var(--paper); z-index: 5; border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; padding: 10px 0; scrollbar-width: none; }
.cities a { display: inline-block; margin-inline-end: 18px; text-decoration: none; }
.city { padding: 40px 0 8px; }
.city h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 12px; display: flex; gap: 14px; align-items: baseline; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); }
.list a { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 16px 0; text-decoration: none; color: var(--ink); }
.list a:hover .nm { color: var(--blue-text); }
.list .nm { font-family: var(--display); font-size: 1.2rem; }
.list .ad { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 720px) { .list a { grid-template-columns: 1fr; gap: 4px; } }

/* center page */
.c-hero { position: relative; min-height: 46vh; display: grid; align-items: end; background: var(--paper-2); overflow: hidden; }
.c-hero.has-img { min-height: min(72vh, 720px); color: #F1EADA; }
.c-hero.has-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.c-hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,10,10,.82) 0%, rgba(10,10,10,.35) 45%, rgba(10,10,10,.05) 100%); }
.c-hero .wrap { position: relative; z-index: 1; width: 100%; padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(28px, 4vw, 48px); }
.c-hero.has-img .mono, .c-hero.has-img .crumbs a { color: rgba(241,234,218,.8); }
.c-hero h1 { font-size: clamp(2.2rem, 6vw, 5.4rem); max-width: 16ch; }
.c-hero .type { display: inline-block; margin-top: 18px; padding: 6px 12px; border: 1px solid currentColor; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; }
html[dir=rtl] .c-hero .type { text-transform: none; }
.c-hero .credit { position: absolute; bottom: 10px; inset-inline-end: 12px; z-index: 1; font-family: var(--mono); font-size: .62rem; color: rgba(241,234,218,.55); }

.c-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: clamp(32px, 6vw, 96px); padding: clamp(40px, 6vw, 80px) 0; }
@media (max-width: 860px) { .c-body { grid-template-columns: 1fr; } }
.c-main > * + * { margin-top: 44px; }
.c-main .desc { font-size: clamp(1.1rem, 1.7vw, 1.35rem); line-height: 1.45; max-width: 48ch; }
.c-main h2 { font-size: 1.55rem; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 6px 12px; border: 1px solid var(--line); font-size: .92rem; background: color-mix(in srgb, var(--paper) 70%, var(--mist)); }
.group + .group { margin-top: 18px; }
.group h3 { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 8px; font-weight: 400; }
html[dir=rtl] .group h3 { text-transform: none; font-size: .82rem; }
.people { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.people li { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.people .nm { font-family: var(--display); font-size: 1.15rem; }
.people .nm.lead { color: var(--blue-text); }
.people .ps { color: var(--ink-2); font-size: .92rem; text-align: end; }
.depts { list-style: none; margin: 0; padding: 0; }
.depts li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }

/* mined from the center's own site */
.about p { font-size: 1.08rem; line-height: 1.55; max-width: 60ch; margin: 0 0 14px; }
.credit { margin-top: 8px !important; }
.credit a { text-decoration: none; }
.times { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-width: 60ch; font-family: var(--mono); font-size: .86rem; }
.times li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.gallery .strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; aspect-ratio: 4/3; overflow: hidden; background: var(--paper-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: no-preference) { .gallery figure:hover img { transform: scale(1.04); } }

.card { border: 1px solid var(--ink); padding: 22px 24px; position: sticky; top: 80px; }
.card h2 { font-size: 1.05rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; font-weight: 400; color: var(--ink-2); margin-bottom: 16px; }
html[dir=rtl] .card h2 { text-transform: none; }
.card dl { margin: 0; }
.card dt { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; color: var(--ink-2); margin-top: 14px; }
html[dir=rtl] .card dt { text-transform: none; font-size: .78rem; }
.card dd { margin: 2px 0 0; font-size: 1.02rem; }
.card .phone { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .02em; }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn { display: inline-block; padding: 11px 16px; text-decoration: none; font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; border: 1px solid var(--ink); color: var(--ink); background: transparent; transition: background .18s, color .18s; }
html[dir=rtl] .btn { text-transform: none; font-size: .85rem; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #181818; }
.btn.gold:hover { background: #181818; border-color: #181818; color: var(--gold); }
.socials { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.socials a { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; }
.card .map.small { margin-top: 20px; }

.nearby { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line); }
.nearby h2 { margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cards a { display: block; padding: 18px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .18s; }
.cards a:hover { border-color: var(--ink); }
.cards .nm { font-family: var(--display); font-size: 1.15rem; display: block; margin-bottom: 6px; }
.cards .m { display: block; }

/* claim block — the product */
.claim { background: #181818; color: #F1EADA; padding: clamp(56px, 9vw, 120px) 0; }
.claim .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
@media (max-width: 860px) { .claim .wrap { grid-template-columns: 1fr; } }
.claim .mono { color: var(--gold); }
.claim h2 { font-size: clamp(2rem, 5vw, 4rem); margin-top: 12px; }
.claim p { font-size: 1.1rem; color: rgba(241,234,218,.78); max-width: 46ch; margin: 0 0 22px; }

/* footer */
.foot { padding: 40px 0 56px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; }
.foot .wrap { display: grid; gap: 8px; }
.foot .brand { font-size: 1rem; }

/* accent — thin, gold, sparingly. Small in area, loud in colour. */
.top::before { content: ""; display: block; height: 4px; background: var(--gold); }
.hero .kicker, .state-hero .crumbs, .c-hero .crumbs { position: relative; padding-top: 14px; }
.hero .kicker::before, .state-hero .crumbs::before, .c-hero .crumbs::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 44px; height: 3px; background: var(--gold); }
.c-main h2, .section > .wrap > h2, .nearby h2 { position: relative; padding-top: 12px; }
.c-main h2::before, .section > .wrap > h2::before, .nearby h2::before { content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 28px; height: 3px; background: var(--gold); }
.stat b { display: inline-block; border-bottom: 3px solid var(--gold); padding-bottom: 4px; }
.c-hero .type { border-color: var(--gold); color: inherit; }
.c-hero.has-img .type { background: var(--gold); color: #181818; border-color: var(--gold); }
.card { border-top: 4px solid var(--gold); }
.claim { border-top: 4px solid var(--gold); }
.list a:hover, .cards a:hover, .grid a:hover { box-shadow: inset 4px 0 0 var(--gold); }
html[dir=rtl] .list a:hover, html[dir=rtl] .cards a:hover, html[dir=rtl] .grid a:hover { box-shadow: inset -4px 0 0 var(--gold); }
.list a:hover { padding-inline-start: 12px; }
.list a { transition: padding .18s, box-shadow .18s; }
a:hover { text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
::selection { background: var(--gold); color: #181818; }

/* motion — scroll-driven reveal, cut entirely under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: rise both linear; animation-timeline: view(); animation-range: entry 0% entry 40%; }
    @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  }
  .c-hero.has-img img { animation: settle 1.6s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes settle { from { transform: scale(1.05); } to { transform: none; } }
}
