/* The public site. The admin has its own stylesheet (admin.css). */

@font-face {
  font-family: "Playfair Display";
  src: url("/assets/playfair-display-wght-normal-92cdd45e.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Playfair Display";
  src: url("/assets/playfair-display-wght-italic-bb807916.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/assets/eb-garamond-wght-normal-1e782b72.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "EB Garamond";
  src: url("/assets/eb-garamond-wght-italic-9db9dcf9.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/assets/courier-prime-400-580e396d.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/assets/courier-prime-700-dcc5fa27.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paper and ink. The paper tone matches the watercolour paper of the artwork. */
  --paper: #f9f8f3;
  --ink: #2a2925;
  --muted: #6e695f;
  --rule: #e2ddd0;
  --accent: #56633a;

  --display: "Playfair Display", "Big Caslon", Georgia, serif;
  --text: "EB Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --mono: "Courier Prime", "Courier New", monospace;

  --measure: 42rem;
  --wide: 68rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--text);
}

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

a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.5rem, 6vw, 3.75rem); letter-spacing: -.01em; }
p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link { position: absolute; left: -999rem; }
.skip-link:focus { left: 1rem; top: 1rem; padding: .5rem .75rem; background: var(--ink); color: var(--paper); z-index: 1; }

/* Small capitals used for labels, navigation and section markers. */
.eyebrow, .section-label, .nav, .facts dt, .card__meta, .brand__tagline, .servings, .page-header__meta, .index__letter {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
  border-bottom: 1px solid var(--rule);
}

.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; }
.brand:hover { color: inherit; }
.brand__mark { width: auto; height: 4rem; }
.brand__text { display: grid; gap: .2rem; }
.brand__name { font-family: var(--display); font-size: 1.75rem; font-weight: 500; line-height: 1; }

.nav { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; }
.nav a { color: var(--ink); text-decoration: none; padding: .25rem 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); border-bottom-color: currentColor; }

/* Page frame */

.main { max-width: var(--wide); margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) var(--gutter) 4rem; }
.main > section + section { margin-top: clamp(3rem, 7vw, 5rem); }

.footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: .875rem;
}
.footer p { margin: 0; }
.footer__name { font-family: var(--display); font-size: 1.25rem; color: var(--ink); }

.page-header { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.page-header .eyebrow { margin-bottom: .75rem; }
.page-header__meta { margin: 1rem 0 0; }

.section-label { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2rem; }
.section-label::before, .section-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.empty, .result-count { text-align: center; color: var(--muted); }
.more { text-align: center; margin: 2.5rem 0 0; }

/* Front page */

.epigraph { max-width: var(--measure); margin: 0 auto; text-align: center; }
.epigraph__quote {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  line-height: 1.15;
}
.epigraph__text { margin: 0; color: var(--muted); }

/* Cards: a picture mounted like a print in a white mat, with its name beneath.
   The mat also evens out the artwork, some of which was scanned with a white
   margin around the paper and some without. */

.grid { --columns: 4; --gap: 2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.5rem var(--gap); }

.card {
  flex: 0 0 calc((100% - (var(--columns) - 1) * var(--gap)) / var(--columns));
  display: grid;
  gap: .3rem;
  align-content: start;
  text-decoration: none;
  text-align: center;
}
.card__image {
  display: block;
  aspect-ratio: 4 / 3;
  margin-bottom: .6rem;
  padding: .55rem;
  background: #fff;
  box-shadow: 0 0 0 1px var(--rule), 0 10px 24px -18px rgb(42 41 37 / .45);
}
.card__image img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s ease; }
.card:hover .card__image img { opacity: .85; }
.card__title { font-family: var(--display); font-size: 1.4rem; font-weight: 500; line-height: 1.15; }

@media (prefers-reduced-motion: reduce) {
  .card__image img { transition: none; }
}

@media (max-width: 62rem) {
  .grid { --columns: 3; }
}

/* Recipe index */

.search { display: flex; gap: .5rem; max-width: 30rem; margin: 2rem auto 0; }
.search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: .6rem .8rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.search input[type="submit"] {
  padding: .6rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font: 700 .72rem var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}

.index { columns: 3 15rem; column-gap: 3rem; }
.index__group { break-inside: avoid; margin-bottom: 2rem; }
.index__letter { padding-bottom: .4rem; margin-bottom: .6rem; border-bottom: 1px solid var(--rule); color: var(--accent); }
.index ul { list-style: none; margin: 0; padding: 0; }
.index li { padding: .2rem 0; font-family: var(--display); font-size: 1.3rem; line-height: 1.25; }
.index a { text-decoration: none; }

/* Recipe */

.recipe__header { max-width: var(--measure); margin: 0 auto; text-align: center; }
.eyebrow { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; margin: 0 0 1rem; }
.eyebrow a { text-decoration: none; }
.recipe__intro {
  margin: 1.25rem 0 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1.4;
  color: var(--muted);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2.75rem;
  margin: 2.5rem 0;
  padding: 1.1rem 0;
  border-block: 1px solid var(--rule);
  text-align: center;
}
.facts dd { margin: .2rem 0 0; font-family: var(--display); font-size: 1.4rem; line-height: 1.1; }

.recipe__image {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 3rem;
  padding: clamp(.5rem, 1.5vw, .9rem);
  background: #fff;
  box-shadow: 0 0 0 1px var(--rule), 0 18px 40px -28px rgb(42 41 37 / .5);
}
.recipe__image img { max-height: min(26rem, 70vh); width: auto; }

.recipe__body { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: 3rem clamp(2rem, 6vw, 5rem); align-items: start; }
.recipe__body h2 { font-size: 2rem; margin-bottom: 1.25rem; }
.recipe__body h3 { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 1.75rem 0 .5rem; }

.servings { display: flex; align-items: center; gap: .6rem; margin: -.5rem 0 1rem; }
.servings output { min-width: 1.5rem; text-align: center; font-family: var(--display); font-size: 1.3rem; letter-spacing: 0; color: var(--ink); }
.servings button {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  font: 1rem/1 var(--text);
  cursor: pointer;
}
.servings button:hover { border-color: var(--accent); color: var(--accent); }

.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li { display: flex; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); line-height: 1.4; }
.ingredients__amount { flex: none; min-width: 4.75rem; font-weight: 600; white-space: nowrap; }
.ingredients__note { color: var(--muted); }

.method ol { list-style: none; margin: 0; padding: 0; }
.method li { counter-increment: step; position: relative; padding: 0 0 1.5rem 3rem; }
.method li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.35rem;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--accent);
}
.method li p:last-child { margin-bottom: 0; }
.method figure { margin: 1rem 0 0; }
.method figure img { max-height: 24rem; width: auto; }

.notes { margin-top: 1.5rem; padding: 1.5rem 1.75rem; background: #fff; box-shadow: 0 0 0 1px var(--rule); }
.notes h2 { font-size: 1.5rem; margin-bottom: .6rem; }
.notes p:last-child { margin-bottom: 0; }

.recipe__footer { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); text-align: center; color: var(--muted); font-size: .875rem; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; list-style: none; margin: 0 0 1.5rem; padding: 0; }
.tags a { display: block; padding: .2rem .7rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted); text-decoration: none; }
.tags a:hover { border-color: var(--accent); color: var(--accent); }
.recipe__credit { margin: 0 0 .75rem; }
.recipe__actions { display: flex; justify-content: center; gap: 1.5rem; margin: 0; }
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .2em; cursor: pointer; }
.link-button:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Pages (About, Contact, Photo Album) */

.page-article__image { max-width: 26rem; margin: 0 auto 2.5rem; }
.page-article__image img, .gallery img { box-shadow: 0 0 0 1px var(--rule), 0 18px 40px -28px rgb(42 41 37 / .5); }

.prose { max-width: var(--measure); margin: 0 auto; }
.prose h2 { font-size: 2rem; margin: 2rem 0 1rem; }
.prose img { margin: 0 auto 1.5rem; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 1px solid var(--rule); font-family: var(--display); font-style: italic; font-size: 1.4rem; }

.gallery { columns: 3 15rem; column-gap: 2rem; margin-top: 2.5rem; }
.gallery figure { break-inside: avoid; margin: 0 0 2rem; }
.gallery img { width: 100%; }

/* Small screens */

@media (max-width: 46rem) {
  .masthead { flex-direction: column; text-align: center; }
  .brand { flex-direction: column; gap: .6rem; }
  .nav { justify-content: center; gap: .25rem 1.25rem; }
  .grid { --columns: 2; --gap: 1rem; row-gap: 2rem; }
  .card__image { padding: .35rem; }
  .card__title { font-size: 1.2rem; }
  .recipe__body { grid-template-columns: minmax(0, 1fr); }
}

/* Print: the recipe and nothing else. */

@media print {
  body { background: #fff; font-size: 11pt; }
  .masthead, .footer, .skip-link, [data-print-hidden], .tags, .eyebrow { display: none; }
  .main { max-width: none; padding: 0; }
  h1 { font-size: 26pt; }
  .recipe__image { margin-bottom: 1rem; padding: 0; box-shadow: none; }
  .recipe__image img { max-height: 6cm; }
  .facts { margin: 1rem 0; }
  .recipe__body { grid-template-columns: 6.5cm 1fr; gap: 1cm; }
  .method li, .ingredients li { break-inside: avoid; }
  .notes { box-shadow: none; border: 1px solid #ccc; }
  a { text-decoration: none; }
}
