/* Photo albums (2026-09-27): album lists, the paged thumbnail grid and the full-window viewer (assets/js/album-viewer.js). */

/* ---- album cards (Photo Albums page, My albums) ---- */
.alb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
@media (max-width: 575.98px) { .alb-cards { grid-template-columns: 1fr 1fr; gap: 10px; } }
.alb-card { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); color: var(--foreground); text-decoration: none; transition: var(--transition-fast); }
.alb-card:hover { box-shadow: var(--shadow-md); color: var(--foreground); }
.alb-cover { aspect-ratio: 4 / 3; background: #1a1d24 center / cover no-repeat; display: grid; place-items: center; color: #8a93a6; font-size: 0.85rem; }
.alb-card-body { padding: 8px 10px 10px; }
.alb-card-title { font-size: 0.98rem; font-weight: 600; line-height: 1.25; margin: 0 0 2px; overflow-wrap: anywhere; }
.alb-card-meta { font-size: 0.8rem; color: var(--muted-foreground); display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.alb-vis { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #1d7a45; }
.alb-vis.is-private { color: var(--muted-foreground); }
.alb-vis.is-hidden { color: var(--bs-danger); }
.alb-plan { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; background: var(--secondary); border: 1px solid hsl(25, 80%, 85%); border-radius: 10px; padding: 12px 16px; }
.alb-plan .btn { margin-left: auto; }

/* ---- one album: 5 across x 2 rows (10 a page); phones 2 across x 20 rows (40 a page) ---- */
.alb-desc { white-space: pre-line; max-width: 65ch; }
.alb-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 575.98px) { .alb-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.alb-tb { position: relative; display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #1a1d24; }
.alb-tb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s; }
.alb-tb:hover img { transform: scale(1.04); }
.alb-tb.is-locked img { opacity: 0.3; filter: blur(2px); transform: scale(1.08); }
.alb-tb.is-locked::after { content: ""; position: absolute; inset: 0; background: center / 26px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.alb-tb-no { position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; font-variant-numeric: tabular-nums; }
.alb-gate { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; background: var(--secondary); border: 1px solid hsl(25, 80%, 85%); border-radius: 10px; padding: 12px 16px; }
.alb-gate > div:first-child { flex: 1 1 220px; }
@media (prefers-reduced-motion: reduce) { .alb-tb img { transition: none; } }

/* ---- the viewer: covers the whole browser window ---- */
.alb-vw { position: fixed; inset: 0; z-index: 2000; background: #000; color: #fff; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
.alb-vw-top { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; background: linear-gradient(rgba(0,0,0,.8), rgba(0,0,0,0)); transition: opacity 0.25s; }
.alb-vw-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center; flex: 0 0 auto; padding: 0; }
.alb-vw-btn:hover { background: rgba(255,255,255,.28); }
.alb-vw-btn svg { width: 20px; height: 20px; }
.alb-vw-btn:focus-visible, .alb-vw-arr:focus-visible, .alb-vw-st:focus-visible { outline: 2px solid #f58f2f; outline-offset: 2px; }
.alb-vw-ttl { flex: 1; min-width: 0; font-size: 14px; line-height: 1.25; }
.alb-vw-ttl b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb-vw-ttl span { color: #bbb; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.alb-vw-track { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.alb-vw-track::-webkit-scrollbar { display: none; }
.alb-vw-sl { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; position: relative; display: grid; place-items: center; }
.alb-vw-sl img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; -webkit-user-drag: none; }
.alb-vw-sl.is-locked img { opacity: 0.3; filter: blur(6px); width: 70vmin; height: 70vmin; object-fit: cover; }
.alb-vw-arr { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 50px; height: 50px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 32px; line-height: 1; display: grid; place-items: center; padding: 0 0 4px; transition: opacity 0.25s; }
.alb-vw-arr:hover { background: rgba(255,255,255,.3); }
.alb-vw-arr.is-prev { left: 14px; }
.alb-vw-arr.is-next { right: 14px; }
.alb-vw-arr:disabled { opacity: 0; pointer-events: none; }
@media (hover: none) and (pointer: coarse), (max-width: 575.98px) { .alb-vw-arr { display: none; } }
.alb-vw-bot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 24px 0 calc(8px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.85)); transition: opacity 0.25s; }
.alb-vw-cap { text-align: center; font-size: 14px; padding: 0 16px 8px; min-height: 1.5em; color: #eee; overflow-wrap: anywhere; }
.alb-vw-strip { display: flex; gap: 6px; overflow-x: auto; padding: 0 10px; scrollbar-width: none; }
.alb-vw-strip::-webkit-scrollbar { display: none; }
.alb-vw-strip::before, .alb-vw-strip::after { content: ""; margin: auto; }
.alb-vw-st { flex: 0 0 auto; width: 56px; height: 42px; padding: 0; border: 2px solid transparent; border-radius: 5px; overflow: hidden; opacity: 0.55; background: #222; }
.alb-vw-st img { width: 100%; height: 100%; object-fit: cover; display: block; }
.alb-vw-st.is-on { border-color: #f58f2f; opacity: 1; }
.alb-vw-st.is-locked img { opacity: 0.35; filter: blur(1px); }
.alb-vw.is-bare .alb-vw-top, .alb-vw.is-bare .alb-vw-bot, .alb-vw.is-bare .alb-vw-arr { opacity: 0; pointer-events: none; }
.alb-vw-hint { position: absolute; left: 0; right: 0; top: 50%; margin-top: -10px; text-align: center; font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; pointer-events: none; transition: opacity 0.5s; z-index: 3; }
.alb-vw-gate { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 2; }
.alb-vw-gate .card { max-width: 340px; user-select: text; -webkit-user-select: text; }
.alb-vw-toast { position: absolute; left: 50%; top: calc(66px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: #fff; color: #222; font-size: 13px; padding: 8px 12px; border-radius: 8px; z-index: 9; max-width: 90%; text-align: center; }
body.alb-vw-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .alb-vw-top, .alb-vw-bot, .alb-vw-arr { transition: none; } }

/* ---- manage screen ---- */
.alb-drop { display: block; border: 2px dashed var(--border); border-radius: 12px; padding: 24px 16px; text-align: center; background: var(--muted); cursor: pointer; }
.alb-drop.is-over { border-color: var(--accent); background: var(--secondary); }
.alb-ups { display: grid; gap: 6px; }
.alb-up { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 5px; background: var(--card); font-size: 0.85rem; }
.alb-up img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; background: var(--muted); }
.alb-up-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alb-up-state { color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.alb-up-state.is-ok { color: #1d7a45; }
.alb-up-state.is-err { color: var(--bs-danger); }
.alb-mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
@media (max-width: 575.98px) { .alb-mgrid { grid-template-columns: 1fr 1fr; gap: 8px; } }
.alb-mitem { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); scroll-margin-top: 80px; }
.alb-mitem img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--muted); }
.alb-mitem-body { padding: 6px; display: grid; gap: 6px; }
.alb-mitem .form-control { font-size: 0.82rem; padding: 0.2rem 0.4rem; }
.alb-mitem .btn { font-size: 0.78rem; padding: 0.15rem 0.4rem; }
