/* Page-specific bits shared by the guest page and the gallery. Mobile first. */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sr-only:focus-visible + .btn-big, .sr-only:focus-visible ~ .btn-big { outline: 3px solid var(--blue); outline-offset: 3px; }

.wedding-word { font-size: clamp(2rem, 9vw, 2.6rem); margin: -.4rem 0 0; }
.thanks-script { font-size: clamp(2.6rem, 12vw, 3.6rem); margin: .2rem 0; }
.hint { margin: 1rem 0 .5rem; }
label.btn-big, label.btn-soft { display: flex; align-items: center; justify-content: center; text-align: center; }
label.btn-soft { display: inline-flex; margin-top: 1rem; }

.see-photos, .gb-link { display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 1rem; text-align: center; }
.name-box { margin-top: 1.1rem; text-align: center; }
.name-box summary { cursor: pointer; padding: .7rem; font-size: 1.15rem; }
.name-box input {
  width: 100%; margin-top: .4rem; min-height: 56px; padding: .6rem 1rem;
  border: 1.5px solid var(--blue); border-radius: 14px; font: inherit; font-size: 1.15rem; color: var(--navy); text-align: center; background: #fff;
}

.files { list-style: none; margin: 0; padding: 0; text-align: left; }
.file-row { margin: .6rem 0; padding: .7rem .8rem; border: 1px solid var(--blue); border-radius: 14px; background: #fff; }
.file-row .top { display: flex; justify-content: space-between; gap: .6rem; font-size: 1rem; }
.file-row .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-row .state { flex: none; font-family: var(--caps); letter-spacing: .04em; }
.bar { height: 10px; margin-top: .5rem; background: var(--blue-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--navy); border-radius: 999px; transition: width .25s ease; }
.file-row.done .bar > i { background: var(--ok); }
.file-row.failed { border-color: #e0b3b3; }
.file-row.failed .bar > i { background: var(--danger); }
.keep-open { margin: 0 0 .5rem; }

/* Gallery */
.gal-head { margin-bottom: .6rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; max-width: 56rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.grid li { position: relative; aspect-ratio: 1; background: var(--blue-soft); overflow: hidden; border-radius: 4px; }
.grid button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid .vid::after { content: "\25B6"; position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(31, 58, 122, .8); color: #fff; font-size: 12px; line-height: 26px; text-align: center; }
.grid .nothumb { display: grid; place-items: center; height: 100%; font-family: var(--caps); color: var(--navy); font-size: .9rem; padding: .3rem; }
.empty { margin: 2rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: .6rem 0; }

.viewer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: rgba(10, 18, 45, .96); color: #fff; }
.viewer .stage { flex: 1; display: grid; place-items: center; min-height: 0; padding: 8px; }
.viewer .stage img, .viewer .stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .bar-top, .viewer .bar-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
}
.viewer .bar-bottom { padding: 10px max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.viewer .caption { font-size: 1rem; opacity: .9; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer button, .viewer a {
  min-width: 52px; min-height: 52px; padding: 0 16px; border: 1.5px solid rgba(255, 255, 255, .6); border-radius: 14px;
  background: transparent; color: #fff; font-family: var(--caps); font-size: 1.1rem; letter-spacing: .05em; text-decoration: none; display: inline-grid; place-items: center; cursor: pointer;
}
.viewer button.danger { border-color: #f0a0a0; color: #f6b8b8; }

@media (min-width: 520px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 6px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(6, 1fr); } }

/* Guestbook */
.gb-pair { display: flex; flex-direction: column; gap: 0; }
.gb-form { width: 100%; text-align: left; }
.gb-form label { display: block; margin: 1rem 0 .3rem; font-size: 1.15rem; }
.gb-form input, .gb-form textarea { width: 100%; font: inherit; font-size: 1.2rem; padding: .75rem .85rem; border: 1px solid var(--navy-line); border-radius: 12px; background: #fff; color: var(--ink); min-height: 52px; }
.gb-form textarea { resize: vertical; min-height: 9rem; line-height: 1.4; }
.gb-count { text-align: right; margin: .2rem 0 .6rem; opacity: .7; }
.gb-form .btn-big { width: 100%; margin-top: .6rem; }
.book { list-style: none; margin: 1rem 0 0; padding: 0; width: 100%; display: grid; gap: .9rem; }
.note { border: 1px solid var(--blue); background: var(--blue-soft); border-radius: 14px; padding: 1rem 1.1rem; text-align: left; }
.note-msg { margin: 0 0 .6rem; font-style: italic; font-size: 1.3rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-who { margin: 0; text-align: right; font-size: 1.1rem; }
.note-date { margin: 0; text-align: right; }
