/* photo David – modern dark design.
   Black with a soft blue-violet glow, thin light lines for depth, Manrope (self-hosted, OFL).
   No external resources.

   Every colour, radius and font is a variable in :root (section 1). A future alternative look
   ("theme") only needs to override these variables – the rules below never use raw colours
   except neutral white / black overlays. */

/* ── 0. Font (variable weight 200–800, Latin + Latin Extended incl. Czech) ── */
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../fonts/manrope/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../fonts/manrope/manrope-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── 1. Design tokens ── */
:root {
    /* backgrounds (the *-rgb variants are for semi-transparent layers: rgba(var(--bg-rgb), .7)) */
    --bg: #050507;
    --bg-rgb: 5, 5, 7;
    --surface: #0c0d13;            /* cards, tiles */
    --surface-rgb: 12, 13, 19;
    --surface-2: #13141c;          /* hover, inputs */
    --lightbox-bg: #030305;
    --video-bg: #0d0e15;           /* video tile without a poster */

    /* lines */
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --line-photo: rgba(255, 255, 255, .09);   /* thin frame around thumbnails */

    /* text */
    --text: #ecebf3;
    --text-soft: #d6d5e0;          /* long texts, secondary buttons */
    --text-dim: #9b9bad;
    --text-faint: #6c6c7e;
    --on-accent: #fff;

    /* accent: blue → violet */
    --accent: #7c6cff;
    --accent-rgb: 124, 108, 255;
    --accent-blue: #4f8bff;
    --accent-blue-rgb: 79, 139, 255;
    --accent-violet: #9b5cff;
    --accent-violet-rgb: 155, 92, 255;
    --grad: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
    --link: #a9a0ff;
    --link-hover: #c6c0ff;
    --glow: 0 0 0 1px rgba(var(--accent-rgb), .55), 0 10px 40px -12px rgba(var(--accent-rgb), .45);

    /* states */
    --ok-rgb: 40, 160, 100;     --ok-line: rgba(70, 200, 130, .3);   --ok-text: #b8f0cf;
    --error-rgb: 220, 70, 90;   --error-line: rgba(240, 100, 120, .3); --error-text: #ffc4cc;
    --warn-rgb: 230, 170, 60;   --warn-line: rgba(240, 190, 90, .3);  --warn-text: #ffe2a8;
    --danger: #b9434f;
    --dev-error: #ff9aa8;

    /* shape and spacing */
    --radius: 16px;
    --radius-sm: 8px;
    --radius-field: 12px;
    --gap: 8px;
    --page-pad: clamp(16px, 4vw, 48px);
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --logo-h: 72px;
    --title-size: clamp(1.3rem, 1.8vw, 1.6rem);   /* page / album titles – one size everywhere */
    color-scheme: dark;
}
@media (max-width: 600px) { :root { --logo-h: 52px; } }

/* ── 2. Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
html:has(.pswp--open) { overflow: hidden; }   /* lightbox open: the page behind does not scroll */

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;   /* html carries the colour; body must not cover the glow layer */
    color: var(--text);
    font: 400 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Soft blue-violet glow in the background – the page is never one flat black area */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(1000px 600px at 8% -12%, rgba(var(--accent-blue-rgb), .26), transparent 60%),
        radial-gradient(900px 560px at 104% 6%, rgba(var(--accent-violet-rgb), .22), transparent 58%),
        radial-gradient(1100px 700px at 50% 118%, rgba(var(--accent-rgb), .14), transparent 60%);
}
img { max-width: 100%; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
::selection { background: rgba(var(--accent-rgb), .45); }

/* ── 3. Header (logo; slides away while scrolling down, returns on scroll up – site.js) ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px var(--page-pad);
    background: rgba(var(--bg-rgb), .72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    transition: transform .3s ease, background .3s ease;
    will-change: transform;
}
.site-header.is-hidden { transform: translateY(-100%); }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 1.15rem;
    letter-spacing: .06em;      /* small spacing between letters */
    line-height: 1;
}
.brand:hover { color: var(--text); }
.brand { flex-shrink: 0; }   /* the logo never gets squeezed by the menu */
.brand-logo { display: block; height: var(--logo-h); width: auto; }
.brand-photo { font-weight: 300; color: var(--text-dim); }   /* "správa" next to the logo in the admin */
.site-nav { display: flex; align-items: center; gap: 22px; font-size: .9rem; }
.site-nav a { color: var(--text-dim); transition: color .15s ease; white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.lang-switch {
    padding: 5px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: .8rem;
}
.lang-switch:hover { border-color: var(--accent); }
.lang-short { display: none; }

/* Family member name + logout */
.user-menu { display: flex; align-items: center; gap: 14px; color: var(--text-dim); }
.user-menu form { display: inline; }
.user-menu a, .user-menu .link { white-space: nowrap; }

@media (max-width: 600px) {
    /* many items (family: public gallery, name, logout, language) → whole items wrap, never words */
    .site-nav { gap: 6px 14px; font-size: .85rem; flex-wrap: wrap; justify-content: flex-end; }
    .lang-long { display: none; }          /* phone: "EN" / "CZ" instead of the full name */
    .lang-short { display: inline; }
    .brand { font-size: 1.05rem; }
    /* long names are shortened, the link to the password page stays */
    .user-menu { gap: 12px; font-size: .85rem; }
    .user-menu > a { max-width: 26vw; overflow: hidden; text-overflow: ellipsis; }
}

/* ── 4. Main area, titles ── */
/* Full window width everywhere (home, categories, albums) – the same left edge on every page.
   Text pages limit their own width (.prose, .narrow cards). */
.site-main {
    flex: 1;
    width: 100%;
    padding: clamp(16px, 2.4vw, 28px) var(--page-pad) 64px;
}
.page-title {
    margin: 0 0 16px;
    font-size: var(--title-size);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.15;
}
.empty-note { color: var(--text-dim); }
.hint { color: var(--text-dim); font-size: .88rem; }

/* ── 5. Tiles (categories / albums): 1 column phone, 2 tablet portrait, 3 desktop ── */
.tiles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* minmax(0, …): images never widen the column */
    gap: clamp(16px, 2.4vw, 28px);
}
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { min-width: 0; }

.tile a {
    display: block;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 8px);
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)), var(--surface);
    color: var(--text);
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.tile-media {
    display: block;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--c, var(--surface-2));
}
.tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .3s ease, opacity .5s ease;
    filter: saturate(.95) brightness(.94);
}
.tile-caption {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 14px 10px 8px;
}
.tile-title { font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.tile-count { font-size: .8rem; color: var(--text-faint); white-space: nowrap; }
.tile a:hover, .tile a:focus-visible {
    border-color: rgba(var(--accent-rgb), .55);
    box-shadow: var(--glow);
    transform: translateY(-3px);
}
.tile a:hover img, .tile a:focus-visible img { transform: scale(1.045); filter: saturate(1.05) brightness(1); }
.tile a:hover .tile-title { color: #fff; }

.tile-group { margin-bottom: 48px; }
.group-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 12px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── 6. Buttons (pills) ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--grad);
    color: var(--on-accent);
    font: 600 .9rem/1.2 var(--font);
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s ease, box-shadow .2s ease, transform .15s ease;
}
.btn:hover { color: var(--on-accent); filter: brightness(1.12); box-shadow: 0 8px 24px -10px rgba(var(--accent-rgb), .8); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: default; filter: none; box-shadow: none; }
.btn-secondary { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--link); }
.btn-danger { background: var(--danger); }
.btn-small { padding: 6px 12px; font-size: .78rem; }
.link { background: none; border: 0; color: var(--text-dim); font: inherit; cursor: pointer; padding: 0; }
.link:hover { color: var(--text); }
.link:disabled { opacity: .4; cursor: default; }
.inline { display: inline; }

/* ── 7. Cards, forms, messages ── */
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .008)), var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    padding: clamp(20px, 3vw, 32px);
}
.narrow { max-width: 460px; margin: 6vh auto 0; }
.wide-form { max-width: 580px; }
/* Title inside a form card: smaller than a page title, never breaks into a tall block */
.card .page-title { margin-bottom: 20px; }
.admin-sso { margin: 18px 0 0; font-size: .82rem; }
.admin-sso a { color: var(--text-faint); }
.admin-sso a:hover { color: var(--text-dim); }

.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: .88rem; color: var(--text-dim); }
.form input[type="text"], .form input[type="password"], .form input[type="email"], .form input[type="number"],
.form input[type="file"], .form select, .form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-field);
    background: rgba(255, 255, 255, .03);
    color: var(--text);
    font: inherit;
    transition: border-color .15s ease, background .15s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .06);
    outline: none;
}
.form textarea { resize: vertical; }
.form .btn { align-self: flex-start; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.flash { padding: 11px 16px; border-radius: var(--radius-field); margin: 0 0 18px; background: var(--surface-2); border: 1px solid var(--line); }
.flash-ok { background: rgba(var(--ok-rgb), .12); border-color: var(--ok-line); color: var(--ok-text); }
.flash-error { background: rgba(var(--error-rgb), .12); border-color: var(--error-line); color: var(--error-text); }
.flash-warn { background: rgba(var(--warn-rgb), .12); border-color: var(--warn-line); color: var(--warn-text); }

/* Small "← back" link above a title (admin album, family password) */
.breadcrumb { margin: 0 0 10px; font-size: .85rem; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--text); }

/* ── 8. Album page: toolbar + header ── */
/* Toolbar: "Galerie › Makro" left, view icons right; sticks below the header while scrolling.
   When the header hides, it moves to the very top (html.header-hidden, site.js). */
.album-toolbar {
    position: sticky;
    top: var(--header-h, 84px);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -8px calc(-1 * var(--page-pad)) 8px;
    padding: 8px var(--page-pad);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: top .3s ease, border-color .2s ease, background .2s ease;
}
html.header-hidden .album-toolbar { top: 0; }
.album-toolbar.is-stuck {
    border-bottom-color: var(--line);
    background: rgba(var(--bg-rgb), .78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.album-toolbar .breadcrumb {
    display: flex; align-items: center; gap: 12px; min-width: 0;
    margin: 0; font-size: .92rem; color: var(--text-dim);
}
.album-toolbar .breadcrumb a { white-space: nowrap; }
/* "Galerie" link: a bit stronger, but quiet – light text in a thin pill */
.album-toolbar .crumb-back {
    padding: 3px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, .03);
    color: var(--text-soft);
    font-size: .88rem;
    font-weight: 600;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.album-toolbar .crumb-back:hover { border-color: var(--accent); color: #fff; background: rgba(var(--accent-rgb), .1); }
.crumb-sep { color: var(--text-faint); font-size: 1.2rem; }
/* (no size change when stuck – it changed the page height and made the header flicker) */
.album-title {
    margin: 0;
    font-size: var(--title-size);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Big cover photo at the top of an album (title on it). The toolbar shows the title only once stuck. */
.album-hero {
    position: relative;
    height: clamp(200px, 38vh, 440px);
    margin: 4px 0 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 8px);
    background: var(--c, var(--surface-2));
}
.album-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(var(--bg-rgb), .82), rgba(var(--bg-rgb), .18) 48%, transparent 72%);
    pointer-events: none;
}
.album-hero-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .6s ease;
    animation: hero-in 1.8s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes hero-in { from { transform: scale(1.06); } to { transform: none; } }
.album-hero-text {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 1;
    padding: clamp(16px, 3vw, 32px);
}
.album-hero-title {
    margin: 0;
    font-size: clamp(1.6rem, 3.4vw, 2.8rem);
    font-weight: 650;
    letter-spacing: -.025em;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .55);
}
@media (max-width: 600px) { .album-hero { height: clamp(170px, 30vh, 260px); border-radius: var(--radius); } }
.album-title-mini { font-size: 1rem; opacity: 0; transition: opacity .2s ease; }
.album-toolbar.is-stuck .album-title-mini { opacity: 1; }
.crumb-sep:has(+ .album-title-mini) { transition: opacity .2s ease; }
.album-toolbar:not(.is-stuck) .crumb-sep:has(+ .album-title-mini) { opacity: 0; }

.album-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.album-head:empty { display: none; }
.album-description { margin: 0 0 8px; max-width: 70ch; color: var(--text); }
.album-count { margin: 0; color: var(--text-dim); font-size: .86rem; }
.download-zip { white-space: nowrap; }
.select-hint { margin: 8px 0 0; }

.view-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}
.view-switch button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.view-switch button:hover { color: var(--text); background: var(--surface-2); }
.view-switch button[aria-pressed="true"] { color: var(--on-accent); background: var(--grad); }
.view-switch svg { width: 17px; height: 17px; fill: currentColor; }

@media (max-width: 600px) {
    .album-toolbar { flex-wrap: wrap; }
    .album-toolbar .breadcrumb { font-size: .85rem; }
    .album-toolbar .crumb-back { padding: 4px 10px; font-size: .8rem; }
    .view-switch button { width: 34px; }
}

/* ── 9. Gallery layouts ── */
.gallery { --row-h: 280px; }
/* .item = one photo (link + optional selection button); layout rules apply to it.
   A thin light line and soft corners keep thumbnails from looking flat. */
.gallery .item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--c, var(--surface-2));
    box-shadow: inset 0 0 0 1px var(--line);
    transition: transform .2s ease, box-shadow .2s ease;
}
.gallery .item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px var(--line-photo);
    pointer-events: none;
    transition: box-shadow .2s ease;
}
.gallery .item:hover::after { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .7); }
.gallery .ph { display: block; width: 100%; height: 100%; }
.gallery img { display: block; width: 100%; height: auto; transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .5s ease; }
.gallery .item:hover img { transform: scale(1.03); }

/* Justified rows: items grow in proportion to their aspect ratio (--r set by JS) */
.gallery.v-justified { display: flex; flex-wrap: wrap; gap: var(--gap); }
.gallery.v-justified .item {
    flex-grow: var(--r, 1.5);
    flex-basis: calc(var(--r, 1.5) * var(--row-h));
    aspect-ratio: var(--r, 1.5);
}
.gallery.v-justified img { height: 100%; object-fit: cover; }
.gallery.v-justified::after { content: ""; flex-grow: 999999; } /* last row keeps its natural size */

/* Masonry: CSS columns */
.gallery.v-masonry { columns: 4 280px; column-gap: var(--gap); }
.gallery.v-masonry .item { break-inside: avoid; margin-bottom: var(--gap); }

/* Grid of squares */
.gallery.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--gap); }
.gallery.v-grid .item { aspect-ratio: 1; }
.gallery.v-grid img { height: 100%; object-fit: cover; }

/* Video tiles: poster or dark placeholder, ▶ in the middle, length bottom left */
.gallery .ph.is-video { position: relative; }
.ph-blank {
    display: block; width: 100%; height: 100%; aspect-ratio: var(--r, 1.7778);
    background: radial-gradient(120% 90% at 30% 20%, rgba(var(--accent-rgb), .22), transparent 60%), var(--video-bg);
}
.ph-play {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%;
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
    background: rgba(var(--bg-rgb), .45); border: 1.5px solid rgba(255, 255, 255, .85);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    transition: background .2s ease, transform .2s ease; pointer-events: none;
}
.ph-play svg { width: 24px; height: 24px; fill: #fff; margin-left: 3px; }
.gallery .item:hover .ph-play { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.ph-duration {
    position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px;
    font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff;
    background: rgba(var(--bg-rgb), .6); pointer-events: none;
}

@media (max-width: 600px) {
    .gallery { --row-h: 160px; --gap: 5px; }
    .gallery .item { border-radius: 6px; }
    .gallery.v-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
}

/* Photos still loading: the average colour shows, the photo fades in (site.js) */
img.is-loading { opacity: 0; }
/* Tiles / photos below the fold slide in when scrolled into view (site.js) */
.tile.reveal, .gallery .item.reveal { opacity: 0; transform: translateY(18px); }
.tile.reveal.is-in, .gallery .item.reveal.is-in {
    opacity: 1; transform: none;
    transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}

/* ── 9b. End of an album: strip of all albums of the same part ── */
.album-nav { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.strip-media img {
    display: block; width: 100%; height: 100%; object-fit: cover;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .5s ease;
}

.album-strip {
    position: relative;   /* offsetLeft of the current album (site.js) */
    list-style: none; margin: 0; padding: 4px 2px 14px;
    display: flex; gap: 12px;
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
}
.album-strip li { flex: 0 0 auto; width: clamp(120px, 13vw, 180px); scroll-snap-align: start; }
.album-strip a { display: block; color: var(--text-dim); font-size: .82rem; }
.album-strip a:hover { color: var(--text); }
.strip-media {
    display: block; aspect-ratio: 3 / 2; overflow: hidden;
    border: 1px solid var(--line); border-radius: 12px; background: var(--c, var(--surface-2));
    transition: border-color .2s ease;
}
.album-strip a:hover .strip-media { border-color: rgba(var(--accent-rgb), .6); }
.album-strip a:hover img { transform: scale(1.05); }
.strip-title { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-strip .is-current .strip-media { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -10px rgba(var(--accent-rgb), .8); }
.album-strip .is-current a { color: var(--text); font-weight: 600; }
@media (max-width: 600px) {
    .album-strip li { width: 128px; }
}

/* ── 10. Selection: empty circle / filled accent circle with a tick ── */
.sel-toggle {
    position: absolute; top: 4px; right: 4px; z-index: 2;
    display: grid; place-items: center; width: 42px; height: 42px;
    border: 0; padding: 0; background: none; cursor: pointer; color: #fff;
}
.sel-toggle svg, .pswp__button--select .pswp__icn { width: 26px; height: 26px; overflow: visible; }
.sel-toggle circle, .pswp__button--select circle {
    fill: rgba(0, 0, 0, .28); stroke: #fff; stroke-width: 1.8;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); transition: fill .15s ease, stroke .15s ease;
}
.sel-toggle .tick, .pswp__button--select .tick {
    fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0;
}
.sel-toggle:hover circle { fill: rgba(0, 0, 0, .55); }
.ph.is-sel + .sel-toggle circle, .pswp__button--select.is-on circle { fill: var(--accent); stroke: var(--accent); }
.ph.is-sel + .sel-toggle .tick, .pswp__button--select.is-on .tick { opacity: 1; }
/* Selected: the same thin line as on hover, in the accent colour, and the photo lifts slightly */
.gallery .item:has(.ph.is-sel) { transform: translateY(-3px); box-shadow: 0 12px 30px -14px rgba(var(--accent-rgb), .75); }
.gallery .item:has(.ph.is-sel)::after { box-shadow: inset 0 0 0 1.5px var(--accent); }

.sel-bar {
    position: sticky; bottom: 14px; z-index: 15;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
    width: fit-content; max-width: 100%;
    margin: 26px auto 0; padding: 10px 12px 10px 20px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: rgba(var(--surface-rgb), .86);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .9);
}
/* Nothing selected (and no message to show) → the bar stays out of the way */
.sel-bar[data-empty]:has(#sel-status:empty) { display: none; }
@media (max-width: 600px) { .sel-bar { border-radius: 18px; justify-content: center; } }

/* ── 11. Floating "back" / "top" buttons (appear after scrolling, site.js) ── */
.float-nav {
    position: fixed; right: clamp(12px, 2.5vw, 28px); bottom: clamp(12px, 2.5vw, 28px); z-index: 25;
    display: flex; gap: 8px;
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.float-nav.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.float-nav a, .float-nav button {
    display: inline-flex; align-items: center; gap: 6px;
    height: 44px; padding: 0 16px;
    border: 1px solid var(--line-strong); border-radius: 999px;
    background: rgba(var(--surface-rgb), .86); color: var(--text);
    font: 600 .85rem var(--font); cursor: pointer;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .9);
    transition: border-color .15s ease;
}
.float-nav button { width: 44px; padding: 0; justify-content: center; font-size: 1.1rem; }
.float-nav a:hover, .float-nav button:hover { border-color: var(--accent); color: #fff; }
body:has(.sel-bar) .float-nav { bottom: 86px; }   /* the selection bar sits at the bottom too */

/* ── 12. Lightbox (PhotoSwipe) ── */
.pswp { --pswp-bg: var(--lightbox-bg); --pswp-icon-color: var(--text); --pswp-icon-stroke-color: transparent; }
.pswp__button--arrow { width: 56px; opacity: .4; transition: opacity .2s ease; }
.pswp__button--arrow:hover { opacity: .9; }
.pswp__button--arrow .pswp__icn {
    width: 24px; height: 24px; margin-top: -12px; left: 16px;
    fill: none; stroke: var(--pswp-icon-color); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* .pswp prefix: beats photoswipe.css, which is loaded later */
.pswp .pswp__button--arrow--next .pswp__icn { left: auto; right: 16px; transform: none; }
.pswp__button--download[hidden] { display: none; }
/* Soft glow in the colour of the current photo (gallery.js) */
.pswp__glow {
    position: absolute; inset: 0; pointer-events: none; opacity: 0;
    background: var(--c, #000);
    -webkit-mask-image: radial-gradient(ellipse 60% 62% at 50% 50%, #000, transparent);
    mask-image: radial-gradient(ellipse 60% 62% at 50% 50%, #000, transparent);
    transition: background-color .9s ease, opacity .9s ease;
}
.pswp__glow.is-on { opacity: .34; }
.pswp__button--info .pswp__icn, .pswp__button--play .pswp__icn, .pswp__button--download .pswp__icn { fill: var(--pswp-icon-color); stroke: var(--pswp-icon-color); }
.pswp__button--play .i-pause, .pswp--playing .pswp__button--play .i-play { display: none; }
.pswp--playing .pswp__button--play .i-pause { display: inline; }
/* Video in the lightbox */
.pswp-video { position: relative; display: grid; place-items: center; }
.pswp-video video { width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 4px; }
.pswp-video > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .35; }
.pswp-video-msg {
    position: relative; display: grid; gap: 14px; justify-items: center; padding: 22px 26px; text-align: center;
    border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(var(--surface-rgb), .86); color: var(--text);
}
/* Photo info (EXIF) pill at the bottom */
.pswp__exif {
    position: absolute;
    left: 50%; bottom: 14px; transform: translateX(-50%);
    max-width: calc(100% - 28px);
    padding: 8px 16px;
    border: 1px solid var(--line); border-radius: 999px;
    background: rgba(var(--surface-rgb), .8);
    text-align: center;
    font: 500 12.5px/1.4 var(--font);
    color: var(--text-soft);
    pointer-events: none;
    display: none;
}
.pswp--exif .pswp__exif:not(:empty) { display: block; }
@media (max-width: 600px) { .pswp .pswp__button--arrow { display: none; } .pswp__exif { border-radius: var(--radius-field); } }

/* ── 13. Error page ── */
.error-page { text-align: center; }
.error-page .page-title { margin-bottom: 14px; }
.error-code {
    margin: 0;
    font-size: 4rem;
    font-weight: 200;
    letter-spacing: -.04em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.dev-error { text-align: left; white-space: pre-wrap; font-size: .8rem; color: var(--dev-error); overflow-x: auto; }

/* ── 14. About + contact, privacy ── */
.about-page { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.about-text p { max-width: 65ch; color: var(--text); font-size: 1.05rem; }
.contact-card h2 { margin: 0 0 16px; font-size: 1.15rem; font-weight: 600; }
@media (max-width: 800px) { .about-page { grid-template-columns: 1fr; } }
.prose { max-width: 75ch; }
.prose h2 { font-size: 1.15rem; font-weight: 600; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--text-soft); }
.prose li { margin-bottom: 6px; }

/* ── 15. Footer ── */
.site-footer {
    padding: 28px var(--page-pad) 34px;
    border-top: 1px solid var(--line);
    color: var(--text-faint);
    font-size: .84rem;
}
.site-footer p { margin: 4px 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--text); }
/* removal request: a quiet, small link */
.removal-note { font-size: .76rem; margin-top: 12px !important; }
.removal-note a { color: var(--text-faint); }
.removal-note a:hover { color: var(--text-dim); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* "Press Back again to exit" in the installed app (site.js) */
.exit-hint {
    position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 12px);
    padding: 10px 18px; border: 1px solid var(--line-strong); border-radius: 999px;
    background: rgba(var(--surface-rgb), .92); color: var(--text); font-size: .88rem; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.exit-hint.is-visible { opacity: 1; transform: translate(-50%, 0); }
