:root {
    --bg: #0b0a0d;
    --surface: #17151a;
    --ink: #f4f1ec;
    --muted: #aaa3ad;
    --dark: #070609;
    --dark-soft: #17151a;
    --line: rgba(255, 255, 255, .12);
    --accent: #ef5a29;
    --accent-2: #ffb13b;
    --success: #2f9e63;
    --warning: #b97a14;
    --error: #c54444;
    --radius: 20px;
    --shadow: 0 22px 60px rgba(0, 0, 0, .46);
    --shell: min(1160px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(239, 90, 41, .08), transparent 34rem),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}
body::selection { background: rgba(239, 90, 41, .25); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
button { color: inherit; }
code {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255,255,255,.06);
    padding: .08rem .35rem;
    font-size: .9em;
    overflow-wrap: anywhere;
}
.shell { width: var(--shell); margin-inline: auto; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 100;
    transform: translateY(-150%);
    background: var(--surface);
    padding: 10px 14px;
    border-radius: 8px;
}
.skip-link:focus { transform: none; }

.site-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 10;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 max(20px, calc((100vw - 1160px) / 2));
    color: white;
    background: linear-gradient(to bottom, rgba(8,7,9,.82), transparent);
}
.compact-header {
    position: relative;
    background: var(--dark);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 50%;
    font-size: 12px;
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(10px);
}
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a {
    color: inherit;
    text-decoration: none;
    font-size: .83rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .76;
    transition: opacity .2s ease;
}
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a.active { opacity: 1; }
.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    background: rgba(0,0,0,.15);
}
.menu-toggle span:not(.sr-only) {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: white;
}

.hero {
    position: relative;
    min-height: 720px;
    display: grid;
    align-items: end;
    color: white;
    background: var(--dark) url('../images/krinkle-hero.webp') center 35% / cover no-repeat;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7,6,8,.86) 0%, rgba(7,6,8,.42) 46%, rgba(7,6,8,.2) 100%),
        linear-gradient(to top, rgba(7,6,8,.7), transparent 55%);
}
.hero-content {
    position: relative;
    z-index: 1;
    padding: 190px 0 100px;
}
.eyebrow {
    margin: 0 0 14px;
    color: var(--accent-2);
    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; line-height: 1.08; }
h1 { font-size: clamp(3.2rem, 8vw, 7.8rem); letter-spacing: -.055em; }
h2 { font-size: clamp(2.1rem, 4.5vw, 4.5rem); letter-spacing: -.045em; }
h3 { font-size: 1.25rem; }
.hero h1 { max-width: 900px; margin-bottom: 24px; }
.hero-copy { max-width: 660px; margin: 0 0 34px; font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(255,255,255,.82); }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .04em;
    cursor: pointer;
}
.button.primary { background: var(--accent); color: white; box-shadow: 0 12px 30px rgba(239,90,41,.28); }
.button.primary:hover { background: #ff6735; }
.button.ghost { border-color: rgba(255,255,255,.38); color: white; background: rgba(255,255,255,.05); }
.button.dark-ghost { border-color: rgba(255,255,255,.2); color: var(--ink); background: rgba(255,255,255,.035); }
.button.dark-ghost:hover { border-color: rgba(239,90,41,.65); background: rgba(239,90,41,.08); }

.section { padding: 110px 0; }
.section-dark { background: var(--dark); color: white; }
.section-heading { margin-bottom: 36px; }
.split-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.split-heading h2 { margin-bottom: 0; }
.text-link {
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.light-link { color: white; }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(42px, 7vw, 100px);
    align-items: center;
}
.about-grid h2 { margin-bottom: 22px; }
.about-grid h3 { margin-bottom: 20px; color: var(--accent); }
.about-grid p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; }
.about-image {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 5;
}
.about-image img { width: 100%; height: 100%; object-fit: cover; object-position: 38% center; }

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.service-card {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 18px;
    padding: 28px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--radius);
    background: var(--dark-soft);
    transition: transform .2s ease, border-color .2s ease;
}
.service-card:hover { transform: translateY(-3px); border-color: rgba(239,90,41,.55); }
.service-grid-light .service-card { background: var(--surface); border-color: var(--line); }
.service-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    color: var(--accent-2);
    background: rgba(255,177,59,.1);
}
.service-icon svg { width: 28px; height: 28px; fill: currentColor; }
.service-icon-large { width: 76px; height: 76px; border-radius: 22px; }
.service-icon-large svg { width: 38px; height: 38px; }
.service-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.service-card h2, .service-card h3 { margin-bottom: 0; }
.service-card p { margin: 10px 0 14px; color: rgba(255,255,255,.62); }
.service-grid-light .service-card p { color: var(--muted); }
.service-card a { color: var(--accent); font-weight: 800; text-decoration: none; }
.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .04em;
    white-space: nowrap;
    background: rgba(255,255,255,.08);
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-loading { color: #aaa4ad; }
.status-online { color: #55d98d; background: rgba(47,158,99,.14); }
.status-offline { color: #ff7777; background: rgba(197,68,68,.14); }
.status-external, .status-unknown { color: var(--accent-2); background: rgba(255,177,59,.12); }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.post-list { display: grid; gap: 18px; }
.post-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.post-card time { color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.post-card h2, .post-card h3 { margin: 14px 0 12px; }
.post-card p { margin: 0; color: var(--muted); }
.post-card-wide { max-width: 880px; }
.resume-banner { background: linear-gradient(130deg, #24161d, #111013 55%, #2e1c12); color: white; }
.resume-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.resume-inner h2 { margin-bottom: 16px; }
.resume-inner p:not(.eyebrow) { color: rgba(255,255,255,.65); }

.page-hero { padding-top: 175px; padding-bottom: 70px; }
.page-hero h1 { font-size: clamp(3.4rem, 7vw, 6.8rem); margin-bottom: 24px; }
.page-hero > p:not(.eyebrow) { max-width: 760px; color: var(--muted); font-size: 1.1rem; }
.page-hero .button-row, .page-hero > .button { margin-top: 28px; }
.event-list { display: grid; gap: 16px; }
.event-card {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 24px;
    align-items: start;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.event-date {
    display: grid;
    place-items: center;
    min-height: 90px;
    border-radius: 16px;
    background: var(--dark);
    color: white;
    line-height: 1;
}
.event-date span { color: var(--accent-2); font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.event-date strong { font-size: 2.15rem; }
.event-card h2 { margin-bottom: 8px; font-size: 1.65rem; letter-spacing: -.025em; }
.event-card p { margin: 0; color: var(--muted); }
.event-meta { color: var(--accent) !important; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.gallery-item {
    position: relative;
    border: 0;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #211e24;
    cursor: zoom-in;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.035); }
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 34px;
    background: rgba(7,6,8,.92);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: calc(100vh - 68px); max-width: min(1200px, 100%); border-radius: 12px; }
.lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    border: 0;
    background: transparent;
    color: white;
    font-size: 42px;
    cursor: pointer;
}
.empty-state, .resume-card, .contact-aside, .config-note {
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.resume-card { max-width: 820px; }
.contact-list { display: grid; gap: 0; margin: 30px 0 0; }
.contact-list div { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.contact-list dt { font-weight: 800; }
.contact-list dd { margin: 0; color: var(--muted); }
.notice { padding: 14px 16px; border-radius: 12px; border: 1px solid currentColor; }
.notice.success { color: var(--success); background: rgba(47,158,99,.08); }
.notice.warning { color: var(--warning); background: rgba(185,122,20,.08); }
.notice.error { color: var(--error); background: rgba(197,68,68,.08); }
.contact-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(260px,.6fr); gap: 32px; align-items: start; }
.contact-form { display: grid; gap: 18px; }
.contact-form label { display: grid; gap: 8px; font-weight: 800; }
.contact-form input, .contact-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
    background: #100f12;
    color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid rgba(239,90,41,.15); border-color: var(--accent); }
.honeypot { position: absolute !important; left: -10000px !important; }
.contact-aside { position: sticky; top: 24px; }
.contact-aside p { color: var(--muted); }

.service-landing { min-height: calc(100vh - 86px); padding-top: 100px; padding-bottom: 100px; }
.service-landing h1 { font-size: clamp(4rem, 9vw, 8rem); margin-bottom: 20px; }
.service-description { max-width: 680px; color: var(--muted); font-size: 1.18rem; }
.service-health-panel { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 30px 0 26px; }
.health-detail { color: var(--muted); }
.config-note { max-width: 800px; margin-top: 38px; }
.config-note code { display: block; margin: 12px 0; padding: 12px; }
.config-note p { color: var(--muted); margin-bottom: 0; }

.site-footer { padding: 72px 0 24px; background: #050407; color: white; }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.footer-brand { margin-bottom: 16px; }
.site-footer p { color: rgba(255,255,255,.55); }
.social-links { display: flex; flex-wrap: wrap; gap: 18px; }
.social-links a { text-decoration: none; font-weight: 750; }
.footer-bottom { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.45); font-size: .84rem; }


/* Dark editorial theme overrides */
.section:not(.section-dark):not(.resume-banner) {
    background: transparent;
}
.section-dark {
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), transparent 180px),
        var(--dark);
}
.post-card,
.event-card,
.empty-state,
.resume-card,
.contact-aside,
.config-note,
.service-grid-light .service-card {
    box-shadow: 0 16px 45px rgba(0,0,0,.18);
}
.post-card:hover,
.event-card:hover,
.service-grid-light .service-card:hover {
    border-color: rgba(239,90,41,.42);
}
.page-hero {
    background:
        linear-gradient(180deg, rgba(255,255,255,.018), transparent),
        var(--bg);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #746f78;
}
.contact-form input:hover,
.contact-form textarea:hover {
    border-color: rgba(255,255,255,.22);
}
.about-image,
.gallery-item {
    border: 1px solid rgba(255,255,255,.1);
}

@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .site-nav {
        position: absolute;
        top: 76px;
        left: 20px;
        right: 20px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 14px;
        border: 1px solid rgba(255,255,255,.14);
        border-radius: 16px;
        background: rgba(17,16,19,.96);
        box-shadow: var(--shadow);
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 11px 12px; }
    .about-grid, .contact-layout { grid-template-columns: 1fr; }
    .about-image { aspect-ratio: 16 / 10; }
    .post-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 680px) {
    :root { --shell: min(100% - 28px, 1160px); }
    .site-header { min-height: 74px; }
    .hero { min-height: 650px; }
    .hero-content { padding-bottom: 64px; }
    h1 { font-size: clamp(3rem, 16vw, 5.2rem); }
    .section { padding: 78px 0; }
    .service-grid { grid-template-columns: 1fr; }
    .service-card { grid-template-columns: 48px 1fr; padding: 22px; }
    .service-icon { width: 48px; height: 48px; border-radius: 13px; }
    .service-icon svg { width: 24px; height: 24px; }
    .split-heading, .resume-inner, .footer-grid { align-items: flex-start; flex-direction: column; }
    .event-card { grid-template-columns: 64px 1fr; gap: 16px; padding: 18px; }
    .event-date { min-height: 64px; border-radius: 12px; }
    .event-date strong { font-size: 1.5rem; }
    .gallery-grid { grid-template-columns: 1fr; }
    .contact-list div { grid-template-columns: 1fr; gap: 4px; }
}

@media print {
    .site-header, .site-footer, .button-row, .eyebrow { display: none !important; }
    body { background: white; color: #17151a; }
    .page-hero { padding: 20px 0; }
    .section { padding: 20px 0; }
    .resume-card { border: 0; padding: 0; }
}

/* Live RSS news dashboard */
.news-shell {
    width: min(1640px, calc(100% - 40px));
    margin-inline: auto;
}
.news-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}
.news-refresh-note {
    color: var(--muted);
    font-size: .9rem;
}
.news-feed-section {
    padding-top: 24px;
}
.feed-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.rss-column {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 16px 45px rgba(0,0,0,.2);
}
.rss-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 76px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.018);
}
.rss-column-header h2 {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: -.02em;
}
.rss-state {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: .65rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.rss-state-loading { color: var(--muted); background: rgba(255,255,255,.06); }
.rss-state-online { color: #55d98d; background: rgba(47,158,99,.14); }
.rss-state-cached, .rss-state-stale { color: var(--accent-2); background: rgba(255,177,59,.12); }
.rss-state-error { color: #ff7777; background: rgba(197,68,68,.14); }
.rss-items {
    max-height: 760px;
    overflow-y: auto;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}
.rss-item {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.rss-item:last-child { border-bottom: 0; }
.rss-item a {
    display: block;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    line-height: 1.32;
}
.rss-item a:hover,
.rss-item a:focus-visible { color: var(--accent); }
.rss-item time {
    display: block;
    margin-top: 8px;
    color: var(--accent-2);
    font-size: .69rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.rss-item p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.5;
}
.rss-message {
    margin: 0;
    padding: 24px 20px;
    color: var(--muted);
}
.rss-error { color: #ff8a8a; }
.rss-placeholder { padding: 20px; }
.rss-placeholder span {
    display: block;
    height: 11px;
    margin-bottom: 11px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.11), rgba(255,255,255,.04));
    background-size: 200% 100%;
    animation: rss-loading 1.25s infinite linear;
}
.rss-placeholder span:nth-child(2) { width: 82%; }
.rss-placeholder span:nth-child(3) { width: 58%; }
@keyframes rss-loading { to { background-position: -200% 0; } }

@media (max-width: 1250px) {
    .feed-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .news-shell { width: min(100% - 28px, 1640px); }
    .feed-grid { grid-template-columns: 1fr; }
    .rss-items { max-height: none; }
}

/* Large embedded résumé viewer */
.resume-page {
    width: min(1400px, calc(100% - 40px));
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 24px;
    padding-bottom: 64px;
}

.pdf-container {
    width: 100%;
    height: calc(100vh - 230px);
    min-height: 750px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.pdf-viewer {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 750px;
    border: 0;
    margin: 0;
    padding: 0;
    background: #ffffff;
}

@media (max-width: 800px) {
    .resume-page {
        width: calc(100% - 24px);
        padding-top: 16px;
        padding-bottom: 32px;
    }

    .pdf-container {
        height: 78vh;
        min-height: 600px;
        border-radius: 10px;
    }

    .pdf-viewer {
        min-height: 600px;
    }
}
/* Resume rendered in normal page flow */
.resume-page {
    width: min(1100px, calc(100% - 40px));
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 24px;
    padding-bottom: 72px;
}

.resume-document {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
}

.resume-page-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

@media (max-width: 800px) {
    .resume-page {
        width: calc(100% - 20px);
        padding-top: 12px;
        padding-bottom: 40px;
    }

    .resume-document {
        gap: 16px;
    }

    .resume-page-image {
        border-radius: 4px;
    }
}

/* Recursive metadata gallery */
.gallery-section { padding-top: 28px; }
.gallery-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}
.gallery-toolbar input,
.gallery-toolbar select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 10px 13px;
    background: #100f12;
    color: var(--ink);
}
.gallery-toolbar input:focus,
.gallery-toolbar select:focus { outline: 3px solid rgba(239,90,41,.15); border-color: var(--accent); }
.gallery-clear { min-height: 46px; padding: 10px 18px; }
.gallery-result-count { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .88rem; }
.gallery-grid-searchable { align-items: start; }
.gallery-item.gallery-card {
    display: grid;
    grid-template-rows: auto 1fr;
    aspect-ratio: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    background: var(--surface);
    cursor: default;
}
.gallery-item.gallery-card[hidden] { display: none !important; }
.gallery-preview {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #09080a;
    color: var(--ink);
    text-decoration: none;
    cursor: zoom-in;
}
.gallery-preview img,
.gallery-preview video { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery-preview:hover img,
.gallery-preview:hover video { transform: scale(1.025); }
.gallery-video-preview { cursor: pointer; }
.gallery-file-preview { align-content: center; gap: 8px; cursor: pointer; }
.gallery-file-preview strong { font-size: clamp(2.2rem, 7vw, 4.8rem); color: var(--accent-2); }
.gallery-file-preview span { color: var(--muted); }
.gallery-file-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,.74);
    color: white;
    font-size: .7rem;
    font-weight: 800;
}
.gallery-caption { min-width: 0; padding: 16px; }
.gallery-caption h2 { margin: 0 0 5px; overflow: hidden; font-size: 1rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.gallery-path { margin: 0 0 12px; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.gallery-meta-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gallery-meta-chips span {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .69rem;
}
.gallery-description,
.gallery-tags { margin: 12px 0 0; color: var(--muted); font-size: .82rem; }
.gallery-no-results { margin-top: 20px; }
@media (max-width: 900px) {
    .gallery-toolbar { grid-template-columns: 1fr 1fr; }
    .gallery-search-label { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .gallery-toolbar { grid-template-columns: 1fr; }
    .gallery-search-label,
    .gallery-result-count { grid-column: auto; }
}

/* Compact gallery thumbnails */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 14px;
}

.gallery-card img,
.gallery-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gallery-card {
    min-width: 0;
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}



/* Fast paginated gallery additions BEGIN */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 28px;
    text-align: center;
}
.gallery-pagination span { color: var(--muted); }
@media (max-width: 560px) {
    .gallery-pagination { flex-wrap: wrap; gap: 10px; }
}
/* Fast paginated gallery additions END */
