/* Skaner Minifigurek LEGO — shared design system for content pages.
   Mobile-first. System font stack on purpose: no webfont round-trip on a shop's LTE. */

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

:root {
    /* Light only, on purpose: every figure photo ships with a white
       background, so a dark ground turns the grids into white boxes. */
    color-scheme: light;

    --bg: #fbfbfa;
    --surface: #ffffff;
    --surface-alt: #f4f4f2;
    --text: #16161a;
    --text-secondary: #55555f;
    --text-muted: #8a8a94;
    --border: #e6e6e2;
    --border-strong: #d4d4ce;
    --accent: #1d4ed8;
    --accent-hover: #1e40af;
    --accent-light: #eef2ff;
    --success: #047857;
    --success-light: #ecfdf5;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16,16,26,.06), 0 4px 12px rgba(16,16,26,.04);

    --measure: 680px;
    --gutter: 20px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "Fira Code", Menlo, Consolas, monospace;
}


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

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

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

/* ── Layout ── */
.wrap { max-width: var(--measure); margin: 0 auto; padding-inline: var(--gutter); }

/* ── Site header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
    font-size: 15px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -.01em;
}

.brand-mark { font-size: 18px; line-height: 1; }

.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
}
.header-cta:hover { background: var(--accent-hover); color: #fff; }

/* ── Breadcrumbs ── */
.crumbs {
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .sep { opacity: .5; }
.crumbs [aria-current] { color: var(--text); }

/* ── Typography ── */
h1 {
    font-size: clamp(26px, 6.2vw, 36px);
    line-height: 1.18;
    letter-spacing: -.022em;
    font-weight: 720;
    margin-top: 14px;
}

h2 {
    font-size: clamp(19px, 4.4vw, 23px);
    line-height: 1.28;
    letter-spacing: -.015em;
    font-weight: 680;
    margin-top: 40px;
    margin-bottom: 12px;
}

h3 {
    font-size: 16.5px;
    font-weight: 650;
    letter-spacing: -.008em;
    margin-top: 26px;
    margin-bottom: 8px;
}

p { margin-bottom: 15px; color: var(--text-secondary); }
p.lead {
    font-size: clamp(17px, 3.6vw, 19px);
    line-height: 1.55;
    color: var(--text);
    margin-top: 14px;
    margin-bottom: 22px;
}

main { padding-bottom: 64px; }

/* ── Meta row under the title ── */
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 100px;
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
}
a.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill-accent { background: var(--accent-light); color: var(--accent); border-color: transparent; }

/* ── Hero figure ── */
.figure-hero {
    margin-top: 24px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    overflow: hidden;
}
.figure-hero img { margin: 0 auto; max-height: 300px; width: auto; }
.figure-hero .emoji-fallback { font-size: 96px; line-height: 1.1; display: block; }

.cover-hero {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-alt);
}
.cover-hero img { width: 100%; }

/* ── Code table ── */
.codes-box {
    margin-top: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.codes-box > header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}
.codes-box > header h2 { margin: 0; font-size: 15px; font-weight: 650; }
.codes-box > header p { margin: 3px 0 0; font-size: 13px; color: var(--text-muted); }

.code-list { list-style: none; padding: 10px 18px 16px; }
.code-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
}
.code-list li:last-child { border-bottom: 0; }
.code-list code {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--text);
    background: var(--surface-alt);
    padding: 3px 9px;
    border-radius: 6px;
}
.code-list .batch { font-size: 12.5px; color: var(--text-muted); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.codes {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 440px;
}
table.codes th, table.codes td {
    text-align: left;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.codes th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    font-weight: 620;
    background: var(--surface-alt);
    position: sticky;
    top: 0;
}
table.codes td:first-child { white-space: normal; min-width: 150px; }
table.codes td a { text-decoration: none; font-weight: 550; }
table.codes td a:hover { text-decoration: underline; }
table.codes code { font-family: var(--mono); font-size: 13.5px; color: var(--text-secondary); }
table.codes tbody tr:hover { background: var(--surface-alt); }

/* ── Figure grid ── */
.fig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    margin-top: 16px;
    list-style: none;
}

.fig-grid a {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 8px 10px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, transform .15s;
}
.fig-grid a:hover { border-color: var(--accent); transform: translateY(-2px); }
.fig-grid img { height: 74px; width: auto; object-fit: contain; margin: 0 auto 8px; }
.fig-grid .emoji-fallback {
    font-size: 40px;
    height: 74px;
    line-height: 74px;
    display: block;
    margin-bottom: 8px;
}
.fig-grid .label { font-size: 12.5px; font-weight: 550; line-height: 1.3; display: block; }
.fig-grid .num { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

/* ── Series cards ── */
.series-list { list-style: none; display: grid; gap: 12px; margin-top: 18px; }

.series-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s;
}
.series-card:hover { border-color: var(--accent); }
.series-card img {
    width: 92px;
    height: 62px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: var(--surface-alt);
}
.series-card .sc-title { font-weight: 640; font-size: 15.5px; letter-spacing: -.01em; }
.series-card .sc-meta { font-size: 13px; color: var(--text-muted); }

/* ── Callout / CTA ── */
.cta-box {
    margin-top: 34px;
    background: var(--accent-light);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.cta-box h2 { margin: 0 0 6px; font-size: 18px; }
.cta-box p { margin: 0 0 15px; font-size: 14.5px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--accent);
    color: #fff;
    font-size: 15.5px;
    font-weight: 620;
    padding: 13px 26px;
    border-radius: 100px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: var(--accent-hover); color: #fff; }

.note {
    margin-top: 22px;
    font-size: 13.5px;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-left: 3px solid var(--border-strong);
    padding: 12px 15px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note strong { color: var(--text-secondary); }

/* ── Prev / next ── */
.pager {
    display: flex;
    gap: 10px;
    margin-top: 34px;
    border-top: 1px solid var(--border);
    padding-top: 18px;
}
.pager a {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    text-decoration: none;
    color: var(--text);
}
.pager a:hover { border-color: var(--accent); }
.pager .dir { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.pager .name { display: block; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager .next { text-align: right; }

/* ── Filter input (codes page) ── */
.filter-wrap { margin-top: 20px; position: sticky; top: 54px; z-index: 10; padding-block: 10px; background: var(--bg); }
.filter-wrap input {
    width: 100%;
    font-family: inherit;
    font-size: 16px; /* 16px prevents iOS zoom-on-focus */
    padding: 12px 16px;
    border-radius: 100px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    outline: none;
}
.filter-wrap input:focus { border-color: var(--accent); }
.filter-count { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 26px 40px;
    font-size: 13.5px;
    color: var(--text-muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.site-footer nav a { color: var(--text-secondary); text-decoration: none; }
.site-footer nav a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .fine { line-height: 1.6; }

.prose ul { margin: 0 0 15px 20px; color: var(--text-secondary); }
.prose li { margin-bottom: 5px; }

@media (min-width: 700px) {
    .fig-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
}
