/**
 * @file        sg-album.css
 * @description Styles of the album module: step photo layouts and their picker, album cards, editor rows, album page, tag chips, photo search, slideshow, guest links, guest page, photos from guests (G6-01 to G6-11)
 *
 * @author      Thomas Dobler - SYNTHETIXMIND LTD
 * @company     SYNTHETIXMIND LTD, Paphos, Cyprus
 * @url         https://synthetixmind.com
 *
 * @uid         21cbfa50-f322-43c7-b811-88a5c5c9acb0
 * @version     0.2.0.2
 * @created     2026-12-01
 * @updated     2026-12-04
 *
 * @copyright   (c) 2026 by SYNTHETIXMIND LTD
 * @license     Proprietary — All rights reserved
 */

/* G6-01 layouts. 360 px first: every layout fits the column, nothing scrolls sideways except the carousel track. */
.sg-album-gallery--masonry { display: block; columns: 2 140px; column-gap: 6px; }
.sg-album-gallery--masonry li { break-inside: avoid; margin: 0 0 6px; }
.sg-album-gallery--masonry img { aspect-ratio: auto; }
.sg-album-gallery--large { grid-template-columns: minmax(0, 1fr); }
.sg-album-gallery--large img { aspect-ratio: auto; max-height: 80vh; object-fit: contain; background: var(--bg); }
.sg-album-carousel { margin: 12px 0; }
.sg-album-gallery--carousel { display: flex; grid-template-columns: none; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; margin: 0; overscroll-behavior-x: contain; }
.sg-album-gallery--carousel li { flex: 0 0 100%; scroll-snap-align: center; }
.sg-album-gallery--carousel img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--bg); }
.sg-album-carousel__nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 0; }
.sg-album-carousel__nav .sg-button { min-width: 44px; min-height: 44px; font-size: 1.4rem; line-height: 1; }
.sg-album-license-line { margin: 4px 0 8px; overflow-wrap: anywhere; }

/* G6-01 picker with small diagrams. */
.sg-album-layout-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.sg-album-layout-pick { display: grid; gap: 4px; justify-items: center; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; min-height: 44px; text-align: center; font-size: 0.9rem; }
.sg-album-layout-pick:has(input:checked) { border-color: var(--ink); font-weight: 600; }
.sg-album-layout-pick input { margin: 0; }
.sg-album-diagram { display: grid; gap: 2px; width: 48px; height: 36px; }
.sg-album-diagram i { background: var(--border-strong); border-radius: 2px; }
.sg-album-diagram--grid { grid-template-columns: 1fr 1fr; }
.sg-album-diagram--masonry { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr 2fr; }
.sg-album-diagram--masonry i:nth-child(1) { grid-row: span 2; }
.sg-album-diagram--masonry i:nth-child(4) { grid-row: span 2; }
.sg-album-diagram--carousel { grid-template-columns: 1fr 4fr 1fr; }
.sg-album-diagram--carousel i:nth-child(4) { display: none; }
.sg-album-diagram--large { grid-template-columns: 1fr; }
.sg-album-diagram--large i:not(:first-child) { display: none; }

/* G6-02 album cards. */
.sg-album-sort { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-album-sort [aria-current="true"] { border-color: var(--ink); color: var(--ink); font-weight: 600; }
.sg-album-cards { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.sg-album-card a { display: grid; height: 100%; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); color: var(--ink); text-decoration: none; }
.sg-album-card a:hover { border-color: var(--border-strong); }
.sg-album-card img, .sg-album-card__empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: grid; place-items: center; background: var(--bg); color: var(--ink-muted); }
.sg-album-card__body { display: grid; gap: 4px; padding: 12px; min-width: 0; }
.sg-album-card__body strong { font-family: var(--font-head); font-weight: 600; overflow-wrap: anywhere; }

/* G6-03 editor rows: drag on wide screens, the "Move" menu everywhere. */
.sg-album-items { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.sg-album-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sg-album-item[draggable="true"] { cursor: grab; }
.sg-album-item--dragging { opacity: 0.5; }
.sg-album-item--over { border-color: var(--ink); }
.sg-album-item__body { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.sg-album-hidden .sg-icon { width: 14px; height: 14px; }
.sg-album-moveto { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sg-album-moveto input { width: 5rem; }
.sg-album-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 720px) { .sg-album-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; } }

/* G6-04 album page. */
.sg-album-grid figure { margin: 0; }
.sg-album-grid figcaption { font-size: 0.85rem; color: var(--ink-muted); margin: 4px 0 0; overflow-wrap: anywhere; }
.sg-album-license-tag { white-space: nowrap; }
.sg-album-copyright { margin-top: 16px; }

/* G6-06 search. */
.sg-album-progress progress { width: 100%; height: 4px; }
.sg-album-results li { position: relative; }
.sg-album-result__open { display: inline-block; font-size: 0.85rem; margin: 4px 0 0; min-height: 24px; }

/* Phase 6 mockup pass (2026-12-04): shared pieces of G6-05, G6-07 to G6-11. Tokens: navy #1c2c37, surface #f2f4f6, sand #eaddd3, orange through --primary. */
.sg-album-icon { flex: 0 0 auto; width: 18px; height: 18px; vertical-align: -4px; }
.sg-album-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; min-width: 0; }
.sg-album-head h1, .sg-album-head h2 { margin: 0; overflow-wrap: anywhere; }
.sg-album-head__sub { margin: 2px 0 0; overflow-wrap: anywhere; }
.sg-album-footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 16px 0 0; }
.sg-album-footer .sg-button, .sg-album-link__buttons .sg-button, .sg-album-toolbar .sg-button { min-height: 44px; }
.sg-album-banner { display: flex; gap: 10px; align-items: flex-start; }
.sg-album-banner .sg-album-icon { margin-top: 1px; }
.sg-album-banner__body { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sg-album-error { display: flex; gap: 6px; align-items: flex-start; }
.sg-album-emptycard { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); margin: 12px 0 0; }
.sg-album-emptycard .sg-album-icon { width: 32px; height: 32px; color: var(--ink-muted); }
.sg-album-emptycard h2, .sg-album-emptycard h3 { margin: 0; font-size: 1.05rem; }
.sg-album-emptycard p { margin: 0; max-width: 36rem; }

/* G6-05 tags: one box with chips and the field, counter right of the label. */
.sg-album-tagremove { display: none; }
.sg-album-tagfield__head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.sg-album-tagfield__head label { font-weight: 600; }
.sg-album-tagfield__head .sg-hint { margin: 0; }
.sg-album-tagfield__count { margin-left: auto; color: var(--ink); }
.sg-album-tagbox { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; margin: 6px 0; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.sg-album-tagbox:focus-within { border-color: var(--ink); }
.sg-album-tagfield--full .sg-album-tagbox { background: var(--bg); }
.sg-album-tags { display: contents; margin: 0; padding: 0; list-style: none; }
.sg-album-tag { color: var(--ink); max-width: 100%; overflow-wrap: anywhere; background: var(--bg); }
.sg-album-tag__remove { display: inline-grid; place-items: center; border: 0; background: none; color: var(--ink-muted); cursor: pointer; min-width: 28px; min-height: 28px; padding: 0; }
.sg-album-tag__remove:hover { color: var(--ink); }
.sg-album-tag__remove .sg-album-icon { width: 14px; height: 14px; }
.sg-album-tagbox input { flex: 1 1 8rem; min-width: 0; min-height: 40px; border: 0; background: transparent; }
.sg-album-tagbox input:focus { outline: none; }
.sg-album-tagbox .sg-button { min-height: 40px; }

/* G6-11 license: radio cards (account), select with the sentence (photo editor). */
.sg-album-license { border: 0; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.sg-album-license__choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.sg-album-license__choice:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.sg-album-license__choice input { margin: 3px 0 0; }
.sg-album-license__text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sg-album-photolicense { margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); }
.sg-album-photolicense .sg-field select { width: 100%; min-height: 44px; }
.sg-album-chip--own { border-color: var(--mahogany); color: var(--mahogany); }

/* G6-07 slideshow: top bar with Exit, full screen stage, small map in a corner, caption and controls that wrap at 360 px. */
.sg-album-show { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 100vh; background: #0B141A; color: #F2F4F6; }
.sg-album-show:fullscreen { min-height: 100%; }
.sg-album-show__top { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 12px; min-width: 0; }
.sg-album-show__title { margin: 0; font-family: var(--font-head); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sg-album-show .sg-button--ghost { color: #F2F4F6; border-color: #44535F; background: transparent; min-height: 44px; }
.sg-album-show__stage { margin: 0; display: grid; place-items: center; min-height: 0; padding: 8px; }
.sg-album-show__stage img { max-width: 100%; max-height: calc(100vh - 220px); object-fit: contain; transition: opacity 0.4s ease; }
.sg-album-show__stage img.sg-album-show--fade { opacity: 0; }
.sg-album-show__map { position: absolute; right: 12px; top: 64px; width: 120px; height: 80px; background: rgba(28, 44, 55, 0.85); border: 1px solid #44535F; border-radius: var(--radius); }
.sg-album-show__map polyline { fill: none; stroke: #AEB8C1; stroke-width: 1.2; stroke-linejoin: round; }
.sg-album-show__map circle { fill: var(--orange); stroke: #F2F4F6; stroke-width: 1; }
.sg-album-show__end { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(92%, 360px); padding: 16px; border: 1px solid #44535F; border-radius: var(--radius-lg); background: rgba(28, 44, 55, 0.95); text-align: center; }
.sg-album-show__end p { margin: 0 0 8px; }
.sg-album-show__endactions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sg-album-show__bar { display: grid; gap: 8px; padding: 10px 12px 16px; border-top: 1px solid #2B3A45; background: rgba(28, 44, 55, 0.6); }
.sg-album-show__caption { display: flex; gap: 8px 12px; align-items: baseline; justify-content: space-between; min-width: 0; }
.sg-album-show__caption p { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.sg-album-show__keys { margin: 0; font-size: 0.85rem; color: #AEB8C1; }
.sg-album-show__controls, .sg-album-show__options { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.sg-album-show__toggle .sg-album-icon:nth-of-type(2), .sg-album-show__toggle[aria-pressed="true"] .sg-album-icon:nth-of-type(1) { display: none; }
.sg-album-show__toggle[aria-pressed="true"] .sg-album-icon:nth-of-type(2) { display: inline-block; }
.sg-album-show__loop { color: #F2F4F6; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.sg-album-segs { display: inline-flex; margin: 0; padding: 0; border: 1px solid #44535F; border-radius: var(--radius); overflow: hidden; }
.sg-album-seg { position: relative; display: inline-grid; place-items: center; min-width: 52px; min-height: 44px; cursor: pointer; font-family: var(--font-mono); }
.sg-album-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sg-album-seg:has(input:checked) { background: #F2F4F6; color: #1C2C37; }
.sg-album-seg:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (min-width: 1024px) { .sg-album-show__bar { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; } .sg-album-show__keys { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sg-album-show__stage img { transition: none; }
  .sg-album-gallery--carousel { scroll-behavior: auto; }
}

/* G6-08 guest links: rows with label, state chip, expiry and count, actions that wrap; QR panel; new link form. */
.sg-album-links { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.sg-album-link { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.sg-album-link--expired, .sg-album-link--revoked { border-color: var(--border); background: var(--bg); color: var(--ink-muted); }
.sg-album-link__title { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.sg-album-link__main .sg-hint { margin: 2px 0 0; }
.sg-album-link__actions { display: grid; gap: 8px; min-width: 0; }
.sg-album-link__buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.sg-album-link__url { width: 100%; font-family: var(--font-mono); font-size: 0.85rem; }
.sg-album-chip--active { border-color: var(--navy); color: var(--navy); }
.sg-album-chip--expired { border-color: var(--mahogany); color: var(--mahogany); }
.sg-album-qr > summary { list-style: none; }
.sg-album-qr > summary::-webkit-details-marker { display: none; }
.sg-album-qr__panel { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.sg-album-qr__panel svg { width: 120px; height: 120px; flex: 0 0 auto; }
.sg-album-qr__panel div { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.sg-album-qr__panel p { margin: 0 0 4px; }
.sg-album-newlink { margin: 12px 0 0; }
.sg-album-newlink > summary { list-style: none; display: inline-flex; min-height: 44px; }
.sg-album-newlink > summary::-webkit-details-marker { display: none; }
.sg-album-newlink__form { margin: 8px 0 0; padding: 12px; border: 1px solid var(--border-warm); border-radius: var(--radius); background: var(--beige); color: var(--warm-ink); }
.sg-album-newlink__title { margin: 0 0 8px; }
.sg-album-newlink__form select, .sg-album-newlink__form input { width: 100%; min-height: 44px; }
@media (min-width: 720px) { .sg-album-link { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } }

/* G6-09 guest page. */
.sg-album-guesthead { display: flex; gap: 12px; align-items: center; min-width: 0; }
.sg-album-guesthead h1 { margin: 0; overflow-wrap: anywhere; }
.sg-album-guesthead p { margin: 2px 0 0; }
.sg-album-guesthead__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; background: var(--beige); color: var(--mahogany); }
.sg-album-consent { padding: 12px; border: 1px solid var(--border-warm); border-radius: var(--radius); background: var(--beige); color: var(--warm-ink); margin: 0 0 12px; overflow-wrap: anywhere; }
.sg-album-consent p { margin: 0; }
.sg-album-consent__check { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; }
.sg-album-guest__head { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin: 16px 0 4px; }
.sg-album-guest__label { font-weight: 600; }
.sg-album-guest__count { font-size: 1.05rem; }
.sg-album-drop .sg-album-icon { width: 32px; height: 32px; color: var(--mahogany); }
.sg-album-guestlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sg-album-guestlist__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.sg-album-guestlist__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-album-guestlist__state { margin: 0; text-align: right; }
.sg-album-guestlist__item progress { grid-column: 1 / -1; width: 100%; height: 4px; accent-color: var(--navy); }
.sg-album-guestlist__item--failed { border-color: var(--accent); }
.sg-album-done { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 24px 8px; }
.sg-album-done h2 { margin: 0; }
.sg-album-done__icon .sg-album-icon { width: 40px; height: 40px; color: var(--navy); }

/* G6-10 photos from guests: tabs, trip badge, toolbar, groups with tick tiles. */
.sg-album-tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.sg-album-tabs__tab { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.sg-album-tabs__tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--navy); font-weight: 600; }
.sg-album-tabs__count { font: 500 0.8rem var(--font-mono); padding: 1px 6px; border-radius: 999px; background: var(--beige); color: var(--warm-ink); }
.sg-album-tripbadge { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; overflow-wrap: anywhere; }
.sg-album-tripchip { color: var(--ink); }
.sg-album-toolbar { margin: 0 0 12px; }
.sg-album-toolbar .sg-hint { margin: 0; }
.sg-album-toolbar .sg-check { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.sg-album-toolbar select { min-height: 44px; max-width: 100%; }
.sg-album-guestgroups { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.sg-album-guestgroup__head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0 0 8px; overflow-wrap: anywhere; }
.sg-album-guestgroup__head .sg-chip { margin-left: auto; }
.sg-album-pick { position: relative; display: block; }
.sg-album-pick input { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; margin: 0; accent-color: var(--navy); }
.sg-album-pick:has(input:checked) img { outline: 3px solid var(--navy); outline-offset: -3px; }
.sg-album-holding-tab { margin: 0 0 12px; }
.sg-album-trip-actions { margin: 8px 0; }
