/* ==========================================================================
   Epic Pesach brochure: phone-tall pages, 1080 x 1920 (9:16), the format of
   the Villatel Village Pesach brochure. Each .sheet is one page. On screen
   the sheets stack as a preview; `node tools/make-brochure.mjs` prints them
   to PDF. Same brand system as the site. All sizes are in px of that page.
   ========================================================================== */

:root {
  --porcelain: #fdf9ec;
  --seafoam: #d1dbd6;
  --coconut: #e6ded1;
  --mauvewood: #714242;
  --apricot: #d39985;
  --cypress: #153834;
  --eucalyptus: #89afaf;
  --display: "Aboreto", "Cinzel", Georgia, serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Rethink Sans", "Helvetica Neue", Arial, sans-serif;
  --hebrew: "Frank Ruhl Libre", "Times New Roman", serif;
  --page-w: 1080px;
  --page-h: 1920px;
  --pad-x: 76px;
  --pad-y: 84px;
  color-scheme: light;
}

@page { size: 1080px 1920px; margin: 0; }

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

/* Phones in landscape must not enlarge the text: every page is a fixed-size box. */
html { -webkit-print-color-adjust: exact; print-color-adjust: exact; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: #cfc8bb;
  color: var(--cypress);
  font: 400 28px/1.46 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ----- Sheets ----------------------------------------------------------- */

.sheet {
  --bg: var(--porcelain);
  --fg: var(--cypress);
  --fg-2: rgba(21, 56, 52, 0.78);
  --line: rgba(21, 56, 52, 0.24);
  position: relative;
  width: var(--page-w);
  height: var(--page-h);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x) 64px;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  page-break-after: always;
  break-after: page;
}
.sheet:last-child { page-break-after: auto; break-after: auto; }
.sheet--coconut { --bg: var(--coconut); }
.sheet--seafoam { --bg: var(--seafoam); }
.sheet--cypress { --bg: var(--cypress); --fg: var(--porcelain); --fg-2: rgba(253, 249, 236, 0.84); --line: rgba(253, 249, 236, 0.3); }

@media screen {
  .sheet { margin: 28px auto; box-shadow: 0 12px 44px rgba(0, 0, 0, 0.26); }
  .screen-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: var(--page-w); margin: 0 auto; padding: 20px 6px 0; font: 600 13px/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cypress); }
  /* Tall enough to tap. */
  .screen-bar a { display: inline-block; padding-block: 11px; text-decoration: underline; text-underline-offset: 0.3em; }
}
@media screen and (max-width: 1128px) {
  /* Scale the fixed-size sheets down to the screen instead of scrolling sideways. */
  body { overflow-x: hidden; }
  /* Older Safari cannot divide one length by another in calc(), so the page also sets --fit in script. */
  .sheet { zoom: var(--fit, 1); zoom: calc((100vw - 24px) / 1080px); margin: 12px auto; }
  .screen-bar { padding: 6px 16px 0; flex-wrap: wrap; }
  .screen-bar > :not(a) { display: none; }
}
@media print {
  body { background: none; }
  .screen-bar { display: none; }
}

/* ----- Type ------------------------------------------------------------- */

.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.05; text-wrap: balance; }
h1.display { font-size: 100px; }
h2.display { font-size: 62px; }
h3 { font: 400 34px/1.22 var(--serif); }
.eyebrow { font: 600 19px/1.4 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--fg-2); }
.lede { font: 400 33px/1.42 var(--serif); color: var(--fg-2); text-wrap: pretty; }
.fine { font-size: 24px; line-height: 1.42; color: var(--fg-2); }
.he { font-family: var(--hebrew); font-weight: 500; }
p { color: var(--fg-2); }
p, li, dd { text-wrap: pretty; }
strong { font-weight: 600; color: var(--fg); }

.head { display: grid; gap: 20px; margin-bottom: 36px; }
/* Three columns, so the dates stay centred whether the page number has one digit or two. */
.folio { margin-top: auto; padding-top: 26px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; border-top: 1px solid var(--line); font: 600 17px/1.4 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-2); }
.folio span:last-child { justify-self: end; }
/* Whatever comes last on a page keeps its distance from the folio rule. */
.sheet:not(.cover) > :nth-last-child(2) { margin-bottom: 36px; }
.sheet a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.cover__foot a, .contact a, .cover__cols h3 a { text-decoration: none; }
.cover__foot a { display: block; padding-block: 28px; }
/* The second calendar page has fewer lines, so its rows take the spare height. */
.days--roomy .day { padding: 21px 0; }
.days--roomy .day--extra { padding: 16px 0; }

.prelim { padding: 20px 26px; border: 1px solid var(--line); font-size: 24px; line-height: 1.45; color: var(--fg-2); }
.prelim strong { color: var(--fg); }

/* ----- Photos ----------------------------------------------------------- */

.ph { overflow: hidden; background: var(--coconut); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
/* A photo that takes whatever height its page has left, rather than a fixed one. */
.ph--fill { position: relative; min-height: 180px; }
.ph--fill img { position: absolute; inset: 0; }
.fill { flex: 1 1 0; min-height: 180px; }
.banner { height: 150px; flex: none; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.duo .ph { height: 208px; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ----- Cover ------------------------------------------------------------ */

.cover { padding: 0; }
.cover__top { padding: 76px var(--pad-x) 0; display: grid; justify-items: center; gap: 30px; text-align: center; }
/* The name is the logo and the cover's headline, so it is set wide. */
.cover__logo { width: 760px; margin: 0; --accent: var(--apricot); }
.cover__logo svg { display: block; width: 100%; height: auto; }
.cover__dates { font: 600 21px/1.6 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--fg); }
/* The photo takes every pixel the text leaves, and is framed so the wall television is whole. */
.cover__art { margin: 40px 0 0; min-height: 480px; }
.cover__art img { object-position: 50% 42%; }
.cover__title { padding: 46px var(--pad-x) 0; display: grid; gap: 20px; }
.cover__title .lede { font-size: 38px; line-height: 1.36; }
.cover__cols { margin: 40px var(--pad-x) 0; padding-top: 28px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.cover__cols h3 { font: 600 19px/1.4 var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--apricot); margin-bottom: 12px; }
.cover__cols p { font-size: 24px; line-height: 1.38; }
.cover__foot { margin-top: 40px; padding: 0 var(--pad-x); background: var(--apricot); color: var(--cypress); display: flex; justify-content: space-between; align-items: center; gap: 24px; font: 600 21px/1.4 var(--sans); letter-spacing: 0.08em; }

/* ----- Shared blocks ---------------------------------------------------- */

.stack { display: grid; gap: 22px; align-content: start; }

.facts { border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 230px 1fr; gap: 24px; padding: 17px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.facts dt { font: 600 18px/1.5 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-2); }
.facts dd { font: 400 28px/1.35 var(--serif); color: var(--fg); }
.facts--dist > div { grid-template-columns: 1fr auto; padding: 11px 0; }
.facts--dist dt { font: 400 28px/1.35 var(--serif); letter-spacing: 0; text-transform: none; color: var(--fg); }
.facts--dist dd { font: 500 25px/1.35 var(--sans); text-align: right; font-variant-numeric: tabular-nums; }

.items { display: grid; grid-template-columns: 1fr; }
.items--2 { grid-template-columns: 1fr 1fr; column-gap: 44px; }
.items li { display: grid; gap: 7px; align-content: start; padding: 15px 0; border-top: 1px solid var(--line); }
.items h3 { font-size: 31px; }
.items p { font-size: 24px; line-height: 1.42; }

.ticks { display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 34px; font-size: 25px; line-height: 1.4; color: var(--fg-2); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 12px; height: 12px; background: var(--apricot); }
.ticks--2 { grid-template-columns: 1fr 1fr; gap: 12px 40px; }

.box { padding: 22px 30px; border: 1px solid var(--line); display: grid; gap: 14px; align-content: start; }
.box h3 small { font: 400 22px/1.3 var(--sans); color: var(--fg-2); margin-left: 10px; }

/* ----- Villas and apartments -------------------------------------------- */

.vrows { display: grid; gap: 22px; }
.vrow { display: grid; grid-template-columns: 318px 1fr; gap: 30px; align-items: center; }
.vrow .ph { height: 184px; }
.vrow__body { display: grid; gap: 8px; align-content: center; }
.vrow__top { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.vrow__name { font: 400 31px/1.15 var(--display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg); }
.vrow__price { font: 400 38px/1 var(--display); letter-spacing: 0.03em; white-space: nowrap; color: var(--fg); }
.vrow__spec { font: 500 23px/1.4 var(--sans); color: var(--fg-2); }
.vrow__sum { font-size: 24px; line-height: 1.38; }

.acards { display: grid; grid-template-columns: 1fr 1fr; gap: 30px 44px; }
.acard { display: grid; gap: 10px; align-content: start; }
.acard .ph { height: 236px; margin-bottom: 10px; }

/* Fixed columns, so a long villa name or header never squeezes "Private, with spa" onto two lines. */
table { width: 100%; border-collapse: collapse; font-size: 25px; table-layout: fixed; }
thead th:nth-child(1) { width: 45%; }
thead th:nth-child(2) { width: 11%; }
thead th:nth-child(3) { width: 23%; }
td { white-space: nowrap; }
th, td { padding: 9px 16px 9px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font: 600 17px/1.4 var(--sans); letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-2); }
tbody th { font: 400 28px/1.3 var(--serif); color: var(--fg); }
td { color: var(--fg-2); font-variant-numeric: tabular-nums; }
td.num { font: 400 31px/1 var(--display); color: var(--fg); letter-spacing: 0.03em; }
th:last-child, td:last-child { padding-right: 0; text-align: right; }

/* ----- The day-by-day calendar ------------------------------------------ */

.days { display: grid; }
.day { display: grid; grid-template-columns: 190px 1fr; gap: 30px; padding: 12px 0; border-top: 1px solid var(--line); }
.day:last-child { border-bottom: 1px solid var(--line); }
/* The one-line rows for the days before and after the program. */
.day--extra { align-items: baseline; padding: 12px 0; }
.day--extra p { font-size: 24px; line-height: 1.35; }
.day__when { display: grid; gap: 4px; align-content: start; }
.day__dow { font: 600 18px/1.3 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-2); }
.day__date { font: 400 40px/1.1 var(--display); letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.day__heb { font-size: 21px; color: var(--fg-2); }
.day__what { display: grid; gap: 10px; align-content: start; }
.day__title { font-size: 32px; }
.day--yomtov .day__date,
.day--erev .day__date { color: var(--mauvewood); }

.chips { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.chip { display: inline-flex; align-items: baseline; gap: 10px; padding: 9px 16px 9px 14px; border-left: 6px solid var(--cypress); background: rgba(21, 56, 52, 0.06); font-size: 23px; line-height: 1.3; color: var(--fg); }
.chip__time { font-weight: 600; font-size: 20px; letter-spacing: 0.04em; color: var(--fg-2); }
.chip--tefillah { border-left-color: var(--cypress); }
.chip--learning { border-left-color: var(--eucalyptus); background: rgba(137, 175, 175, 0.2); }
.chip--kids { border-left-color: var(--apricot); background: rgba(211, 153, 133, 0.2); }
.chip--family { border-left-color: var(--mauvewood); background: rgba(113, 66, 66, 0.09); }
.chip--zman { border-left-color: transparent; background: none; outline: 1px dashed rgba(21, 56, 52, 0.42); outline-offset: -1px; }
.chip--stay { border-left-color: var(--coconut); background: var(--coconut); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.legend .chip { font-size: 21px; padding: 6px 14px 6px 12px; }
.legend__note { font-size: 21px; line-height: 1.3; color: var(--mauvewood); }

/* ----- Steps and contact ------------------------------------------------ */

.steps { display: grid; grid-template-columns: 1fr 1fr; column-gap: 44px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid currentColor; border-radius: 50%; font: 500 21px/1 var(--sans); }
.steps h3 { font-size: 29px; }
.steps p { font-size: 23px; line-height: 1.42; margin-top: 6px; }

.contact { display: grid; grid-template-columns: 1fr; }
.contact div { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); }
.contact .big { font: 400 34px/1.25 var(--serif); color: var(--fg); overflow-wrap: anywhere; }

.venue { display: flex; align-items: center; gap: 32px; }
.venue__logo { width: 200px; flex: none; }
.venue__logo svg { display: block; width: 100%; height: auto; }

.spacer { flex: 1; }
.mt-sm { margin-top: 12px; }
.mt { margin-top: 30px; }
.mt-lg { margin-top: 40px; }
