/* ============================================================
   Capture the love — wedding photo collection
   Mirrors the brand & style guide:
     - Blush surface with paper grain
     - Jost (300/400/500) for everything structural
     - Dancing Script (700) for single accent words
     - Rosewood as the only "tap-me" accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@500;600;700&family=Jost:wght@300;400;500&display=swap');

:root {
  --blush:      #FBEAE2;
  --veil:       #FFF6F1;
  --petal:      #F1D7CC;
  --rose:       #DCB3A4;
  --rosewood:   #A86A56;
  --rosewood-d: #8F5644;
  --charcoal:   #45403D;
  --ink:        #7C736E;
  --white:      #FFFFFF;

  --ok:         #7E9472;
  --danger:     #A35454;

  --t-script:   clamp(3.4rem, 11vw, 5.6rem);
  --t-h1:       clamp(1.6rem, 4.4vw, 2.4rem);

  --ease:       cubic-bezier(.22, .68, .18, 1);

  --r-card:     16px;
  --r-soft:     14px;
  --r-btn:      11px;
  --r-field:    10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;

  background-color: var(--blush);
  background-image:
    radial-gradient(ellipse 50% 38% at 22% 14%, rgba(255, 255, 255, 0.55), transparent 70%),
    radial-gradient(ellipse 46% 40% at 84% 30%, rgba(220, 179, 164, 0.34), transparent 72%),
    radial-gradient(ellipse 60% 44% at 70% 88%, rgba(241, 215, 204, 0.50), transparent 70%),
    radial-gradient(ellipse 50% 40% at 12% 76%, rgba(220, 179, 164, 0.26), transparent 72%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Subtle paper grain layered above the gradients. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/></svg>");
}

a { color: var(--rosewood); }
a:hover { color: var(--rosewood-d); }

/* ---- Layout --------------------------------------------------------------- */
.page,
.page-wide {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 26px 22px 90px;
}
.page      { max-width: 680px; }
.page-wide { max-width: 1200px; }

/* ---- Brand lockup (the hero device) -------------------------------------- */
.brand {
  text-align: center;
  padding: 56px 0 48px;
  position: relative;
}
.brand .eyebrow {
  display: inline-block;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--rosewood);
  padding-bottom: 14px;
}
.brand .line {
  font-weight: 300;
  font-size: clamp(0.9rem, 3vw, 1.25rem);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.brand .word {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: var(--t-script);
  line-height: 0.9;
  color: var(--charcoal);
  margin: 0.06em 0 0.14em;
}
.brand .sub {
  font-weight: 300;
  font-size: clamp(0.74rem, 2.1vw, 0.95rem);
  letter-spacing: 0.3em;
  line-height: 1.7;
  text-transform: uppercase;
  color: var(--ink);
}
.brand .seam {
  width: 46px;
  height: 1px;
  background: var(--rose);
  margin: 30px auto 0;
}
.brand .couple {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 3rem);
  line-height: 1;
  color: var(--charcoal);
  margin-top: 14px;
}

/* ---- Card / surfaces ------------------------------------------------------ */
.card {
  background: var(--veil);
  border: 1px solid var(--petal);
  border-radius: var(--r-card);
  padding: 30px 28px;
  box-shadow: 0 18px 36px -28px rgba(69, 64, 61, 0.35);
}

/* ---- Form --------------------------------------------------------------- */
label {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  font-family: inherit;
  font-weight: 400;
  font-size: 1rem;
  color: var(--charcoal);
  background: var(--blush);
  border: 1px solid var(--rose);
  border-radius: var(--r-field);
  padding: 13px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink); }
input:focus, textarea:focus {
  border-color: var(--rosewood);
  background: var(--veil);
  box-shadow: 0 0 0 3px rgba(168, 106, 86, 0.16);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.65; }

.row { margin-bottom: 20px; }

.hint {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-top: 6px;
  line-height: 1.6;
}

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Jost', inherit;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--r-btn);
  padding: 14px 26px;
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
  background: var(--rosewood);
  color: #fff;
  border: 1px solid var(--rosewood-d);
  box-shadow: 0 12px 26px -16px rgba(143, 86, 68, 0.8);
}
.btn:hover { background: var(--rosewood-d); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-secondary,
.btn.ghost {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--rose);
  box-shadow: none;
}
.btn-secondary:hover,
.btn.ghost:hover {
  background: transparent;
  border-color: var(--rosewood);
  color: var(--rosewood);
  transform: translateY(-2px);
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

/* ---- Dropzone ------------------------------------------------------------- */
.drop {
  border: 1.5px dashed var(--rose);
  border-radius: var(--r-soft);
  padding: 34px 22px;
  text-align: center;
  background: var(--blush);
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.drop:hover { border-color: var(--rosewood); background: var(--veil); }
.drop.drag  { border-color: var(--rosewood-d); background: var(--veil); }
.drop .lead {
  font-weight: 300;
  font-size: 0.92rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.drop p {
  font-size: 0.84rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  line-height: 1.55;
  margin: 4px 0;
}
.drop .pick {
  display: inline-block;
  margin-top: 10px;
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rosewood);
  border-bottom: 1px solid var(--rose);
  padding-bottom: 3px;
}
.drop input[type="file"] { display: none; }

/* ---- Queue ---------------------------------------------------------------- */
.queue {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.queue-item {
  background: var(--veil);
  border: 1px solid var(--petal);
  border-radius: var(--r-soft);
  padding: 12px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
}
.queue-item .thumb {
  width: 56px;
  height: 56px;
  background: var(--petal);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.queue-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.queue-item .meta { min-width: 0; font-size: 0.88rem; }
.queue-item .name {
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--charcoal);
}
.queue-item .progress {
  margin-top: 6px;
  height: 4px;
  background: var(--petal);
  border-radius: 999px;
  overflow: hidden;
}
.queue-item .progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rosewood);
  transition: width .2s var(--ease);
}
.queue-item .status {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 5px;
}
.queue-item.done  .status { color: var(--ok); }
.queue-item.error .status { color: var(--danger); }

.queue-item .btn,
.queue-item .btn-secondary {
  padding: 9px 14px;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}

/* ---- Flash ---------------------------------------------------------------- */
.flash {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--r-soft);
  background: var(--veil);
  border: 1px solid var(--petal);
  color: var(--charcoal);
  font-size: 0.9rem;
}
.flash.error { background: #f5e0e0; border-color: #e7b6b6; color: var(--danger); }
.flash.ok    { background: #e9efde; border-color: #cdd6b9; color: var(--ok); }

/* ---- Gallery (CSS-columns masonry) --------------------------------------- */
.gallery {
  column-count: 1;
  column-gap: 14px;
}
@media (min-width: 600px)  { .gallery { column-count: 2; } }
@media (min-width: 960px)  { .gallery { column-count: 3; } }
@media (min-width: 1280px) { .gallery { column-count: 4; } }

.tile {
  break-inside: avoid;
  margin: 0 0 14px;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--veil);
  border: 1px solid var(--petal);
  box-shadow: 0 14px 30px -22px rgba(69, 64, 61, 0.4);
  position: relative;
  cursor: zoom-in;
}
.tile img { display: block; width: 100%; height: auto; }
.tile .caption {
  padding: 13px 14px 16px;
  font-size: 0.86rem;
}
.tile .who {
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rosewood);
}
.tile .msg {
  color: var(--ink);
  margin-top: 6px;
  white-space: pre-wrap;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.55;
}
.tile .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.tile .play span {
  width: 56px;
  height: 56px;
  background: rgba(69, 64, 61, 0.6);
  color: #fff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  backdrop-filter: blur(2px);
}

/* Guestbook tile - a message with no photo. */
.tile.note {
  background: var(--veil);
  padding: 26px 22px 24px;
  cursor: default;
  text-align: center;
}
.tile.note .who {
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  color: var(--rosewood);
  margin-bottom: 10px;
}
.tile.note .msg {
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--charcoal);
  text-transform: none;
  letter-spacing: 0;
}

/* ---- Toolbar -------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 24px;
}
.toolbar .stats {
  color: var(--ink);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.toolbar .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Lightbox ------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 22, 18, 0.93);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lightbox.show { display: flex; }
.lightbox img,
.lightbox video {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox .lb-caption {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--veil);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0 24px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.lightbox .lb-close,
.lightbox .lb-prev,
.lightbox .lb-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  font-size: 22px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.lightbox .lb-close:hover,
.lightbox .lb-prev:hover,
.lightbox .lb-next:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev  { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next  { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---- Slideshow ------------------------------------------------------------ */
.slideshow {
  position: fixed;
  inset: 0;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}
.slideshow.show { display: flex; }
.slideshow .stage {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.slideshow img,
.slideshow video {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}
.slideshow .ss-caption {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
  font-size: 2.1rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
  padding: 0 36px;
}
.slideshow .ss-exit {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.slideshow .ss-exit:hover { background: rgba(255, 255, 255, 0.22); }

/* ---- Poster --------------------------------------------------------------- */
.poster {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 40px 90px;
  text-align: center;
}
.poster .lockup-top {
  font-weight: 300;
  font-size: clamp(1rem, 3.2vw, 1.4rem);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.poster .lockup-word {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(6.5rem, 20vw, 11rem);
  line-height: 0.85;
  color: var(--charcoal);
  margin: 0.05em 0 0.14em;
}
.poster .lockup-sub {
  font-weight: 300;
  font-size: clamp(0.86rem, 2.4vw, 1.05rem);
  letter-spacing: 0.3em;
  line-height: 1.7;
  text-transform: uppercase;
  color: var(--ink);
}
.poster .seam {
  width: 60px;
  height: 1px;
  background: var(--rose);
  margin: 38px auto;
}
.poster .qr {
  margin: 14px auto 28px;
  width: 340px;
  max-width: 80vw;
  aspect-ratio: 1 / 1;
  background: var(--white);
  padding: 18px;
  border-radius: var(--r-card);
  border: 1px solid var(--petal);
  box-shadow: 0 18px 40px -24px rgba(69, 64, 61, 0.4);
}
.poster .qr img {
  width: 100%;
  height: 100%;
  display: block;
}
.poster .quote {
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  line-height: 1.35;
  color: var(--charcoal);
  max-width: 560px;
  margin: 26px auto 0;
}
.poster .couple-line {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1;
  color: var(--charcoal);
  margin-top: 30px;
}
.poster .date-line {
  font-weight: 300;
  font-size: 0.84rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 10px;
}
.poster .url {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  margin-top: 22px;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}
.poster .print-hide {
  margin-top: 40px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media print {
  body {
    background: var(--blush) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body::before { opacity: 0.3; }
  .print-hide { display: none !important; }
  .poster { padding: 30px 24px; }
}

/* ---- Admin ---------------------------------------------------------------- */
.admin-tile { position: relative; }
.admin-tile .del {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(30, 22, 18, 0.7);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.admin-tile .del:hover { background: var(--danger); }

.login {
  max-width: 380px;
  margin: 30px auto 0;
}

.empty {
  text-align: center;
  color: var(--ink);
  padding: 70px 20px;
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
  font-size: 1.8rem;
  letter-spacing: 0;
}
.empty a { color: var(--rosewood); }

/* ---- Footnote ------------------------------------------------------------- */
.footnote {
  text-align: center;
  margin-top: 36px;
  color: var(--ink);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---- Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Small screens -------------------------------------------------------- */
@media (max-width: 480px) {
  .card { padding: 24px 20px; }
  .brand { padding: 36px 0 28px; }
  .brand .word { font-size: clamp(2.8rem, 14vw, 4.2rem); }
}
