/* Kim & Luke — guestbook. Styled after the wedding invitation:
   white paper, black serif capitals with wide tracking, a fine script and long hairline swashes. */

:root {
  --paper: #ffffff;
  --ink: #141414;
  --ink-soft: #3a3a3a;
  --muted: #7a7774;
  --line: #dedad4;
  --line-strong: #bdb8b0;
  --wash: #f7f5f2;
  --accent: #8f5a34;            /* a whisper of the autumn colour scheme */
  --danger: #9b2c2c;
  --caps: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --body: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  --script: "Mrs Saint Delafield", "Snell Roundhand", "Apple Chancery", cursive;
  --radius: 3px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: clamp(36px, 7vw, 72px) var(--gutter) clamp(20px, 4vw, 36px);
}
.hero__kicker {
  font-family: var(--caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: clamp(13px, 1.8vw, 17px);
  margin: 0 auto 18px;
  max-width: 30em;
}
.names { margin: 0; font-weight: 500; line-height: 1; }
.names__name {
  display: block;
  font-family: var(--caps);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: clamp(54px, 10vw, 104px);
  padding-left: .12em; /* balances tracking */
}
.names__and {
  position: relative;
  display: block;
  height: clamp(48px, 8vw, 84px);
  margin: -.05em calc(-1 * var(--gutter));
}
.swash { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.swash path { fill: none; stroke: var(--ink); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.names__and .script {
  position: relative;
  font-family: var(--script);
  font-size: clamp(56px, 9vw, 96px);
  line-height: 1;
  display: inline-block;
  transform: translateY(-.06em);
  background: linear-gradient(to bottom, transparent 46%, var(--paper) 46%, var(--paper) 62%, transparent 62%);
  padding: 0 .1em;
}
.dateline {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(14px, 3vw, 28px);
  margin: clamp(26px, 4vw, 40px) 0 clamp(18px, 3vw, 28px);
  font-family: var(--caps);
  font-weight: 600;
}
.dateline__side {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: clamp(16px, 2.4vw, 22px);
  padding-bottom: .55em;
  min-width: 5.5em;
}
.dateline__side:first-child { text-align: right; }
.dateline__side:last-child { text-align: left; }
.dateline__day {
  position: relative;
  border-left: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
  padding: 0 clamp(14px, 2.6vw, 24px);
}
.arc {
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 120px;
  transform: translate(-50%, 6px);
  overflow: visible;
}
.arc text { font-family: var(--caps); font-weight: 600; font-size: 13px; letter-spacing: .28em; fill: var(--ink); }
.dateline__num { font-size: clamp(52px, 8vw, 72px); font-weight: 500; line-height: 1; display: block; }
.venue {
  margin: 0;
  font-family: var(--caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: clamp(17px, 2.4vw, 22px);
  line-height: 1.5;
}
.venue span { font-size: .78em; letter-spacing: .2em; color: var(--ink-soft); }

/* ── Tabs ───────────────────────────────────────────── */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: clamp(8px, 4vw, 48px);
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--gutter);
}
.tabs a {
  font-family: var(--caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: clamp(14px, 2vw, 17px);
  color: var(--muted);
  text-decoration: none;
  padding: 16px 6px 14px;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ── Section titles: small serif THE + big script word, as on the invitation ── */
main { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.view { padding: clamp(36px, 6vw, 64px) 0 40px; animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.title {
  position: relative;
  margin: 0 auto 8px;
  text-align: center;
  font-weight: 400;
  line-height: 1;
  height: clamp(118px, 17vw, 168px);
}
.title__the {
  display: block;
  font-family: var(--caps);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: clamp(30px, 4.4vw, 44px);
  position: relative;
  z-index: 1;
}
.title__script {
  display: block;
  font-family: var(--script);
  font-size: clamp(86px, 13vw, 138px);
  line-height: .9;
  margin-top: -.32em;
  position: relative;
  z-index: 2;
}
.title::before {   /* the long hairline that sweeps in from the left */
  content: "";
  position: absolute;
  left: 50%;
  top: clamp(30px, 4vw, 40px);
  width: min(560px, 82vw);
  height: 80px;
  transform: translateX(-62%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 80' preserveAspectRatio='none'%3E%3Cpath d='M4 78 C 30 40, 150 22, 300 8 C 360 3, 420 1, 556 2' fill='none' stroke='%23141414' stroke-width='1.1'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  pointer-events: none;
}
.lede {
  text-align: center;
  max-width: 34em;
  margin: 0 auto clamp(28px, 4vw, 40px);
  font-size: clamp(19px, 2.3vw, 22px);
  color: var(--ink-soft);
}
.subhead {
  text-align: center;
  font-family: var(--caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: clamp(17px, 2.2vw, 21px);
  margin: 0 0 28px;
}
.count { color: var(--muted); letter-spacing: .1em; font-weight: 500; }
.count:not(:empty)::before { content: "· "; }
.divider { display: flex; align-items: center; gap: 18px; margin: clamp(40px, 6vw, 64px) auto 36px; max-width: 420px; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.empty { text-align: center; color: var(--muted); font-style: italic; margin: 8px 0 40px; }

/* ── Cards & forms ──────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 3.4vw, 36px);
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 14px 40px -28px rgba(0,0,0,.25);
}
.sign { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.field { display: block; margin-bottom: 22px; }
.field__label {
  display: block;
  font-family: var(--caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field__label em { text-transform: none; letter-spacing: .02em; font-style: italic; color: var(--muted); font-weight: 500; }
.field input, .field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  padding: 10px 2px;
  font-size: 21px;         /* ≥16px stops iPad/iPhone zooming in */
  border-radius: 0;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}
.field textarea {
  resize: vertical;
  min-height: 9em;
  line-height: 1.6;
  /* faint ruled lines, like writing in a book */
  background-image: linear-gradient(to bottom, transparent calc(1.6em - 1px), var(--line) calc(1.6em - 1px), var(--line) 1.6em);
  background-size: 100% 1.6em;
  background-attachment: local;
  padding-top: 0;
  border-bottom-color: transparent;
}
.field input:focus { border-bottom-color: var(--ink); }
.field textarea:focus { box-shadow: 0 1px 0 var(--ink); }
.field input::placeholder, .field textarea::placeholder { color: #aaa49c; font-style: italic; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: var(--caps);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: 17px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #2b2b2b; }
.btn:active { transform: scale(.99); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--wash); }
.btn--danger { background: var(--danger); border-color: var(--danger); }
.form__error { color: var(--danger); margin: -6px 0 16px; font-style: italic; }

/* QR card */
.qr { text-align: center; padding: 26px 22px; position: sticky; top: 76px; }
.qr__eyebrow { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; font-size: 15px; margin: 0 0 14px; }
.qr__code { width: 176px; height: 176px; margin: 0 auto 14px; }
.qr__code svg { width: 100%; height: 100%; display: block; }
.qr__text { margin: 0 0 8px; font-size: 17px; color: var(--ink-soft); line-height: 1.4; }
.qr__url { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: .04em; word-break: break-all; }

/* Message wall */
.wall { columns: 3 300px; column-gap: 22px; }
.note {
  break-inside: avoid;
  margin: 0 0 22px;
  padding: 28px 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  position: relative;
  text-align: center;
}
.note.is-new { animation: arrive .8s ease both; }
@keyframes arrive { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.note__msg { margin: 0 0 14px; white-space: pre-line; overflow-wrap: anywhere; font-size: 19px; }
.note__name { font-family: var(--script); font-size: 40px; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.note__time { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.x {
  position: absolute; top: 6px; right: 6px;
  width: 34px; height: 34px;
  border: 1px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--danger);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.is-admin .x { display: inline-flex; }

/* ── Photos ─────────────────────────────────────────── */
.uploader { max-width: 760px; margin: 0 auto clamp(40px, 6vw, 64px); }
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(36px, 6vw, 56px) 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--wash);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  outline: none;
}
.drop:hover, .drop:focus-visible { border-color: var(--ink); }
.drop.is-over { border-color: var(--accent); background: #f6efe8; }
.drop__icon { width: 58px; height: 48px; fill: none; stroke: var(--ink); stroke-width: 1.6; margin-bottom: 8px; }
.drop__main { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .16em; font-size: clamp(16px, 2.3vw, 20px); }
.drop__sub { color: var(--muted); font-style: italic; }
.show-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .show-touch { display: inline; } .hide-touch { display: none; } }

.queue { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.queue:empty { display: none; }
.q { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; font-size: 16px; }
.q__thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 2px; background: var(--wash); }
.q__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q__bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.q__bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.q__status { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .14em; font-size: 13px; color: var(--muted); }
.q.is-done .q__status { color: var(--ink); }
.q.is-error .q__status { color: var(--danger); }
.q__err { color: var(--danger); font-style: italic; font-size: 15px; }

.gallery { columns: 4 220px; column-gap: 12px; }
.ph { break-inside: avoid; margin: 0 0 12px; position: relative; border-radius: 2px; overflow: hidden; background: var(--wash); cursor: zoom-in; }
.ph img { width: 100%; height: auto; transition: transform .5s ease; }
.ph:hover img { transform: scale(1.025); }
.ph__by { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; font-size: 15px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.45)); opacity: 0; transition: opacity .3s; }
.ph:hover .ph__by { opacity: 1; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(255,255,255,.97); display: flex; align-items: center; justify-content: center; padding: 56px 64px; }
.lb__fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lb__fig img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; box-shadow: 0 20px 60px -30px rgba(0,0,0,.5); }
.lb__fig figcaption { margin-top: 12px; color: var(--muted); font-style: italic; text-align: center; }
.lb__close, .lb__nav { position: absolute; border: 0; background: none; cursor: pointer; color: var(--ink); line-height: 1; padding: 10px 16px; }
.lb__close { top: 8px; right: 10px; font-size: 42px; }
.lb__nav { top: 50%; transform: translateY(-50%); font-size: 64px; font-family: var(--caps); }
.lb__prev { left: 4px; } .lb__next { right: 4px; }
.lb__dl { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; font-size: 14px; color: var(--ink); }

/* ── Readings ───────────────────────────────────────── */
.abbey { margin: 0 auto 44px; max-width: 460px; }
.abbey img { width: 100%; height: auto; mix-blend-mode: multiply; }
.readings { max-width: 720px; margin: 0 auto; }
.reading { position: relative; text-align: center; padding: 0 0 48px; margin: 0 0 48px; border-bottom: 1px solid var(--line); }
.reading:last-child { border-bottom: 0; }
.reading__title { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .16em; font-size: clamp(20px, 3vw, 26px); margin: 0 0 6px; line-height: 1.3; }
.reading__by { font-style: italic; color: var(--ink-soft); margin: 0; }
.reading__reader { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .16em; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.reading__body { white-space: pre-line; margin: 26px 0 0; font-size: 20px; line-height: 1.75; }
.reading__body.is-collapsed { max-height: 22em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.reading__more { margin-top: 10px; background: none; border: 0; cursor: pointer; font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .18em; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.doc {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 24px;
  padding: 14px 20px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; text-align: left; transition: border-color .2s, background .2s;
}
.doc:hover { border-color: var(--ink); background: var(--wash); }
.doc__badge { font-family: var(--caps); font-weight: 600; letter-spacing: .1em; font-size: 13px; border: 1px solid var(--ink); padding: 6px 8px; text-transform: uppercase; }
.doc__name { display: block; font-size: 17px; }
.doc__size { display: block; font-size: 14px; color: var(--muted); }
.reading__tools { display: none; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.is-admin .reading__tools { display: flex; }
.tool { border: 1px solid var(--line-strong); background: #fff; border-radius: var(--radius); padding: 8px 14px; cursor: pointer; font-family: var(--caps); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.tool--danger { color: var(--danger); }

/* ── Footer, admin, modal, toast, thanks ───────────── */
.foot { text-align: center; padding: 40px var(--gutter) 48px; border-top: 1px solid var(--line); margin-top: 20px; }
.foot__script { font-family: var(--script); font-size: 54px; margin: 0; line-height: 1.1; }
.foot__date { font-family: var(--caps); font-weight: 600; letter-spacing: .3em; font-size: 14px; margin: 4px 0 18px; }
.foot__admin { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.adminbar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: center; background: var(--ink); color: #fff; padding: 10px var(--gutter); font-size: 15px; }
.adminbar__label { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: #d8c3b0; margin-right: 6px; }
.adminbar a, .adminbar button { color: #fff; background: none; border: 0; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.is-admin .tabs { top: 44px; }

.modal { position: fixed; inset: 0; z-index: 70; background: rgba(20,20,20,.35); display: flex; align-items: flex-start; justify-content: center; padding: 6vh var(--gutter); overflow-y: auto; }
.modal__box { width: 100%; max-width: 620px; }
.modal__title { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .18em; font-size: 20px; text-align: center; margin: 0 0 24px; }
.modal__note { color: var(--muted); font-style: italic; font-size: 16px; margin: -12px 0 20px; text-align: center; }
.modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.file-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 16px; }
.file-pick input { font-size: 16px; border: 0; padding: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 30px; font-size: 16px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); max-width: calc(100vw - 32px); text-align: center; }

.thanks { position: fixed; inset: 0; z-index: 90; background: var(--paper); display: flex; align-items: center; justify-content: center; text-align: center; padding: var(--gutter); animation: fade .4s ease both; cursor: pointer; }
.thanks__script { font-family: var(--script); font-size: clamp(110px, 20vw, 190px); line-height: 1; margin: 0 0 10px; }
.thanks__text { font-size: clamp(20px, 3vw, 26px); margin: 0 0 30px; color: var(--ink-soft); }
.thanks__hint { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .2em; font-size: 13px; color: var(--muted); margin: 0; }

/* ── Kiosk (iPad on the guestbook table): open the site with ?kiosk ── */
.kiosk .foot__admin { display: none; }
.kiosk .hero { padding-top: 28px; }

/* ── Small screens ──────────────────────────────────── */
@media (max-width: 820px) {
  .sign { grid-template-columns: 1fr; }
  .qr { position: static; display: grid; grid-template-columns: 120px 1fr; gap: 6px 18px; text-align: left; align-items: center; }
  .qr__eyebrow { grid-column: 2; margin: 0; }
  .qr__code { grid-row: 1 / span 3; width: 120px; height: 120px; margin: 0; }
  .qr__text, .qr__url { grid-column: 2; }
  .kiosk .qr { display: block; text-align: center; }
  .kiosk .qr__code { width: 160px; height: 160px; margin: 0 auto 12px; }
}
@media (max-width: 560px) {
  body { font-size: 18px; }
  .qr { display: none; }           /* guests on phones are already here */
  .kiosk .qr { display: block; }
  .lightbox { padding: 56px 8px; }
  .lb__nav { font-size: 48px; padding: 10px 6px; }
  .dateline__side { min-width: 0; }
  .wall { columns: 1; }
  .gallery { columns: 2; column-gap: 8px; }
  .ph { margin-bottom: 8px; }
}

/* ── Printing the guestbook as a keepsake ──────────── */
@media print {
  @page { margin: 16mm; }
  body { font-size: 12pt; }
  .tabs, .adminbar, .sign, .lede, .foot__admin, .x, .toast, .modal, .lightbox, .thanks, .divider,
  #view-photos, #view-readings { display: none !important; }
  #view-guestbook { display: block !important; animation: none; }
  .hero { padding: 0 0 10mm; }
  .wall { columns: 2; column-gap: 8mm; }
  .note { border-color: #ccc; page-break-inside: avoid; }
  .note__name { font-size: 26pt; }
}
