/* Sissons Barn Matchmaker. Mobile first. Colours and type follow sissonsbarn.co.uk (see design-notes.md).
   Nothing here is cropped or masked into an arch: every photograph is a rectangle with one small radius. */

:root {
  --font: "Marcellus", "Minerva Modern", Georgia, "Times New Roman", serif;   /* Stand-in, gaps Q20 */
  --paper: #ffffff;
  --ink: #000000;
  --olive: #3d4435;
  --sage: #aec7c2;
  --beige: #e7d9cb;
  --line: rgba(0, 0, 0, 0.22);
  --soft: rgba(0, 0, 0, 0.64);
  --radius: 6px;
  --gutter: 20px;
  --measure: 640px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.6; overflow-wrap: break-word; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, dl, dd, ul, figure, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul { list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---- Header and footer ---- */
.site-header { background: var(--olive); color: #fff; }
.site-header__in { max-width: 1080px; margin: 0 auto; padding: 14px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.site-header__logo img { width: 122px; height: auto; }
.site-header__phone { color: #fff; text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 24px var(--gutter) 40px; color: var(--soft); font-size: 15px; text-align: center; }
.site-footer a { display: inline-block; margin: 0 8px; padding: 10px 0; }

/* ---- Frame ---- */
.mm { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.app { max-width: var(--measure); margin: 0 auto; padding-top: 20px; }
.is-result .app { max-width: 760px; }
.preview { background: var(--beige); border-radius: var(--radius); padding: 8px 12px; font-size: 15px; margin-bottom: 16px; }
.progress { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 16px; margin-bottom: 28px; color: var(--soft); font-size: 15px; }
.progress__count { grid-column: 2; text-align: right; }
.progress__back { grid-column: 1; grid-row: 1; justify-self: start; }
.progress__track { grid-column: 1 / -1; height: 3px; background: var(--beige); border-radius: 2px; overflow: hidden; }
.progress__bar { display: block; height: 100%; width: 0; background: var(--olive); transition: width 0.3s ease; }
.is-result .progress { display: none; }

/* ---- Type ---- */
.q { font-weight: 400; font-size: clamp(1.55rem, 1.1rem + 2.6vw, 2.35rem); line-height: 1.2; letter-spacing: 0; margin-bottom: 24px; text-wrap: balance; }
.q:focus { outline: none; }
.q--result { margin-bottom: 16px; }
h2 { font-weight: 400; font-size: 1.35rem; line-height: 1.3; margin-bottom: 14px; text-wrap: balance; }
h3 { font-weight: 400; font-size: 1.15rem; line-height: 1.3; margin-bottom: 6px; }
.lead { font-size: 1.1rem; margin-bottom: 16px; }
.note { color: var(--soft); font-size: 0.95rem; margin-top: 12px; }
.note--lead { margin: -8px 0 20px; font-size: 1rem; }
.note--kind { color: var(--ink); background: var(--beige); border-radius: var(--radius); padding: 14px 16px; font-size: 1rem; margin: 16px 0; }
.note--guide { margin: 0 0 28px; }
.small { color: var(--soft); font-size: 0.85rem; line-height: 1.5; margin-top: 16px; }
.problem { color: var(--ink); font-size: 1rem; margin-top: 16px; min-height: 0; }
.problem:not(:empty) { border-left: 4px solid var(--ink); padding: 8px 12px; background: var(--beige); }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 28px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--ink); color: #fff; font-size: 1.05rem; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--olive); border-color: var(--olive); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn--line { background: transparent; color: var(--ink); min-height: 48px; padding: 10px 20px; font-size: 1rem; }
.btn--line:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: inherit; }
.step__next { margin-top: 28px; }
.step__next .btn { width: 100%; }

/* ---- Fields ---- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .slider label { font-size: 1rem; }
.field__opt { color: var(--soft); font-size: 0.9rem; }
.field input, .field select, .slider__n { width: 100%; min-height: 52px; padding: 10px 14px; border: 1px solid var(--ink); border-radius: var(--radius); background: #fff; font-size: 17px; }
.field--inline { margin-top: 20px; }
.field--inline input { max-width: 120px; }
.pair { display: grid; gap: 0 16px; }
.pair--tokens { margin-top: 16px; }
.phone { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 8px; }
.phone select, .phone input { min-width: 0; }

/* ---- Options ---- */
.group { margin-bottom: 24px; }
.group legend { font-size: 1.1rem; margin-bottom: 10px; padding: 0; }
.group--hidden-legend legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.group__note { color: var(--soft); font-size: 0.95rem; margin: -4px 0 12px; }
.group__body { display: grid; gap: 10px; }
.group__body--gap { margin-top: 16px; }
.opt { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 14px; min-height: 56px; padding: 12px 48px 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt__body { display: grid; gap: 2px; min-width: 0; }
.opt__label { font-size: 1.05rem; line-height: 1.35; }
.opt__sub { color: var(--soft); font-size: 0.92rem; line-height: 1.45; }
.opt__dishes { display: block; margin-top: 6px; color: var(--ink); }
.opt__price { font-size: 0.98rem; white-space: nowrap; text-align: right; }
.opt__tick { position: absolute; right: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border: 1px solid var(--ink); border-radius: 50%; background: #fff; }
.opt input[type="checkbox"] ~ .opt__tick { border-radius: 4px; }
.opt.is-on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f6f8f7; }
.opt.is-on .opt__tick { background: var(--ink); }
.opt.is-on .opt__tick::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.opt.is-off { opacity: 0.45; cursor: default; }
.opt.is-off input { cursor: default; }
.opt:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.opt:hover:not(.is-off) { border-color: var(--ink); }

.group--chips .group__body, .group__body.group--chips { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.group__body.group--chips { margin-top: 12px; }
.group--four .group__body { grid-template-columns: 1fr; }
.opt--wide { grid-column: 1 / -1; }

.opt--photo { grid-template-columns: 84px 1fr; padding: 10px 46px 10px 10px; }
.opt--photo .opt__price { grid-column: 2; text-align: left; color: var(--soft); }
.opt__img { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; grid-row: span 2; }

/* ---- Sliders and steppers ---- */
.sliders { display: grid; gap: 22px; }
.slider { display: grid; gap: 8px; }
.slider__row { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 14px; align-items: center; }
.slider__n { min-height: 48px; text-align: center; padding: 8px 6px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--sage); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--sage); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); }
.extra { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.extra__text { display: grid; gap: 2px; flex: 1 1 150px; min-width: 0; }
.extra__label { font-size: 1.05rem; }
.extra__sub { color: var(--soft); font-size: 0.92rem; }
.stepper { display: inline-grid; grid-template-columns: 48px 44px 48px; align-items: center; border: 1px solid var(--ink); border-radius: var(--radius); }
.stepper button { height: 48px; border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.stepper button[disabled] { opacity: 0.3; cursor: default; }
.stepper output { text-align: center; font-size: 1.1rem; }
.cottage { border-left: 3px solid var(--sage); padding-left: 16px; margin-bottom: 8px; }
.cottage .field { margin-top: 16px; }

.banner { margin-bottom: 20px; }
.banner__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }

/* ---- Reveal summary ---- */
.summary { border-top: 1px solid var(--line); margin-bottom: 24px; }
.summary > div { display: grid; grid-template-columns: minmax(96px, 0.5fr) 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--soft); }

/* ---- Results ---- */
.block { margin-bottom: 36px; }
.hero { margin-bottom: 28px; }
.hero__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.hero figcaption { color: var(--soft); font-size: 0.95rem; margin-top: 8px; }
.rows { border-top: 1px solid var(--ink); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.row dd { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row__sub { display: block; color: var(--soft); font-size: 0.92rem; line-height: 1.5; margin-top: 4px; }
.row--quiet { color: var(--soft); }
.row--strong dt, .row--strong dd { font-size: 1.08rem; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 18px 0 6px; border-bottom: 2px solid var(--ink); font-size: 1.15rem; }
.total__n, .spend__amount { font-size: clamp(2.1rem, 1.4rem + 4vw, 3.1rem); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* The signature: the minimum food spend as a measure the couple fills. */
.spend { background: var(--olive); color: #fff; border-radius: var(--radius); padding: 24px 20px; }
.spend__figure { font-size: 1.25rem; line-height: 1.35; margin-bottom: 12px; }
.spend__figure:focus { outline: none; }
.spend__amount { display: block; }
.spend__lead { margin-bottom: 18px; }
.spend__small { font-size: 0.9rem; opacity: 0.86; margin-top: 14px; }
.bar { height: 22px; border-radius: 3px; overflow: hidden; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.34) 0 6px, rgba(255, 255, 255, 0.12) 6px 12px); }
.bar__used { height: 100%; background: var(--sage); transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.bar__key { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.95rem; margin-top: 10px; }
.key { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 2px; vertical-align: -2px; }
.key--used { background: var(--sage); }
.key--left { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0 3px, rgba(255, 255, 255, 0.2) 3px 6px); }
.ideas { margin-bottom: 20px; }
.ideas__title { margin-bottom: 8px; }
.ideas__after { font-size: 0.95rem; margin-top: 10px; }
.idea { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 12px 14px; margin-bottom: 8px; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.7); border-radius: var(--radius); text-align: left; cursor: pointer; }
.idea:hover { background: #fff; color: var(--ink); border-color: #fff; }
.spend :focus-visible { outline-color: #fff; }

.estimates .rows { border-top-color: var(--line); }
.guide { background: #f4f6f5; border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; font-size: 0.98rem; }
.guide:empty { display: none; }
.guide p + p, .guide ul { margin-top: 8px; }
.guide li { padding: 4px 0; }
.guide__title { font-size: 1.05rem; }
.guide__small { color: var(--soft); font-size: 0.9rem; }
.menu__name { font-size: 1.2rem; }
.swap { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; display: grid; gap: 12px; justify-items: start; }
.alts { display: grid; gap: 14px; }
.alt { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; display: grid; gap: 8px; justify-items: start; align-content: start; }
.alt__price { font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.included { background: var(--beige); border-radius: var(--radius); padding: 16px; margin-top: 18px; display: grid; gap: 10px; }
.offer { background: var(--beige); border-radius: var(--radius); padding: 18px 16px; }
.actions { display: grid; gap: 12px; justify-items: start; border-top: 2px solid var(--ink); padding-top: 28px; }
.actions .btn:not(.btn--line) { width: 100%; }
.actions__row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }

/* ---- Coming soon ---- */
.gate { max-width: 760px; margin: 24px auto 0; }
.gate__photo { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.gate__card { padding: 28px 0; }

/* ---- Wider screens ---- */
@media (min-width: 600px) {
  :root { --gutter: 32px; }
  body { font-size: 18px; }
  .app { padding-top: 36px; }
  .site-header__logo img { width: 150px; }
  .pair { grid-template-columns: 1fr 1fr; }
  .step__next .btn, .actions .btn:not(.btn--line) { width: auto; min-width: 260px; }
  .group--four .group__body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group--chips .opt--wide { grid-column: auto; }
  .group--photos .group__body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt--photo { grid-template-columns: 1fr; padding: 10px 10px 14px; align-content: start; }
  .opt--photo .opt__img { width: 100%; height: auto; aspect-ratio: 3 / 2; grid-row: auto; }
  .opt--photo .opt__body { padding: 4px 34px 0 4px; }
  .opt--photo .opt__price { grid-column: 1; padding-left: 4px; }
  .opt--photo .opt__tick { top: auto; bottom: 14px; right: 12px; margin-top: 0; }
  .spend { padding: 32px; }
  .alts { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* ---- Very narrow phones (checked to 260px) ---- */
@media (max-width: 340px) {
  :root { --gutter: 12px; }
  body { font-size: 16px; }
  .opt { padding: 10px 40px 10px 12px; grid-template-columns: 1fr; }
  .opt__price { text-align: left; white-space: normal; }
  .opt__tick { right: 10px; }
  .opt--photo { grid-template-columns: 60px 1fr; padding: 8px 38px 8px 8px; }
  .opt__img { width: 60px; height: 60px; }
  .group--chips .group__body, .group__body.group--chips { grid-template-columns: 1fr; }
  .slider__row { grid-template-columns: minmax(0, 1fr) 64px; gap: 8px; }
  .phone { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .row dd { text-align: left; }
  .total { flex-wrap: wrap; }
  .spend { padding: 18px 14px; }
  .summary > div { grid-template-columns: 1fr; gap: 0; }
  .stepper { grid-template-columns: 44px 36px 44px; }
  .site-header__logo img { width: 96px; }
}

/* ---- Embedded in the venue's own page by embed.js. The frame grows with the content, so nothing is
   sized to the screen. The venue's page already has its own header and footer. ---- */
@media screen {
  html.is-embedded .site-header, html.is-embedded .site-footer { display: none; }
  html.is-embedded .app { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress__bar, .bar__used { transition: none; }
}

@media print {
  .site-header, .site-footer, .progress, .actions, .ideas, .swap button, .alt button, #res-sliders { display: none; }
  .spend { background: none; color: #000; border: 1px solid #000; }
}
