/*
 * fenechka.info — the design approved by the owner on 2026-09-15, reworked on 2026-09-16 from
 * "a phone layout stretched to a desktop" into a site that uses the screen it is given.
 * Tokens and rationale: .claude/research/11-design-direction.md
 *
 * Mobile-first on purpose: 62% of engaged sessions are phones, and mobile engages at 42.9%
 * against desktop's 24.5%. What changed for desktop is that the page now has TWO widths — a page
 * width for grids and chrome, and a reading width for prose, because 95 characters a line is not
 * a reading measure.
 *
 * Unbounded is a DISPLAY face: wordmark, h1 and section headings only. Below ~20px its wide
 * geometric letterforms fight the Cyrillic text around them, so cards, rows and UI use Golos Text.
 */

:root {
    --bg: #FBF6F0;
    --surface: #FFFFFF;
    --ink: #26201C;
    --body: #3B322C;
    --muted: #7C6F67;
    --line: #EADFD4;
    --tint: #F2E4DA;
    --tint-2: #F4EAE0;
    --accent: #C4553A;
    --accent-dark: #9E3F28;
    --accent-2: #2E7D74;
    --accent-3: #E0A43B;

    --radius-card: 18px;
    --radius-control: 14px;
    --radius-small: 12px;

    /* Two measures, not one: chrome and grids get the page, prose gets ~70 characters. */
    --w-page: 1160px;
    --w-text: 720px;

    --shadow-sm: 0 1px 2px rgba(38, 32, 28, 0.05);
    --shadow-md: 0 8px 24px -12px rgba(38, 32, 28, 0.28);
    --shadow-lg: 0 24px 60px -28px rgba(38, 32, 28, 0.45);

    --display: "Unbounded", "Golos Text", system-ui, sans-serif;
    --text: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--text);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 {
    font-family: var(--display);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 12px;
    text-wrap: balance;
}

/* A long Russian headline in a wide display face needs a lower ceiling than a two-word hero:
   46px turned "Цветовая гамма – это универсальный язык фенечки" into three poster lines. */
h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; }
h2 { font-size: clamp(21px, 2.6vw, 28px); font-weight: 700; }
/* h3 is small enough that the display face reads as noise — Golos carries it. */
h3 { font-family: var(--text); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

p { margin: 0 0 14px; }

img { max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--w-page); margin: 0 auto; padding: 0 20px; }
/* Prose column. Everything a person reads sentence by sentence lives inside one of these.
   Centred, because a 720px column against the left edge of a 1160px page reads as a sidebar that
   failed to load rather than as a measure. */
.prose { max-width: var(--w-text); margin-inline: auto; }

/* ---------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 30;
    background: rgba(251, 246, 240, 0.86);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    max-width: var(--w-page); margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; gap: 14px;
    /* wrap + a 100% basis on the nav is what drops the open menu BELOW the bar on a phone.
       Without it the panel becomes a flex item inside the row and gets squeezed into a column
       beside the wordmark — which is exactly what it did before this line existed. */
    flex-wrap: wrap;
}

.wordmark {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.04em;
    color: var(--ink);
    white-space: nowrap;
}
.wordmark .mark { display: block; border-radius: 9px; }
.wordmark .dot { color: var(--accent); }

.nav-toggle {
    width: 44px; height: 44px; flex: none;          /* never below 44px: this is a touch target */
    order: 3; margin-left: 8px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); cursor: pointer; padding: 0;
}
.nav-toggle:hover { border-color: var(--accent); }

.site-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 4px 0 10px;
    font-size: 15px;
}
.site-nav a { display: block; padding: 10px 0; color: var(--ink); border-bottom: 1px solid var(--line); }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-cta a {
    margin: 4px 0 8px; padding: 13px 16px; border: 0; border-radius: var(--radius-small);
    background: var(--accent); color: #fff; font-weight: 600; text-align: center;
    box-shadow: var(--shadow-sm);
}

/* Phone: the nav is a panel the burger opens, on its own row. Desktop rules below put it back
   into the bar. */
.site-nav { display: none; order: 4; flex-basis: 100%; }
.site-nav.is-open { display: block; }
.wordmark { order: 1; }

.header-cta {
    display: none;                                  /* desktop only; the panel carries it on phones */
    height: 40px; padding: 0 16px;
    align-items: center; border-radius: 999px;
    background: var(--accent); color: #fff;
    font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-sm);
}
.header-cta:hover { background: var(--accent-dark); color: #fff; }

/* ---------------------------------------------------------------- content */
/* main.wrap, not main: ".wrap { padding: 0 20px }" is a class shorthand and would zero the
   vertical padding of a plain "main" rule. */
main.wrap { padding-block: 26px 40px; }

.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px; border-radius: 999px;
    background: var(--tint); color: var(--accent-dark);
    font-size: 12px; font-weight: 600;
}

.meta { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }

/* On the search page the heading row must not stretch past the results it labels — "24+ найдено"
   was floating 350px to the right of the last snippet. */
.search-page .section-head { max-width: 760px; }

/* The eyebrow + heading + link row that opens every section. */
.section-head {
    display: flex; align-items: baseline; gap: 12px;
    margin: 38px 0 16px;
}
.section-head h2 { margin: 0; }
.section-head .more { margin-left: auto; font-size: 14px; font-weight: 500; white-space: nowrap; }

/* Stored bodies keep their own markup, including their own <h1>. The layout never adds one.
   The rewrite pass strips the presentational junk; these rules catch what is left. */
.body { color: var(--body); font-size: 17px; line-height: 1.72; text-align: left; }
.body p { text-indent: 0; }
/* 2008-era table layouts: let them scroll rather than push the page sideways. */
.body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.body td { padding: 2px 4px; }
.body span { font-size: inherit !important; font-family: inherit !important; }
.body img { border-radius: 14px; box-shadow: var(--shadow-sm); }
.body h1 { margin-bottom: 18px; }
.body h2 { font-size: clamp(20px, 2.2vw, 25px); margin: 34px 0 12px; }
.body h3 { margin: 26px 0 10px; }
.body ul, .body ol { padding-left: 22px; }
.body li { margin-bottom: 6px; }
.body a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.body iframe { max-width: 100%; border-radius: 14px; }

/* uCoz body classes referenced by the stored HTML — ported, not replaced. */
.Compact { display: inline-block; max-width: 100%; }
.eText, .eMessage { color: var(--body); }

/* ---------------------------------------------------------------- hero (home) */
.hero { display: grid; gap: 22px; align-items: center; margin-bottom: 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); margin: 10px 0 12px; }
.hero .lede { font-size: 17px; color: var(--muted); margin: 0 0 20px; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stats {
    display: flex; flex-wrap: wrap; gap: 8px 18px;
    margin: 22px 0 0; padding: 0; list-style: none;
    font-size: 13.5px; color: var(--muted);
}
.hero-stats b { display: block; font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.03em; }

/* A cluster of real photographs from the gallery: the site's best asset, above the fold. */
.hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-art a {
    display: block; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
    background: var(--tint-2); box-shadow: var(--shadow-sm);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.hero-art a:hover img { transform: scale(1.06); }
.hero-art a:nth-child(1) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }

/* ---------------------------------------------------------------- cards and lists */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.tile {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
    color: var(--ink);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tile:hover { transform: translateY(-3px); border-color: #DFCFC0; box-shadow: var(--shadow-md); color: var(--ink); }
.tile .ic {
    width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--tint); color: var(--accent-dark);
}
.tile h2 { font-family: var(--text); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; margin: 6px 0 0; }
.tile .count { margin-top: auto; padding-top: 6px; font-size: 12.5px; color: var(--muted); }
/* The tool is the reason most people arrive: it gets the accent card. */
.tile.is-primary { background: var(--ink); border-color: var(--ink); color: #F7F0E8; }
.tile.is-primary h2 { color: #fff; }
.tile.is-primary .count { color: #BCAEA3; }
.tile.is-primary .ic { background: rgba(255, 255, 255, 0.1); color: var(--accent-3); }

/* Album cards: a 2x2 collage of what is actually inside, then the name. */
.album-card { padding: 10px 10px 14px; gap: 10px; }
.album-thumbs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
    /* One row of three: each cell lands near 116px, which is SMALLER than the stored thumbnails,
       so they scale down and stay sharp. A 2x2 collage stretched them instead. */
    aspect-ratio: 3 / 1;
    border-radius: 14px; overflow: hidden; background: var(--tint-2);
}
/* contain, like the gallery itself: a square crop out of a 94x120 schema is an arbitrary
   fragment — three black bands and a blur told a visitor nothing about "Фенечки с надписью". */
.album-thumbs img {
    width: 100%; height: 100%; object-fit: contain; display: block;
    background: var(--surface); padding: 3px;
}
.album-card h2 { margin: 0 4px; }
.album-card .count { margin: 0 4px; padding-top: 0; }

.card-list { display: flex; flex-direction: column; gap: 10px; }
.card {
    display: flex; gap: 12px; align-items: center;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; padding: 10px; color: var(--ink);
}
.card:hover { border-color: #DFCFC0; box-shadow: var(--shadow-md); color: var(--ink); }
.card img { width: 64px; height: 64px; border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.card .t { font-size: 15px; font-weight: 500; line-height: 1.3; }
.card .s { font-size: 12px; color: var(--muted); }

.rows { display: flex; flex-direction: column; }
.rows a {
    display: flex; align-items: baseline; gap: 12px;
    padding: 14px 12px; margin: 0 -12px;
    border-radius: 12px;
    border-bottom: 1px solid var(--line); color: var(--ink);
}
.rows a:hover { background: var(--surface); color: var(--ink); }
.rows .t { font-size: 15.5px; font-weight: 500; line-height: 1.35; }
.rows .s { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------------------------------------------------------------- album chips */
.album-chips {
    display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
    margin: 0 -20px 18px; padding: 2px 20px 10px;
    scrollbar-width: thin;
}
.chip-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px; white-space: nowrap;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink);
    font-size: 13.5px; font-weight: 500;
}
.chip-link span { color: var(--muted); font-size: 12px; }
.chip-link:hover { border-color: var(--accent); color: var(--accent); }
.chip-link.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-more { cursor: pointer; font-family: var(--text); color: var(--accent); }
/* Twelve albums is two rows on a desktop; the remaining fifteen were pushing the first photograph
   270px down the page. Collapsed only when the script is there to open it again. */
.album-chips.is-collapsed .chip-link:nth-of-type(n+13):not(.chip-more) { display: none; }
.chip-link.is-on span { color: #B7A99E; }

/* ---------------------------------------------------------------- gallery */
/* The gallery is a REFERENCE, not a mosaic: half of these files are pattern schemas, and the
   whole point of looking at one is to see the whole pattern.
     - contain, not cover: cover cropped a 94x120 schema to its middle third;
     - 130px cells, not 150+: the stored thumbnails are 120px on the short side, so a bigger cell
       upscales them. Denser tracks mean the images shrink instead of stretching;
     - a white plate with a hairline, so a letterboxed portrait reads as a framed item rather than
       as a hole in the grid. */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.grid a {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1; border-radius: 14px; padding: 5px;
    overflow: hidden; background: var(--surface); border: 1px solid var(--line);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.grid a:hover { border-color: #DFCFC0; box-shadow: var(--shadow-md); }
.grid img {
    max-width: 100%; max-height: 100%; width: auto; height: auto;
    object-fit: contain; display: block; border-radius: 9px;
}

.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.pager a, .pager span {
    min-width: 44px; height: 44px; padding: 0 12px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-small); font-size: 15px; font-weight: 500;
}
.pager a { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .current { background: var(--accent); color: #fff; font-weight: 600; }
.pager .gap { color: var(--muted); min-width: 20px; }
.pager-step { font-weight: 600; }
.pager-step:last-child { margin-left: auto; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    height: 52px; padding: 0 22px; border-radius: var(--radius-control);
    font-weight: 600; font-size: 16px;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-secondary { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.callout {
    margin: 34px 0 0; padding: 22px; border-radius: 22px;
    background: var(--ink); color: #F5EDE5;
    display: flex; flex-direction: column; gap: 12px;
}
.callout h2 { color: #F5EDE5; font-size: 19px; margin: 0; }
.callout p { color: #C9BBB0; font-size: 14.5px; margin: 0; }
.callout .btn { background: var(--accent-3); color: var(--ink); }
.callout .btn:hover { background: #EDB85C; color: var(--ink); }

/* ---------------------------------------------------------------- forum archive */
.posts article {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
}
.posts .who { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.posts .who strong { color: var(--ink); }

.note {
    padding: 13px 15px; border-radius: 14px;
    background: var(--tint); color: var(--accent-dark);
    font-size: 13.5px; line-height: 1.5;
}

/* ---------------------------------------------------------------- search */
.search-form { display: flex; gap: 10px; margin: 6px 0 22px; max-width: 620px; }
.search-form input {
    flex: 1 1 auto; height: 52px; padding: 0 16px;
    border: 1px solid var(--line); border-radius: var(--radius-control);
    background: var(--surface); color: var(--ink);
    font: 400 16px var(--text);
}
.search-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196, 85, 58, 0.14); }
.search-form button {
    height: 52px; padding: 0 22px; border: 0; border-radius: var(--radius-control);
    background: var(--accent); color: #fff; font: 600 16px var(--text); cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); }

/* 24 results across 1120px with a 15px title and a 15px snippet were unscannable: the eye had
   nothing to jump between. One column at reading width, a title that is clearly a title, and a
   snippet clamped to two lines so every result is the same height. */
.search-results { max-width: 760px; }
.search-hit { flex-direction: column; align-items: flex-start !important; gap: 5px !important; padding: 14px 16px !important; }
.search-hit .t { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.search-hit .sn {
    font-size: 14px; font-weight: 400; color: var(--muted); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.search-hit mark { background: #F7E3C8; color: var(--ink); border-radius: 3px; padding: 0 2px; }

/* The search affordance in the bar: an icon on a desktop, a line in the burger panel. */
.nav-search {
    /* A phone gets it too: search is a primary action, not something to hunt for in a menu. */
    display: inline-flex; order: 2; margin-left: auto; flex: none;
    width: 40px; height: 40px; border-radius: 50%;
    align-items: center; justify-content: center;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.nav-search:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- read also */
.related { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); }
.related h2 { font-size: 19px; margin-bottom: 14px; }
.related-list { display: grid; gap: 8px; }
.related-list a {
    display: flex; align-items: baseline; gap: 12px;
    padding: 12px 14px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink);
    font-size: 15px; font-weight: 500; line-height: 1.35;
}
.related-list a:hover { border-color: #DFCFC0; box-shadow: var(--shadow-md); color: var(--accent); }
.related-list .s { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------------------------------------------------------------- comments */
.comments { margin-top: 36px; }
.comments li {
    list-style: none; background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; padding: 12px 14px; margin-bottom: 10px;
}
.comments ul { padding: 0; margin: 0; }
.comments .who { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.comments .who strong { color: var(--ink); }

/* ---------------------------------------------------------------- footer */
.site-footer {
    margin: 40px 20px 20px; padding: 26px;
    background: var(--ink); border-radius: 22px; color: #F5EDE5;
}
.site-footer .wordmark { color: #F5EDE5; }
.site-footer .wordmark .dot { color: var(--accent-3); }
.site-footer .tagline { margin: 12px 0 0; font-size: 13.5px; color: #A2938A; max-width: 34ch; }
.site-footer ul {
    list-style: none; padding: 0; margin: 18px 0 0;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; font-size: 13.5px;
}
.site-footer a { color: #D9CCC1; }
.site-footer a:hover { color: #fff; }
.site-footer .legal {
    margin-top: 22px; padding-top: 16px; border-top: 1px solid #3C332C;
    font-size: 12px; color: #9A8C81;
}

/* ---------------------------------------------------------------- photo page */
.photo-figure { margin: 0; }
.photo-figure > img, .photo-zoom img {
    display: block; border-radius: 18px; box-shadow: var(--shadow-md);
    max-width: 100%; height: auto;
}
.photo-zoom { position: relative; display: inline-block; cursor: zoom-in; max-width: 100%; }
.photo-zoom-badge {
    position: absolute; right: 12px; bottom: 12px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 999px;
    background: rgba(38, 32, 28, 0.66); color: #fff;
    font-size: 12.5px; font-weight: 500;
    backdrop-filter: blur(6px);
    /* Always visible, just quiet: it replaces a link called "Полный размер", so it has to be
       discoverable without a hover — a touch screen has none to give. */
    opacity: 0.8; transition: opacity .18s ease;
}
.photo-zoom:hover .photo-zoom-badge, .photo-zoom:focus-visible .photo-zoom-badge { opacity: 1; }

/* On a photo page the photograph is the content: the title steps down to a caption, and the
   column is centred instead of hugging the left edge of a 1160px page. */
.photo-page { max-width: var(--w-text); margin-inline: auto; }
.photo-page figcaption { margin-top: 12px; }
.photo-page h1 {
    font-family: var(--text); font-size: 16px; font-weight: 500;
    letter-spacing: 0; color: var(--muted);
}
.photo-page .meta { margin: 6px 0 0; }

/* A grid, not a flex row: at 412px the row wrapped "← Предыдущее" onto a second line straight
   through "Все фото альбома" — two overlapping tap targets on the template that 5,705 pages use.
   Two step tiles side by side, the album link on its own full-width row underneath. */
.photo-nav {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin: 26px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line);
}
.photo-step {
    display: flex; align-items: center; gap: 10px; min-width: 0;
    padding: 8px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--surface);
    color: var(--ink); font-size: 14px; font-weight: 500;
}
.photo-step.is-next { justify-content: flex-end; text-align: right; }
.photo-step:hover { border-color: #DFCFC0; color: var(--accent); }
.photo-step span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-step img { width: 52px; height: 52px; flex: none; border-radius: 10px; object-fit: cover; }
.photo-all {
    grid-column: 1 / -1; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px; font-size: 14px; font-weight: 500;
}
.photo-all:hover { background: var(--surface); }

@media (max-width: 480px) {
    /* "← Предыду…" clipped after six characters inside a 190px tile. */
    .photo-step { font-size: 13px; gap: 8px; padding: 6px; }
    .photo-step img { width: 44px; height: 44px; }
}

/* ---------------------------------------------------------------- viewer */
.lb {
    position: fixed; inset: 0; z-index: 60;
    /* 0.94 let the thumbnails glow through the backdrop; a photo viewer has to be a dark room. */
    background: rgba(20, 17, 15, 0.975);
    backdrop-filter: blur(6px);
    display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    gap: 8px; padding: 56px 12px 84px;
}
.lb-img {
    grid-column: 2; justify-self: center;
    max-width: 100%; max-height: 100%;
    object-fit: contain; border-radius: 10px; cursor: zoom-out;
}
.lb-close, .lb-nav {
    border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255, 255, 255, 0.12); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.lb-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; font-size: 24px; line-height: 1; }
.lb-nav { width: 52px; height: 52px; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.24); }
.lb-bar {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
    color: #E8DDD3; font-size: 14px;
    background: linear-gradient(to top, rgba(24, 20, 17, 0.9), transparent);
}
.lb-title { font-weight: 500; }
.lb-count { color: #9A8C81; }
.lb-page { margin-left: auto; color: var(--accent-3); font-weight: 500; }
.lb-page:hover { color: #fff; }

@media (max-width: 640px) {
    /* Centred arrows sit on top of the photograph on a narrow screen. Down in the corners they
       stay reachable by thumb and stop covering the thing you came to look at — and a swipe does
       the same job anyway. */
    .lb { padding: 48px 6px 104px; }
    .lb-nav { position: absolute; bottom: 64px; width: 46px; height: 46px; background: rgba(255, 255, 255, 0.16); }
    .lb-prev { left: 10px; }
    .lb-next { right: 10px; }
    .lb-title { max-width: 100%; }
    .lb-bar { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); font-size: 13.5px; }
}

/* ---------------------------------------------------------------- phones: undo the 2008 floats */
@media (max-width: 640px) {
    /* Inline float + width on a 2008 photo makes a 4-word column beside it. !important is the
       point here: the declarations being overridden are inline. */
    .body img {
        float: none !important;
        display: block; margin: 16px auto !important;
        width: auto !important; max-width: 100% !important;
    }
    .body table { font-size: 15px; }
}

/* ---------------------------------------------------------------- wider screens */
@media (min-width: 720px) {
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid { gap: 12px; }
    .site-footer ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hero { grid-template-columns: 1fr 1fr; gap: 34px; }
    .hero-art { gap: 12px; }
}

@media (min-width: 900px) {
    .album-chips { flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
    body { font-size: 17px; }
    main.wrap { padding-block: 32px 56px; }

    .nav-toggle { display: none; }
    .header-inner { padding: 12px 20px; gap: 26px; }

    .site-nav { display: block; border: 0; background: none; margin-left: 4px; }
    .site-nav ul { flex-direction: row; align-items: center; gap: 22px; padding: 0; font-size: 14.5px; }
    .site-nav a { padding: 6px 0; border: 0; color: var(--body); white-space: nowrap; }
    /* Kept for the phone panel: everything here is one click away in the footer instead. */
    .site-nav .nav-extra { display: none; }
    .site-nav { order: 2; flex-basis: auto; }
    .nav-search { order: 3; margin-left: auto; }
    .header-cta { display: inline-flex; order: 4; }

    .body { font-size: 17.5px; }
    /* A list of short titles across 1160px is mostly empty space with a date marooned on the
       right. Two columns halve the line and double what fits on a screen. */
    .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
    .site-footer { display: grid; grid-template-columns: 300px 1fr; gap: 30px; align-items: start; padding: 32px; }
    .site-footer ul { margin-top: 4px; }
    .site-footer .legal { grid-column: 1 / -1; margin-top: 8px; }
}
