/* Jellies and jams: the county fair preserves table.
   Gingham cloth on the trestle, a manila entry tag, the judge's card with its rosette,
   copper kettles. Fonts are local OFL files (see fonts/). */
@font-face { font-family: "Sancreek"; src: url("fonts/sancreek.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Petrona"; src: url("fonts/petrona-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Petrona"; src: url("fonts/petrona-italic-var.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  /* names the theme test reads */
  --jar: #8A1C2B; --plum: #4B2A4A; --parchment: #FAF4E8; --gold: #E9C46A; --ink: #2A2020;
  --white: #FFFFFF; --warnbg: #F6E2D6; --link: #8A1C2B;
  /* the fair */
  --berry: #8A1C2B; --ribbon: #1F3F7A; --hall: #172C55; --manila: #EBD9AE; --copper: #A65A2A;
  --rule: #C9B48A;
  --display: "Sancreek", "Rockwell", Georgia, serif;
  --text: "Petrona", Georgia, "Times New Roman", serif;
  --wrap: 1200px;
  --pad: max(18px, calc((100% - var(--wrap)) / 2));
  --gingham:
    linear-gradient(90deg, rgba(138, 28, 43, .42) 50%, transparent 50%),
    linear-gradient(rgba(138, 28, 43, .42) 50%, transparent 50%);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--parchment); color: var(--ink); font: 400 18px/1.55 var(--text); }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.05; color: var(--berry); letter-spacing: .01em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 .45em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 .8em; }
[hidden], .row[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ribbon); outline-offset: 2px; }

/* ---------- bunting ---------- */
.bunting { display: block; width: 100%; height: 58px; }

/* ---------- masthead: the hall ---------- */
.top {
  color: var(--white);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 96px),
    var(--hall);
  padding: 0 0 34px;
}
.hall { display: grid; grid-template-columns: 7fr 5fr; gap: 28px; align-items: end; padding: 8px var(--pad) 0; }
.kicker { margin: 0 0 14px; font-weight: 600; font-size: .95rem; letter-spacing: .06em; color: var(--manila); }
.division { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.division span { font-family: var(--display); font-size: 1.05rem; letter-spacing: .04em; color: var(--hall); background: var(--manila); padding: 4px 14px 2px; border-radius: 2px; box-shadow: 3px 3px 0 var(--berry); }
.top h1 { margin: 0 0 18px; color: var(--white); }
.h1-a { display: block; font-size: clamp(2.6rem, 7.2vw, 5.6rem); line-height: .95; color: var(--manila); text-shadow: 4px 4px 0 var(--berry); }
.h1-b { display: block; margin-top: 12px; font-family: var(--text); font-style: italic; font-weight: 500; font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: 0; color: var(--white); }
.intro { max-width: 40em; font-size: 1.1rem; color: #F3EEE3; }
.top a { color: var(--white); }
.exhibit { margin: 0; }
.exhibit svg { display: block; width: 100%; height: auto; max-height: 360px; }
.top > .warn {
  position: relative; max-width: var(--wrap); margin: 26px auto 0; width: calc(100% - 36px);
  background: var(--warnbg); color: var(--ink); border: 3px double var(--berry); border-left: 10px solid var(--berry);
  padding: 14px 18px 14px 20px; font-size: 1.02rem;
}
.top > .warn::before { content: ""; position: absolute; top: -9px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--gold); border: 2px solid var(--ink); }

/* ---------- the gingham table ---------- */
.tool {
  display: grid; grid-template-columns: 5fr 7fr; gap: 36px; align-items: start;
  padding: 56px var(--pad) 44px;
  background-color: var(--white); background-image: var(--gingham); background-size: 44px 44px;
  border-top: 6px solid var(--ink);
}
.tablecloth-hem {
  height: 22px; background:
    radial-gradient(circle at 11px 0, var(--white) 10px, transparent 11px) 0 0 / 22px 22px repeat-x,
    var(--parchment);
  border-top: 3px solid var(--berry);
}

/* entry tag */
.tag-wrap { position: relative; filter: drop-shadow(6px 8px 0 rgba(42, 32, 32, .28)); padding-top: 18px; }
.tag-wrap::before { content: ""; position: absolute; z-index: 2; left: 50%; top: -40px; width: 3px; height: 82px; background: var(--copper); transform: rotate(14deg); transform-origin: bottom; border-radius: 2px; }
.tag {
  position: relative; background: var(--manila); padding: 58px 26px 22px;
  clip-path: polygon(34px 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%, 0 34px);
  background-image: linear-gradient(rgba(42, 32, 32, .04) 1px, transparent 1px); background-size: 100% 5px;
}
.tag::before { content: ""; position: absolute; left: 50%; top: 14px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: var(--white); border: 5px solid var(--copper); box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 2px var(--ink); }
.tag-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 18px; font-weight: 700; font-size: .88rem; letter-spacing: .05em; }
.tag h2 { display: flex; align-items: center; gap: 12px; font-size: 1.9rem; margin: 18px 0 6px; color: var(--ink); }
.tag h2:first-of-type { margin-top: 0; }
.num { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--berry); color: var(--white); font-family: var(--text); font-weight: 800; font-size: 1.15rem; }
.row { display: grid; grid-template-columns: 1fr 1.25fr; gap: 12px; padding: 12px 0; border-bottom: 1.5px dashed rgba(42, 32, 32, .45); }
.row > div:only-child { grid-column: 1 / -1; }
.row > div { min-width: 0; }
label { display: block; font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
input, select {
  width: 100%; min-height: 48px; font: 600 1.15rem var(--text); color: var(--ink);
  background: var(--parchment); border: 2px solid var(--ink); border-radius: 3px; padding: 8px 10px;
}
input { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--berry) 50%), linear-gradient(-45deg, transparent 50%, var(--berry) 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 13px) 52%; background-size: 7px 7px; background-repeat: no-repeat; }
input:focus, select:focus { border-color: var(--berry); box-shadow: 0 0 0 3px rgba(138, 28, 43, .25); outline: none; }

/* judge's card */
.card {
  position: sticky; top: 14px; background: var(--parchment); border: 3px solid var(--ribbon);
  outline: 1.5px solid var(--ribbon); outline-offset: -10px; padding: 0 26px 24px;
  box-shadow: 8px 10px 0 rgba(42, 32, 32, .28);
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 -26px 18px; padding: 12px 26px 10px; background: var(--ribbon); color: var(--white); }
.card-head span:first-child { font-family: var(--display); font-size: 1.7rem; letter-spacing: .02em; color: var(--manila); }
.card-head span:last-child { font-weight: 700; font-size: .88rem; letter-spacing: .06em; }
.err { background: var(--warnbg); color: var(--berry); font-weight: 700; padding: 14px 16px; border-left: 8px solid var(--berry); font-size: 1.05rem; }
.verdict { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; margin-bottom: 10px; }
.rosette svg { display: block; width: 150px; height: auto; }
.eyebrow { font-family: var(--display); color: var(--berry); font-size: 1.35rem; margin: 0 0 4px; }
.big { font-size: clamp(1.4rem, 2.3vw, 1.85rem); line-height: 1.25; font-weight: 700; color: var(--ink); margin: 0; }
.results { width: 100%; border-collapse: collapse; font-size: 1rem; font-variant-numeric: tabular-nums; margin: 8px 0 10px; }
.results thead th { font-size: .9rem; letter-spacing: .03em; border-bottom: 3px double var(--berry); color: var(--berry); }
.results th, .results td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.results tbody th { font-family: var(--display); font-weight: 400; font-size: 1.2rem; color: var(--berry); }
.results td:last-child { font-weight: 700; background: rgba(233, 196, 106, .22); }
#ratio { font-style: italic; }
.kettles { margin: 14px 0; padding: 14px 14px 10px; background: var(--white); border: 2px solid var(--ink); }
.kettles figcaption { font-weight: 700; margin-bottom: 6px; }
.fig { font-family: var(--display); font-weight: 400; color: var(--berry); margin-right: 6px; }
#kettles { display: block; width: 100%; height: auto; max-height: 380px; }
.key { margin: 6px 0 0; font-size: .98rem; }
.key i { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--ink); vertical-align: -2px; margin: 0 4px 0 10px; }
.key i:first-child { margin-left: 0; }
.key .k-fruit { background: var(--berry); }
.key .k-sugar { background: var(--white); background-image: radial-gradient(#6A7EA8 1px, transparent 1.4px); background-size: 4px 4px; }
.key .k-pectin { background: var(--gold); }
.key .k-cap { border: none; border-top: 3px dashed var(--berry); height: 3px; width: 20px; vertical-align: 4px; }
#notes { padding-left: 1.3em; margin: 10px 0; }
#notes li { margin: 4px 0; }
#notes li::marker { content: "\2726  "; color: var(--berry); }
#result-warn { background: var(--warnbg); border: 2px solid var(--berry); border-left-width: 8px; padding: 12px 14px; margin: 12px 0 0; }

/* ---------- reading on the hall table ---------- */
main > :not(.tool):not(.tablecloth-hem) { margin-left: var(--pad); margin-right: var(--pad); }
.reading { display: grid; grid-template-columns: 5fr 7fr; gap: 36px; margin-top: 54px; align-items: start; }
.slip { background: var(--white); border: 2px solid var(--ink); padding: 26px 28px 14px; box-shadow: 6px 7px 0 var(--manila); }
.prize { position: relative; border-color: var(--ribbon); border-width: 3px; padding-top: 30px; }
.ribbon-tab { position: absolute; top: -18px; left: 22px; margin: 0; padding: 6px 18px 4px; background: var(--ribbon); color: var(--white); font-family: var(--display); font-size: 1.15rem; }
.ribbon-tab::after { content: ""; position: absolute; right: -16px; top: 0; border: 17px solid var(--ribbon); border-right-color: transparent; border-width: 17px 16px 17px 0; }
.how { columns: 2 280px; column-gap: 34px; column-rule: 1px solid var(--rule); }
.how h2 { column-span: all; }
.faq { margin-top: 54px; background: var(--manila); }
.qs { columns: 2 320px; column-gap: 40px; }
details { break-inside: avoid; border-top: 2px solid var(--berry); padding: 10px 0 2px; margin: 0 0 10px; }
summary { font-weight: 700; font-size: 1.12rem; cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; gap: 10px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ribbon); box-shadow: 0 0 0 3px var(--gold); }
details[open] summary::before { background: var(--berry); }

.shop-guide { position: relative; margin-top: 54px; background: var(--parchment); border: 3px solid var(--ink); padding: 0 28px 16px; }
.awning { height: 56px; margin: 0 -28px 18px; border-bottom: 3px solid var(--ink);
  background: repeating-linear-gradient(90deg, var(--berry) 0 44px, var(--white) 44px 88px); position: relative; }
.awning::after { content: ""; position: absolute; left: 0; right: 0; bottom: -17px; height: 16px;
  background: radial-gradient(circle at 22px 0, var(--berry) 21px, transparent 22px) 0 0 / 88px 16px repeat-x,
              radial-gradient(circle at 66px 0, var(--white) 21px, transparent 22px) 0 0 / 88px 16px repeat-x; }
.stall { display: inline-block; margin: 12px 0 8px; font-family: var(--display); font-size: 1.1rem; color: var(--white); background: var(--ribbon); padding: 4px 14px 2px; }
.shop-guide h2 { margin-top: 4px; }
.shop-guide p { max-width: 62em; }
.disc { font-size: .95rem; border-top: 1.5px dashed rgba(42, 32, 32, .45); padding-top: 10px; }
.more { margin-top: 26px; margin-bottom: 40px; font-weight: 600; }

footer { background: var(--hall); color: var(--white); padding: 0 0 26px; font-size: .95rem; }
footer p { max-width: var(--wrap); margin: 14px auto 0; padding: 0 18px; }
footer a { color: var(--white); }

/* kettle fill settles */
.k-fill { transform-box: fill-box; transform-origin: 50% 100%; animation: rise .3s ease-out; }
@keyframes rise { from { transform: scaleY(.2); } }
@media (prefers-reduced-motion: reduce) { .k-fill { animation: none; } }

/* ---------- narrower ---------- */
@media (max-width: 980px) {
  .hall, .tool, .reading { grid-template-columns: 1fr; }
  .exhibit svg { max-width: 460px; margin: 0 auto; }
  .card { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .bunting { height: 46px; }
  .hall { gap: 10px; }
  .tool { padding-top: 40px; gap: 30px; }
  .tag { padding: 56px 16px 16px; }
  .row { grid-template-columns: 1fr 1.2fr; gap: 8px; }
  input, select { font-size: 1.05rem; }
  input { font-size: 1.2rem; }
  .card { padding: 0 14px 16px; outline-offset: -7px; }
  .card-head { margin: 0 -14px 14px; padding: 10px 14px 8px; }
  .verdict { grid-template-columns: 112px 1fr; gap: 12px; }
  .rosette svg { width: 112px; }
  .results { font-size: .92rem; }
  .results th, .results td { padding: 7px 4px; }
  .results thead th { font-size: .8rem; }
  .slip, .shop-guide { padding-left: 16px; padding-right: 16px; }
  .awning { margin: 0 -16px 18px; }
  .kettles { padding: 10px 8px 8px; }
}
