/* ==========================================================================
   Event Photo Album Platform — Editorial UI Stylesheet (Section 12)
   Palette: Warm stone, slate, charcoal, soft ivory, subtle gold accent
   ========================================================================== */

:root {
    --bg-ivory: #f8f7f4;
    --bg-surface: #ffffff;
    --bg-stone-subtle: #f1efea;
    --border-stone: #e3dfd7;
    --text-charcoal: #1e1f22;
    --text-slate: #5c5f66;
    --accent-gold: #8c6d3b;
    --accent-gold-hover: #73582d;
    --status-success-bg: #edf7f1;
    --status-success-text: #1c6b42;
    --status-warning-bg: #fdf5e6;
    --status-warning-text: #946210;
    --status-danger-bg: #fdeeed;
    --status-danger-text: #a62626;
    --radius-sm: 6px;
    --radius-md: 10px;
    --shadow-card: 0 2px 10px rgba(30, 31, 34, 0.05);
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body.app-shell {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-ivory);
    color: var(--text-charcoal);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: min(96vw, 1760px);
    margin: 0 auto;
    padding: 0 clamp(0.85rem, 2.2vw, 2rem);
}

/* Top Navigation Bar */
.top-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-stone);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand__link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-charcoal);
}

.brand__mark {
    color: var(--accent-gold);
    font-size: 1.25rem;
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand__text strong {
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

.brand__text small {
    font-size: 0.75rem;
    color: var(--text-slate);
}

.top-bar__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-nav__link {
    color: var(--text-slate);
    text-decoration: none;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.main-nav__link:hover {
    color: var(--text-charcoal);
    background-color: var(--bg-stone-subtle);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-stone);
}

.user-pill__name {
    font-weight: 600;
    font-size: 0.88rem;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* Main Content & Typography */
.main-content {
    flex: 1;
    padding-top: 2.25rem;
    padding-bottom: 3rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.heading-xl {
    margin: 0 0 0.25rem 0;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.heading-lg {
    margin: 0 0 0.25rem 0;
    font-size: 1.35rem;
    font-weight: 600;
}

.heading-md {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.text-muted {
    color: var(--text-slate);
    margin: 0;
}

.text-xs {
    font-size: 0.8rem;
}

code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-stone-subtle);
    padding: 0.15rem 0.38rem;
    border-radius: 4px;
}

/* Cards & Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

.dashboard-grid--event-workspace {
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
}

.dashboard-grid > .card:only-child {
    grid-column: 1 / -1;
}

@media (max-width: 860px) {
    .dashboard-grid,
    .dashboard-grid--event-workspace {
        grid-template-columns: minmax(0, 1fr);
    }
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

[hidden] {
    display: none !important;
}

.card--full {
    grid-column: 1 / -1;
}

.card__header {
    padding: 1.15rem 1.4rem;
    border-bottom: 1px solid var(--border-stone);
    background: #fcfbf9;
}

.card__body {
    padding: 1.35rem 1.4rem;
    min-width: 0;
    flex: 1 1 auto;
}

/* Auth Card */
.auth-card-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 62vh;
}

.auth-card {
    width: 100%;
    max-width: 430px;
}

.auth-card .form-stack {
    padding: 1.5rem;
}

/* Forms & Buttons */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-weight: 500;
    font-size: 0.88rem;
    color: var(--text-charcoal);
}

.form-input, .select-compact {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.62rem 0.8rem;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-charcoal);
}

.select-compact {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.form-input:focus, .select-compact:focus {
    outline: 2px solid var(--accent-gold);
    outline-offset: 1px;
    border-color: var(--accent-gold);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 0.62rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
    background-color: var(--text-charcoal);
    color: #ffffff;
}

.btn--primary:hover {
    background-color: var(--accent-gold);
}

.btn--secondary {
    background-color: var(--bg-stone-subtle);
    color: var(--text-charcoal);
    border-color: var(--border-stone);
}

.btn--secondary:hover {
    background-color: #e6e2da;
}

.btn--ghost {
    background: transparent;
    color: var(--text-slate);
    border-color: var(--border-stone);
}

.btn--ghost:hover {
    color: var(--text-charcoal);
    background: var(--bg-stone-subtle);
}

.btn--sm {
    padding: 0.32rem 0.68rem;
    font-size: 0.82rem;
}

.btn--block {
    width: 100%;
}

/* Badges & Alerts */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 999px;
    background: var(--bg-stone-subtle);
    color: var(--text-slate);
}

.badge--role {
    background: #efeae0;
    color: var(--accent-gold);
}

.badge--success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
}

.badge--warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.alert {
    margin: 1rem 1.5rem 0;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.alert--danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
    border: 1px solid #f5c2c0;
}

/* Data Tables & Key-Value Lists */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border-stone);
    vertical-align: middle;
}

.data-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-slate);
    background: #faf9f6;
}

.perm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.kv-list {
    margin: 0;
    display: grid;
    grid-template-columns: 170px 1fr;
    row-gap: 0.65rem;
    column-gap: 1rem;
}

.kv-list dt {
    color: var(--text-slate);
    font-weight: 500;
}

.kv-list dd {
    margin: 0;
}

.site-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-stone);
    text-align: center;
    font-size: 0.85rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   Phase 2 — Event Management, Albums & Responsive Guest Experience
   ========================================================================== */

.form-control {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-charcoal);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    outline: 2px solid var(--accent-gold);
    outline-offset: 1px;
    border-color: var(--accent-gold);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-slate);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    align-items: end;
    width: 100%;
    min-width: 0;
}

@media (max-width: 560px) {
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.form-grid > .form-group {
    min-width: 0;
    width: 100%;
}

.form-group--full {
    grid-column: 1 / -1;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
}

.filter-bar > .form-group {
    flex: 1 1 200px;
    min-width: min(100%, 160px);
}

.filter-bar > .form-group--album-select {
    flex: 1.6 1 240px;
    min-width: min(100%, 180px);
}

.filter-bar > .form-group--compact {
    flex: 0 1 auto;
    width: auto;
    min-width: max-content;
}

.filter-bar__actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 0 0 auto;
    align-items: center;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.event-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn--danger {
    background-color: var(--status-danger-bg);
    color: var(--status-danger-text);
    border-color: #f5c2c0;
}

.btn--danger:hover {
    background-color: #f9d7d5;
}

.alert--success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    border: 1px solid #bce3cc;
    margin: 0 0 1.25rem 0;
}

.alert--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    margin: 0 0 1rem 0;
}

.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumb {
    font-size: 0.84rem;
    color: var(--text-slate);
    margin-bottom: 0.35rem;
    display: flex;
    gap: 0.4rem;
}

.breadcrumb a {
    color: var(--text-slate);
    text-decoration: none;
}

.link-strong {
    color: var(--text-charcoal);
    text-decoration: none;
}

.link-strong:hover {
    color: var(--accent-gold);
}

.meta-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.meta-list__row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.meta-list__row dt {
    color: var(--text-slate);
    font-weight: 500;
}

.meta-list__row dd {
    margin: 0;
    word-break: break-all;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border-stone);
    margin: 1.25rem 0;
}

.button-row, .table-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

/* Guest Shell & Themes */
body.guest-shell {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--event-bg, var(--bg-ivory));
    color: var(--text-charcoal);
    font-family: var(--font-sans);
    line-height: 1.6;
}

body.guest-shell.theme-cinema_dark {
    background-color: #111317;
    color: #f3f4f6;
    --bg-surface: #1a1d24;
    --border-stone: #2b303c;
    --text-charcoal: #f3f4f6;
    --text-slate: #9ca3af;
}

body.guest-shell.theme-classic_warm {
    background-color: #faf6f0;
    --bg-surface: #fffdf9;
    --border-stone: #e6dccf;
}

body.guest-shell.theme-minimal_mono {
    background-color: #ffffff;
    --bg-surface: #fafafa;
    --border-stone: #e5e5e5;
}

.preview-banner {
    background: #1e293b;
    color: #f8fafc;
    padding: 0.5rem 0;
    font-size: 0.85rem;
}

.preview-banner__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guest-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-stone);
}

.guest-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.guest-brand__link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-charcoal);
    font-weight: 600;
}

.guest-main {
    flex: 1;
    padding-top: 2.5rem;
    padding-bottom: 3.5rem;
}

.guest-hero {
    padding: 2.5rem 2rem;
    margin-bottom: 2.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-stone);
    text-align: center;
}

.guest-hero--compact {
    padding: 1.75rem 1.5rem;
}

.guest-hero__date {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-slate);
    margin: 0 0 0.5rem 0;
}

.guest-hero__title {
    margin: 0 0 0.65rem 0;
    font-size: 2.1rem;
    letter-spacing: -0.02em;
}

.guest-hero__description {
    max-width: 680px;
    margin: 0 auto;
    color: var(--text-slate);
}

.guest-section {
    margin-bottom: 2.5rem;
}

.guest-section__header {
    margin-bottom: 1.15rem;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.album-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-charcoal);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.album-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.album-card__cover {
    height: 150px;
    background: var(--bg-stone-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent-gold);
}

.album-card__body {
    padding: 1.15rem 1.25rem;
}

.album-card__title {
    margin: 0 0 0.35rem 0;
    font-size: 1.1rem;
}

.album-card__desc {
    margin: 0 0 0.65rem 0;
    font-size: 0.88rem;
    color: var(--text-slate);
}

.album-card__meta {
    font-size: 0.82rem;
    color: var(--accent-gold);
    font-weight: 500;
}

.album-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.album-pill {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-stone);
    background: var(--bg-surface);
    color: var(--text-slate);
    text-decoration: none;
    font-size: 0.88rem;
}

.album-pill--active {
    background: var(--text-charcoal);
    color: #ffffff;
    border-color: var(--text-charcoal);
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.photo-tile {
    margin: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-stone);
    background: var(--bg-surface);
}

.photo-tile__frame {
    height: 200px;
    background: var(--tile-bg, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.photo-tile__caption {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-slate);
}

.auth-wrapper, .status-page-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 58vh;
}

.status-page-card {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.status-page-card__body {
    padding: 2.5rem 2rem;
}

.status-page__code {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--bg-stone-subtle);
    color: var(--text-slate);
    margin-bottom: 0.75rem;
}

.guest-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-stone);
    text-align: center;
    font-size: 0.85rem;
}

/* ==========================================================================
   Phase 3 — Photo Ingestion, Batch Uploader, Queue & Admin Photo Cards
   ========================================================================== */

.upload-dropzone {
    border: 2px dashed var(--border-stone);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    background: #fcfbf9;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: var(--accent-gold);
    background: var(--bg-stone-subtle);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-stone-subtle);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border-stone);
}

.progress-bar__fill {
    height: 100%;
    background: var(--accent-gold);
    transition: width 0.2s ease;
}

.upload-file-list {
    list-style: none;
    padding: 0;
    margin: 0.85rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 260px;
    overflow-y: auto;
}

.upload-file-list__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.65rem;
    background: var(--bg-stone-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.photo-admin-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
    min-width: 0;
}

.photo-admin-card {
    display: grid;
    grid-template-columns: clamp(165px, 18vw, 225px) minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-md);
    background: #fcfbf9;
    width: 100%;
    min-width: 0;
}

.photo-admin-card__preview,
.photo-admin-card__details {
    min-width: 0;
    width: 100%;
}

@media (max-width: 720px) {
    .photo-admin-card {
        grid-template-columns: 1fr;
    }
}

.albums-overview-box {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    resize: vertical;
    overflow: auto;
}

.albums-overview-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-sm);
    background: var(--bg-stone-subtle);
    color: var(--text-charcoal);
    text-decoration: none;
    font-size: 0.88rem;
    min-width: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.albums-overview-pill:hover,
.albums-overview-pill.is-active {
    border-color: var(--accent-gold);
    background: var(--bg-surface);
}

.albums-overview-pill__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.photo-admin-card__img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-stone);
    background: var(--bg-stone-subtle);
}

/* ==========================================================================
   Phase 4 — Interactive Guest Gallery, Masonry/Grid, Lightbox, Favorites,
             Shareable Selections & QR / Poster Preview
   ========================================================================== */

.gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.15rem;
    margin-bottom: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-md);
}

.gallery-toolbar__search {
    flex: 1 1 260px;
}

.gallery-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.gallery-search-input {
    flex: 1 1 200px;
}

.gallery-toolbar__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.gallery-sort-form {
    margin: 0;
}

.gallery-layout-switch {
    display: inline-flex;
    gap: 0.25rem;
}

.gallery-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.photo-gallery--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.1rem;
}

.photo-gallery--masonry {
    column-count: 3;
    column-gap: 1.1rem;
    display: block;
}

@media (max-width: 960px) {
    .photo-gallery--masonry {
        column-count: 2;
    }
}

@media (max-width: 580px) {
    .photo-gallery--masonry {
        column-count: 1;
    }
}

.photo-gallery--masonry .photo-tile {
    break-inside: avoid;
    margin-bottom: 1.1rem;
}

.photo-tile {
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.photo-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.photo-tile--favorited {
    border-color: var(--event-accent, #e11d48);
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.22);
}

.photo-tile__media {
    position: relative;
    overflow: hidden;
    background: var(--bg-stone-subtle, #f1f5f9);
}

.photo-tile__open-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.photo-tile__img {
    width: 100%;
    display: block;
    object-fit: cover;
    height: 225px;
    transition: transform 0.25s ease;
}

.photo-gallery--masonry .photo-tile__img {
    height: auto;
    min-height: 160px;
    max-height: 440px;
}

.photo-tile__open-btn:hover .photo-tile__img {
    transform: scale(1.02);
}

.photo-tile__fav-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(15, 23, 42, 0.55);
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.photo-tile__fav-btn:hover {
    transform: scale(1.08);
    background: rgba(15, 23, 42, 0.8);
}

.photo-tile__fav-btn.is-active {
    background: #e11d48;
    border-color: #fda4af;
    color: #ffffff;
}

.photo-tile__caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem;
}

.photo-tile__caption-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-tile__download-link {
    text-decoration: none;
    color: var(--text-charcoal);
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-stone);
}

.gallery-pagination {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.gallery-pagination__links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-modal[hidden] {
    display: none !important;
}

.lightbox-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 23, 0.92);
}

.lightbox-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1240px, 96vw);
    height: min(860px, 92vh);
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lightbox-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-modal__counter {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #cbd5e1;
}

.lightbox-modal__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lightbox-modal__stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #090d16;
}

.lightbox-modal__image-wrap {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.lightbox-modal__image-wrap--zoomed {
    transform: scale(1.65);
    cursor: zoom-out;
}

.lightbox-modal__img {
    max-width: 88vw;
    max-height: 68vh;
    object-fit: contain;
    user-select: none;
}

.lightbox-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
}

.lightbox-modal__nav--prev {
    left: 1rem;
}

.lightbox-modal__nav--next {
    right: 1rem;
}

.lightbox-modal__footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #0f172a;
}

.lightbox-modal__caption {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.lightbox-modal__exif {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

.lightbox-modal__exif div {
    display: inline-flex;
    gap: 0.35rem;
}

.lightbox-modal__exif dt {
    font-weight: 600;
    color: #cbd5e1;
}

.lightbox-modal__exif dd {
    margin: 0;
}

.lightbox-modal__downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Shareable Selection Modal */
.selection-modal {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.selection-modal[hidden] {
    display: none !important;
}

.selection-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
}

.selection-modal__card {
    position: relative;
    z-index: 1;
    width: min(540px, 100%);
    max-height: 90vh;
    overflow-y: auto;
}

.selection-owner-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Admin QR & Poster Section */
.qr-admin-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 820px) {
    .qr-admin-grid {
        grid-template-columns: 1fr;
    }
}

.qr-preview-box {
    width: 240px;
    height: 240px;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-preview-box svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==========================================================================
   Color Picker Swatches, Chips & Live Poster / Theme Appearance Preview
   ========================================================================== */

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker-swatch {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    cursor: pointer;
    flex-shrink: 0;
}

.color-picker-swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-swatch::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-picker-swatch::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-chip-row,
.poster-live-preview__swatches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    align-items: center;
    width: 100%;
    margin-top: 0.25rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.color-chip,
.color-swatch-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0.52rem;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #1e293b;
    font-size: 0.75rem;
    line-height: 1.25;
}

.color-chip code,
.color-swatch-chip code {
    background: transparent;
    padding: 0;
    color: #1e293b;
    font-size: 0.74rem;
}

.color-chip__dot,
.color-swatch-chip__dot {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.22);
    display: inline-block;
    flex-shrink: 0;
}

.poster-live-preview {
    width: 100%;
    max-width: 360px;
    border-radius: var(--radius-md);
    border: 2px solid var(--poster-primary, #0f172a);
    background: var(--poster-bg, #f8fafc);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.poster-live-preview__header {
    background: var(--poster-primary, #0f172a);
    color: #ffffff;
    padding: 0.65rem 0.9rem;
    text-align: center;
    border-bottom: 3px solid var(--poster-accent, #3b82f6);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.poster-live-preview__card {
    position: relative;
    padding: 1.25rem 1.15rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.55rem;
}

.poster-live-preview__accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--poster-primary, #0f172a) 0%, var(--poster-accent, #3b82f6) 100%);
    transition: background 0.15s ease;
}

.poster-live-preview__badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--poster-accent, #3b82f6);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
    transition: background-color 0.15s ease;
}

.poster-live-preview__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.28;
    color: var(--poster-primary, #0f172a);
    transition: color 0.15s ease;
}

.poster-live-preview__qr,
.poster-live-preview__qr-frame,
.poster-live-preview__qr-sample {
    width: 168px;
    height: 168px;
    aspect-ratio: 1 / 1;
    padding: 0.55rem;
    background: var(--poster-qr-bg, var(--qr-bg, #ffffff));
    color: var(--poster-qr-fg, #0f172a);
    border: 2px solid var(--poster-accent, #3b82f6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.poster-live-preview__qr svg,
.poster-live-preview__qr-frame svg,
.poster-live-preview__qr-sample svg {
    width: 100%;
    height: 100%;
    max-width: 152px;
    max-height: 152px;
    display: block;
}

.poster-live-preview__subtitle {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--poster-primary, #0f172a);
    text-align: center;
    transition: color 0.15s ease;
}

/* Staff & Role Form Utilities */
.form-select {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.62rem 0.8rem;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-charcoal);
    width: 100%;
}

.form-select:focus {
    outline: 2px solid var(--accent-gold);
    outline-offset: 1px;
    border-color: var(--accent-gold);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 0.45rem 0.85rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border-stone);
    border-radius: var(--radius-sm);
    background: var(--bg-stone-subtle);
}

/* ==========================================================================
   Whole-Platform Light & Dark Theme Selector Overrides
   ========================================================================== */

html[data-theme="dark"] {
    color-scheme: dark;
    --bg-ivory: #0f1319;
    --bg-surface: #181e27;
    --bg-stone-subtle: #222a36;
    --border-stone: #2e3848;
    --text-charcoal: #f1f5f9;
    --text-slate: #94a3b8;
    --accent-gold: #cfa35a;
    --accent-gold-hover: #e0b76f;
    --status-success-bg: #103222;
    --status-success-text: #4ade80;
    --status-warning-bg: #36250b;
    --status-warning-text: #fbbf24;
    --status-danger-bg: #3b1619;
    --status-danger-text: #f87171;
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .card__header,
html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .upload-dropzone,
html[data-theme="dark"] .photo-admin-card {
    background: #141921;
}

html[data-theme="dark"] .btn--primary {
    background-color: var(--accent-gold);
    color: #0f1319;
    font-weight: 600;
}

html[data-theme="dark"] .btn--primary:hover {
    background-color: var(--accent-gold-hover);
    color: #0f1319;
}

html[data-theme="dark"] .btn--secondary:hover {
    background-color: #2b3545;
}

html[data-theme="dark"] .badge--role {
    background: #2b261b;
    color: var(--accent-gold);
}

html[data-theme="dark"] .alert--info {
    background: #132542;
    color: #93c5fd;
    border-color: #1e3a8a;
}

html[data-theme="dark"] body.guest-shell {
    background-color: #0f1319;
    color: #f1f5f9;
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="light"] body.guest-shell.theme-cinema_dark {
    background-color: var(--event-bg, #f8f7f4);
    color: #1e1f22;
    --bg-surface: #ffffff;
    --border-stone: #e3dfd7;
    --text-charcoal: #1e1f22;
    --text-slate: #5c5f66;
}
