/* Ben Russell — site styles. Palette taken from the logo: the indigo of "Ben Russell",
   the green of "Student Rabbi", and the willow's run from green through gold to magenta.
   Green does the structural work (labels, rules, active nav); --gold (the willow's amber,
   deepened for reading) does links and emphasis. */
:root {
  --paper: #fdfcf9; --panel: #f4f2f8; --ink: #22195c; --ink-soft: #5b5878;
  --rule: #e4e1ec; --gold: #a65208; --green: #0e7c3a;
  --bar: #ffffff; --bar-ink: #22195c;
  --willow: linear-gradient(90deg, #2f9a45 0%, #17a097 20%, #e9b525 45%, #f07d1d 65%, #e2402b 82%, #c4357f 100%);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Literata", Georgia, serif;
  --font-util: "Karla", "Helvetica Neue", Arial, sans-serif;
  --font-heb: "Frank Ruhl Libre", "Times New Roman", serif;
  --measure: 34rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #110e24; --panel: #1a1633; --ink: #ecebf7; --ink-soft: #a6a3c4;
    --rule: #2a2648; --gold: #f2b54a; --green: #4fcf82;
    --bar: #0c0a1c; --bar-ink: #ecebf7; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #110e24; --panel: #1a1633; --ink: #ecebf7; --ink-soft: #a6a3c4;
  --rule: #2a2648; --gold: #f2b54a; --green: #4fcf82;
  --bar: #0c0a1c; --bar-ink: #ecebf7; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.68;
  -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.wrap { max-width: 46rem; margin: 0 auto; padding-inline: 1.5rem; }
@media (max-width: 30rem) { .wrap { padding-inline: 1rem; } }

/* ---- shared site bar (also injected into the course app) ---- */
.srb-sitebar { background: var(--bar); color: var(--bar-ink);
  padding-top: env(safe-area-inset-top, 0px); }
.srb-sitebar::after { content: ""; display: block; height: 4px; background: var(--willow); }
.srb-sitebar-inner { max-width: 46rem; margin: 0 auto; padding: .9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
@media (max-width: 30rem) { .srb-sitebar-inner { padding-inline: 1rem; } }
.srb-logo { display: block; line-height: 0; }
.srb-logo img { display: block; height: 104px; width: auto; max-width: 100%; }
@media (max-width: 30rem) { .srb-logo img { height: auto; width: 20rem; } }
.srb-sitebar nav ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0;
  font-family: var(--font-util); font-size: .74rem; letter-spacing: .15em; text-transform: uppercase; }
.srb-sitebar nav a { color: var(--ink-soft); text-decoration: none; padding-block: .2rem;
  border-bottom: 2px solid transparent; display: inline-block; }
.srb-sitebar nav a:hover { color: var(--gold); }
.srb-sitebar nav a[aria-current="page"] { color: var(--bar-ink); border-bottom-color: var(--green); }

/* ---- page furniture ---- */
.view { padding-block: 3.25rem 4.5rem; }
.eyebrow { font-family: var(--font-util); font-size: .72rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--green); margin: 0 0 1.25rem; }
h1 { font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.5rem, 8vw, 3.75rem); line-height: 1.04; letter-spacing: -.02em;
  margin: 0; text-wrap: balance; }
h1.section { font-size: clamp(1.9rem, 5.5vw, 2.5rem); line-height: 1.12; margin: 0 0 1.4rem; }
.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.3rem; }
.lede { font-size: 1.18rem; line-height: 1.6; }
.hebrew { font-family: var(--font-heb); direction: rtl; unicode-bidi: isolate;
  font-size: 2rem; line-height: 1.4; color: var(--gold); margin: 1.5rem 0; }
.subhead { font-family: var(--font-util); font-size: .76rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); margin: 2.5rem 0 1rem; font-weight: 600; }
hr.break { border: none; height: 2px; background: var(--willow); margin: 2.6rem 0; opacity: .85; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0,1fr) 14rem; gap: 2.5rem; align-items: center; }
@media (max-width: 44rem) { .hero { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero .mark { order: -1; max-width: 12rem; } }
.mark { width: 100%; border-radius: 4px; }
.intro { margin-top: 2.5rem; max-width: var(--measure); }
.intro p { margin: 0 0 1.2rem; }
.intro .welcome { font-family: var(--font-display); font-size: 1.2rem; color: var(--gold);
  margin-top: 1.6rem; }
.latest { margin-top: 3rem; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.latest h2 { font-family: var(--font-util); font-size: .72rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--green); margin: 0 0 1rem; font-weight: 600; }
.latest ul { list-style: none; margin: 0; padding: 0; }
.latest li + li { border-top: 1px solid var(--rule); }
.latest a { display: flex; gap: 1.1rem; align-items: baseline; padding-block: .7rem;
  text-decoration: none; color: var(--ink); }
.latest a:hover .latest-title { color: var(--gold); }
.latest-date { font-family: var(--font-util); font-size: .75rem; color: var(--ink-soft);
  min-width: 4.2rem; font-variant-numeric: tabular-nums; }
.latest-title { font-family: var(--font-display); font-size: 1.1rem; }
.more { display: inline-block; margin-top: 1.2rem; font-family: var(--font-util);
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }

/* about */
.portrait { float: right; width: 15rem; margin: .35rem 0 1.5rem 2rem; border-radius: 3px; }
@media (max-width: 40rem) { .portrait { float: none; width: 100%; max-width: 20rem;
  margin: 0 0 1.75rem; } }
.contact { margin-top: 2.75rem; padding-top: 1.6rem; border-top: 1px solid var(--rule); }
.contact .subhead { margin-top: 0; }
.contact p { margin: 0 0 .5rem; }
.phone { font-family: var(--font-display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.phone a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--rule); }
.phone a:hover { border-bottom-color: var(--gold); }
.email { font-family: var(--font-util); font-size: 1rem; margin-top: .6rem; word-break: break-word; }
.email a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.email a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* writings */
.count { font-family: var(--font-util); font-size: .92rem; color: var(--ink-soft);
  max-width: var(--measure); margin: 0 0 2rem; }
.year { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: .1em;
  color: var(--green); margin: 2.5rem 0 .4rem; padding-bottom: .45rem;
  border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.year:first-of-type { margin-top: 0; }
ol.pieces { list-style: none; margin: 0; padding: 0; }
.piece { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; padding-block: 1.35rem;
  border-bottom: 1px solid var(--rule); }
@media (max-width: 34rem) { .piece { grid-template-columns: 1fr; gap: .3rem; } }
.piece-meta { font-family: var(--font-util); font-size: .76rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; display: flex; gap: .55rem; align-items: baseline; min-width: 0; }
.piece-no { color: var(--green); }
.piece-body { min-width: 0; }
.piece-body h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem;
  line-height: 1.25; margin: 0 0 .3rem; }
.piece-body h3 a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.piece-body h3 a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.occasion { display: block; font-family: var(--font-util); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--green); margin-bottom: .35rem; }
.piece-body p { margin: 0; color: var(--ink-soft); font-size: .96rem; line-height: 1.58; }

.site-foot { border-top: 1px solid var(--rule); padding-block: 2rem 3.5rem;
  font-family: var(--font-util); font-size: .78rem; letter-spacing: .1em; color: var(--ink-soft); }

/* ---- pictures ----
   Every picture spot is a fixed shape. The picture is cropped to fit, never stretched.
   A spot whose file is not there yet shows its file name and size. */
.art { position: relative; margin: .4rem 0 1.25rem; border-radius: 3px; overflow: hidden;
  background: var(--panel); }
.art::before { content: attr(data-slot); position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; text-align: center; padding: 1rem;
  border: 1px dashed var(--ink-soft); border-radius: 3px; font-family: var(--font-util);
  font-size: .74rem; letter-spacing: .08em; line-height: 1.5; color: var(--ink-soft); }
.art-img { position: absolute; inset: 0; z-index: 1; background-position: center; background-size: cover;
  background-repeat: no-repeat; }
.art.square { aspect-ratio: 1 / 1; }
.art.wide { aspect-ratio: 2 / 1; }
.art.tall { aspect-ratio: 4 / 5; }
.art.band { aspect-ratio: 3 / 1; margin: 2.5rem 0 0; border-radius: 4px; }
.art.right { float: right; margin-left: 1.75rem; }
.art.left { float: left; margin-right: 1.75rem; }
.art.right.wide, .art.left.wide { width: 18rem; }
.art.right.square, .art.left.square, .art.right.tall, .art.left.tall { width: 12rem; }
.hero .art { margin: 0; width: 100%; }
.prose .subhead, .prose hr.break, .contact { clear: both; }
@media (max-width: 44rem) { .hero .art { order: -1; max-width: 12rem; } }
@media (max-width: 40rem) {
  .portrait { max-width: none; }
  .art.right.wide, .art.left.wide { float: none; width: 100%; margin: 0 0 1.5rem; }
  .art.right.square, .art.right.tall { width: 40%; margin-left: 1rem; }
  .art.left.square, .art.left.tall { width: 40%; margin-right: 1rem; }
}

/* ==== Full-window layout (Oct 4, 6 PM) ====
   Ben: text and pictures move with the size of the browser and fill the window; no skinny
   column with wide empty margins; reflow for whatever device is looking. Type grows a little
   with the window, the side padding scales, and wide screens set things side by side. */
html { font-size: clamp(100%, 0.82rem + 0.32vw, 125%); }
:root { --gutter: clamp(1rem, 4.5vw, 6rem); --measure: 68ch; }
.wrap, .srb-sitebar-inner { max-width: 110rem; padding-inline: var(--gutter); }
.srb-logo img { height: clamp(5rem, 3.6rem + 2.4vw, 7rem); }
h1 { font-size: clamp(2.5rem, 1.6rem + 4.2vw, 6.5rem); }
h1.section { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3.6rem); }

/* pictures that text wraps around grow with the column */
.art.right.wide, .art.left.wide { width: min(46%, 34rem); }
.art.right.square, .art.left.square { width: min(34%, 22rem); }
.art.right.tall, .art.left.tall { width: min(30%, 20rem); }
.art.band { max-height: 72vh; }

/* Home: name and picture; band; then intro, Most recent and a picture side by side */
.hero { grid-template-columns: minmax(0, 1fr) clamp(12rem, 30vw, 28rem); }
.home-lower { display: grid; gap: 2.5rem clamp(2rem, 4vw, 5rem); margin-top: 3rem; align-items: start; }
.home-lower .intro, .home-lower .latest { margin-top: 0; max-width: none; }
.home-recent { margin: 0; aspect-ratio: 2 / 1; }
@media (min-width: 760px) {
  .home-lower { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .home-recent { grid-column: 2; aspect-ratio: 4 / 5; }
}
@media (min-width: 1200px) {
  .home-lower { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .75fr); }
  .home-recent { grid-column: 3; grid-row: 1; }
}

/* About: on tablets the portrait floats; on wide screens it sits in a side column,
   with "Get in touch" below it, staying in view while the page scrolls */
.about .portrait { width: min(40%, 22rem); }
.about .prose { max-width: none; }
@media (min-width: 1000px) {
  .about { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(16rem, 1fr);
    grid-template-areas: "main portrait" "main contact"; grid-template-rows: auto 1fr;
    column-gap: clamp(2.5rem, 4vw, 5rem); align-items: start; }
  .about .portrait { grid-area: portrait; float: none; width: 100%; margin: .35rem 0 0; }
  .about .prose { grid-area: main; max-width: none; }
  .about .contact { grid-area: contact; position: sticky; top: 1.5rem; }
}

/* Writings: title beside the introduction, and the pieces in columns */
@media (min-width: 900px) {
  main:has(> ol.pieces) { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    column-gap: clamp(2rem, 5vw, 6rem); align-items: end; }
  main:has(> ol.pieces) > * { grid-column: 1 / -1; }
  main:has(> ol.pieces) > .eyebrow { grid-column: 1; grid-row: 1; }
  main:has(> ol.pieces) > h1 { grid-column: 1; grid-row: 2; }
  main:has(> ol.pieces) > .count { grid-column: 2; grid-row: 1 / span 2; max-width: 70ch; margin: 0 0 1.4rem; }
}
ol.pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  column-gap: clamp(1.5rem, 3vw, 3rem); }
.piece { grid-template-columns: 1fr; gap: .35rem; }

/* Courses: banner with the midrash, then one card per course */
.courses-banner { display: grid; margin: 0 0 3rem; border-radius: 4px; overflow: hidden;
  background: #16113d; color: #f1effa; }
.courses-banner .art { margin: 0; border-radius: 0; aspect-ratio: 16 / 10; }
.courses-banner blockquote { margin: 0; padding: clamp(1.4rem, 3vw, 3.5rem); display: flex;
  flex-direction: column; justify-content: center; }
.courses-banner blockquote p { font-family: var(--font-display); font-size: clamp(1.25rem, .9rem + 1.3vw, 2.2rem);
  line-height: 1.35; margin: 0 0 1rem; }
.courses-banner cite { font-family: var(--font-util); font-style: normal; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: #e9b525; }
@media (min-width: 900px) {
  .courses-banner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .courses-banner .art { aspect-ratio: auto; min-height: 22rem; }
}
.course-list { display: grid; gap: clamp(1.5rem, 3vw, 3rem); margin-top: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); }
.course-card { display: grid; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
  background: var(--paper); }
.course-card .art { margin: 0; border-radius: 0; }
.course-card .body { padding: clamp(1.25rem, 2.5vw, 2.5rem); }
.course-card h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.4rem);
  line-height: 1.15; margin: 0 0 .5rem; text-wrap: balance; }
.course-card .facts { font-family: var(--font-util); font-size: .82rem; letter-spacing: .06em;
  color: var(--green); margin: 0 0 1rem; }
.course-card p { margin: 0 0 1.3rem; max-width: 65ch; }
.course-card .open { display: inline-block; font-family: var(--font-util); font-weight: 600; font-size: .88rem;
  letter-spacing: .04em; text-decoration: none; color: var(--paper); background: var(--ink);
  padding: .85rem 1.35rem; border-radius: 3px; }
.course-card .open:hover { background: var(--gold); }
@media (min-width: 900px) {
  .course-list > .course-card:only-child { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center; }
  .course-list > .course-card:only-child .art { aspect-ratio: auto; height: 100%; min-height: 22rem; }
}

/* phones (kept last so they win) */
@media (max-width: 40rem) {
  .art.right.wide, .art.left.wide { float: none; width: 100%; margin: 0 0 1.5rem; }
  .art.right.square, .art.right.tall, .art.left.square, .art.left.tall { width: 40%; }
  .about .portrait { float: none; width: 100%; max-width: none; margin: 0 0 1.75rem; }
}
@media (max-width: 30rem) { .srb-logo img { height: auto; width: 20rem; } }

/* footer: Instagram on every page; contact: Instagram under the email addresses */
.foot-row { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem 1.5rem; flex-wrap: wrap; }
.foot-row a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot-row a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.email + .email { margin-top: .2rem; }
.social { font-family: var(--font-util); font-size: 1rem; margin-top: .6rem; }
.social a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.social a:hover { border-bottom-color: var(--gold); }
.book { margin-top: 1.2rem; }
.book a { display: inline-block; font-family: var(--font-util); font-weight: 600; font-size: .9rem;
  letter-spacing: .04em; text-decoration: none; color: var(--paper); background: var(--green);
  padding: .8rem 1.3rem; border-radius: 3px; }
.book a:hover { background: var(--gold); }

/* ---- quotes (Oct 4, 7 PM): Ben's words, live text, credited to the piece they come from ---- */
.quote { margin: 0; --qs: clamp(1.15rem, .95rem + .8vw, 1.6rem); }
/* Style D, Ben's pick (Oct 4, 7:15 PM): large double marks at both ends, the same color as the words;
   the credit line in the softer ink. Two colors only. */
.quote blockquote { position: relative; margin: 0; padding-left: 1.15em; font-family: var(--font-display);
  font-weight: 400; font-size: var(--qs); line-height: 1.38; color: var(--ink);
  text-wrap: pretty; }
.quote blockquote::before { content: "\201C"; position: absolute; left: 0; top: -.18em;
  font-size: 2.3em; line-height: 1; color: inherit; }
.quote blockquote::after { content: "\201D"; font-size: 2.3em; line-height: 0; vertical-align: -.4em;
  margin-left: .06em; color: inherit; }
.quote figcaption { margin: .75rem 0 0 calc(1.15 * var(--qs)); font-family: var(--font-util); font-size: .78rem;
  letter-spacing: .03em; color: var(--ink-soft); }
.quote figcaption cite { font-style: italic; }
.quote figcaption a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
.quote figcaption a:hover { color: var(--ink); border-bottom-color: var(--ink-soft); }

/* Home: under your name */
.quote-hero { margin-top: clamp(1.25rem, 2.5vw, 2.25rem); max-width: 38rem; }
.quote-hero { --qs: clamp(1.2rem, .9rem + 1.3vw, 2.1rem); }

/* About: in the side column under Get in touch; on phones and tablets, after it */
.about-quotes { display: grid; gap: 2.25rem; margin-top: 2.5rem; clear: both; }
@media (min-width: 1000px) {
  .about { grid-template-areas: "main portrait" "main contact" "main quotes"; grid-template-rows: auto auto 1fr; }
  .about .contact { position: static; }
  .about-quotes { grid-area: quotes; position: sticky; top: 1.5rem; margin-top: 2.75rem; }
}

/* Writings and Courses: beside the introduction */
.quote-intro { margin: 0 0 2rem; max-width: 40rem; }
@media (min-width: 1200px) {
  main:has(> ol.pieces) { grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, 1fr); }
  main:has(> ol.pieces) > .quote-intro { grid-column: 3; grid-row: 1 / span 2; margin: 0 0 1.4rem; align-self: end; }
}
@media (min-width: 900px) {
  main:has(> .course-list) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(2rem, 5vw, 6rem); align-items: end; }
  main:has(> .course-list) > * { grid-column: 1 / -1; }
  main:has(> .course-list) > .eyebrow, main:has(> .course-list) > h1, main:has(> .course-list) > .count { grid-column: 1; }
  main:has(> .course-list) > .quote-intro { grid-column: 2; grid-row: 2 / span 3; margin: 0 0 1.4rem; }
}

/* Writings: the last spot of each year's grid */
.piece-quote { align-content: center; }
.piece-quote .quote { --qs: clamp(1.1rem, .95rem + .6vw, 1.4rem); }

/* Footer, between your name and Instagram */
.quote-foot { flex: 1 1 22rem; max-width: 36rem; }
.quote-foot { --qs: 1rem; }
.quote-foot blockquote { letter-spacing: 0; }
.quote-foot figcaption { font-size: .7rem; letter-spacing: .04em; }
/* phones: picture and name side by side, the quote full width under them */
@media (max-width: 44rem) {
  .hero { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem 1.25rem; align-items: center; }
  .hero > div { display: contents; }
  .hero .art { order: 0; grid-column: 1; grid-row: 1; max-width: none; }
  .hero h1 { grid-column: 2; grid-row: 1; }
  .hero .quote-hero { grid-column: 1 / -1; grid-row: 2; margin-top: .75rem; }
}

/* Courses (Oct 7): three courses fill one row on wide screens */
@media (min-width: 1100px) { .course-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Home (Oct 7): the logo already carries Ben's name, so the page title is kept for screen readers
   and search engines but not shown; the quote takes its place beside the tree */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero .quote-hero { margin-top: 0; }
@media (max-width: 44rem) {
  .hero { grid-template-columns: 7rem minmax(0, 1fr); align-items: start; }
  .hero .quote-hero { grid-column: 2; grid-row: 1; margin-top: 0; }
}
@media (min-width: 44.01rem) { .quote-hero { --qs: clamp(1.5rem, .8rem + 2vw, 2.75rem); max-width: 40rem; } }
