@font-face { font-family: "Cardo"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/cardo-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Cardo"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/cardo-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Cardo"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/cardo-latin-700-normal.woff2") format("woff2"); }

/* ---------- Type & sizes (colours live in themes.css) ---------- */
:root {
  --serif: Cardo, "Palatino Linotype", Palatino, Georgia, serif;
  --border-width: 18px;               /* the card's blue border (the waves cut into its outer edge; see wavy-edge.js) */
  --pattern-size: 1000px;             /* size of the flower tile: smaller = busier */
}

* { box-sizing: border-box; }

html { font-size: 112.5%; } /* 18px base: easy reading */

body {
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem 1rem 2.5rem;
  background-color: var(--page-bg);
  /* block-printed flowers, tiled so they go on and on */
  background-image: var(--pattern);
  background-size: var(--pattern-size) var(--pattern-size);
  background-blend-mode: var(--pattern-blend, normal);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.55;
  overflow-x: hidden;
}

/* ---------- The card, sitting above the flowers ---------- */
/* .card-wrap exists so the card's cut edge can have a shadow that follows it */
.card-wrap { display: block; max-width: 36rem; margin: 0 auto; filter: drop-shadow(0 2px 2px var(--shadow)) drop-shadow(0 12px 22px var(--shadow)); }
.card {
  position: relative;
  max-width: 36rem;
  margin: 0 auto;
  --card-pad-top: 3rem; --card-pad-x: 2rem; --card-pad-bottom: 2.25rem;
  padding: var(--card-pad-top) var(--card-pad-x) var(--card-pad-bottom);
  background: var(--paper);
  text-align: center;
  border: var(--border-width) solid var(--art);
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-weight: 400; margin: 0; }
h1 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 .5rem; }
.lead-in { font-size: 1.25rem; }
.date { font-size: 1.8rem; display: inline-block; margin: .3rem 0; }
.date sup { font-size: .55em; line-height: 0; vertical-align: super; }
.where { font-size: 1.25rem; margin: .7rem 0 0; }
.more { font-style: italic; margin: .15rem 0 0; }
.names { font-size: 1.8rem; line-height: 1.2; margin: 0; }
.amp { font-style: italic; }
h2 { font-size: 1.5rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .75rem; }
p { margin: .5rem 0; }

.small-caps { font-size: .85rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }

a { color: var(--ink); }

/* ---------- Form ---------- */
form { text-align: left; max-width: 28rem; margin: 0 auto; }
.field { margin: 0 0 1.5rem; padding: 0; border: 0; }
label, legend { display: block; font-size: 1rem; margin-bottom: .35rem; padding: 0; }
.optional { color: var(--ink-soft); font-size: .9rem; }
.legend-note { display: block; font-size: .9rem; font-style: italic; margin-top: .1rem; }

input[type="text"], input[type="email"], textarea {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: .7rem .8rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
}
textarea { resize: vertical; border: 2px solid var(--ink); }
input:focus, textarea:focus, .choice:focus-within, .send:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.choices { display: grid; gap: .6rem; }
.choice {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem 1rem; margin: 0;
  border: 2px solid var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
}
.choice input { width: 1.4rem; height: 1.4rem; accent-color: var(--accent); margin: 0; }
.choice:has(input:checked) { background: var(--ink); color: var(--paper); }

.send {
  display: block; width: 100%;
  font: inherit; font-size: 1.2rem; letter-spacing: .08em;
  padding: 1rem;
  color: var(--paper); background: var(--ink);
  border: 2px solid var(--ink); cursor: pointer;
  min-height: 3.5rem;
}
.send:hover { filter: brightness(.92); }
.send[disabled] { opacity: .6; cursor: wait; }

.error { color: var(--error); font-weight: 700; margin: .35rem 0 0; min-height: 0; }
.error:empty { display: none; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--error); }

#form-status { margin-top: 1.25rem; }
#form-status:empty { margin: 0; }
.problem { margin-top: 1.25rem; border: 4px solid var(--alert); padding: 1rem; background: var(--alert-bg); }
.problem[hidden] { display: none; }
.problem p { margin: 0; }
.problem a { font-weight: 700; }

.thanks { padding: 1rem 0 .5rem; }
.thanks-msg { font-size: 1.5rem; font-style: italic; line-height: 1.4; margin: 0 0 1.5rem; }
.thanks-msg[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

footer { margin-top: 2.5rem; }
footer .small-caps { font-size: .7rem; letter-spacing: .12em; text-wrap: balance; }
footer a { text-transform: none; letter-spacing: .04em; font-size: .85rem; }   /* the email address reads better in lower case */
.invite { margin-bottom: 2.5rem; }

@media (max-width: 480px) {
  body { padding: 1rem .75rem 1.5rem; }
  .card { --card-pad-top: 2.5rem; --card-pad-x: 1.4rem; --card-pad-bottom: 1.75rem; }
  .date { font-size: 1.5rem; } .names { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Address group */
fieldset.address { border: 2px solid var(--ink); padding: 1rem 1rem .25rem; margin: 0 0 1.5rem; }
fieldset.address legend { padding: 0 .5rem; margin-bottom: 0; }
fieldset.address .sub { margin-bottom: 1rem; }
fieldset.address .sub label { font-size: .95rem; }

/* A link that looks like the Send button (used on the homepage placeholder) */
a.send { text-align: center; text-decoration: none; line-height: 1.4; }

/* ---------- Flowers ON the card ----------
   A strip of the watercolour flowers sits at the top of the card and another at the bottom, whole and
   edge to edge. (The faint flowers on the page behind come from --pattern in themes.css.) */
.card::before {
  content: "";
  position: static; inset: auto; border: 0;
  display: block;
  aspect-ratio: 1400 / 361;
  margin: calc(-1 * var(--card-pad-top)) calc(-1 * var(--card-pad-x)) 1.25rem;
  background: var(--card-top) center / 100% 100% no-repeat;
}
.card::after {
  content: "";
  display: block;
  aspect-ratio: 1400 / 668;
  margin: 1.5rem calc(-1 * var(--card-pad-x)) calc(-1 * var(--card-pad-bottom));
  background: var(--card-bottom) center / 100% 100% no-repeat;
}

/* The card's edge: a plain blue border, and public/wavy-edge.js cuts the card's outline (clip-path) into long,
   irregular waves so the real edge is wavy. The shadow is on .card-wrap so that it follows the cut edge.
   (Without JavaScript the card just keeps a straight edge.) */

/* ---------- The painted header and heading (see savethedate.html) ---------- */
:root { --lw: min(540px, calc(100vw - 120px)); }   /* --lw = width of the date line in the painted header; the other lettering is sized from it */
.painted { margin: 0; }
.painted .ltr { display: block; margin-left: auto; margin-right: auto; height: auto; max-width: 100%; }
.ltr-names { display: block; text-align: center; }
.ltr-names .ltr { margin: calc(var(--lw) * 6 / 1018) auto 0; }
.ltr-names .ltr:first-child { margin-top: 0; }
.ltr-heading { display: block; margin: 0 auto; width: calc(var(--lw) * 599 / 1018); height: auto; }
