/* The Italian Pantry — static edition */
@font-face { font-family: "Libre Caslon Text"; src: url("/fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url("/fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url("/fonts/libre-caslon-text-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Caslon Display"; src: url("/fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/fonts/courier-prime-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("/fonts/courier-prime-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --paper: #F3F5F4;      /* enamel tabletop */
  --ink: #23262E;
  --muted: #5C6370;
  --blue: #1E4F8F;       /* majolica blue */
  --rule: #D3D8DE;
  --card: #FFFFFB;       /* index card */
  --card-ink: #2A2C31;
  --card-line: rgba(30, 79, 143, .17);
  --card-margin: #C9433C;
  --measure: 34rem;
  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --type: "Courier Prime", "Courier New", Courier, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161A21;
    --ink: #E6E8EC;
    --muted: #A2A9B4;
    --blue: #93B4E6;
    --rule: #2F3540;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161A21; --ink: #E6E8EC; --muted: #A2A9B4; --blue: #93B4E6; --rule: #2F3540; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); color: var(--card-ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ------------------------------------------------ header & nav */
.site-head, .masthead, main, .site-foot { width: min(100% - 2rem, 46rem); margin-inline: auto; }
.site-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.5rem 0 1rem; border-bottom: 1px solid var(--rule);
}
.wordmark { font-family: var(--display); font-size: 1.6rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
nav[aria-label="Site"] { display: flex; gap: 1.25rem; font-size: 1rem; }
nav[aria-label="Site"] a { color: var(--muted); text-decoration: none; }
nav[aria-label="Site"] a:hover, nav[aria-label="Site"] a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; }

.masthead { padding: clamp(3rem, 9vw, 6.5rem) 0 2.5rem; }
.wordmark-big {
  font-family: var(--display); font-weight: 400; margin: 0;
  font-size: clamp(3.1rem, 11.5vw, 7.25rem); line-height: .92; letter-spacing: -.025em;
}
.dek { font-size: clamp(1.15rem, 2.4vw, 1.4rem); line-height: 1.5; max-width: 30em; margin: 1.5rem 0 1.75rem; color: var(--muted); font-style: italic; }

/* ------------------------------------------------ home */
.start { font-size: 1.05rem; padding: 1rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 0 1rem; }
.year h2 {
  font-family: var(--display); font-weight: 400; color: var(--blue);
  font-size: 2.6rem; line-height: 1; margin: 3rem 0 .5rem;
}
.stories { list-style: none; margin: 0; padding: 0; }
.stories a {
  display: grid; grid-template-columns: 80px 1fr; column-gap: 1.25rem; row-gap: .15rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit;
}
.stories img { grid-row: span 2; width: 80px; height: 80px; object-fit: cover; border-radius: 3px; }
.stories .t { font-size: 1.3rem; line-height: 1.3; color: var(--ink); }
.stories .x { font-size: .98rem; line-height: 1.55; color: var(--muted); }
.stories a:hover .t { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
@media (max-width: 520px) {
  .stories a { grid-template-columns: 56px 1fr; column-gap: 1rem; }
  .stories img { width: 56px; height: 56px; }
  .stories .x { grid-column: 1 / -1; }
}

/* ------------------------------------------------ story */
.story-head { padding: clamp(2.5rem, 7vw, 4.5rem) 0 1.25rem; }
.story-head h1 {
  font-family: var(--display); font-weight: 400; margin: 0;
  font-size: clamp(2.3rem, 6.5vw, 3.9rem); line-height: 1.04; letter-spacing: -.015em; max-width: 15em;
}
.dateline { margin: 1rem 0 0; color: var(--muted); font-style: italic; }
.lead { margin: 1.5rem 0 2rem; }
.lead img { border-radius: 2px; }
.lead.wide img { width: 100%; }
.lead.tall img { max-height: 34rem; width: auto; }
.lead.small { max-width: 22rem; }
.has-recipe { color: var(--muted); font-size: 1rem; margin: 0 0 2rem; }

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15em; hyphens: auto; }
.prose em { font-style: italic; }
.prose img { margin: 1.5rem 0; border-radius: 2px; }
.prose > p:first-of-type::first-line { font-variant-caps: small-caps; letter-spacing: .02em; }

/* ------------------------------------------------ the recipe card */
.recipe { margin: 3.5rem 0 3rem; max-width: 38rem; }
.card {
  --line: 28px;
  position: relative;
  background-color: var(--card);
  color: var(--card-ink);
  font-family: var(--type);
  font-size: 1rem;
  line-height: var(--line);
  padding: 20px clamp(1.25rem, 5vw, 2.75rem) var(--line);
  border-radius: 3px;
  box-shadow: 0 1px 1px rgba(20, 24, 32, .08), 0 10px 26px -12px rgba(20, 24, 32, .35);
  background-image:
    linear-gradient(var(--card-margin), var(--card-margin)),
    linear-gradient(var(--card), var(--card)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--card-line) calc(var(--line) - 1px), var(--card-line) var(--line));
  background-size: 100% 2px, 100% 78px, 100% 100%;
  background-position: 0 76px, 0 0, 0 20px;
  background-repeat: no-repeat, no-repeat, repeat;
  font-feature-settings: normal;
}
.card a { color: #1E4F8F; }
.card h2 {
  font-family: var(--type); font-weight: 700; font-size: 1.2rem;
  line-height: 1.3; margin: 0 0 calc(var(--line) - 2px); min-height: 56px;
  display: flex; align-items: flex-end; padding-bottom: 6px;
}
.card h3 { font-family: var(--type); font-weight: 700; font-size: 1rem; line-height: var(--line); margin: var(--line) 0 0; }
.card p { margin: 0 0 var(--line); }
.card ul, .card ol { margin: 0 0 var(--line); padding-left: 2.2em; }
.card ul { list-style: none; padding-left: 1.2em; }
.card ul li::before { content: "\2013"; display: inline-block; width: 1.2em; margin-left: -1.2em; }
.card li { margin: 0; }
.card > :last-child { margin-bottom: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { box-shadow: 0 14px 30px -14px rgba(0,0,0,.8); } }
@media print { .card { transform: none; box-shadow: none; border: 1px solid #999; } }

/* ------------------------------------------------ readers' notes */
.notes { margin: 4rem 0 0; padding-top: 2rem; border-top: 1px solid var(--rule); max-width: var(--measure); }
.notes h2 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; margin: 0 0 1rem; }
.notes ol { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 1rem 0; border-bottom: 1px solid var(--rule); font-size: 1rem; line-height: 1.6; }
.notes li:last-child { border-bottom: 0; }
.notes .who { margin: 0 0 .35rem; font-weight: 700; }
.notes .who time { font-weight: 400; color: var(--muted); font-style: italic; margin-left: .5rem; }
.notes li p { margin: 0 0 .6em; }
.notes li.author { padding-left: 1.1rem; border-left: 2px solid var(--blue); }

/* ------------------------------------------------ prev / next */
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 3.5rem 0 1rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.prevnext a { text-decoration: none; color: var(--ink); font-size: 1.15rem; line-height: 1.35; }
.prevnext a span { display: block; color: var(--muted); font-size: .9rem; font-style: italic; margin-bottom: .25rem; }
.prevnext a:hover { color: var(--blue); }
.prevnext .next { text-align: right; }

/* ------------------------------------------------ recipes index, about */
.recipes-index h1, .about h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 7vw, 3.8rem); line-height: 1.04;
  margin: clamp(2.5rem, 7vw, 4rem) 0 1rem; letter-spacing: -.015em;
}
.lede { color: var(--muted); font-style: italic; max-width: 30em; margin: 0 0 2rem; }
.letters { columns: 2 18rem; column-gap: 3rem; }
.letter { break-inside: avoid; margin-bottom: 1.75rem; }
.letter h2 { font-family: var(--display); font-weight: 400; color: var(--blue); font-size: 1.9rem; line-height: 1; margin: 0 0 .5rem; }
.letter ul { list-style: none; margin: 0; padding: 0; }
.letter li { margin: 0 0 .55rem; line-height: 1.4; }
.letter .from { display: block; color: var(--muted); font-size: .9rem; font-style: italic; }
.about .prose { margin-bottom: 4rem; }

/* ------------------------------------------------ footer */
.site-foot {
  margin-top: 5rem; padding: 1.5rem 0 3rem; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .95rem;
}
.site-foot p { margin: 0; }

@media (min-width: 900px) {
  .lead.small { float: right; margin: .4rem 0 1.5rem 2.5rem; max-width: 16rem; position: relative; z-index: 1; }
}
