/*
Theme Name: Global Photo Bank
Theme URI: https://globalphotobank.com
Author: Suman Khadka
Author URI: http://www.sumankhadka.net
Description: A clean, image-first WordPress theme for photo libraries.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: greative
*/

/* =========================================================================
   1. Design tokens
   ====================================================================== */

:root {
    /* Neutrals */
    --bg: #f4f5f6;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --ink: #15171c;
    --ink-2: #2c313a;
    --body: #5b616d;
    --muted: #8b919d;
    --line: #e5e7ec;
    --line-strong: #d3d7de;

    /* Dark surfaces */
    --dark: #15171c;
    --dark-2: #1e2128;

    /* Brand accent */
    --accent: #c0603a;
    --accent-600: #a44d2b;
    --accent-050: #fdf2ed;

    /* Radii */
    --r-sm: 8px;
    --r: 14px;
    --r-lg: 22px;
    --r-pill: 999px;

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(21, 23, 28, .05), 0 1px 3px rgba(21, 23, 28, .06);
    --shadow: 0 4px 12px rgba(21, 23, 28, .07), 0 1px 3px rgba(21, 23, 28, .05);
    --shadow-lg: 0 18px 40px rgba(21, 23, 28, .13), 0 4px 12px rgba(21, 23, 28, .07);

    /* Rhythm */
    --gap: 1.25rem;
    --section-y: clamp(2.5rem, 5vw, 4.5rem);

    /* One gutter for the whole site — every left/right margin derives from
       this, so nothing drifts out of alignment between sections. */
    --gutter: 1.15rem;

    /* Comfortable reading measure for long-form text. */
    --measure: 68ch;

    --ease: cubic-bezier(.4, 0, .2, 1);
}

@media (min-width: 576px) {
    :root { --gutter: 1.5rem; }
}

@media (min-width: 992px) {
    :root { --gutter: 2rem; }
}

/* =========================================================================
   2. Base
   ====================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--body);
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .6em;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.015em;
}

h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
h3 { font-size: clamp(1.2rem, 1rem + .7vw, 1.5rem); }

p { margin: 0 0 1.15rem; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color .2s var(--ease);
}

a:hover { color: var(--accent-600); }

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

ul, ol { margin: 0 0 1.15rem; padding-left: 1.25rem; }

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

::selection {
    background: var(--accent);
    color: #fff;
}

/* Bootstrap's flat 12px gutter is tight on a phone and mean on a desktop.
   Drive every container off --gutter instead so all page edges line up. */
.container {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

@media (min-width: 1200px) {
    .container { max-width: 1240px; }
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1100;
    padding: .75rem 1.25rem;
    background: var(--ink);
    color: #fff;
    border-radius: 0 0 var(--r-sm) 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

/* Honeypot field — must stay in the DOM but never be seen. */
.comment-form-hp {
    position: absolute !important;
    left: -9999px !important;
}

/* =========================================================================
   3. Buttons
   ====================================================================== */

.btn-accent,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .7rem 1.5rem;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover,
.btn-accent:focus {
    background: var(--accent-600);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-ghost:hover {
    background: var(--surface);
    border-color: var(--ink);
    color: var(--ink);
}

/* =========================================================================
   4. Header & navigation
   ====================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow .25s var(--ease);
}

.site-header.is-scrolled {
    box-shadow: var(--shadow);
}

.site-nav {
    padding-top: .6rem;
    padding-bottom: .6rem;
}

.site-brand {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    padding: 0;
    margin-right: auto;
}

.site-brand a,
.site-brand .custom-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

/* One knob for the brand mark: change --brand-h and the logo scales
   everywhere, keeping its own aspect ratio. */
.site-brand img,
.site-brand .custom-logo {
    --brand-h: clamp(44px, 12vw, 54px);
    height: var(--brand-h);
    width: auto;
    max-width: min(60vw, 260px);
    object-fit: contain;
    transition: opacity .2s var(--ease), height .2s var(--ease);
}

@media (min-width: 992px) {
    .site-brand img,
    .site-brand .custom-logo { --brand-h: 60px; }
}

/* Tighten the header once the page scrolls — the logo shrinks with it. */
.site-header.is-scrolled .site-brand img,
.site-header.is-scrolled .site-brand .custom-logo { --brand-h: clamp(38px, 10vw, 48px); }

.site-brand:hover img { opacity: .8; }

.site-nav__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.nav-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: .95rem;
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.nav-search-toggle:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.navbar-toggler {
    padding: .4rem .6rem;
    border-color: var(--line);
    background: var(--surface);
}

.navbar-toggler:focus { box-shadow: none; }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2315171c' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-nav .navbar-nav { gap: .15rem; }

.site-nav .nav-link {
    position: relative;
    padding: .5rem .9rem;
    color: var(--ink-2);
    font-size: .95rem;
    font-weight: 500;
    border-radius: var(--r-sm);
    transition: color .2s var(--ease), background-color .2s var(--ease);
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus,
.site-nav .current-menu-item > .nav-link,
.site-nav .current_page_item > .nav-link {
    color: var(--accent);
    background: var(--accent-050);
}

/* Search drawer */
.nav-search {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.nav-search__form {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 0;
}

.nav-search__icon {
    position: absolute;
    left: 1rem;
    color: var(--muted);
    pointer-events: none;
}

.nav-search__form input[type="search"] {
    flex: 1;
    height: 46px;
    padding: 0 1rem 0 2.6rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--ink);
    font-size: .95rem;
}

.nav-search__form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

@media (max-width: 991.98px) {
    .site-nav .navbar-collapse {
        padding-top: .5rem;
        margin-top: .5rem;
        border-top: 1px solid var(--line);
    }

    .site-nav .nav-link { padding: .6rem .5rem; }
}

/* =========================================================================
   5. Hero
   ====================================================================== */

/* Mobile first: one centred column. From 768px up the whole block swings
   left over the darkest part of the photo. */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(440px, 76svh, 640px);
    padding: clamp(3rem, 11vw, 6rem) 0;
    overflow: hidden;
    background: var(--dark);
}

.hero__media {
    position: absolute;
    inset: 0;
}

.hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Vertical scrim on phones (text sits over the middle of the frame),
   diagonal on desktop (text sits left). */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 17, 21, .58) 0%, rgba(15, 17, 21, .74) 55%, rgba(15, 17, 21, .9) 100%);
}

/* .hero__inner also carries .container — it must keep Bootstrap's max-width
   and auto margins, so the measure is capped on .hero__content instead.
   Setting max-width here pinned the whole block to the viewport edge. */
.hero__inner {
    position: relative;
    z-index: 2;
}

.hero__content {
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    text-align: center;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: .9rem;
    padding: .3rem .85rem;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    color: rgba(255, 255, 255, .9);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.hero__title {
    margin-bottom: .75rem;
    color: #fff;
    font-size: clamp(1.85rem, 1.15rem + 3.4vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
    /* Stops a long word from stretching the line on a 320px screen. */
    overflow-wrap: break-word;
    text-wrap: balance;
}

.hero__lede {
    max-width: 42ch;
    margin: 0 auto 1.75rem;
    color: rgba(255, 255, 255, .82);
    font-size: clamp(.95rem, .9rem + .3vw, 1.12rem);
    text-wrap: pretty;
}

.hero__lede strong { color: #fff; font-weight: 600; }

/* Frosted-glass search shell wrapping a solid white field. */
.hero__search {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    padding: .45rem;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: var(--r-lg);
    backdrop-filter: blur(14px) saturate(170%);
    -webkit-backdrop-filter: blur(14px) saturate(170%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: border-color .2s var(--ease), background-color .2s var(--ease);
}

.hero__search:focus-within {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .45);
}

/* The icon is anchored to the field, not the form — so it stays put whether
   the button sits beside the input or below it. */
.hero__search-field {
    position: relative;
    display: flex;
    flex: 1;
    min-width: 0;
}

.hero__search-icon {
    position: absolute;
    top: 50%;
    left: 1.1rem;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.hero__search input[type="search"] {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 1rem 0 2.85rem;
    border: 0;
    border-radius: calc(var(--r-lg) - .45rem);
    background: #fff;
    color: var(--ink);
    font-size: 1rem;
    text-overflow: ellipsis;
}

.hero__search input[type="search"]::placeholder { color: var(--muted); }
.hero__search input[type="search"]:focus { outline: none; }

.hero__search-btn {
    height: 52px;
    border-radius: calc(var(--r-lg) - .45rem);
    font-size: 1rem;
}

.hero__search-btn i { font-size: .9rem; }

.hero__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    justify-content: center;
    margin: 1.15rem 0 0;
    color: rgba(255, 255, 255, .62);
    font-size: .82rem;
}

.hero__suggestions a {
    padding: .25rem .75rem;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, .9);
    font-size: .82rem;
    transition: background-color .2s var(--ease), border-color .2s var(--ease);
}

.hero__suggestions a:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .5);
    color: #fff;
}

/* Very small phones: hide the button label, keep the icon. */
@media (max-width: 359.98px) {
    .hero__search-btn span { display: none; }
}

/* Tablet up: input and button share a row. */
@media (min-width: 576px) {
    .hero__search {
        flex-direction: row;
        align-items: center;
    }

    .hero__search-btn { padding-inline: 1.75rem; }
}

/* Desktop: swing the whole block left. */
@media (min-width: 768px) {
    .hero::after {
        background: linear-gradient(105deg, rgba(15, 17, 21, .9) 0%, rgba(15, 17, 21, .66) 48%, rgba(15, 17, 21, .34) 100%);
    }

    .hero__content {
        max-width: 640px;
        margin-inline: 0;
        text-align: left;
    }

    .hero__lede { margin-inline: 0; }
    .hero__search { margin-inline: 0; }
    .hero__suggestions { justify-content: flex-start; }
}

/* =========================================================================
   6. Sections & headings
   ====================================================================== */

.section { padding: var(--section-y) 0; }
.section--tight { padding: clamp(2rem, 4vw, 3rem) 0 0; }

.section-head { margin-bottom: 1.75rem; }

.section-head--row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.section-head__title {
    position: relative;
    margin-bottom: .35rem;
    padding-bottom: .65rem;
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
}

.section-head__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 44px;
    height: 3px;
    border-radius: var(--r-pill);
    background: var(--accent);
}

.section-head__sub {
    margin: 0;
    color: var(--muted);
    font-size: .95rem;
}

/* =========================================================================
   7. Category chips
   ====================================================================== */

.chip-rail {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-2);
    font-size: .9rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}

.chip:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    transform: translateY(-2px);
}

.chip__count {
    padding: .05rem .45rem;
    border-radius: var(--r-pill);
    background: var(--bg);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    transition: background-color .2s var(--ease), color .2s var(--ease);
}

.chip:hover .chip__count {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

/* =========================================================================
   8. Photo grid & cards
   ====================================================================== */

.photo-grid {
    display: grid;
    /* min() keeps the track from overflowing a narrow phone viewport. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    grid-auto-flow: dense;
    gap: var(--gap);
}

@media (max-width: 575.98px) {
    .photo-grid { gap: .85rem; }
}

.photo-card {
    position: relative;
    border-radius: var(--r);
    overflow: hidden;
    background: var(--dark-2);
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.photo-card__link {
    display: block;
    height: 100%;
    color: inherit;
}

.card-media {
    position: relative;
    height: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.card-media img,
.card-media .card-media__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}

.photo-card:hover .card-media img { transform: scale(1.06); }

.card-media__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #24272e, #34383f);
    color: rgba(255, 255, 255, .3);
    font-size: 2rem;
}

.photo-card__overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 2.25rem 1rem .95rem;
    background: linear-gradient(to top, rgba(12, 14, 18, .92) 0%, rgba(12, 14, 18, .58) 48%, rgba(12, 14, 18, 0) 100%);
    color: #fff;
}

/* Liquid-glass category chip, floating clear of the scrim. */
.photo-card__cat {
    position: absolute;
    top: .7rem;
    left: .7rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 1.4rem);
    padding: .28rem .7rem;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    box-shadow: 0 6px 18px rgba(12, 14, 18, .22), inset 0 1px 0 rgba(255, 255, 255, .4);
    color: #fff;
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .09em;
    line-height: 1.5;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(12, 14, 18, .35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color .25s var(--ease), border-color .25s var(--ease);
}

.photo-card:hover .photo-card__cat {
    background: rgba(255, 255, 255, .26);
    border-color: rgba(255, 255, 255, .55);
}

/* Backdrop-filter needs something behind it — without this the chip reads as
   flat white over the image edge on Safari. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .photo-card__cat { background: rgba(12, 14, 18, .55); }
}

.photo-card__title {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    text-shadow: 0 1px 3px rgba(12, 14, 18, .4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 768px) {
    .photo-card--feature {
        grid-column: span 2;
        grid-row: span 2;
    }

    .photo-card--feature .card-media { aspect-ratio: auto; }
    .photo-card--feature .photo-card__title { font-size: clamp(1.2rem, 1rem + .8vw, 1.7rem); }
    .photo-card--feature .photo-card__overlay { padding: 3rem 1.75rem 1.5rem; }
    .photo-card--feature .photo-card__cat { top: 1rem; left: 1rem; }
}

/* Related sets sit below a hairline so they read as a separate block
   rather than a continuation of the post. */
.single-post .related {
    margin-top: var(--stack);
    padding-top: var(--stack);
    padding-bottom: 0;
    border-top: 1px solid var(--line);
}

.empty-state {
    padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r);
    background: var(--surface);
    text-align: center;
    color: var(--muted);
}

.empty-state__icon {
    display: block;
    margin-bottom: 1rem;
    color: var(--line-strong);
    font-size: 2.5rem;
}

.empty-state h2 { margin-bottom: .5rem; }
.empty-state .chip-rail { justify-content: center; margin-top: 1.5rem; }

/* =========================================================================
   9. Page & archive headers
   ====================================================================== */

.page-header {
    padding: clamp(2rem, 4vw, 3.25rem) 0 clamp(1.5rem, 3vw, 2.25rem);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.breadcrumb-trail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .9rem;
    color: var(--muted);
    font-size: .85rem;
}

.breadcrumb-trail a { color: var(--muted); }
.breadcrumb-trail a:hover { color: var(--accent); }
.breadcrumb-trail i { font-size: .6rem; opacity: .6; }

.page-header__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}

.page-header__count {
    padding: .15rem .7rem;
    border-radius: var(--r-pill);
    background: var(--accent-050);
    color: var(--accent);
    font-size: .85rem;
    font-weight: 600;
}

.page-header__desc {
    max-width: 68ch;
    margin: 0;
    color: var(--body);
}

.page-header__desc p:last-child { margin-bottom: 0; }

.page-header__search {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 560px;
    margin-top: 1.5rem;
}

.page-header__search > i {
    position: absolute;
    left: 1rem;
    color: var(--muted);
    pointer-events: none;
}

.page-header__search input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 1rem 0 2.6rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--ink);
}

.page-header__search input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

/* Author header */
.author-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.author-card__avatar img,
.author-card__img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.author-card__body { flex: 1; min-width: 260px; }

.author-card__eyebrow {
    margin: 0 0 .25rem;
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.author-card__bio {
    max-width: 62ch;
    margin-bottom: .5rem;
}

.author-card__count {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

/* Static page panel */
.page-panel {
    max-width: 860px;
    margin: clamp(2rem, 4vw, 3rem) auto 0;
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.page-panel__media {
    margin: 0 0 2rem;
    border-radius: var(--r);
    overflow: hidden;
}

/* =========================================================================
   10. Single post
   ====================================================================== */

/* Every block inside a single post steps down from one rhythm token, so the
   vertical spacing stays even from the title all the way to the comments. */
.single-post { --stack: clamp(2rem, 5vw, 3.25rem); }

.post-hero {
    position: relative;
    padding: clamp(1.75rem, 4vw, 3.25rem) 0 clamp(1.5rem, 3vw, 2.5rem);
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

/* Soft accent wash behind the title — reads as depth, not decoration. */
.post-hero::before {
    content: "";
    position: absolute;
    top: -55%;
    right: -10%;
    width: min(560px, 70%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-050) 0%, rgba(253, 242, 237, 0) 70%);
    pointer-events: none;
}

.post-hero > .container { position: relative; z-index: 1; }

.post-hero .breadcrumb-trail { margin-bottom: 1rem; }

/* Full container width — the old 20ch cap wrapped titles into a narrow
   ragged column and looked broken on phones. */
.post-hero__title {
    max-width: none;
    width: 100%;
    margin-bottom: 1.1rem;
    font-size: clamp(1.65rem, 1.15rem + 2.3vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -.028em;
    line-height: 1.16;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    color: var(--muted);
    font-size: .82rem;
}

.post-hero__meta > span {
    display: inline-flex;
    align-items: center;
    padding: .3rem .8rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.post-hero__meta i { margin-right: .45rem; opacity: .75; }

@media (min-width: 768px) {
    .post-hero__meta { gap: .6rem; font-size: .875rem; }
}

/* Article body — capped to a readable measure but flush left, so it lines up
   with the title, the gallery and the tags rather than floating mid-page. */
.post-entry {
    max-width: var(--measure);
    margin: var(--stack) 0 0;
    color: var(--ink-2);
    font-size: clamp(1rem, .97rem + .2vw, 1.075rem);
    line-height: 1.75;
}

/* Lead paragraph gets a touch more weight — a small premium cue. */
.post-entry > p:first-of-type {
    color: var(--ink-2);
    font-size: 1.1em;
    line-height: 1.7;
}

.post-entry > *:last-child { margin-bottom: 0; }

.post-entry h2,
.post-entry h3,
.post-entry h4 { margin-top: 2.25rem; }

.post-entry a { text-decoration: underline; text-underline-offset: 3px; }

.post-entry img,
.post-entry figure {
    margin: 2rem 0;
    border-radius: var(--r);
    overflow: hidden;
}

.post-entry figcaption {
    margin-top: .6rem;
    color: var(--muted);
    font-size: .875rem;
    text-align: center;
}

.post-entry blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--accent-050);
    color: var(--ink-2);
    font-style: italic;
}

.post-entry blockquote p:last-child { margin-bottom: 0; }

.post-entry ul,
.post-entry ol { margin-bottom: 1.5rem; padding-left: 1.4rem; }
.post-entry li { margin-bottom: .4rem; list-style: inherit; }

.post-entry code {
    padding: .15rem .4rem;
    border-radius: 4px;
    background: var(--bg);
    font-size: .9em;
}

.post-entry table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.post-entry th,
.post-entry td {
    padding: .65rem .75rem;
    border: 1px solid var(--line);
    text-align: left;
}

.post-entry th { background: var(--surface-2); color: var(--ink); }

/* Gallery — CSS masonry keeps every photo at its native proportions. */
.photo-set { padding-top: var(--stack); }

.masonry {
    column-count: 4;
    column-gap: var(--gap);
}

.masonry__item {
    position: relative;
    display: block;
    margin: 0 0 var(--gap);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--dark-2);
    box-shadow: var(--shadow-sm);
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.masonry__zoom { display: block; }

.masonry__img {
    width: 100%;
    height: auto;
    transition: transform .5s var(--ease);
}

.masonry__item:hover .masonry__img { transform: scale(1.04); }

.masonry__scrim {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 14, 18, .38);
    color: #fff;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity .3s var(--ease);
}

.masonry__item:hover .masonry__scrim { opacity: 1; }

.masonry__download {
    position: absolute;
    top: .65rem;
    right: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .95);
    color: var(--ink);
    font-size: .9rem;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}

.masonry__item:hover .masonry__download,
.masonry__download:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.masonry__download:hover {
    background: var(--accent);
    color: #fff;
}

@media (max-width: 1199.98px) { .masonry { column-count: 3; } }
@media (max-width: 767.98px)  { .masonry { column-count: 2; column-gap: .85rem; } }
@media (max-width: 767.98px)  { .masonry__item { margin-bottom: .85rem; } }

/* One column below 480px would leave huge portrait images filling the whole
   screen — two narrow columns scroll far better on a phone. */
@media (max-width: 479.98px) {
    .masonry { column-count: 2; column-gap: .6rem; }
    .masonry__item { margin-bottom: .6rem; border-radius: var(--r-sm); }
    .masonry__download { width: 32px; height: 32px; top: .4rem; right: .4rem; font-size: .78rem; }
}

/* Touch devices have no hover — keep the affordances visible. */
@media (hover: none) {
    .masonry__download { opacity: 1; transform: none; }
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    /* Hairline opens the post footer (tags + share) below the gallery. */
    margin-top: var(--stack, 2rem);
    padding-top: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid var(--line);
}

.tag-list__label {
    margin-right: .25rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.tag-list a {
    padding: .3rem .85rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink-2);
    font-size: .85rem;
}

.tag-list a::before { content: "#"; opacity: .45; margin-right: .15rem; }

.tag-list a:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

/* Share bar */
.share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.25rem;
    padding: 1.15rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.share-bar__label {
    flex: 1 0 100%;
    margin: 0 0 .25rem;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;
}

@media (min-width: 576px) {
    .share-bar { justify-content: flex-start; padding-inline: 1.25rem; }

    .share-bar__label {
        flex: 0 0 auto;
        margin: 0 .5rem 0 0;
        text-align: left;
    }
}

.share-bar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: .95rem;
    cursor: pointer;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}

.share-bar__btn:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    transform: translateY(-2px);
}

.share-bar__copy.is-copied {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.share-bar__copy.is-copied i::before { content: "\f00c"; }

/* =========================================================================
   11. Pagination
   ====================================================================== */

.pager { margin-top: clamp(2rem, 4vw, 3rem); }

.pager__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pager__item .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .6rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-2);
    font-size: .92rem;
    font-weight: 500;
    transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.pager__item .page-numbers:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.pager__item .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pager__item .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.pager__item .page-numbers.dots:hover {
    background: transparent;
    color: var(--muted);
}

/* =========================================================================
   12. Comments
   ====================================================================== */

.comments-area {
    max-width: var(--measure);
    /* Flush left like the article body — centring it broke the page's
       left edge, which every other block shares. */
    margin: var(--stack, clamp(2.5rem, 5vw, 4rem)) 0 0;
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.comments-title {
    margin-bottom: 1.5rem;
    font-size: 1.35rem;
}

.comment-list {
    margin: 0 0 2.5rem;
    padding: 0;
    list-style: none;
}

.comment-list .children {
    margin: 1rem 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.comment-list li { list-style: none; }

.comment-body {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
}

.comment-author img {
    display: inline-block;
    border-radius: 50%;
    margin-right: .6rem;
    vertical-align: middle;
}

.comment-author .fn {
    color: var(--ink);
    font-style: normal;
    font-weight: 600;
}

.comment-metadata,
.comment-metadata a {
    color: var(--muted);
    font-size: .82rem;
}

.comment-content { margin-top: .75rem; }
.comment-content p:last-child { margin-bottom: 0; }

.reply a {
    font-size: .85rem;
    font-weight: 500;
}

.comment-respond {
    padding: clamp(1.5rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
}

.comment-reply-title { margin-bottom: 1.25rem; font-size: 1.2rem; }

.comment-form label {
    display: block;
    margin-bottom: .4rem;
    color: var(--ink);
    font-size: .88rem;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .7rem .9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--ink);
    font-family: inherit;
    font-size: .95rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
}

.comment-form .form-submit { margin-bottom: 0; }

.comment-form input[type="submit"] {
    padding: .75rem 1.75rem;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--accent);
    color: #fff;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .2s var(--ease);
}

.comment-form input[type="submit"]:hover { background: var(--accent-600); }

.comment-form-cookies-consent label {
    display: inline;
    font-weight: 400;
    color: var(--body);
}

.no-comments { color: var(--muted); }

/* =========================================================================
   13. Footer
   ====================================================================== */

.site-footer {
    margin-top: clamp(3rem, 6vw, 5rem);
    background: var(--dark);
    color: rgba(255, 255, 255, .7);
}

.site-footer__top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}

/* The mark is blue/green on transparent — it disappears on the dark footer,
   so it sits on a light rounded plate rather than being filtered white. */
.site-footer__logo {
    display: inline-flex;
    align-items: center;
    padding: .55rem .9rem;
    border-radius: var(--r);
    background: rgba(255, 255, 255, .94);
}

.site-footer__brand img,
.site-footer__brand .custom-logo {
    height: clamp(38px, 9vw, 52px);
    width: auto;
    max-width: min(60vw, 200px);
    object-fit: contain;
}

.site-footer__tagline {
    max-width: 42ch;
    margin: 1.15rem 0 0;
    color: rgba(255, 255, 255, .6);
    font-size: .92rem;
}

.site-footer__heading {
    margin-bottom: 1rem;
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.site-footer__links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer__links li { margin-bottom: .55rem; }

.site-footer__links a {
    color: rgba(255, 255, 255, .68);
    font-size: .93rem;
}

.site-footer__links a:hover { color: #fff; }

.social-icons {
    display: flex;
    gap: .6rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .85);
    font-size: .95rem;
    transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}

.social-icon:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 1.35rem 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .5);
    font-size: .87rem;
}

.site-footer__bottom p { margin: 0; }
.site-footer__bottom a { color: rgba(255, 255, 255, .8); }
.site-footer__bottom a:hover { color: #fff; }

@media (max-width: 767.98px) {
    .site-footer__top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-footer__bottom { justify-content: center; text-align: center; }
}

/* =========================================================================
   14. Back to top
   ====================================================================== */

.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: #fff;
    font-size: .95rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    box-shadow: var(--shadow-lg);
    transition: opacity .25s var(--ease), transform .25s var(--ease), background-color .2s var(--ease), visibility .25s;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover { background: var(--accent); }

/* =========================================================================
   15. 404
   ====================================================================== */

.error-404 {
    max-width: 620px;
    margin: 0 auto;
    text-align: center;
}

.error-404__code {
    margin: 0;
    color: var(--line-strong);
    font-size: clamp(4.5rem, 12vw, 8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.05em;
}

.error-404__title { margin-top: .5rem; }

.error-404__text {
    max-width: 46ch;
    margin: 0 auto 2rem;
}

.error-404__search {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.error-404__search > i {
    position: absolute;
    left: 1rem;
    color: var(--muted);
    pointer-events: none;
}

.error-404__search input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 1rem 0 2.6rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
}

.error-404__search input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
}

/* =========================================================================
   16. Motion preferences
   ====================================================================== */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
