/* ═══════════════════════════════════════════════════════════
   VEETER — Neubrutalist Design System
   Spacing: 8px base grid (8 · 16 · 24 · 32 · 48 · 64)
   Corners: 0 everywhere, no exceptions
   Accent: #e85d2a burnt orange
   ═══════════════════════════════════════════════════════════ */

/* ─── FONTS ────────────────────────────────────────────── */
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('/static/fonts/atkinson-regular-latinext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('/static/fonts/atkinson-regular-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url('/static/fonts/atkinson-bold-latinext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url('/static/fonts/atkinson-bold-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic; font-weight: 400; font-display: swap;
    src: url('/static/fonts/atkinson-italic-latinext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic; font-weight: 400; font-display: swap;
    src: url('/static/fonts/atkinson-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic; font-weight: 700; font-display: swap;
    src: url('/static/fonts/atkinson-bolditalic-latinext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: italic; font-weight: 700; font-display: swap;
    src: url('/static/fonts/atkinson-bolditalic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── RESET ──────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important;
}

/* ─── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #fff; }
::-webkit-scrollbar-thumb { background: var(--accent, #e85d2a); border: 3px solid #fff; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-h, #d14a1a); }
html { scrollbar-width: auto; scrollbar-color: #e85d2a #fff; }

/* ─── TOKENS ─────────────────────────────────────────── */
:root {
    --bg: #fafaf8;
    --fg: #1a1a1a;
    --muted: #6b6b6b;
    --accent: #e85d2a;
    --accent-h: #d14a1a;
    --search-bg: #d4d84a;
    --border: #1a1a1a;
    --bw: 2px;
    --white: #ffffff;
    --tag-bg: #fff4ef;
    --shadow: 3px 3px 0 var(--accent);
    --shadow-sm: 2px 2px 0 var(--accent);
    --mono: 'SF Mono', 'Cascadia Mono', 'Consolas', monospace;

    /* spacing scale (8px base) */
    --s1: 8px;
    --s2: 16px;
    --s3: 24px;
    --s4: 32px;
    --s6: 48px;
    --s8: 64px;

    /* layout */
    --nav-h: 56px;
    --gap: var(--s3);
    --col-w: 280px;
    --page-w: 860px;
}

/* ─── BASE ───────────────────────────────────────────── */
html {
    font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; overflow-x: hidden; }
a { color: var(--fg); text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ─── NAVBAR ─────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: var(--bg);
    display: flex;
    align-items: stretch;
    z-index: 1000;
    transition: transform 0.25s ease;
}

.nav--hidden { transform: translateY(-100%); }

.nav__logo {
    display: flex;
    align-items: center;
    padding: 0 var(--s3);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
}

.nav__logo:hover { background: var(--accent-h); }

.nav__logo-short { display: none; }

.nav__search {
    flex: 1;
    position: relative;
}

.nav__search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.nav__search-shadow,
.nav__search-fg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.15s ease;
}

.nav__search-shadow {
    transform: translate(2px, 2px);
}

.nav__search-icon:hover .nav__search-fg {
    transform: translate(-2px, -2px);
}

.nav__search-icon:hover .nav__search-shadow {
    transform: translate(4px, 4px);
}

.nav__search-icon:active .nav__search-fg {
    transform: translate(0, 0);
}

.nav__search-icon:active .nav__search-shadow {
    transform: translate(2px, 2px);
}

.nav__input {
    width: 100%;
    height: 100%;
    padding: 0 48px 0 var(--s3);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fg);
    background: var(--search-bg);
    border: none;
    border-bottom: 3px solid transparent;
    outline: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav__input::placeholder { color: #fff; font-weight: 700; }
.nav__input:focus {
    background: var(--bg);
    border-bottom-color: var(--search-bg);
    font-weight: 400;
}

/* ─── IMAGE GRID (CSS columns) ───────────────────────── */
.grid-wrap {
    padding: calc(var(--nav-h) + var(--gap)) var(--gap) var(--gap);
}

.grid-wrap__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--s3);
    letter-spacing: 0.05em;
}

.grid {
    columns: var(--col-w);
    column-gap: var(--gap);
}

.grid__fill {
    display: block;
    cursor: pointer;
    transition: background 0.15s ease, filter 0.15s ease;
}

.grid__fill:hover {
    filter: brightness(0.9);
}

.grid__item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: var(--gap);
    position: relative;
    overflow: hidden;
    vertical-align: top;
}

.grid__img {
    width: 100%;
    display: block;
}

/* overlay — always in DOM for SEO, visible on hover */
.grid__ov {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.grid__item:hover .grid__ov { opacity: 1; }

.grid__ov-title {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    padding: var(--s1) var(--s2);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
}

.grid__ov-meta {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    padding: 6px var(--s2);
    font-size: 0.7rem;
    line-height: 1.3;
}

/* ─── IMAGE PAGE ─────────────────────────────────────── */
.img-page {
    padding: calc(var(--nav-h) + var(--s4)) var(--s3) var(--s4);
    max-width: var(--page-w);
    margin: 0 auto;
}

.img-page__hero-wrap {
    display: block;
    position: relative;
    margin: 0 auto var(--s4);
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
}

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

.img-page__hero-ov {
    position: absolute;
    top: 0; right: 0;
    padding: var(--s2) var(--s3);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.img-page__hero-wrap:hover .img-page__hero-ov,
.img-page__hero-ov.active { opacity: 1; pointer-events: auto; }

.img-page__hero-dl {
    padding: 8px 18px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.img-page__hero-dl:hover { background: var(--accent); }

.img-page__title {
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: var(--s1);
}

.img-page__photographer {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: var(--s2);
}

.img-page__photographer a {
    color: var(--accent);
    font-weight: 700;
}

.img-page__desc-wrap {
    margin-bottom: var(--s4);
}

.img-page__desc {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--fg);
    max-height: calc(1.05rem * 1.7 * 3);
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.img-page__desc-wrap.expanded .img-page__desc {
    max-height: 200rem;
}

.img-page__desc-fade {
    height: 3rem;
    margin-top: -3rem;
    position: relative;
    background: linear-gradient(to bottom, rgba(250,250,248,0), var(--bg));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.img-page__desc-wrap.expanded .img-page__desc-fade,
.img-page__desc-wrap.expanded .img-page__desc-more {
    display: none;
}

.img-page__desc-more {
    display: inline-block;
    margin-top: var(--s1);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.img-page__desc-more:hover {
    text-decoration: underline;
}


/* EXIF metadata grid */
.img-page__meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: var(--s2);
    margin-bottom: var(--s6);
    padding: var(--s3);
    border: var(--bw) solid var(--border);
    box-shadow: var(--shadow);
}

.img-page__meta-item { display: flex; flex-direction: column; gap: 2px; }

.img-page__meta-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.img-page__meta-value { font-size: 0.95rem; }

.img-page__meta-link {
    color: var(--fg);
    text-decoration: none;
}

.img-page__meta-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.camera-asterisk {
    position: relative;
    cursor: help;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8em;
    vertical-align: super;
    margin-left: 1px;
}

.camera-tip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    padding: var(--s1) var(--s2);
    background: var(--fg);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 6px;
    z-index: 100;
    pointer-events: none;
}

.camera-asterisk:hover .camera-tip,
.camera-asterisk:focus .camera-tip {
    display: block;
}

/* tags */
.img-page__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1);
    margin-bottom: var(--s6);
}

.img-page__tag {
    display: inline-block;
    padding: 4px var(--s2);
    background: var(--tag-bg);
    border: var(--bw) solid var(--border);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    transition: all 0.1s;
}

.img-page__tag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* engagement: votes + views */
.img-page__engage {
    display: flex;
    align-items: center;
    gap: var(--s4);
    margin-bottom: var(--s4);
}

.img-page__votes {
    display: flex;
    align-items: center;
    gap: var(--s1);
    border: var(--bw) solid var(--border);
    padding: 2px var(--s1);
}

.vote-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    font-family: inherit;
    color: var(--fg);
    transition: color 0.1s;
}

.vote-btn:hover { color: var(--accent); }

.vote-score {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 24px;
    text-align: center;
}

.img-page__views {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: #6b6b6b;
    letter-spacing: 0.05em;
}

/* comments */
.img-page__comments {
    margin-bottom: var(--s6);
}

.img-page__comments-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 var(--s3);
    padding: var(--s1) 0;
    border-bottom: var(--bw) solid var(--border);
}

.img-page__comment-form {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    margin-bottom: var(--s4);
}

.img-page__comment-name,
.img-page__comment-body {
    font-family: inherit;
    font-size: 0.9rem;
    padding: var(--s1) var(--s2);
    border: var(--bw) solid var(--border);
    background: #fff;
    resize: vertical;
}

.img-page__comment-name { max-width: 240px; }

.img-page__comment-actions {
    display: flex;
    align-items: center;
    gap: var(--s2);
}

.img-page__comment-submit {
    display: inline-block;
    padding: var(--s1) var(--s3);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #fff;
    background: var(--accent);
    border: var(--bw) solid var(--border);
    cursor: pointer;
}

.img-page__comment-submit:disabled { opacity: 0.5; cursor: wait; }

.img-page__comment-status {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: #6b6b6b;
}

.img-page__comment {
    padding: var(--s2) 0;
    border-bottom: 1px solid #e5e5e5;
}

.img-page__comment-author {
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: var(--s2);
}

.img-page__comment-date {
    font-size: 0.75rem;
    color: #6b6b6b;
    font-family: var(--mono);
}

.img-page__comment-text {
    margin: var(--s1) 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.img-page__no-comments {
    font-size: 0.85rem;
    color: #6b6b6b;
    font-style: italic;
}

/* use / embed / download */
.img-page__use {
    margin-bottom: var(--s6);
    border: var(--bw) solid var(--border);
    padding: var(--s3);
    box-shadow: var(--shadow);
}

.img-page__use-actions {
    display: flex;
    gap: var(--s1);
    flex-wrap: wrap;
    margin-bottom: var(--s2);
}

.img-page__dl,
.img-page__copy {
    display: inline-block;
    padding: var(--s1) var(--s3);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: var(--bw) solid var(--border);
    cursor: pointer;
    transition: all 0.1s;
}

.img-page__dl {
    background: var(--fg);
    color: #fff;
    text-decoration: none;
}

.img-page__dl:hover { background: var(--accent); border-color: var(--accent); }

.img-page__copy { background: var(--white); color: var(--fg); }

.img-page__copy:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.img-page__copy--done {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

.img-page__embed-box {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: var(--s2);
    margin-bottom: var(--s2);
    overflow-x: auto;
}

.img-page__embed-box code {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--fg);
    word-break: break-all;
}

.img-page__use-terms {
    font-size: 0.78rem;
    color: var(--muted);
}

.img-page__use-terms a { color: var(--accent); font-weight: 700; }

/* related images heading */
.img-page__related {
    max-width: none;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 0 var(--gap);
}

.img-page__related .grid {
    columns: var(--col-w);
    column-gap: var(--gap);
}

.img-page__related-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--s3);
    letter-spacing: 0.05em;
    border-bottom: var(--bw) solid var(--border);
    padding-bottom: var(--s1);
}

/* ─── BOTTOM TAGS + SEARCH ──────────────────────────── */
.img-page__bottom {
    margin-top: var(--s6);
    padding-top: var(--s4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
}

.img-page__bottom .img-page__tags {
    justify-content: center;
}

.img-page__bottom-search {
    width: 100%;
    max-width: 560px;
}

.img-page__bottom-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--s3);
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--fg);
    background: var(--white);
    border: var(--bw) solid var(--border);
    outline: none;
}

.img-page__bottom-input::placeholder { color: var(--muted); }
.img-page__bottom-input:focus { border-color: var(--accent); box-shadow: var(--shadow-sm); }

/* ─── GRID END (bottom of every page) ────────────────── */
.grid-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--s6) var(--gap);
    gap: var(--s3);
}

.grid-end__search {
    width: 100%;
    max-width: 560px;
}

.grid-end__input {
    width: 100%;
    height: 48px;
    padding: 0 var(--s3);
    font-family: inherit;
    font-size: 1.05rem;
    color: var(--fg);
    background: var(--white);
    border: var(--bw) solid var(--border);
    outline: none;
}

.grid-end__input::placeholder { color: var(--muted); }
.grid-end__input:focus { border-color: var(--accent); box-shadow: var(--shadow-sm); }

/* ─── EMPTY STATE ────────────────────────────────────── */
.empty {
    text-align: center;
    padding: calc(var(--nav-h) + 80px) var(--s3) 80px;
}

.empty__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--s2);
}

.empty__text { color: var(--muted); }

/* ─── FOOTER ─────────────────────────────────────────── */
.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--s6) var(--s3) var(--s4);
    font-size: 0.78rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.footer__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    background: var(--accent);
    color: #fff !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none !important;
    flex-shrink: 0;
}

.footer__logo:hover { background: var(--accent-h); }

.footer a {
    color: var(--accent);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ─── AD PLACEHOLDER ─────────────────────────────────── */
.ad-slot { display: none; }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 768px) {
    .nav__logo-full { display: none; }
    .nav__logo-short { display: inline; }
}

@media (max-width: 540px) {
    :root { --gap: var(--s2); }
    .nav__logo { font-size: 1.1rem; letter-spacing: 0.12em; padding: 0 var(--s2); }
    .img-page { padding: calc(var(--nav-h) + var(--s2)) var(--s2) var(--s2); }
    .img-page__title { font-size: 1.5rem; }
    .img-page__meta { grid-template-columns: 1fr 1fr; padding: var(--s2); }
    .img-page__use { padding: var(--s2); }
}
