/* =====================================================================
   cookbook.net.pl – arkusz stylów
   Mobile-first · CSS Grid/Flexbox · tryb ciemny · druk · WCAG 2.1 AA
   ===================================================================== */

/* ---------- Tokeny ---------- */
:root {
    --brand: #d9581c;          /* kolor logo */
    --brand-strong: #a8430f;   /* przyciski/linki – kontrast ≥ 4.5:1 na białym */
    --brand-soft: #fbe6d9;
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #faf8f4;
    --text: #2b2522;
    --text-muted: #6b625c;
    --border: #e4ded6;
    --ok: #1d7a45;
    --ok-soft: #e1f3e8;
    --warn: #8a5a00;
    --warn-soft: #fff2d6;
    --danger: #b3261e;
    --danger-soft: #fde4e2;
    --info-soft: #e5eefc;
    --info: #1f4f9c;
    --star: #e09b12;
    --shadow: 0 1px 2px rgba(43, 37, 34, .06), 0 4px 16px rgba(43, 37, 34, .06);
    --radius: 14px;
    --radius-sm: 8px;
    --on-brand: #ffffff;
    --focus: 0 0 0 3px rgba(217, 88, 28, .45);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-head: Georgia, "Times New Roman", serif;
    --container: 1180px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand: #f07a3a;
        --brand-strong: #f28c52;
        --on-brand: #1a1210;
        --brand-soft: #3a2519;
        --bg: #161311;
        --surface: #211c19;
        --surface-2: #1b1714;
        --text: #f1ebe6;
        --text-muted: #b4aaa2;
        --border: #3a322d;
        --ok: #6fd39a;
        --ok-soft: #1c3226;
        --warn: #f2c467;
        --warn-soft: #3a2f16;
        --danger: #ff8a80;
        --danger-soft: #3d1d1a;
        --info: #9cc0ff;
        --info-soft: #1b2639;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --brand: #f07a3a;
    --brand-strong: #f28c52;
    --on-brand: #1a1210;
    --brand-soft: #3a2519;
    --bg: #161311;
    --surface: #211c19;
    --surface-2: #1b1714;
    --text: #f1ebe6;
    --text-muted: #b4aaa2;
    --border: #3a322d;
    --ok: #6fd39a;
    --ok-soft: #1c3226;
    --warn: #f2c467;
    --warn-soft: #3a2f16;
    --danger: #ff8a80;
    --danger-soft: #3d1d1a;
    --info: #9cc0ff;
    --info-soft: #1b2639;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    color-scheme: dark;
}

/* ---------- Reset / baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-strong); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
::selection { background: var(--brand); color: #fff; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--brand-strong); color: var(--on-brand); padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }
.hp { position: absolute; left: -9999px; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.print-only { display: none; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1rem; }
.container.narrow { max-width: 480px; }
.container.medium { max-width: 860px; }
.site-main { flex: 1; padding-block: 1.25rem 3rem; outline: none; }

/* ---------- Przyciski ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .65rem 1.15rem; min-height: 44px;
    font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none;
    color: var(--on-brand); background: var(--brand-strong);
    border: 2px solid var(--brand-strong); border-radius: 999px; cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(.9); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--brand-strong) !important; }
.btn-outline:hover { background: var(--brand-soft); border-color: var(--brand-strong); filter: none; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-brand) !important; }

.btn-small { padding: .35rem .85rem; min-height: 36px; font-size: .9rem; }
.btn-large { padding: .85rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: inherit; cursor: pointer; font-size: 1.1rem;
}
.btn-icon:hover { background: var(--brand-soft); }
.link-button {
    background: none; border: 0; padding: 0; font: inherit; color: var(--brand-strong);
    text-decoration: underline; text-underline-offset: .15em; cursor: pointer;
}
.link-danger { color: var(--danger); }
.inline-form { display: inline; }

/* ---------- Nagłówek ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.5) blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center;
    gap: .5rem 1rem; padding-block: .6rem;
}
.brand {
    display: inline-flex; align-items: center; gap: .55rem;
    font-family: var(--font-head); font-size: 1.3rem; font-weight: 700;
    color: var(--text); text-decoration: none;
}
.brand-tld { color: var(--brand-strong); font-weight: 400; }
.header-search {
    grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding-left: 1rem;
}
.header-search input[type="search"] { flex: 1; border: 0; box-shadow: none; min-height: 40px; background: transparent; padding: .55rem 0; font: inherit; color: var(--text); min-width: 0; }
.header-search input[type="search"]:focus { outline: none; box-shadow: none; }
.header-search:focus-within { box-shadow: var(--focus); }
.nav-toggle { grid-column: 3; justify-self: end; }
.site-nav { grid-column: 1 / -1; display: none; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: .5rem 0; display: flex; flex-direction: column; gap: .25rem; }
.site-nav a, .site-nav .link-button {
    display: block; padding: .6rem .5rem; color: var(--text); text-decoration: none; font-weight: 500; border-radius: var(--radius-sm);
}
.site-nav a.btn { color: var(--on-brand); display: inline-flex; }
.site-nav a.btn:hover { background: var(--brand-strong); }
.site-nav a[aria-current="page"] { color: var(--brand-strong); box-shadow: inset 0 -2px 0 var(--brand); }
.site-nav a:hover, .site-nav .link-button:hover { background: var(--brand-soft); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-toggle .icon-sun { display: block; }
    :root:not([data-theme]) .theme-toggle .icon-moon { display: none; }
}

@media (min-width: 900px) {
    .header-inner { grid-template-columns: auto minmax(180px, 340px) 1fr; }
    .header-search { grid-column: 2; grid-row: 1; }
    .nav-toggle { display: none; }
    .site-nav { display: block; grid-column: 3; justify-self: end; }
    .site-nav ul { flex-direction: row; align-items: center; padding: 0; }
    .site-nav a, .site-nav .link-button { padding: .45rem .6rem; white-space: nowrap; }
    .site-nav ul { gap: 0; }
}

/* ---------- Okruszki, flash ---------- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; padding: .9rem 0 0; margin: 0; font-size: .9rem; color: var(--text-muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 500; }

.flash-area:empty { display: none; }
.flash-area { padding-top: 1rem; display: grid; gap: .5rem; }
.flash {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    padding: .8rem 1rem; border-radius: var(--radius-sm); border-left: 4px solid;
    background: var(--info-soft); border-color: var(--info); color: var(--text); margin-bottom: 1rem;
}
.flash-area .flash { margin: 0; }
.flash-success { background: var(--ok-soft); border-color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: var(--danger); }
.flash-warning { background: var(--warn-soft); border-color: var(--warn); }
.flash-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 .25rem; }

/* ---------- Karty i siatki ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.grid-2, .grid-3 { display: grid; gap: 0 1rem; }
@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.page-title { margin-top: .5rem; }
.section-title { margin-top: 1.5rem; }
.section-title .count, .page-title .count { color: var(--text-muted); font-weight: 400; font-size: .8em; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.lead { font-size: 1.1rem; color: var(--text-muted); }
.empty-state { text-align: center; padding: 2.5rem 1rem; }

/* ---------- Hero ---------- */
.hero {
    display: grid; gap: 1.5rem; align-items: center;
    background: linear-gradient(135deg, var(--brand-soft), var(--surface));
    border-radius: calc(var(--radius) * 1.5); padding: 2rem 1.25rem; margin: 1rem 0 1.5rem;
    border: 1px solid var(--border);
}
.hero h1 { margin-bottom: .4em; }
.hero-logo { display: none; }
@media (min-width: 720px) {
    .hero { grid-template-columns: 1fr auto; padding: 2.5rem 3rem; }
    .hero-logo { display: block; filter: drop-shadow(0 10px 25px rgba(217, 88, 28, .35)); }
}

/* ---------- Filtry ---------- */
.filters { display: grid; gap: 0 1rem; align-items: end; }
.filters .field { margin-bottom: .75rem; }
.filters-actions { display: flex; gap: .5rem; margin-bottom: .75rem; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; } }
@media (min-width: 640px) { .filters.newsletter-filters { grid-template-columns: 2fr 1fr; } .newsletter-filters .filters-actions { grid-column: 1 / -1; } }

.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.tag {
    display: inline-block; padding: .3rem .75rem; border-radius: 999px; font-size: .9rem;
    background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.tag:hover, .tag.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }

/* ---------- Siatka przepisów ---------- */
.recipe-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.recipe-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(43, 37, 34, .12); }
.recipe-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.recipe-card-media { position: relative; aspect-ratio: 3 / 2; background: var(--brand-soft); }
.recipe-card-media img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card-placeholder { display: grid; place-items: center; height: 100%; }
.recipe-card-placeholder img { width: 64px; height: 64px; opacity: .55; }
.recipe-card-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.recipe-card-title { font-size: 1.15rem; margin-bottom: .35rem; }
.recipe-card-excerpt { color: var(--text-muted); font-size: .93rem; flex: 1; }
.recipe-meta { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .88rem; color: var(--text-muted); }

.badge {
    display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border); text-decoration: none; white-space: nowrap;
}
.recipe-card-media .badge-category { position: absolute; left: .7rem; top: .7rem; background: rgba(255, 255, 255, .94); color: #2b2522; border: 0; }
.badge-category { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.badge-easy, .badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-medium, .badge-wait { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-hard, .badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-admin { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ---------- Paginacja ---------- */
.pagination ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; padding: 0; margin: 2rem 0 0; }
.pagination a, .pagination span {
    display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .6rem;
    border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand-strong); }
.pagination [aria-current="page"] { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); font-weight: 700; }

/* ---------- Formularze ---------- */
.field { margin-bottom: 1rem; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"],
input[type="file"], select, textarea {
    width: 100%; font: inherit; color: var(--text); background: var(--surface);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .75rem; min-height: 44px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .9rem; margin: .3rem 0 0; font-weight: 500; }
.field-error::before { content: "⚠ "; }
.form-hint { color: var(--text-muted); font-size: .88rem; margin: .3rem 0 0; }
.req { color: var(--danger); }
.field-check label { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; }
.field-check input { width: 1.15rem; height: 1.15rem; margin-top: .25rem; accent-color: var(--brand-strong); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.card { padding: 1.25rem; }
legend { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; padding: 0; margin-bottom: .9rem; float: left; width: 100%; }
fieldset > :not(legend) { clear: both; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 3rem; }
.password-wrap .btn-icon { position: absolute; right: 0; top: 0; }
.strength { height: 6px; border-radius: 3px; background: var(--border); margin-top: .4rem; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }
.strength[data-level="2"] span { width: 50%; background: var(--warn); }
.strength[data-level="3"] span { width: 75%; background: #c6a300; }
.strength[data-level="4"] span { width: 100%; background: var(--ok); }
.strength[data-level="1"] span { width: 25%; }

.segmented { display: flex; flex-wrap: wrap; gap: .4rem; }
.segmented label { margin: 0; font-weight: 500; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: inline-block; padding: .55rem 1rem; border-radius: 999px; border: 1.5px solid var(--border);
    background: var(--surface); cursor: pointer; min-height: 44px;
}
.segmented input:checked + span { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }

.dynamic-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; }
.ingredient-row, .step-row {
    display: grid; gap: .5rem; align-items: end; padding: .75rem; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.ingredient-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.ingredient-row .field:first-child { grid-column: 1 / -1; }
.ingredient-row .field, .step-row .field { margin: 0; }
.ingredient-row label, .step-row label { font-weight: 500; font-size: .9rem; }
.step-row { grid-template-columns: 1fr auto; }
.btn-remove { color: var(--danger); font-size: 1.5rem; }
@media (min-width: 640px) {
    .ingredient-row { grid-template-columns: 3fr 1fr 1.3fr auto; }
    .ingredient-row .field:first-child { grid-column: auto; }
}
.image-preview { margin-top: .75rem; max-width: 300px; border-radius: var(--radius-sm); }
.current-image { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.current-image img { border-radius: var(--radius-sm); max-width: 200px; }
.danger-zone { border-color: var(--danger); }

.auth-card { margin-top: 1.5rem; }
.auth-alt { text-align: center; margin: 1rem 0 0; }

/* ---------- Strona przepisu ---------- */
.recipe-header { margin: 1rem 0 1.25rem; }
.recipe-kicker { display: flex; gap: .4rem; margin-bottom: .6rem; }
.recipe-title { font-size: clamp(1.9rem, 5vw, 3rem); }
.recipe-byline { color: var(--text-muted); }
.stars-static { color: var(--star); letter-spacing: 1px; }
.recipe-owner-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.recipe-hero { margin: 0 0 1.5rem; border-radius: calc(var(--radius) * 1.25); overflow: hidden; background: var(--brand-soft); }
.recipe-hero img { width: 100%; max-height: 560px; object-fit: cover; }
.recipe-intro { font-size: 1.1rem; max-width: 70ch; margin-bottom: 1.5rem; }
.recipe-facts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; margin: 0 0 2rem;
}
.recipe-facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; }
.recipe-facts dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.recipe-facts dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.recipe-columns { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .recipe-columns { grid-template-columns: 340px 1fr; align-items: start; } .recipe-ingredients { position: sticky; top: 90px; } }
.servings-scaler { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; font-size: .92rem; }
.servings-scaler input { width: 5rem; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { border-bottom: 1px dashed var(--border); }
.ingredients label { display: flex; gap: .5rem; align-items: baseline; padding: .55rem 0; cursor: pointer; }
.ingredients input { accent-color: var(--brand-strong); width: 1.05rem; height: 1.05rem; flex: none; }
.ingredients .qty, .ingredients .unit { font-weight: 700; }
.ingredients input:checked ~ span { text-decoration: line-through; color: var(--text-muted); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.4rem 3.4rem; min-height: 2.6rem; }
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: -.15rem;
    width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%;
    background: var(--brand-strong); color: var(--on-brand); font-weight: 700; font-family: var(--font-head);
}
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.5rem 0; }
.share-label { font-weight: 600; }

.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; margin-bottom: .75rem; }
.star-input legend { float: none; width: auto; font-family: var(--font); font-size: 1rem; font-weight: 500; margin-bottom: .4rem; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { cursor: pointer; font-size: 2rem; line-height: 1; color: var(--border); width: 44px; height: 44px; display: grid; place-items: center; }
.star-input label::before { content: "★"; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }
.star-input input:focus-visible + label { box-shadow: var(--focus); border-radius: 50%; }
.rating-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; }

.comments { margin-top: 2rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .9rem; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; }
.comment header { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; margin-bottom: .35rem; }
.comment time { color: var(--text-muted); font-size: .85rem; }
.comment p { margin-bottom: .4rem; }

/* ---------- Tabele / admin ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; }
.table .actions > * { margin-right: .6rem; }
.table-thumb { border-radius: 6px; object-fit: cover; }
.admin-nav ul, .tabs { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.25rem; }
.admin-nav a, .tabs a {
    display: inline-block; padding: .5rem 1rem; border-radius: 999px; background: var(--surface);
    border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 500;
}
.admin-nav a[aria-current="page"], .tabs a[aria-current="page"] { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 1rem; }
.stat { margin: 0; display: flex; flex-direction: column; gap: .1rem; color: var(--text); text-decoration: none; }
.stat-link { transition: border-color .15s, transform .15s; }
.stat-link:hover { border-color: var(--brand); transform: translateY(-2px); }
.stat-link:hover .stat-sub { color: var(--brand-strong); }
.stat-label { color: var(--text-muted); font-size: .85rem; margin: 0; }
.stat-value { font-size: 2rem; font-weight: 800; font-family: var(--font-head); margin: .1rem 0; color: var(--brand-strong); }
.stat-sub { font-size: .82rem; color: var(--text-muted); margin: 0; }
.plain-list { padding-left: 1.2rem; margin: 0; }
.plain-list li { margin-bottom: .4rem; }
.bar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.bar-list li { display: grid; grid-template-columns: 110px 1fr 40px; gap: .6rem; align-items: center; }
.bar-list meter { width: 100%; height: 12px; }
.bar-value { text-align: right; font-weight: 600; }
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.bulk-actions select { width: auto; }
.admin-comments { list-style: none; padding: 0; margin: 0; }
.admin-comments .actions { display: flex; gap: 1rem; }
.is-hidden-comment { opacity: .65; }
.account-grid { margin-top: 2rem; }

/* ---------- Strony błędów, treść ---------- */
.error-page { text-align: center; padding-top: 2rem; }
.error-code { font-size: clamp(4rem, 15vw, 7rem); font-weight: 800; font-family: var(--font-head); color: var(--brand); margin: 0; line-height: 1; }
.error-search { margin: 1.5rem auto; max-width: 420px; padding: .25rem; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 2rem; }
.prose li { margin-bottom: .5rem; }

/* ---------- Stopka ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-top: 2.5rem; margin-top: auto; font-size: .94rem; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.footer-title { font-size: 1.05rem; margin-bottom: .6rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a, .footer-links .link-button { color: var(--text-muted); }
.footer-links a:hover { color: var(--brand-strong); }
.newsletter-form { display: grid; gap: .5rem; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-block: 1rem; color: var(--text-muted); font-size: .88rem; }
.footer-bottom p { margin: 0; }

/* ---------- Baner cookies ---------- */
.cookie-banner {
    position: fixed; inset: auto 0 0 0; z-index: 90; background: var(--surface);
    border-top: 3px solid var(--brand); box-shadow: 0 -8px 30px rgba(0, 0, 0, .15); padding: 1rem 0;
}
.cookie-inner { display: grid; gap: 1rem; }
.cookie-title { font-size: 1.1rem; margin-bottom: .3rem; }
.cookie-inner p { margin: 0; font-size: .92rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (min-width: 800px) { .cookie-inner { grid-template-columns: 1fr auto; align-items: center; } }

/* ---------- Ruch ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Druk przepisu ---------- */
@media print {
    :root { --text: #000; --bg: #fff; --surface: #fff; --border: #bbb; }
    body { background: #fff; font-size: 11pt; color: #000; }
    .site-header, .site-footer, .breadcrumbs, .flash-area, .cookie-banner, .skip-link,
    .no-print, .recipe-owner-actions, .share, .comments, .rating-box, .tag-cloud, .btn { display: none !important; }
    .print-only { display: block; }
    .container { max-width: none; padding: 0; }
    .site-main { padding: 0; }
    .recipe-hero img { max-height: 8cm; }
    .recipe-columns { grid-template-columns: 7cm 1fr; display: grid; gap: 1cm; }
    .recipe-ingredients { position: static; box-shadow: none; border: 1px solid #bbb; }
    .recipe-facts { grid-template-columns: repeat(5, 1fr); }
    .steps li { break-inside: avoid; }
    .steps li::before { background: #fff; color: #000; border: 1.5pt solid #000; }
    a { color: #000; text-decoration: none; }
    .print-source { margin-top: 1cm; font-size: 9pt; color: #555; }
}
