/* Jewish Lake City, direction "Daylight". Plain CSS, no build step.
   Type: Literata (display and text), IBM Plex Sans (labels, captions).
   Order: name; the words (headline, welcome, contact) and the portrait; the parent line.
   Phone: words then portrait, one column. Computer (860px and up): portrait on the left, words on the right. */

:root {
  --paper: #faf9f6;
  --ink: #1d1b17;
  --text: #2b2823;
  --muted: #625c53;
  --rule: #d8d3c9;
  --link: #214a3a;
  --serif: Literata, "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 4vw, 48px);
  --measure: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.25rem;          /* 20px */
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.page { flex: 1 0 auto; width: 100%; }
.mast { width: 100%; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
p { margin: 0; }

/* Masthead */
.mast {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 26px var(--gutter) 0;
}
.name {
  font-size: 1.5rem;           /* 24px desktop */
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* Page */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* The words: headline and welcome, then the contact */
.top { margin-top: clamp(48px, 8vw, 96px); }
.words {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 5vw, 64px);
}
.lead { display: grid; gap: 24px; align-content: start; }
h1 {
  font-weight: 400;
  font-size: clamp(2.25rem, 1.2rem + 3.2vw, 3.375rem);   /* 36px phone to 54px desktop */
  line-height: 1.12;
  letter-spacing: -0.012em;
  max-width: 16ch;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}
.welcome { max-width: 26em; text-wrap: pretty; }

.contact h2 {
  font-weight: 400;
  font-size: 1.5rem;            /* 24px: the rabbi's name heads the block */
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 14px;
}
.contact dl { margin: 0; border-top: 1px solid var(--rule); }
.contact .row {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.contact dt {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}
.contact dd {
  margin: 0;
  font-size: 1.375rem;          /* 22px */
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.contact dd a { color: var(--ink); }
.contact .note {
  display: block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Photo slot: one real community photo from our own events. On a phone it sits under the contact rows.
   The figure carries the hidden attribute until img/community.jpg loads, so with no file it takes no space. */
.portrait { margin: 32px 0 0; }
.portrait[hidden] { display: none; }
.portrait img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #e4e0d8;
}

/* The parent line, closing the page */
.parent {
  max-width: var(--measure);
  width: 100%;
  margin: clamp(72px, 10vw, 128px) auto 0;
  padding: 22px var(--gutter) 40px;
}
.parent p {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 36em;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.parent a { color: var(--link); }

@media (min-width: 860px) {
  /* No photo: headline and welcome beside the contact */
  .words { grid-template-columns: 7fr 5fr; align-items: start; }
  .contact { padding-top: 0.4em; }

  /* With the photo: photo on the left at 4:5, the words on the right. The headline starts level with the top of
     the photo and the contact rows end level with its bottom; if the words run taller, the photo keeps to the top. */
  .top:has(> .portrait:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: clamp(40px, 5vw, 72px);
  }
  .top:has(> .portrait:not([hidden])) .words {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: 1fr;
    align-content: space-between;
  }
  .top:has(> .portrait:not([hidden])) .contact { padding-top: 0; }
  .top:has(> .portrait:not([hidden])) h1 { margin-top: -0.14em; }
  .top:has(> .portrait:not([hidden])) .welcome { max-width: 21em; }
  .top > .portrait { grid-column: 1; grid-row: 1; align-self: start; margin: 0; }
  .top > .portrait img { max-width: 580px; }
}
@media (max-width: 640px) {
  .name { font-size: 1.25rem; }           /* 20px on a phone */
  .contact .row { grid-template-columns: 1fr; gap: 4px; }
  .contact dd { font-size: 1.25rem; }
}
