/* Matches the family holiday card: a string of lights around a pale gray
   page, staggered red script with a dark shadow, and rounded photos. */
:root {
  --ground: #ece8e8;
  --paper: #fff;
  --ink: #292524;
  --soft: #5a5351;
  --red: #de5248;       /* the card's red, for large lettering */
  --red-deep: #b5362d;  /* dark enough for buttons and small text */
  --red-dark: #8f2720;
  --yellow: #ffc655;
  --blue: #90c4c8;
  --shadow: #433e3d;
  --line: #cbc4c3;
  --band: 84px;
  --script: Pacifico, "Brush Script MT", cursive;
  --caps: "Lilita One", "Arial Rounded MT Bold", Impact, sans-serif;
  --diner: "Fontdiner Swanky", "Cooper Black", Georgia, serif;
  --serif: "Bree Serif", Rockwell, Georgia, serif;
  --hand: Kalam, "Bradley Hand", "Segoe Print", cursive;
  --text: Jost, Futura, "Century Gothic", "Trebuchet MS", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1.1875rem/1.5 var(--text); }

/* Lights run along the top and bottom. Wide screens get the whole frame. */
.lights {
  min-height: 100vh;
  border: 0 solid transparent;
  border-width: var(--band) 0;
  border-image: url("lights.svg") 240 round;
}
.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
main { padding-block: 1rem 2rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }

h1, h2, h3, h4, p, ul { margin: 0; }
h1, h2 { font-weight: 400; color: var(--red); overflow-wrap: anywhere; }
h1 { font-family: var(--script); font-style: italic; }
h2 { font-family: var(--diner); }
h1 {
  padding-right: .15em;
  font-size: clamp(2.75rem, 9.5vw, 5.5rem);
  line-height: 1.3;
  text-shadow: .015em .015em 0 var(--shadow), .03em .03em 0 var(--shadow), .045em .045em 0 var(--shadow), .06em .06em 0 var(--shadow);
}
/* Triple-tapping the header opens admin, so taps shouldn't zoom or select. */
[data-admin] { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
h1 span { display: block; }
h1 span + span { margin-top: .3em; padding-left: .9em; font-family: var(--diner); font-size: .8em; font-style: normal; }
h2 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.35;
  text-shadow: .02em .02em 0 var(--shadow), .04em .04em 0 var(--shadow), .055em .055em 0 var(--shadow);
}
h3, .sign-off { font-family: var(--caps); font-weight: 400; letter-spacing: .03em; text-transform: uppercase; }
h3 { margin-top: 1rem; font-size: 1.375rem; color: var(--red-deep); }
h4 { font-family: var(--serif); font-size: 1.375rem; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
.choices { display: grid; gap: 1rem; max-width: 24rem; }
.sign-off { justify-self: end; color: var(--red); font-size: clamp(1.5rem, 4vw, 2.25rem); text-shadow: 1px 1px 0 var(--shadow), 2px 2px 0 var(--shadow); }

.lede { max-width: 38rem; color: var(--soft); }
.intro, section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
section, .gift { scroll-margin-top: 1.5rem; }
.empty, .off, .hint { color: var(--soft); }
.steps { display: grid; gap: .5rem; max-width: 40rem; margin: 0; padding-left: 1.75rem; }
.steps li::marker { color: var(--red-deep); font-family: var(--caps); }
.steps strong { font-weight: 600; }
.jump { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.jump a { padding-block: .5rem; font-weight: 500; }

a, .link { color: var(--red-deep); text-underline-offset: .2em; }
a:hover, .link:hover { color: var(--red-dark); }
.link { min-height: 3rem; padding: .5rem 0; border: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.button {
  display: inline-block;
  min-height: 3rem;
  padding: .625rem 1.25rem;
  border: 2px solid var(--red-deep);
  border-radius: 12px;
  background: var(--red-deep);
  color: #fff;
  font: 500 1.125rem/1.4 var(--text);
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.button:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.button.quiet { border-color: var(--ink); background: transparent; color: var(--ink); }
.button.quiet:hover { background: var(--ink); color: #fff; }

label { font-weight: 500; }
input {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: .625rem .75rem;
  border: 2px solid #7d7472;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
::placeholder { color: #6d6563; opacity: 1; }
.inline { display: grid; gap: .5rem; max-width: 44rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; }
.row input { flex: 1 1 14rem; }
.notice, .thanks, .after-shop, .bought-by { padding: .875rem 1rem; border-radius: 12px; background: var(--yellow); }
.notice { max-width: 44rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 2rem; }
.gift { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 16px; background: var(--paper); }
.picture { display: grid; place-items: center; aspect-ratio: 1; padding: 1rem; border-radius: 16px 16px 0 0; overflow: hidden; }
.picture img { width: 100%; height: 100%; min-height: 0; border-radius: 8px; object-fit: contain; }
.picture .blank { width: 85%; height: auto; }
.body { flex: 1; display: flex; flex-direction: column; gap: .5rem; padding: .5rem 1.25rem 1.25rem; }
.facts { display: flex; flex-wrap: wrap; gap: .125rem .75rem; color: var(--soft); overflow-wrap: anywhere; }
.facts strong { color: var(--red-deep); font-family: var(--caps); font-weight: 400; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.note { font-family: var(--hand); font-size: 1.25rem; white-space: pre-line; overflow-wrap: anywhere; }
.more { color: var(--soft); overflow-wrap: anywhere; }
.more summary { color: var(--red-deep); cursor: pointer; }

/* Full-width buttons, shop first, in the order people use them. */
.actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin-top: auto; padding-top: .75rem; }
.actions .button { width: 100%; }

/* A bulb hangs over the corner of each gift you've bought, the way the
   lights overlap the photos on the card. */
.mine::after {
  content: "";
  position: absolute;
  top: -.75rem;
  right: 1rem;
  width: 4rem;
  aspect-ratio: 80 / 124;
  background: url("bulb.svg") center / contain no-repeat;
  transform: rotate(-12deg);
  pointer-events: none;
}
.taken { border: 2px solid var(--line); background: transparent; }
.taken .picture img { opacity: .5; filter: grayscale(1); }

.guests { margin-top: 1rem; padding: 0; list-style: none; }
.guests li { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr) 9rem 5rem; align-items: center; gap: .5rem 1rem; padding: .875rem 0; border-top: 2px solid var(--line); }
.guests strong { font-weight: 500; overflow-wrap: anywhere; }
.guests .off { grid-column: 2 / 4; }
.guests input { color: var(--soft); text-overflow: ellipsis; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (min-width: 48rem) { .lights { --band: 120px; } }
@media (min-width: 80rem) { .lights { border-width: var(--band); } }
@media (max-width: 44rem) {
  .guests li { grid-template-columns: minmax(0, 1fr) auto; }
  .guests input { grid-column: 1 / -1; }
  .guests .off { grid-column: auto; }
}
