/* Recuerdi · gallery, upload and access codes (WED-6, WED-22). Editorial Luz tokens only:
   the accent comes from --brand-accent via --accent / --accent-text / --accent-soft.
   Rule: no one-sided borders on rounded elements. */

h1, h2, h3 { font-family: var(--font-display); font-weight: 300; letter-spacing: var(--tracking-display); margin: 0; font-optical-sizing: auto; }
p { margin: 0; }
em { font-style: italic; font-weight: 300; }
a { color: inherit; }
.muted { color: var(--ink-3); }
[hidden] { display: none !important; }

.g-body { min-height: 100dvh; }
.g-head { max-width: 1120px; margin: 0 auto; padding: calc(var(--space-5) + env(safe-area-inset-top)) var(--gutter) var(--space-5); text-align: center; position: relative; }
.g-back { position: absolute; left: var(--gutter); top: calc(var(--space-5) + env(safe-area-inset-top)); color: var(--ink-3); text-decoration: none; transition: color var(--dur-2); }
.g-back:hover { color: var(--accent-text); }
.g-names { color: var(--ink-3); margin-top: var(--space-7); }
.g-title { font-size: var(--step-4); line-height: var(--leading-tight); margin-top: var(--space-3); }
.g-title em { color: var(--accent-text); }
.g-rule { display: block; width: 44px; height: 1px; background: var(--champagne); margin: var(--space-5) auto 0; }
.g-main { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) calc(var(--space-9) + env(safe-area-inset-bottom)); }
.g-loading { text-align: center; color: var(--ink-3); padding: var(--space-8) 0; }

/* ---------- Buttons, cards, chips ---------- */
.card { background: var(--ivory); border: 1px solid var(--rule); border-radius: var(--radius-3); padding: clamp(1.1rem, .9rem + .8vw, 1.75rem); box-shadow: var(--shadow-1); min-width: 0; }
.btn { --bg: var(--ink); --fg: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: 0 1.2em; border-radius: var(--radius-pill); background: var(--bg); color: var(--fg); border: 1px solid var(--bg); font-size: var(--step--1); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2), background-color var(--dur-2), color var(--dur-2), opacity var(--dur-2); -webkit-tap-highlight-color: transparent; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn--ghost { --bg: transparent; --fg: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { background: var(--paper-2); box-shadow: none; }
.btn--accent { --bg: var(--accent); --fg: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--sm { min-height: 34px; padding: 0 .9em; font-size: 12px; }
.btn--block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent-text); font-size: var(--step--1); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--accent-text) 35%, transparent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--rule-strong); background: transparent; font-size: 12.5px; cursor: pointer; color: var(--ink-2); transition: background-color var(--dur-2), color var(--dur-2), border-color var(--dur-2); }
.chip:hover { background: var(--paper-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.input { width: 100%; min-height: 48px; border-radius: var(--radius-2); border: 1px solid var(--rule-strong); background: var(--paper); padding: 0 14px; font-size: 16px; color: var(--ink); transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.input:focus { outline: none; border-color: var(--accent-text); box-shadow: var(--ring); }
.label { display: block; margin-bottom: 6px; color: var(--ink-3); }
.meter { height: 6px; border-radius: var(--radius-pill); background: var(--paper-3); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: inherit; width: 0; transition: width var(--dur-2) var(--ease-out); }

/* ---------- Gate ---------- */
.gate { max-width: 420px; margin: var(--space-5) auto 0; text-align: center; }
.gate h2 { font-size: var(--step-3); }
.gate h2 em { color: var(--accent-text); }
.gate p { color: var(--ink-2); margin: var(--space-3) 0 var(--space-5); }
.gate form { display: grid; gap: var(--space-3); text-align: left; }
.gate .input { text-align: center; font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; font-size: 17px; }
.gate .input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font-ui); font-size: 15px; }
.gate .err { color: var(--danger); font-size: var(--step--1); text-align: center; min-height: 1.4em; }

/* ---------- Role note ---------- */
.note { max-width: 640px; margin: 0 auto var(--space-5); padding: 12px 16px; border-radius: var(--radius-2); background: var(--accent-soft); color: var(--accent-text); font-size: var(--step--1); text-align: center; }

/* ---------- Before the window (WED-100): "¡Disfruten la fiesta!" ---------- */
.wait { max-width: 520px; margin: var(--space-5) auto var(--space-6); text-align: center; background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.wait__ico { display: block; font-family: var(--font-display); font-size: var(--step-3); color: var(--accent-text); line-height: 1; }
.wait h2 { font-size: var(--step-3); font-style: italic; margin: var(--space-3) 0 var(--space-2); }
.wait p { color: var(--ink-2); margin: 0 auto; max-width: 40ch; }

/* ---------- Upload ---------- */
.up { max-width: 640px; margin: 0 auto var(--space-7); transition: border-color var(--dur-2), box-shadow var(--dur-2); }
.up.is-drag { border-color: var(--accent-text); box-shadow: var(--ring); }
.up__name { margin-bottom: var(--space-4); }
.up__btn { position: relative; width: 100%; min-height: 56px; font-size: var(--step-0); }
.up__btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.up__extra { display: none; justify-content: center; align-items: center; gap: var(--space-3); margin-top: var(--space-3); font-size: 12px; color: var(--ink-3); }
@media (pointer: fine) { .up__extra { display: flex; } }
.up__hint { margin-top: var(--space-3); font-size: 12px; color: var(--ink-3); text-align: center; }
.up__msg { margin-top: var(--space-4); padding: 12px 14px; border-radius: var(--radius-2); background: var(--paper-2); font-size: var(--step--1); display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.up__msg.is-err { background: color-mix(in oklab, var(--danger) 10%, var(--paper)); color: var(--danger); }
.up__msg.is-ok { background: var(--accent-soft); color: var(--accent-text); }

.queue { margin-top: var(--space-5); }
.queue__h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-3); }
.queue__h b { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); }
.queue__h span { font-size: 12px; color: var(--ink-3); }
.queue ul { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: 10px; max-height: 320px; overflow: auto; overscroll-behavior: contain; }
.qi { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 12px; align-items: center; }
.qi__th { width: 44px; height: 44px; border-radius: var(--radius-2); background: var(--paper-2); object-fit: cover; grid-row: 1 / span 2; }
.qi__n { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.up__priv { display: grid; justify-items: center; margin: 0 0 var(--space-3); }
.up__priv .up__hint { margin-top: 6px; }
.qi__s { font-size: 11.5px; color: var(--ink-3); grid-column: 2; display: flex; gap: 8px; align-items: center; min-width: 0; }
.qi__s .meter { flex: 1; height: 4px; }
.qi__a { grid-row: 1 / span 2; grid-column: 3; }
.qi.is-done .qi__s { color: var(--success); }
.qi.is-err .qi__s { color: var(--danger); }
.qi.is-wait .qi__s { color: var(--accent-text); }

/* ---------- Toolbar ---------- */
.tools { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: center; justify-content: space-between; padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--rule); }
.tools__count { font-family: var(--font-display); font-size: var(--step-1); }
.tools__row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.cols { display: inline-flex; gap: 4px; }
.cols button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule-strong); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); }
.cols button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.cols i { display: flex; gap: 2px; }
.cols i b { width: 3px; height: 11px; border-radius: 1px; background: currentColor; }
.couple-bar { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; justify-content: space-between; margin-bottom: var(--space-5); font-size: var(--step--1); }
.switch { display: inline-flex; gap: 10px; align-items: center; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: var(--radius-pill); background: var(--paper-3); position: relative; cursor: pointer; transition: background-color var(--dur-2); flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ivory); box-shadow: var(--shadow-1); transition: transform var(--dur-2) var(--ease-out); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- Grid ---------- */
.grid { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(4px, .6vw, 10px); }
.tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--radius-2); overflow: hidden; background: var(--paper-2); cursor: zoom-in; display: block; width: 100%; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-4) var(--ease-out), opacity var(--dur-3); }
.tile:hover img { transform: scale(1.04); }
.tile.is-dim img { opacity: .45; }
.tile__play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tile__play span { width: 40px; height: 40px; border-radius: 50%; background: rgba(20,18,14,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; }
.tile__play span::after { content: ""; margin-left: 3px; border-left: 12px solid var(--on-photo); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.tile__hearts { position: absolute; left: 6px; bottom: 6px; font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(20,18,14,.45); color: var(--on-photo); pointer-events: none; }
.tile__badge { position: absolute; left: 6px; top: 6px; font-size: 9.5px; padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(251,248,242,.92); color: #1C1A16; pointer-events: none; letter-spacing: .04em; }
.tile__badge.is-alert { background: var(--accent); color: var(--accent-ink); }
.g-empty { text-align: center; color: var(--ink-3); padding: var(--space-8) 0; font-family: var(--font-display); font-size: var(--step-1); font-style: italic; }
.g-more { display: flex; justify-content: center; padding: var(--space-6) 0; }
.g-foot { display: flex; justify-content: center; gap: var(--space-5); flex-wrap: wrap; padding-top: var(--space-6); }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 50; background: #0E0D0A; color: var(--on-photo); display: grid; grid-template-rows: auto 1fr auto; touch-action: none; animation: lbIn var(--dur-2) var(--ease-out); }
@keyframes lbIn { from { opacity: 0; } }
.lb__bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
.lb__bar > div { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lb__n { font-size: 12px; opacity: .7; font-family: var(--font-mono); padding-left: 4px; }
.lb .btn { --bg: rgba(251,248,242,.14); --fg: var(--on-photo); border-color: transparent; min-height: 36px; font-size: 12px; padding: 0 .95em; }
.lb .btn:hover { --bg: rgba(251,248,242,.24); box-shadow: none; }
.lb .btn.is-on { --bg: var(--on-photo); --fg: #1C1A16; }
.lb__x { width: 40px; padding: 0 !important; font-size: 18px !important; }
.lb__stage { position: relative; overflow: hidden; display: grid; place-items: center; user-select: none; -webkit-user-select: none; }
.lb__stage img, .lb__stage video { max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; will-change: transform; }
.lb__stage video { width: auto; height: auto; max-height: calc(100dvh - 140px); }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(251,248,242,.14); color: var(--on-photo); font-size: 22px; cursor: pointer; display: none; place-items: center; }
@media (pointer: fine) { .lb__nav { display: grid; } }
.lb__nav:hover { background: rgba(251,248,242,.26); }
.lb__prev { left: 12px; } .lb__next { right: 12px; }
.lb__foot { text-align: center; padding: 8px 12px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.lb__foot p { font-size: 13px; opacity: .75; min-height: 1em; }
.lb__acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.heart { color: inherit; }
.heart.is-on { color: #FF7A93; } /* heart pink, not the brand accent */

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: var(--radius-pill); font-size: var(--step--1); box-shadow: var(--shadow-2); transition: opacity var(--dur-2), transform var(--dur-3) var(--ease-out); max-width: calc(100vw - 32px); text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.code { font-family: var(--font-mono); font-size: 15px; letter-spacing: .12em; padding: 6px 12px; border: 1px dashed var(--rule-strong); display: inline-block; }
/* Moments timeline (WED-71): one chapter per moment of the program, on a quiet rail. */
.grid.grid--moments { display: block; }
.moments { position: relative; display: grid; gap: var(--space-6); padding-left: 26px; }
.moments::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px; background: var(--rule-strong); }
.mo { position: relative; display: grid; gap: var(--space-3); }
.mo::before { content: ""; position: absolute; left: -25px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 1px solid var(--accent-text); }
.mo__h { display: flex; align-items: baseline; gap: var(--space-3); }
.mo__time { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent-text); min-width: 3.2em; }
.mo__time--none { min-width: 0; }
.mo__t { flex: 1; min-width: 0; }
.mo__t h2 { font-size: var(--step-2); line-height: 1.1; }
.mo__sub { margin: 0 0 2px; color: var(--ink-3, var(--ink-2)); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.mo__n { font-family: var(--font-display); font-size: var(--step-0); color: var(--ink-2); }
.mo__all { justify-self: start; }
.mo-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.mo-head .link { justify-self: start; }
.mo-head h2 { font-size: var(--step-3); }

/* Headlines (design/DESIGN-RULES.md "Überschriften umbrechen"): balanced, never hyphenated, body copy without
   orphans; part two of a two-part headline (headline() in src/server/headline.ts) starts on its own line. */
h1, h2, h3, .display { text-wrap: balance; -webkit-hyphens: manual; hyphens: manual; overflow-wrap: normal; word-break: normal; }
p, li, dd, blockquote { text-wrap: pretty; }
.hl-2 { display: block; }
@media (min-width: 900px) { .hl-2--soft { display: inline; } }
