/* TEMA Photography — gallery page */
.g-back { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 40px; box-shadow: inset 0 0 0 1.2px var(--line); font-family: var(--f-head); font-size: 14px; transition: box-shadow .4s, color .4s; }
.g-back:hover { color: var(--rose); box-shadow: inset 0 0 0 1.2px var(--rose); }
.g-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.g-hero { position: relative; overflow: hidden; padding: calc(var(--nav-h) + clamp(50px, 8vw, 120px)) var(--pad) clamp(40px, 5vw, 70px); display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; max-width: 1600px; margin: 0 auto; }
.g-hero__in { position: relative; z-index: 1; }
.g-hero__title { font-size: clamp(64px, 12vw, 200px); font-weight: 800; line-height: 1.3; letter-spacing: 0; }
.g-hero__en { font-family: 'Pinyon Script', cursive; color: var(--rose); font-size: clamp(34px, 4vw, 64px); line-height: 1; margin: -.15em 0 26px; direction: ltr; text-align: right; }
.g-hero__p { color: var(--ink-2); max-width: 520px; }
.g-hero__count { position: relative; z-index: 1; display: grid; justify-items: center; line-height: 1; padding-bottom: 20px; }
.g-hero__count b { font-family: var(--f-it); font-weight: 500; font-size: clamp(70px, 9vw, 140px); color: var(--rose); }
.g-hero__count .en-caps { font-size: 11px; color: var(--muted); }

/* ----- Studio (owner) ----- */
.studio { max-width: 1600px; margin: 0 auto 30px; padding: 0 var(--pad); }
.studio[hidden] { display: none; }
.studio__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; background: var(--night); color: #fff; border-radius: 4px; position: relative; overflow: hidden; animation: studioIn 1s var(--ease); }
.studio__bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--rose); }
@keyframes studioIn { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0); } }
.studio__hi { display: flex; align-items: center; gap: 16px; }
.studio__hi img { width: 44px; filter: drop-shadow(0 0 14px rgba(255,77,138,.6)); }
.studio__hi b { display: block; font-family: var(--f-head); font-size: 19px; }
.studio__hi span { font-size: 14px; color: rgba(255,255,255,.65); }
.studio__acts { display: flex; gap: 10px; flex-wrap: wrap; }
.studio .btn--line { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.6); color: #fff; }
.studio .btn--line::before { background: #fff; }
.studio .btn--line:hover { color: var(--ink); }
.upload { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .8s var(--ease); }
.upload.is-open { grid-template-rows: 1fr; }
.upload > div { overflow: hidden; }
.upload__in { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; padding-top: 18px; }
.drop { position: relative; min-height: 300px; border: 1.5px dashed rgba(228,0,91,.5); background: var(--paper); border-radius: 4px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 30px; cursor: pointer; transition: background .4s, border-color .4s; }
.drop b { font-family: var(--f-head); font-size: 22px; }
.drop > span:last-child { color: var(--muted); font-size: 14px; }
.drop__ic { width: 76px; height: 76px; border-radius: 50%; background: var(--blush); display: grid; place-items: center; margin-bottom: 10px; transition: transform .5s var(--ease); }
.drop__ic svg { width: 36px; fill: none; stroke: var(--rose); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop:hover .drop__ic, .drop.is-over .drop__ic { transform: translateY(-6px) scale(1.06); }
.drop.is-over { background: var(--blush); border-color: var(--rose); }
.upload__side { display: flex; flex-direction: column; gap: 14px; }
.sel { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.sel select { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); border-radius: 2px; color: var(--ink); }
.queue { flex: 1; min-height: 120px; max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; align-content: start; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 2px; }
.queue:empty::before { content: 'لم تختاري ملفات بعد'; grid-column: 1 / -1; color: var(--muted); font-size: 14px; text-align: center; align-self: center; padding: 30px 0; }
.q { position: relative; aspect-ratio: 1; border-radius: 3px; overflow: hidden; background: var(--sand); animation: qIn .5s var(--ease); }
@keyframes qIn { from { opacity: 0; transform: scale(.8); } }
.q img, .q video { width: 100%; height: 100%; object-fit: cover; }
.q button { position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; line-height: 1; }
.q i { position: absolute; bottom: 4px; right: 4px; font-style: normal; font-size: 10px; background: var(--rose); color: #fff; padding: 1px 6px; border-radius: 10px; }
.q.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border: 2.5px solid #fff; border-top-color: var(--rose); border-radius: 50%; animation: spin .7s linear infinite; }
.q.is-busy::before { content: ''; position: absolute; inset: 0; background: rgba(18,13,15,.45); }
.q__st { position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 2; display: grid; gap: 4px; text-align: center; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none; }
.q__st em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q .q__bar { position: static; inset: auto; padding: 0; display: block; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); overflow: hidden; }
.q__bar b { display: block; height: 100%; width: 0; background: var(--rose); border-radius: inherit; transition: width .3s; }
.q.is-done::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(228,0,91,.7); color: #fff; font-size: 26px; }
.upload__note { font-size: 12.5px; color: var(--muted); margin: 0; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ----- Filters ----- */
.g-filters { position: sticky; top: 70px; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--pad); max-width: 1600px; margin: 0 auto; background: linear-gradient(var(--cream) 70%, transparent); }
.chips { position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 50px; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; z-index: 1; padding: 9px 18px; border-radius: 40px; font-family: var(--f-head); font-size: 14px; white-space: nowrap; transition: color .4s; color: var(--ink-2); }
.chip sup { font-family: var(--f-en); font-size: 9px; margin-right: 4px; opacity: .6; }
.chip.is-on { color: #fff; }
.chips__ind { position: absolute; top: 5px; bottom: 5px; border-radius: 40px; background: var(--ink); transition: left .6s var(--ease), width .6s var(--ease); z-index: 0; }
/* bride archives sit after the chapters, marked with a small heart */
.chip--album { color: var(--rose); }
.chip--album::before { content: '♡'; margin-left: 6px; font-size: 13px; }
.chip--album.is-private::after { content: '🔒'; font-size: 10px; margin-right: 6px; opacity: .7; }
.chip--album.is-on { color: #fff; }
.album-bar { max-width: 1600px; margin: 6px auto 0; padding: 0 var(--pad); }
.album-bar__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; background: var(--paper); border: 1px solid var(--line); border-right: 4px solid var(--rose); border-radius: 4px; animation: rcIn .7s var(--ease) both; }
.album-bar__in h2 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.4; }
.album-bar__in p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.album-bar__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.album-bar__acts button { font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 20px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); transition: background .3s, color .3s; }
.album-bar__acts button:hover { background: var(--ink); color: #fff; }
.album-bar__acts .is-danger:hover { background: var(--rose); }
.album-dlg__p { color: var(--ink-2); font-size: 15px; margin-top: -8px; }
.upload__more { display: flex; gap: 6px; flex-wrap: wrap; }

/* ----- Watermark on every photo (gallery, albums, lightbox) ----- */
.wm { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .2; mix-blend-mode: overlay;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='170'><text x='130' y='95' text-anchor='middle' transform='rotate(-24 130 85)' font-family='Georgia,serif' font-size='22' letter-spacing='7' fill='white'>TEMA ✦ PHOTOGRAPHY</text></svg>") center / 260px auto repeat; }
.lb__item { position: relative; }
.lb__item .wm { opacity: .14; mix-blend-mode: normal; }

/* ----- Owner: swap a photo ----- */
.gi__swap { position: absolute; top: 10px; right: 10px; z-index: 3; padding: 5px 12px; border-radius: 20px; background: rgba(255,255,255,.92); color: var(--ink); font-family: var(--f-head); font-size: 12px;
  opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .4s var(--ease), background .3s, color .3s; }
.gi:hover .gi__swap, .gi:focus-within .gi__swap { opacity: 1; transform: none; }
.gi__swap:hover { background: var(--rose); color: #fff; }

/* ----- Bride album: cinematic cover + justified rows that open one after another ----- */
.album-hero { position: relative; overflow: hidden; min-height: clamp(220px, 34vw, 460px); border-radius: 6px; display: grid; align-items: end; margin-bottom: 14px; background: var(--night); color: #fff;
  animation: albumIn 1.4s var(--ease) both; }
.album-hero.has-cover::before { content: ''; position: absolute; inset: -4%; background: var(--cover) center / cover no-repeat; animation: albumKen 14s ease-out both; }
.album-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18,13,15,.85), rgba(18,13,15,.1) 60%); }
.album-hero__txt { position: relative; z-index: 2; padding: clamp(22px, 3.4vw, 46px); }
.album-hero__txt .en-caps { color: var(--rose-2); margin: 0 0 4px; font-size: 11px; opacity: 0; animation: albumTxt 1s .5s var(--ease) both; }
.album-hero__txt h2 { font-size: clamp(34px, 5vw, 76px); line-height: 1.3; opacity: 0; animation: albumTxt 1.2s .65s var(--ease) both; }
.album-hero__txt p { margin: 6px 0 0; color: rgba(255,255,255,.75); opacity: 0; animation: albumTxt 1s .85s var(--ease) both; }
@keyframes albumIn { from { clip-path: inset(12% 8% round 30px); opacity: 0; } to { clip-path: inset(0 round 6px); opacity: 1; } }
@keyframes albumKen { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes albumTxt { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.g-grid--album { columns: auto; display: flex; flex-wrap: wrap; gap: 12px; }
.g-grid--album .gi { margin: 0; flex: none; border-radius: 4px; }
.g-grid--album .gi img, .g-grid--album .gi video { width: 100%; height: 100%; object-fit: cover; aspect-ratio: auto !important; }
.g-grid--album .gi { transform: translate3d(0, 40px, 0) scale(.97); }
.g-grid--album .gi.in { transform: none; }
.g-view { display: flex; gap: 4px; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 40px; flex-shrink: 0; }
.g-view button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: all .4s; }
.g-view button.is-on { background: var(--rose); color: #fff; }
.g-view svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* ----- Grid ----- */
.g-grid { columns: 4 280px; column-gap: clamp(10px, 1.2vw, 18px); padding: 20px var(--pad) 40px; max-width: 1600px; margin: 0 auto; }
.g-grid.is-large { columns: 2 460px; }
.gi { position: relative; break-inside: avoid; margin: 0 0 clamp(10px, 1.2vw, 18px); overflow: hidden; background: var(--sand); cursor: zoom-in; border-radius: 3px;
  opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .8s ease, transform .9s var(--ease); transition-delay: var(--dl, 0ms);
  contain: layout paint; }
.gi.in { opacity: 1; transform: none; }
.gi.in.done { transition-delay: 0ms; }
.gi.out { opacity: 0; transform: scale(.94); transition-duration: .35s; transition-delay: 0ms; }
.gi img, .gi video { width: 100%; height: auto; display: block; transition: transform 1.3s var(--ease), filter .8s; }
.gi:hover img, .gi:hover video { transform: scale(1.06); }
.gi::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(18,13,15,.6), transparent 45%); opacity: 0; transition: opacity .6s; }
.gi:hover::after { opacity: 1; }
.gi__vf { position: absolute; inset: 14px; z-index: 2; color: #fff; opacity: 0; transform: scale(1.08); transition: all .6s var(--ease); pointer-events: none; }
.gi:hover .gi__vf { opacity: 1; transform: none; }
.gi__cap { position: absolute; bottom: 16px; right: 18px; left: 18px; z-index: 3; color: #fff; display: flex; justify-content: space-between; align-items: center; font-family: var(--f-head); font-size: 14px; transform: translateY(16px); opacity: 0; transition: all .6s var(--ease); }
.gi:hover .gi__cap { transform: none; opacity: 1; }
.gi__cap .en-caps { font-size: 9px; opacity: .8; }
.gi__badge { position: absolute; top: 14px; right: 14px; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 30px; background: rgba(18,13,15,.6); color: #fff; font-size: 12px; backdrop-filter: blur(6px); }
.gi__badge svg { width: 12px; fill: #fff; }
.gi__badge--new { background: var(--rose); right: auto; left: 14px; }
.gi__play { position: absolute; inset: 0; margin: auto; z-index: 2; width: 66px; height: 66px; border-radius: 50%; background: rgba(255,255,255,.18); backdrop-filter: blur(8px); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.6); transition: transform .5s var(--ease), background .4s; }
.gi__play svg { width: 22px; fill: #fff; margin-left: 3px; }
.gi:hover .gi__play { transform: scale(1.12); background: var(--rose); border-color: var(--rose); }
.gi__del { position: absolute; top: 12px; left: 12px; z-index: 4; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--rose); display: grid; place-items: center; box-shadow: 0 8px 20px -6px rgba(0,0,0,.4); transition: transform .4s var(--ease); }
.gi__del:hover { transform: scale(1.12) rotate(90deg); }
.gi__del svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.gi--new .gi__badge--new ~ .gi__del { top: 48px; }
.g-empty { text-align: center; color: var(--muted); padding: 60px 0; }
.g-cta { text-align: center; padding: clamp(60px, 8vw, 120px) var(--pad); display: grid; justify-items: center; gap: 24px; }
.footer--slim { padding-top: 30px; }

/* ----- Lightbox ----- */
.lb { position: fixed; inset: 0; z-index: 180; color: #fff; visibility: hidden; pointer-events: none; transition: visibility 0s .7s; }
.lb.is-open { visibility: visible; pointer-events: auto; transition: none; }
.lb__bg { position: absolute; inset: 0; background: #0e0a0c; clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%)); transition: clip-path .8s var(--ease-io); }
.lb.is-open .lb__bg { clip-path: circle(150% at var(--ox, 50%) var(--oy, 50%)); }
.lb__top { position: absolute; top: 0; inset-inline: 0; z-index: 4; display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(14px, 3vw, 30px); opacity: 0; transform: translateY(-20px); transition: all .6s .25s var(--ease); }
.lb.is-open .lb__top { opacity: 1; transform: none; }
.lb__info { display: flex; align-items: center; gap: 16px; }
.lb__count { font-size: 12px; color: rgba(255,255,255,.6); }
.lb__count b { color: #fff; font-weight: 500; font-size: 15px; }
.lb__cat { font-family: var(--f-head); font-size: 14px; padding: 4px 14px; border-radius: 30px; background: rgba(228,0,91,.9); }
.lb__tools { display: flex; gap: 6px; }
.lb__btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); transition: background .3s; }
.lb__btn:hover, .lb__btn.is-on { background: var(--rose); }
.lb__btn .i-play, .lb__btn .i-pause { fill: none; stroke: currentColor; stroke-width: 1.8; }
.lb__btn .i-play { fill: currentColor; stroke: none; width: 18px; }
.lb__btn .i-pause { display: none; }
.lb__btn.is-on .i-play { display: none; } .lb__btn.is-on .i-pause { display: block; }
.lb__progress { position: absolute; top: 0; inset-inline: 0; height: 2px; z-index: 5; }
.lb__progress span { display: block; height: 100%; background: var(--rose); transform-origin: right; transform: scaleX(0); }
.lb__stage { position: absolute; inset: 76px clamp(14px, 7vw, 110px) 112px; z-index: 2; touch-action: pan-y; transition: opacity .35s var(--ease), transform .45s var(--ease); }
/* Closing: the photo and controls fade out first, then the backdrop folds away — nothing lingers. */
.lb:not(.is-open) .lb__stage { opacity: 0; transform: scale(.94); }
.lb:not(.is-open) .lb__nav { opacity: 0; }
.lb:not(.is-open) .lb__top, .lb:not(.is-open) .lb__thumbs { transition-duration: .3s; transition-delay: 0s; }
.lb:not(.is-open) .lb__bg { transition: clip-path .6s .12s var(--ease-io); }
html { scrollbar-gutter: stable; }
.lb__item { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb__item img, .lb__item video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,.5); user-select: none; -webkit-user-drag: none; transition: transform .5s var(--ease); }
.lb__item.is-zoom img { transform: scale(2.2); cursor: zoom-out; }
.lb__item img { cursor: zoom-in; }
.lb__item.enter { animation: lbIn .85s var(--ease) both; }
.lb__item.leave { animation: lbOut .6s var(--ease) both; }
.lb__item.dir-prev.enter { animation-name: lbInPrev; } .lb__item.dir-prev.leave { animation-name: lbOutPrev; }
@keyframes lbIn { from { opacity: 0; transform: translateX(-12%) scale(.96); clip-path: inset(0 0 0 100%); } to { opacity: 1; transform: none; clip-path: inset(0); } }
@keyframes lbOut { to { opacity: 0; transform: translateX(10%) scale(.94); } }
@keyframes lbInPrev { from { opacity: 0; transform: translateX(12%) scale(.96); clip-path: inset(0 100% 0 0); } to { opacity: 1; transform: none; clip-path: inset(0); } }
@keyframes lbOutPrev { to { opacity: 0; transform: translateX(-10%) scale(.94); } }
.lb__item.is-first { animation: lbFirst .9s .4s var(--ease) both; }
@keyframes lbFirst { from { opacity: 0; transform: scale(.88); } }
.lb__nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 4; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); backdrop-filter: blur(6px); transition: background .3s, transform .4s var(--ease), opacity .3s; }
.lb__nav:hover { background: var(--rose); }
.lb__nav svg { width: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lb__nav--prev { right: clamp(8px, 2vw, 30px); } .lb__nav--next { left: clamp(8px, 2vw, 30px); }
.lb__nav--prev:hover { transform: translateX(4px); } .lb__nav--next:hover { transform: translateX(-4px); }
.lb__thumbs { position: absolute; bottom: 18px; inset-inline: 0; z-index: 4; display: flex; gap: 8px; overflow-x: auto; padding: 6px max(20px, 50vw - 40px); scrollbar-width: none; scroll-behavior: smooth; opacity: 0; transform: translateY(20px); transition: all .6s .3s var(--ease); }
.lb.is-open .lb__thumbs { opacity: 1; transform: none; }
.lb__thumbs::-webkit-scrollbar { display: none; }
.lb__thumbs button { flex: 0 0 auto; width: 62px; height: 62px; border-radius: 3px; overflow: hidden; opacity: .4; transition: opacity .4s, transform .4s var(--ease), box-shadow .4s; position: relative; }
.lb__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.lb__thumbs button:hover { opacity: .8; }
.lb__thumbs button.is-on { opacity: 1; transform: translateY(-6px); box-shadow: 0 0 0 2px var(--rose); }
.lb__thumbs button.is-vid::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; background: rgba(0,0,0,.35); }
.lb__vf { position: absolute; inset: 70px clamp(8px, 5vw, 80px) 104px; z-index: 3; pointer-events: none; color: rgba(255,255,255,.35); }
.lb__vf .vf { width: 30px; height: 30px; }

@media (max-width: 760px) {
  .g-hero { flex-direction: column; align-items: flex-start; }
  .g-hero__count { justify-items: start; padding: 0; }
  .g-filters { top: 64px; flex-direction: column; align-items: stretch; }
  .g-view { display: none; }
  .g-grid { columns: 2 150px; }
  .gi__cap { display: none; }
  .upload__in { grid-template-columns: 1fr; }
  .drop { min-height: 200px; }
  .lb__stage { inset: 70px 6px 100px; }
  .lb__nav { width: 44px; height: 44px; top: auto; bottom: 96px; translate: none; }
  .lb__vf { display: none; }
  .lb__thumbs button { width: 50px; height: 50px; }
  .lb__btn[data-act=full] { display: none; }
}
