/* Watercolour Garden. Phone first; the ivy is painted in the browser by ivy.js, once per layout. */
:root {
  --paper: #fbf8ef;
  --ink: #2c3731;
  --ink-soft: #4b5750;
  --pencil: #5c5d55;
  --deep: #24582f;
  --leaf: #3a6b2c;
  --rose: #8a4b3f;
  --script: 'Alex Brush', 'Snell Roundhand', 'Apple Chancery', cursive;
  --serif: 'Alegreya', 'Iowan Old Style', Georgia, serif;
  --gutter: 2.125rem;
}

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

/* The paper is on the root, so it covers the whole viewport however tall, with no seam below a short page. */
html {
  background: var(--paper) url("paper.239398b65d88.png") 0 0 / 480px 480px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font: 400 1.1875rem/1.55 var(--serif);
  font-feature-settings: 'lnum';
  overflow-wrap: break-word;
}

/* ---------- The sheet: paper, then paint, then words ---------- */

/*
 * ivy.js measures .wc-main and draws a frame of canvases around it: a band across the top and the
 * foot, hugging the content, and a climber up each side. So the page is exactly its content plus
 * the bands, and all sizes here are CSS pixels set by a tier (--wc-tier, read by the script).
 * --clear is how much room the ivy needs either side of the column; the column's side padding grows
 * only as far as the margin outside it cannot hold that.
 */
.wc-page {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  --wc-tier: phone;
  --main-max: 62rem;
  --clear: 41px;
  --top-pad: 7.5rem;
  --foot-pad: 5.5rem;
}

/* Only the landing page fills the screen. The others are their content plus the frame, and any
   height left over is plain paper below it. The debug bar's stylesheet takes its own room off. */
.wc-page--landing {
  min-height: 100vh;
  min-height: 100svh;
}

.wc-ivy {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.wc-main {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--main-max);
  margin-inline: auto;
  padding-block: var(--top-pad) var(--foot-pad);
  padding-inline: max(var(--gutter), calc(var(--clear) - max(0px, (100% - var(--main-max)) / 2)));
}

/* The paint soaks in once it has been drawn; with reduced motion it simply appears. */
.wc-has-ivy .wc-ivy,
.wc-has-ivy .wc-sprig canvas,
.wc-has-ivy .wc-schedule > canvas {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .wc-ivy,
  .wc-sprig canvas,
  .wc-schedule > canvas {
    transition: opacity 1.4s ease-out;
  }
}

.wc-ivy canvas {
  display: block;
}

/* Page sizes. Leaf size is set by the tier in ivy.js, so it never follows the viewport width. */

.wc-page--rsvp,
.wc-page--info {
  --top-pad: 7.5rem;
  --foot-pad: 6.5rem;
}

.wc-page--admin {
  --main-max: 72rem;
  --clear: 34px;
  --top-pad: 4.5rem;
  --foot-pad: 4.25rem;
}

.wc-page--landing {
  --main-max: 34rem;
  --clear: 58px;
  --top-pad: 6rem;
  --foot-pad: 6rem;
}

@media (min-width: 640px) {
  .wc-page {
    --wc-tier: tablet;
    --clear: 92px;
  }

  .wc-page--rsvp,
  .wc-page--info {
    --top-pad: 7.5rem;
    --foot-pad: 7.875rem;
  }

  .wc-page--admin {
    --clear: 50px;
    --foot-pad: 4.5rem;
  }

  .wc-page--landing {
    --clear: 158px;
    --top-pad: 6.875rem;
    --foot-pad: 6.875rem;
  }
}

@media (min-width: 1180px) {
  .wc-page {
    --wc-tier: wide;
    --clear: 248px;
  }

  .wc-page--rsvp,
  .wc-page--info {
    --top-pad: 8.75rem;
    --foot-pad: 9.375rem;
  }

  .wc-page--admin {
    --clear: 138px;
    --foot-pad: 5rem;
  }

  .wc-page--landing {
    --clear: 430px;
    --top-pad: 8.125rem;
    --foot-pad: 8.125rem;
  }
}

/* The very widest screens: the same wide art with everything a tenth larger. */
@media (min-width: 1700px) {
  .wc-page {
    --wc-tier: xl;
    --clear: 273px;
  }

  .wc-page--rsvp,
  .wc-page--info {
    --top-pad: 9.625rem;
    --foot-pad: 10.3125rem;
  }

  .wc-page--admin {
    --clear: 152px;
    --foot-pad: 5.125rem;
  }

  .wc-page--landing {
    --clear: 473px;
    --top-pad: 8.9375rem;
    --foot-pad: 8.9375rem;
  }
}

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

h1,
h2,
h3,
legend {
  font-weight: 400;
  margin: 0;
}

.wc-script {
  font-family: var(--script);
  color: var(--deep);
  line-height: 1.05;
}

h1.wc-script {
  font-size: clamp(3.25rem, 13.8vw, 6.25rem);
}

h2.wc-script {
  font-size: clamp(2.625rem, 9vw, 3.5rem);
}

p {
  margin: 0;
}

a {
  color: var(--deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--leaf);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--deep);
  outline-offset: 3px;
  border-radius: 3px;
}

.wc-eyebrow {
  color: var(--ink-soft);
  font-style: italic;
}

.wc-rule {
  display: block;
  width: 100%;
  height: 8px;
  background: url("pencil-line.84e7f5cba00e.svg") center / 100% 100% no-repeat;
}

/* Painted accents, drawn into a canvas by ivy.js. A sprig's leaves stray a little outside its box, as they would on paper. */
.wc-sprig {
  display: block;
  position: relative;
  width: min(100%, 15rem);
  height: 4.25rem;
  margin-inline: auto;
}

.wc-sprig canvas {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 280px;
  height: 88px;
  margin-left: -140px;
  opacity: 0;
}

/* ---------- Painted button ---------- */

.wc-button {
  display: inline-block;
  min-height: 3.25rem;
  padding: 0.75rem 2.5rem 0.85rem;
  border: 0;
  background: url("wash-button.aa194ccbbdfa.svg") center / 100% 100% no-repeat;
  color: #fffdf5;
  font: 500 1.25rem/1.4 var(--serif);
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* The same brush stroke, darkened by laying its shadow over it. */
.wc-button:hover {
  color: #fffdf5;
  background-image: url("wash-button-shade.9cfb302b448a.svg"), url("wash-button.aa194ccbbdfa.svg");
}

.wc-button:active {
  background-image:
    url("wash-button-shade.9cfb302b448a.svg"), url("wash-button-shade.9cfb302b448a.svg"), url("wash-button.aa194ccbbdfa.svg");
}

.wc-button:focus-visible {
  outline-offset: 4px;
}

/* ---------- Landing ---------- */

.wc-page--landing .wc-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.wc-scan {
  display: block;
}

.wc-scan__big {
  display: block;
  font-family: var(--script);
  color: var(--deep);
  font-size: clamp(3.25rem, 14vw, 5.5rem);
  line-height: 1.05;
}

.wc-scan__small {
  display: block;
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 4.8vw, 1.5rem);
  font-style: italic;
  text-wrap: balance;
}

/* The second way in: a pencil line to write on, and a stroke of the brush to send it. */
.wc-pass {
  width: min(100%, 17rem);
  margin: 1.25rem auto 0;
}

.wc-pass label {
  display: block;
  color: var(--deep);
  font-size: 1.3125rem;
  font-style: italic;
  font-weight: 500;
}

.wc-pass input {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.25rem 0.125rem 0.5rem;
  border: 0;
  border-radius: 0;
  background: url("pencil-line.84e7f5cba00e.svg") bottom / 100% 8px no-repeat;
  color: var(--ink);
  font: inherit;
  text-align: center;
}

.wc-pass .wc-button {
  margin-top: 0.875rem;
}

/* ---------- RSVP ---------- */

.wc-hero {
  max-width: 36rem;
  margin-inline: auto;
  text-align: center;
}

.wc-hero h1 {
  margin-block: 0.25rem 0.75rem;
}

.wc-hero__lede {
  font-size: 1.25rem;
}

.wc-guests {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.wc-guest {
  min-width: 0;
}

.wc-guest__name {
  text-align: center;
  margin-bottom: 1rem;
}

.wc-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.wc-fieldset + .wc-fieldset,
.wc-menu .wc-fieldset:first-child {
  margin-top: 1.75rem;
}

.wc-fieldset > legend {
  padding: 0;
  margin-bottom: 0.25rem;
  color: var(--deep);
  font-size: 1.3125rem;
  font-style: italic;
  font-weight: 500;
}

.wc-choice {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.75rem;
  align-items: start;
  min-height: 2.75rem;
  padding-block: 0.5rem;
  cursor: pointer;
}

.wc-choice span {
  padding-top: 0.0625rem;
}

.wc-choice input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  background: url("pencil-ring.df7eff0de7f6.svg") center / 100% 100% no-repeat;
  border-radius: 50%;
  cursor: pointer;
}

.wc-choice input:checked {
  background-image: url("pencil-ring-checked.7ddef3ed7ae0.svg");
}

.wc-choice input:checked + span {
  color: var(--deep);
  font-weight: 500;
}

.wc-choice input:focus-visible {
  border-radius: 50%;
}

/* Someone who cannot come is not asked what they would like to eat. */
.wc-guest:has(input[value='declined']:checked) .wc-menu {
  display: none;
}

.wc-guest:has(input[value='declined']:checked) .wc-regret {
  display: block;
}

.wc-regret {
  display: none;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-style: italic;
}

.wc-field {
  display: block;
  margin-top: 1.75rem;
}

.wc-field label {
  display: block;
  color: var(--deep);
  font-size: 1.3125rem;
  font-style: italic;
  font-weight: 500;
}

.wc-field textarea {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  margin-top: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0;
  background: url("pencil-box.42bae2fb61c0.svg") center / 100% 100% no-repeat;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.wc-field textarea::placeholder {
  color: var(--ink-soft);
  font-style: italic;
  opacity: 1;
}

.wc-send {
  margin-top: 3rem;
  text-align: center;
}

.wc-send__note {
  margin-top: 1.25rem;
  color: var(--ink-soft);
}

.wc-guest-divider {
  margin-block: 0.5rem;
}

/* ---------- Info ---------- */

.wc-page--info {
  --main-max: 58rem;
}

.wc-where {
  margin-top: 0.75rem;
  font-size: 1.3125rem;
}

.wc-where strong {
  display: block;
  font-weight: 500;
}

.wc-info-grid {
  display: grid;
  gap: 2.5rem;
  margin-top: 1.5rem;
}

/* Times to one side and events to the other, with a stalk of ivy climbing between them. */
.wc-schedule {
  position: relative;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.wc-schedule > canvas {
  position: absolute;
  top: 0;
  left: 4.875rem;
  width: 2.75rem;
  height: 100%;
  opacity: 0;
}

.wc-schedule li {
  display: grid;
  grid-template-columns: 4.5rem 2.75rem minmax(0, 1fr);
  gap: 0.375rem;
  align-items: center;
  min-height: 2.8125rem;
  padding-block: 0.5rem;
}

.wc-schedule time {
  color: var(--deep);
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 500;
  text-align: right;
}

.wc-schedule span {
  grid-column: 3;
}

.wc-detail + .wc-detail {
  margin-top: 1.25rem;
}

.wc-detail h3 {
  color: var(--deep);
  font-size: 1.3125rem;
  font-style: italic;
  font-weight: 500;
}

.wc-details {
  margin-top: 1rem;
}

.wc-reply {
  margin-top: 3rem;
  text-align: center;
}

.wc-reply__by {
  margin-block: 0.25rem 1.25rem;
  font-size: 1.25rem;
}

.wc-contact {
  margin-top: 2.5rem;
  text-align: center;
}

/* ---------- Admin: same paper and paint, quieter and denser ---------- */

.wc-page--admin {
  font-size: 1.0625rem;
  line-height: 1.4;
}

.wc-admin-head h1 {
  font-size: clamp(2.75rem, 11vw, 3.75rem);
}

.wc-admin-head p {
  color: var(--ink-soft);
  font-style: italic;
}

.wc-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  margin: 1.5rem 0 0;
}

.wc-totals div {
  padding-bottom: 0.5rem;
  background: url("pencil-line.84e7f5cba00e.svg") bottom / 100% 8px no-repeat;
}

.wc-totals dt {
  color: var(--ink-soft);
  font-size: 1rem;
}

.wc-totals dd {
  margin: 0;
  color: var(--deep);
  font-size: 2.25rem;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 500;
  line-height: 1.15;
}

.wc-admin-section {
  margin-top: 2rem;
}

.wc-admin-section h2 {
  color: var(--deep);
  font-size: 1.375rem;
  font-style: italic;
  font-weight: 500;
}

.wc-mains {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.wc-mains li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  padding-block: 0.25rem;
}

.wc-mains strong {
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 500;
}

.wc-bar {
  grid-column: 1 / -1;
  display: block;
  position: relative;
  height: 1.125rem;
  background:
    url("pencil-tick.ab2ab41d0f60.svg") 0 100% / calc(100% * 10 / var(--guests)) 0.5rem repeat-x,
    url("pencil-line.84e7f5cba00e.svg") bottom / 100% 4px no-repeat;
}

/* A brush stroke laid along a pencil ruler marked every ten guests. */
.wc-bar span {
  display: block;
  height: 0.875rem;
  border-style: solid;
  border-width: 0 10px 0 6px;
  border-image: url("wash-bar.685a2641f24a.svg") 0 10 0 6 fill stretch;
}

/* Phones get stacked rows; roles keep it a table for assistive technology. */
.wc-table {
  width: 100%;
  margin-top: 0.5rem;
  border-collapse: collapse;
}

.wc-table thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.wc-table tr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
  padding-block: 0.625rem;
  background: url("pencil-line-faint.c700d0fbe52b.svg") bottom / 100% 6px no-repeat;
}

.wc-table td,
.wc-table th {
  display: block;
  padding: 0;
  font-weight: 400;
  text-align: left;
}

.wc-table td[data-label] {
  font-size: 1rem;
}

.wc-table td[data-label]::before {
  content: attr(data-label) ': ';
  color: var(--ink-soft);
  font-style: italic;
}

.wc-table .wc-guestname {
  font-weight: 500;
}

.wc-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.wc-status::before {
  content: '';
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.wc-status--attending::before {
  background: radial-gradient(circle at 40% 35%, #5aa85a, #2a6a35 75%);
}

.wc-status--declined::before {
  background: radial-gradient(circle at 40% 35%, #c08a70, #8a4b3f 75%);
}

.wc-status--awaiting-reply::before {
  border: 1px solid var(--pencil);
}

.wc-status--declined {
  color: var(--rose);
}

.wc-status--awaiting-reply {
  color: var(--ink-soft);
}

@media (min-width: 50rem) {
  :root {
    --gutter: 3rem;
  }

  .wc-guests {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 4rem;
    align-items: start;
  }

  .wc-guest-divider {
    display: none;
  }

  /* A guest left alone on the last row (a single guest, or the odd one out) sits in the middle at
     the width of one column. In the form a divider follows each guest but the last, so guests are
     the odd children there; in the summary they are every child. */
  .wc-guests > .wc-guest:last-child:nth-child(4n + 1),
  .sk-summary > .wc-guest:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 4rem) / 2);
  }

  .wc-info-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 4rem;
    margin-top: 2.5rem;
  }

  .wc-totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
  }

  .wc-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
  }

  .wc-table thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .wc-table thead th {
    color: var(--ink-soft);
    font-size: 1rem;
    font-style: italic;
    padding-bottom: 0.25rem;
  }

  .wc-table tr {
    grid-template-columns: 1.3fr 1.1fr 1.2fr 1fr;
    gap: 1rem;
    padding-block: 0.4375rem;
  }

  .wc-table td[data-label]::before {
    content: none;
  }
}
