/* Wedding photo server — shared styles.
   Font stacks are deliberately system-only so the pages look right even on a
   venue wifi with no internet. */

:root {
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -12px rgba(0,0,0,.18);
  --maxw: 720px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; display: flex; flex-direction: column; }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- header */

.masthead { text-align: center; padding: 42px 20px 26px; }

.masthead .flourish {
  display: block; width: 64px; height: 1px; margin: 0 auto 22px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.masthead h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 8vw, 46px);
  letter-spacing: .01em;
  margin: 0 0 8px;
  line-height: 1.15;
}

.masthead .date {
  font-family: var(--serif);
  font-style: italic;
  opacity: .62;
  font-size: 15px;
  letter-spacing: .06em;
  margin: 0;
}

.masthead .lede {
  margin: 18px auto 0;
  max-width: 30em;
  font-size: 16px;
  line-height: 1.6;
  opacity: .78;
}

.eyebrow {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  opacity: .5; font-weight: 600;
}

/* ------------------------------------------------------------------ nav */

.subnav {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  padding: 0 20px 8px;
}
.subnav a {
  font-size: 13px; letter-spacing: .04em; text-decoration: none;
  padding: 7px 14px; border-radius: 999px; color: var(--ink); opacity: .6;
}
.subnav a:hover { opacity: 1; background: var(--accent-soft); }
.subnav a.on { opacity: 1; background: var(--accent-soft); color: var(--accent); }

/* ----------------------------------------------------------------- card */

.card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.table-chip {
  display: inline-block; margin: 0 auto 4px;
  font-family: var(--serif); font-style: italic;
  background: var(--accent-soft); color: var(--accent);
  padding: 5px 16px; border-radius: 999px; font-size: 14px;
}

/* --------------------------------------------------------------- inputs */

label.field { display: block; margin-bottom: 14px; }
label.field span {
  display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  opacity: .55; margin-bottom: 6px; font-weight: 600;
}

input[type=text], input[type=password], textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  padding: 12px 14px; border: 1px solid rgba(0,0,0,.14);
  border-radius: 10px; background: #fff; color: inherit;
}
input:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { resize: vertical; min-height: 74px; }

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-size: 16px; font-weight: 600;
  padding: 15px 22px; border-radius: 12px; border: 1px solid transparent;
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none;
  width: 100%; transition: transform .08s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; color: var(--ink); border-color: rgba(0,0,0,.14); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn.small { font-size: 13px; padding: 8px 14px; width: auto; border-radius: 9px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { flex: none; }

.btn-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 380px) { .btn-row { grid-template-columns: 1fr; } }

/* --------------------------------------------------------- upload queue */

.queue { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }

.qitem {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center;
  background: #fff; border: 1px solid rgba(0,0,0,.07);
  border-radius: 11px; padding: 9px 12px 9px 9px;
}
.qitem .thumb {
  width: 46px; height: 46px; border-radius: 8px; object-fit: cover;
  background: var(--accent-soft); display: block;
}
.qitem .meta { min-width: 0; }
.qitem .name {
  font-size: 13.5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-bottom: 5px;
}
.qitem .bar { height: 4px; border-radius: 4px; background: rgba(0,0,0,.09); overflow: hidden; }
.qitem .bar i {
  display: block; height: 100%; width: 0%; border-radius: 4px;
  background: var(--accent); transition: width .22s ease;
}
.qitem .state { font-size: 12px; opacity: .6; white-space: nowrap; }
.qitem.done .state { color: #3f7d4e; opacity: 1; }
.qitem.done .bar i { background: #3f7d4e; }
.qitem.error .state { color: #b3402f; opacity: 1; }
.qitem.error .bar i { background: #b3402f; }

/* -------------------------------------------------------------- toaster */

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2); z-index: 200; max-width: 90vw;
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ------------------------------------------------------------ celebrate */

.done-panel { text-align: center; padding: 8px 0 4px; }
.done-panel .tick {
  width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--accent-soft); display: grid; place-items: center;
}
.done-panel h2 { font-family: var(--serif); font-weight: 400; font-size: 25px; margin: 0 0 6px; }
.done-panel p { opacity: .7; margin: 0 0 18px; font-size: 15px; }

/* -------------------------------------------------------------- gallery */

.stats {
  display: flex; gap: 26px; justify-content: center;
  padding: 4px 0 26px; flex-wrap: wrap;
}
.stat b {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: 27px; line-height: 1;
}
.stat span { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; opacity: .5; }

.grid {
  columns: 3 210px; column-gap: 10px; padding-bottom: 40px;
}
@media (max-width: 560px) { .grid { columns: 2 130px; column-gap: 7px; } }

.tile {
  break-inside: avoid; margin-bottom: 10px; position: relative;
  border-radius: 10px; overflow: hidden; background: var(--accent-soft);
  cursor: zoom-in; display: block; width: 100%; border: 0; padding: 0;
  animation: rise .45s ease both;
}
@media (max-width: 560px) { .tile { margin-bottom: 7px; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.tile img { width: 100%; display: block; }
.tile .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(transparent 55%, rgba(0,0,0,.35));
  pointer-events: none;
}
.tile .play svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.tile .by {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 7px;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 11.5px; text-align: left; letter-spacing: .02em;
  opacity: 0; transition: opacity .2s;
}
.tile:hover .by { opacity: 1; }

.empty { text-align: center; padding: 70px 20px; opacity: .55; }
.empty p { font-family: var(--serif); font-style: italic; font-size: 18px; }

/* ------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed; inset: 0; background: rgba(18,16,14,.95); z-index: 300;
  display: none; place-items: center; padding: 16px;
}
.lightbox.open { display: grid; }
.lightbox img, .lightbox video {
  max-width: 100%; max-height: 82vh; border-radius: 6px; display: block;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
}
/* Subtitles inside the lightbox, sitting over the bottom of the video. */
.lightbox .lbsubs {
  position: absolute; left: 0; right: 0; bottom: 74px;
  text-align: center; padding: 0 16px; pointer-events: none;
}
.lightbox .lbsubs:empty { display: none; }
.lightbox .lbsubs span {
  display: inline-block; background: rgba(0,0,0,.72); color: #fff;
  padding: 7px 15px; border-radius: 8px; font-size: 15px; line-height: 1.35;
  max-width: 34em; text-shadow: 0 1px 6px rgba(0,0,0,.8);
}

.lightbox .cap {
  color: #fff; text-align: center; margin-top: 14px; font-size: 14px; opacity: .8;
  font-family: var(--serif); font-style: italic;
}
.lightbox .x, .lightbox .nav {
  position: absolute; background: rgba(255,255,255,.1); border: 0; color: #fff;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 20px;
  display: grid; place-items: center; backdrop-filter: blur(6px);
}
.lightbox .x { top: 16px; right: 16px; }
.lightbox .nav.prev { left: 12px; top: 50%; margin-top: -22px; }
.lightbox .nav.next { right: 12px; top: 50%; margin-top: -22px; }
.lightbox .nav:hover, .lightbox .x:hover { background: rgba(255,255,255,.22); }

/* ---------------------------------------------------------------- notes */

.note {
  background: #fff; border: 1px solid rgba(0,0,0,.06); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
}
.note p { margin: 0 0 7px; font-family: var(--serif); font-size: 16px; line-height: 1.5; }
.note .who { font-size: 12px; opacity: .55; letter-spacing: .04em; }

/* --------------------------------------------------------------- footer */

.foot {
  margin-top: auto; text-align: center; padding: 34px 20px 30px;
  font-size: 12px; opacity: .42; letter-spacing: .04em;
}
.foot .hash { font-family: var(--serif); font-style: italic; font-size: 14px; opacity: .8; }

.spinner {
  width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ------------------------------------------------- seating-chart typeahead */

.namefield { position: relative; }

.matches {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  background: #fff; border: 1px solid rgba(0,0,0,.12);
  border-radius: 11px; margin-top: 5px; overflow: hidden;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.3);
  display: none; max-height: 46vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.matches.open { display: block; }

.matches button {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; font: inherit; font-size: 15.5px;
  padding: 12px 14px; background: none; border: 0;
  border-bottom: 1px solid rgba(0,0,0,.055); cursor: pointer; color: inherit;
}
.matches button:last-child { border-bottom: 0; }
.matches button:hover, .matches button.active { background: var(--accent-soft); }
.matches button .tbl {
  font-size: 12.5px; opacity: .6; white-space: nowrap;
  font-family: var(--serif); font-style: italic;
}
.matches .none {
  padding: 12px 14px; font-size: 14px; opacity: .55; line-height: 1.45;
}

.seated { margin-top: 8px; font-size: 13.5px; display: none; }
.seated.show { display: block; }
.seated b {
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 12px; border-radius: 999px; font-weight: 600;
  font-family: var(--serif); font-style: italic;
}
.seated a {
  margin-left: 9px; font-size: 12.5px; opacity: .6; cursor: pointer;
  text-decoration: underline;
}

/* --------------------------------------------------- picker hand-off hint

   Between tapping the checkmark in the photo picker and the browser handing
   the files over, a phone may spend many seconds converting HEIC to JPEG. It
   reports no progress while doing so, and the page looks frozen. This says
   something is happening. */

.preparing {
  display: none;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  padding: 13px 15px;
  background: var(--accent-soft);
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.45;
}
.preparing.show { display: flex; }
.preparing .spin {
  flex: none;
  width: 17px; height: 17px;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
