/* Tweller Event Photo Engine — mobile-first, black & gold brand.
   Namespaced under .tepe so it never fights the host theme. */

.tepe {
    --tepe-black: #101010;
    --tepe-ink: #2a2521;
    --tepe-muted: #6b6259;
    --tepe-gold: #c8a34e;
    --tepe-gold-dk: #a9873a;
    --tepe-line: #e7e1d8;
    --tepe-bg: #fbf9f5;
    --tepe-card: #ffffff;
    --tepe-radius: 14px;
    --tepe-shadow: 0 6px 24px rgba(16,16,16,.10);
    box-sizing: border-box;
    color: var(--tepe-ink);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.tepe *, .tepe *::before, .tepe *::after { box-sizing: border-box; }
.tepe img { max-width: 100%; display: block; }

/* ── Buttons ── */
.tepe-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    padding: .78em 1.3em; border-radius: 999px; border: 1px solid transparent;
    font-weight: 600; font-size: .98rem; line-height: 1; cursor: pointer;
    text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.tepe-btn:active { transform: translateY(1px); }
.tepe-btn--gold { background: var(--tepe-gold); color: #1a1408; box-shadow: 0 4px 14px rgba(200,163,78,.35); }
.tepe-btn--gold:hover { background: var(--tepe-gold-dk); }
.tepe-btn--ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); backdrop-filter: blur(4px); }
.tepe-btn--dark { background: var(--tepe-black); color: #fff; }
.tepe-btn--full { width: 100%; }
.tepe-btn[disabled] { opacity: .75; cursor: progress; }

/* Inline button spinner */
.tepe-spin {
    display: inline-block; width: 1em; height: 1em; margin-right: .1em;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: tepe-spin .6s linear infinite; vertical-align: -.12em; flex: 0 0 auto;
}
@keyframes tepe-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tepe-spin { animation-duration: 2s; } }

/* Upload success panel — always gives the guest a way into the gallery */
.tepe-done { text-align: center; padding: 1.25rem 1rem .5rem; }
.tepe-done__tick {
    width: 52px; height: 52px; margin: 0 auto .6rem; border-radius: 50%;
    background: var(--tepe-gold); color: #1a1408; font-size: 1.7rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    animation: tepe-pop .3s ease;
}
@keyframes tepe-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tepe-done__msg { margin: 0 0 .9rem; color: var(--tepe-ink); }
.tepe-linkbtn { background: none; border: 0; color: var(--tepe-gold-dk); font-weight: 600; cursor: pointer; padding: .3em 0; }

/* ── Hero ── */
.tepe-hero {
    position: relative; padding: 3rem 1.25rem 2.25rem; text-align: center;
    background: var(--tepe-black); color: #fff; border-radius: 0 0 22px 22px;
    background-size: cover; background-position: center;
}
.tepe-hero--img { min-height: 42vh; display: flex; align-items: flex-end; }
.tepe-hero__inner { width: 100%; max-width: 720px; margin: 0 auto; }
.tepe-hero__title { font-size: clamp(1.6rem, 6vw, 2.6rem); margin: 0 0 .4rem; color: #fff; line-height: 1.1; }
.tepe-hero__welcome { opacity: .92; margin: .2rem 0 .6rem; }
.tepe-hero__meta { font-size: .9rem; opacity: .8; margin: .3rem 0 1.1rem; letter-spacing: .02em; }
.tepe-hero__actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ── Intro / cats ── */
.tepe-intro { max-width: 720px; margin: 1.25rem auto; padding: 0 1.25rem; color: var(--tepe-ink); }
.tepe-cats { display: flex; gap: .5rem; overflow-x: auto; padding: 1rem 1.25rem; -webkit-overflow-scrolling: touch; }
.tepe-cats::-webkit-scrollbar { display: none; }
.tepe-chip {
    flex: 0 0 auto; padding: .5em 1em; border-radius: 999px; border: 1px solid var(--tepe-line);
    background: var(--tepe-card); color: var(--tepe-ink); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.tepe-chip--active { background: var(--tepe-black); color: #fff; border-color: var(--tepe-black); }

/* ── Masonry ── */
.tepe-masonry { columns: 2; column-gap: 8px; padding: 0 1rem 5rem; }
@media (min-width: 640px) { .tepe-masonry { columns: 3; } }
@media (min-width: 980px) { .tepe-masonry { columns: 4; max-width: 1200px; margin: 0 auto; } }
.tepe-tile { break-inside: avoid; margin-bottom: 8px; position: relative; border-radius: 10px; overflow: hidden; background: #efe9df; cursor: pointer; }
.tepe-tile img { width: 100%; height: auto; display: block; transition: transform .25s ease; }
.tepe-tile:hover img { transform: scale(1.03); }
.tepe-tile__check { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 999px; background: rgba(16,16,16,.5); border: 2px solid #fff; display: none; align-items: center; justify-content: center; color: #fff; }
.tepe-tile--sel .tepe-tile__check { background: var(--tepe-gold); border-color: var(--tepe-gold); }
.tepe-tile__print { position: absolute; bottom: 8px; right: 8px; background: rgba(16,16,16,.62); color: #fff; border: 0; border-radius: 999px; padding: .35em .7em; font-size: .78rem; font-weight: 600; cursor: pointer; opacity: 0; transition: opacity .15s; }
.tepe-tile:hover .tepe-tile__print, .tepe-selectmode .tepe-tile__check { opacity: 1; display: flex; }
.tepe-tile--heic { display: flex; align-items: center; justify-content: center; min-height: 130px; color: var(--tepe-muted); font-size: .8rem; text-align: center; padding: 1rem; }
.tepe-tile__badge { position: absolute; top: 8px; right: 8px; background: var(--tepe-gold); color: #1a1408; font-size: .68rem; font-weight: 700; padding: .2em .5em; border-radius: 6px; }

/* ── Promo card in grid ── */
.tepe-promo {
    break-inside: avoid; margin-bottom: 8px; border-radius: 12px; padding: 1.1rem;
    background: linear-gradient(160deg, #1b1b1b, #101010); color: #fff; text-align: center;
    border: 1px solid rgba(200,163,78,.35);
}
.tepe-promo__eyebrow { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tepe-gold); }
.tepe-promo__title { font-size: 1.05rem; margin: .35rem 0 .2rem; color: #fff; }
.tepe-promo__blurb { font-size: .82rem; opacity: .82; margin: 0 0 .3rem; }
.tepe-promo__price { color: var(--tepe-gold); font-weight: 700; margin-bottom: .6rem; }

/* ── Selection action bar ── */
.tepe-selbar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 40;
    background: var(--tepe-black); color: #fff; border-radius: 999px; padding: .5rem .6rem .5rem 1.1rem;
    display: flex; align-items: center; gap: .8rem; box-shadow: var(--tepe-shadow); max-width: calc(100% - 2rem);
}
.tepe-selbar__count { font-weight: 600; font-size: .92rem; }

/* ── Upload view ── */
.tepe-upload, .tepe-create { max-width: 640px; margin: 0 auto; padding: 1.25rem; }
.tepe-uphead { text-align: center; margin-bottom: 1.25rem; }
.tepe-uphead h1 { font-size: 1.5rem; margin: .3rem 0 .2rem; }
.tepe-uphead__sub { color: var(--tepe-muted); margin: 0; }
.tepe-back { color: var(--tepe-gold-dk); text-decoration: none; font-weight: 600; font-size: .9rem; }
.tepe-upcard, .tepe-create__card, .tepe-create__done { background: var(--tepe-card); border: 1px solid var(--tepe-line); border-radius: var(--tepe-radius); padding: 1.25rem; box-shadow: var(--tepe-shadow); }
.tepe-field { display: block; margin-bottom: 1rem; }
.tepe-field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.tepe-field em { color: var(--tepe-muted); font-weight: 400; font-style: normal; }
.tepe-field input, .tepe-field textarea, .tepe-field select {
    width: 100%; padding: .8em .9em; border: 1px solid var(--tepe-line); border-radius: 10px; font: inherit; background: #fff; color: var(--tepe-ink);
}
.tepe-field input:focus, .tepe-field textarea:focus { outline: 2px solid var(--tepe-gold); border-color: var(--tepe-gold); }

.tepe-dropzone {
    border: 2px dashed var(--tepe-line); border-radius: var(--tepe-radius); padding: 2rem 1rem; text-align: center;
    color: var(--tepe-muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.tepe-dropzone--over { border-color: var(--tepe-gold); background: rgba(200,163,78,.06); }
.tepe-dropzone__title { font-weight: 700; color: var(--tepe-ink); margin: .5rem 0 .2rem; }
.tepe-dropzone__note { font-size: .82rem; margin: 0; }
.tepe-dest { display: flex; flex-wrap: wrap; gap: .4rem; }

.tepe-queue { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.tepe-qitem { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #efe9df; }
.tepe-qitem img { width: 100%; height: 100%; object-fit: cover; }
.tepe-qitem__bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--tepe-gold); width: 0; transition: width .2s; }
.tepe-qitem--done::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(16,16,16,.45); color: #fff; font-size: 1.3rem; }
.tepe-qitem--err { outline: 2px solid #c0392b; }

.tepe-qrhint { text-align: center; margin: 1.5rem auto; color: var(--tepe-muted); }
.tepe-qrhint img { margin: 0 auto .5rem; border: 8px solid #fff; border-radius: 10px; box-shadow: var(--tepe-shadow); }
.tepe-locked { text-align: center; padding: 2rem; background: var(--tepe-card); border-radius: var(--tepe-radius); color: var(--tepe-muted); }

/* ── Drawer ── */
.tepe-drawer { position: fixed; inset: 0; z-index: 60; }
.tepe-drawer__scrim { position: absolute; inset: 0; background: rgba(16,16,16,.5); }
.tepe-drawer__panel {
    position: absolute; top: 0; right: 0; height: 100%; width: min(440px, 92vw); background: var(--tepe-bg);
    display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.25); animation: tepe-slide .22s ease;
}
@keyframes tepe-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.tepe-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tepe-line); }
.tepe-drawer__head h2 { margin: 0; font-size: 1.2rem; }
.tepe-drawer__x { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: var(--tepe-ink); }
.tepe-drawer__body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.tepe-pline { display: flex; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid var(--tepe-line); }
.tepe-pline img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.tepe-psize { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem 0; }
.tepe-psize label { font-size: .9rem; }
.tepe-qty { display: inline-flex; align-items: center; border: 1px solid var(--tepe-line); border-radius: 8px; overflow: hidden; }
.tepe-qty button { width: 30px; height: 30px; border: 0; background: #fff; font-size: 1rem; cursor: pointer; }
.tepe-qty input { width: 34px; text-align: center; border: 0; border-left: 1px solid var(--tepe-line); border-right: 1px solid var(--tepe-line); height: 30px; }
.tepe-summary { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--tepe-black); }
.tepe-summary__row { display: flex; justify-content: space-between; padding: .2rem 0; }
.tepe-summary__row--total { font-weight: 700; font-size: 1.1rem; }
.tepe-summary__row--discount { color: var(--tepe-gold-dk); }
.tepe-pay { display: flex; gap: .5rem; margin: .75rem 0; }
.tepe-pay label { flex: 1; border: 1px solid var(--tepe-line); border-radius: 10px; padding: .7rem; text-align: center; cursor: pointer; font-size: .88rem; font-weight: 600; background: #fff; }
.tepe-pay input { display: none; }
.tepe-pay input:checked + span { color: var(--tepe-gold-dk); }
.tepe-pay label:has(input:checked) { border-color: var(--tepe-gold); background: rgba(200,163,78,.08); }
.tepe-bankbox { white-space: pre-wrap; background: #fff; border: 1px solid var(--tepe-line); border-radius: 10px; padding: .9rem; font-size: .85rem; margin-top: .5rem; }
.tepe-rewardpill { display: inline-flex; align-items: center; gap: .4rem; background: rgba(200,163,78,.14); color: var(--tepe-gold-dk); border: 1px dashed var(--tepe-gold); border-radius: 999px; padding: .4em .8em; font-weight: 700; font-size: .85rem; margin: .5rem 0; }

/* ── Share reward banner ── */
.tepe-share-reward { max-width: 720px; margin: 0 auto 1rem; padding: 1rem 1.25rem; background: linear-gradient(120deg,#1b1b1b,#101010); color: #fff; border-radius: 12px; text-align: center; border: 1px solid rgba(200,163,78,.4); }
.tepe-share-reward code { background: var(--tepe-gold); color: #1a1408; padding: .15em .5em; border-radius: 6px; font-weight: 700; letter-spacing: .04em; }

/* ── Lightbox ── */
.tepe-lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(10,10,10,.94); display: flex; align-items: center; justify-content: center; }
.tepe-lightbox__img { max-width: 92vw; max-height: 78vh; object-fit: contain; border-radius: 6px; }
.tepe-lightbox__x { position: absolute; top: 1rem; right: 1rem; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }
.tepe-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; color: #fff; font-size: 2rem; width: 48px; height: 48px; border-radius: 999px; cursor: pointer; }
.tepe-lightbox__prev { left: .5rem; } .tepe-lightbox__next { right: .5rem; }
.tepe-lightbox__bar { position: absolute; bottom: 1.2rem; display: flex; gap: .6rem; }

/* ── Toast, errors, banner ── */
.tepe-toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%); background: var(--tepe-black); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; z-index: 90; box-shadow: var(--tepe-shadow); max-width: calc(100% - 2rem); text-align: center; }
.tepe-error { color: #c0392b; font-size: .88rem; margin: .3rem 0; }
.tepe-loading, .tepe-empty { text-align: center; color: var(--tepe-muted); padding: 2rem 1rem; }
.tepe-empty { max-width: 480px; margin: 0 auto; }

.tepe-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: flex; align-items: center; gap: .8rem; justify-content: center; flex-wrap: wrap;
    background: rgba(16,16,16,.94); color: #fff; padding: .7rem 1rem; backdrop-filter: blur(6px);
    font-size: .88rem; box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}
.tepe-banner__text strong { color: var(--tepe-gold); }
.tepe-banner__cta { background: var(--tepe-gold); color: #1a1408; text-decoration: none; font-weight: 700; padding: .45em 1em; border-radius: 999px; }
.tepe-banner__x { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; font-size: 1rem; }
/* keep the banner from covering the last row of the grid */
.tepe-gallery { padding-bottom: 3.5rem; }

.tepe-create__sub { color: var(--tepe-muted); margin-top: -.3rem; }
.tepe-create__links a { display: block; margin: .4rem 0; color: var(--tepe-gold-dk); word-break: break-all; }

/* Hub: "your events on this device" + find-by-email */
.tepe-myevents { margin-bottom: 1.5rem; }
.tepe-myevents > h2 { margin: 0 0 .75rem; }
.tepe-myevent { background: var(--tepe-card); border: 1px solid var(--tepe-line); border-radius: var(--tepe-radius); padding: 1rem; margin-bottom: .75rem; box-shadow: var(--tepe-shadow); }
.tepe-myevent__title { font-weight: 700; margin-bottom: .6rem; }
.tepe-myevent__links { display: flex; flex-wrap: wrap; gap: .5rem; }
.tepe-myevent__links .tepe-btn { font-size: .85rem; padding: .55em 1em; }
.tepe-find { margin-top: 1.5rem; }
.tepe-find h3 { margin: 0 0 .25rem; }
