/* =========================================================
   Yeshiva of Far Rockaway
   ========================================================= */

:root {
  --navy:        #15203f;
  --navy-800:    #1c2b52;
  --navy-700:    #26386a;
  --navy-100:    #e8ecf5;
  --maroon:      #7c1d24;
  --maroon-600:  #9a2830;
  --gold:        #b8912f;
  --gold-400:    #c9a961;
  --gold-100:    #f5eeda;
  --cream:       #fbf9f5;
  --paper:       #ffffff;
  --ink:         #1a1d23;
  --muted:       #5a6272;
  --line:        #e3e1da;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1180px;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(21, 32, 63, .06), 0 2px 8px rgba(21, 32, 63, .05);
  --shadow-md: 0 4px 14px rgba(21, 32, 63, .10), 0 12px 32px rgba(21, 32, 63, .08);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy-700); text-decoration-color: rgba(38,56,106,.35); text-underline-offset: 3px; }
a:hover { color: var(--maroon-600); text-decoration-color: currentColor; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.18; color: var(--navy); margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem); }
h2 { font-size: clamp(1.65rem, 1.3rem + 1.6vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.55rem); }
h4 { font-size: 1.12rem; }
p  { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2.5rem, 820px); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: .8rem 1.2rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { width: 218px; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .7rem; cursor: pointer; color: var(--navy); font: inherit; font-size: .95rem; align-items: center; gap: .5rem;
}
.nav-toggle svg { width: 20px; height: 20px; }

.nav > ul { list-style: none; display: flex; align-items: center; gap: .35rem; margin: 0; padding: 0; }
.nav a {
  display: block; padding: .55rem .8rem; border-radius: 7px;
  font-size: .95rem; font-weight: 500; color: var(--navy); text-decoration: none;
  white-space: nowrap; transition: background .15s, color .15s;
}
.nav a:hover, .nav a:focus-visible { background: var(--navy-100); color: var(--navy); }
.nav .current > a { color: var(--maroon); box-shadow: inset 0 -2px 0 var(--gold); }

.has-sub { position: relative; }
.has-sub > a::after { content: ""; display: inline-block; width: .38em; height: .38em; margin-left: .5em; vertical-align: .16em; border-right: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; transform: rotate(45deg); opacity: .65; }
.sub {
  list-style: none; margin: 0; padding: .4rem;
  position: absolute; top: calc(100% + .3rem); left: 0; min-width: 220px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s;
}
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: translateY(0); }
.sub a { font-weight: 400; font-size: .93rem; }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    max-height: calc(100vh - 100%); overflow-y: auto; display: none;
  }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: .6rem 1.25rem 1.1rem; }
  .nav > ul > li { border-bottom: 1px solid var(--line); }
  .nav > ul > li:last-child { border-bottom: 0; }
  .nav a { padding: .8rem .2rem; }
  .has-sub > a::after { display: none; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 .5rem .9rem; min-width: 0; background: transparent; }
  .sub a { padding: .5rem .2rem; color: var(--muted); }
  .brand img { width: 180px; }
}

/* ---------- Page header ---------- */
.page-head { background: var(--navy); color: #fff; padding: clamp(2.5rem, 5vw, 4.2rem) 0; position: relative; }
.page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--gold) 0%, var(--gold-400) 45%, var(--maroon) 100%); }
.page-head h1 { color: #fff; margin: 0; }
.page-head p { color: rgba(255,255,255,.82); margin: .7rem 0 0; font-size: 1.08rem; max-width: 62ch; }
.eyebrow { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-400); margin: 0 0 .7rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.6rem, 5vw, 4.5rem) 0; }
.section-tight { padding: clamp(1.8rem, 3vw, 2.6rem) 0; }
.section-alt { background: var(--paper); border-block: 1px solid var(--line); }
.section-navy { background: var(--navy); color: rgba(255,255,255,.88); }
.section-navy h2, .section-navy h3 { color: #fff; }

.section-title { text-align: center; margin-bottom: 2.2rem; }
.section-title h2 { margin-bottom: .3rem; }
.section-title p { color: var(--muted); margin: 0; }
.section-navy .section-title p { color: rgba(255,255,255,.7); }

.rule { width: 62px; height: 3px; background: var(--gold); border: 0; border-radius: 2px; margin: 0 0 1.4rem; }
.section-title .rule { margin-inline: auto; }

/* ---------- Hero ---------- */
.hero { background: var(--paper); border-bottom: 1px solid var(--line); }
.hero-banner { display: block; }
.hero-banner img { width: 100%; }
.hero-intro { padding: clamp(2.2rem, 4vw, 3.4rem) 0; }
.hero-intro .lead { font-family: var(--serif); font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.85rem); line-height: 1.45; color: var(--navy); margin: 0 auto; max-width: 46ch; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .78rem 1.5rem; border-radius: 8px; border: 1.5px solid transparent;
  font-family: var(--sans); font-size: .96rem; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer; transition: background .16s, color .16s, border-color .16s, transform .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-600); color: #fff; }
.btn-gold { background: var(--gold); color: #201a05; }
.btn-gold:hover { background: var(--gold-400); color: #201a05; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-ghost-light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-ghost-light:hover { background: #fff; color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }
.btn-row.center { justify-content: center; }
/* Not wired up yet — reads as a real button but clearly not clickable */
.btn.is-disabled { background: #d9d4c6; color: #6f6a5c; cursor: default; pointer-events: none; }
.btn.is-disabled:hover { transform: none; }

/* ---------- Sponsor a day of learning ---------- */
.sponsor {
  display: grid; grid-template-columns: 1fr auto; gap: 2rem 2.6rem; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 2rem 2.2rem; box-shadow: var(--shadow-sm);
}
.sponsor h2 { margin-bottom: .35rem; }
.sponsor p { margin: 0; color: var(--muted); max-width: 62ch; }
.sponsor-action { display: grid; justify-items: center; gap: .55rem; }
.sponsor .soon {
  font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
@media (max-width: 820px) {
  .sponsor { grid-template-columns: 1fr; padding: 1.7rem 1.5rem; }
  .sponsor-action { justify-items: start; }
}

/* ---------- Grid + cards ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm); transition: box-shadow .18s, transform .18s, border-color .18s;
}
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--gold-400); color: inherit; }
.card-icon { width: 42px; height: 42px; border-radius: 9px; background: var(--gold-100); color: var(--maroon); display: grid; place-items: center; margin-bottom: 1rem; }
.card-icon svg { width: 22px; height: 22px; }
.card-more { display: inline-flex; align-items: center; gap: .4rem; margin-top: .9rem; font-weight: 600; font-size: .9rem; color: var(--maroon); }
a.card:hover .card-more { gap: .65rem; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.gallery img { border-radius: var(--radius); aspect-ratio: 3/2; object-fit: cover; width: 100%; box-shadow: var(--shadow-sm); }

/* ---------- Faculty ---------- */
.faculty-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1.6rem 1.3rem; }
.faculty-grid.leadership { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); max-width: 880px; margin-inline: auto; }
.person { text-align: center; }
.person img {
  width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 22%;
  /* Some source portraits are transparent cut-outs, others have white baked in —
     a white plate makes the whole grid read consistently. */
  border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.person h3 { font-size: 1.13rem; margin: .95rem 0 .15rem; }
.person .role { font-size: .92rem; color: var(--muted); margin: 0; line-height: 1.45; }
.person .alum {
  display: inline-block; margin-top: .5rem; padding: .18rem .55rem; border-radius: 999px;
  background: var(--gold-100); color: #6b5410; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.person.memorial img { filter: grayscale(1); }
.person.memorial { padding-bottom: .3rem; }

/* ---------- Doc / link lists ---------- */
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
/* Long document lists read better in two columns — wide screens only, since a
   430px minimum would force horizontal scroll on a phone. */
@media (min-width: 940px) {
  .doc-list-2col { grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: .5rem .9rem; }
}
.doc-list a {
  display: flex; align-items: center; gap: .85rem; padding: .85rem 1.1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; color: var(--ink); font-size: .97rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
.doc-list a:hover { border-color: var(--gold-400); box-shadow: var(--shadow-sm); color: var(--navy); }
.doc-list svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--maroon); }
.doc-list .ext { margin-left: auto; font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc-list a.unavailable { opacity: .62; cursor: not-allowed; background: #f4f2ee; }
.doc-list a.unavailable:hover { border-color: var(--line); box-shadow: none; }

.col-2 { columns: 2; column-gap: 2.2rem; }
@media (max-width: 720px) { .col-2 { columns: 1; } }

/* ---------- Video ---------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.8rem; }
.video figure { margin: 0; }
.video .frame { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-sm); }
.video .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { margin-top: .8rem; }
.video figcaption strong { display: block; font-family: var(--serif); font-size: 1.2rem; color: var(--navy); font-weight: 600; }
.video figcaption span { font-size: .9rem; color: var(--muted); }

/* ---------- Audio ---------- */
.audio-list { display: grid; gap: 1.1rem; }
.audio-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; box-shadow: var(--shadow-sm); }
.audio-item h3 { font-size: 1.18rem; margin-bottom: .2rem; }
.audio-item .meta { font-size: .87rem; color: var(--muted); margin: 0 0 .85rem; }
.audio-item audio { width: 100%; height: 40px; }
.audio-item.missing { background: #f4f2ee; }
.notice-inline { font-size: .88rem; color: var(--muted); background: var(--gold-100); border-left: 3px solid var(--gold); padding: .6rem .9rem; border-radius: 0 6px 6px 0; margin: 0; }

/* ---------- Calendar ---------- */
.calendar { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.cal-row { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; justify-content: space-between; align-items: baseline; padding: .95rem 1.3rem; border-bottom: 1px solid var(--line); }
.cal-row:last-child { border-bottom: 0; }
.cal-row.is-break { background: #fbfaf7; }
.cal-row dt { font-weight: 600; color: var(--navy); margin: 0; }
.cal-row dd { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .96rem; }

/* ---------- Prose ---------- */
.prose { font-size: 1.06rem; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.7rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose em { color: var(--navy-700); font-style: italic; }
.prose blockquote { margin: 1.6rem 0; padding: .2rem 0 .2rem 1.4rem; border-left: 3px solid var(--gold); font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; color: var(--navy); }

.callout { background: var(--gold-100); border: 1px solid #e8dcb8; border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 1.8rem 0; }
.callout :last-child { margin-bottom: 0; }
.callout h3 { margin-top: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 1.05rem; }
.field label { display: block; font-size: .89rem; font-weight: 600; color: var(--navy); margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%; padding: .72rem .9rem; font: inherit; font-size: .97rem; color: var(--ink);
  background: var(--paper); border: 1px solid #cdd3df; border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(38,56,106,.13); }
.field textarea { min-height: 145px; resize: vertical; }
.req { color: var(--maroon); }
.form-note { font-size: .85rem; color: var(--muted); }

/* Forms sitting on the navy band need light labels */
.section-navy .field label { color: rgba(255,255,255,.92); }
.section-navy .req { color: var(--gold-400); }
.section-navy .field input,
.section-navy .field select,
.section-navy .field textarea { border-color: rgba(255,255,255,.25); }
.section-navy .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,145,47,.3); }

.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.3rem; }
.info-list li { display: flex; gap: .95rem; align-items: flex-start; }
.info-list svg { width: 21px; height: 21px; color: var(--maroon); flex-shrink: 0; margin-top: .22rem; }
.info-list strong { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: .12rem; }
.info-list a { color: var(--navy-700); font-weight: 500; }

.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); line-height: 0; }
.map-embed iframe { width: 100%; height: 380px; border: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,.72); padding: 3.2rem 0 0; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.6rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand img { width: 210px; background: #fff; padding: .55rem .7rem; border-radius: 8px; }
.footer-brand p { margin: 1.1rem 0 0; line-height: 1.65; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .79rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; margin: 0 0 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.site-footer a { color: rgba(255,255,255,.76); text-decoration: none; }
.site-footer a:hover { color: var(--gold-400); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding: 1.4rem 0; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; justify-content: space-between; font-size: .86rem; color: rgba(255,255,255,.55); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.flyer { width: 100%; max-width: 720px; margin-inline: auto; border-radius: var(--radius); box-shadow: var(--shadow-md); }

/* Embedded PDF: iframes don't render PDFs on iOS, so always pair with a link. */
.pdf-embed { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: var(--paper); }
.pdf-embed iframe { display: block; width: 100%; height: min(78vh, 820px); border: 0; }
@media (max-width: 820px) { .pdf-embed { display: none; } }
.pdf-fallback { display: none; }
@media (max-width: 820px) { .pdf-fallback { display: block; } }
