/* =====================================================================
   Serwis z przepisami — arkusz stylów frontu
   Jasny, apetyczny, mobile-first. Bez zewnętrznych zależności
   (żadnych fontów z CDN — każde dodatkowe połączenie to gorszy LCP).
   ===================================================================== */

:root {
    --accent: #e2603c;
    --accent-dark: #c04a29;
    --accent-soft: #fdf1ec;
    --ink: #1f1b18;
    --ink-2: #4c4642;
    --muted: #857c75;
    --line: #eae4de;
    --bg: #ffffff;
    --bg-warm: #fbf7f3;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 1px 2px rgba(31, 27, 24, .05), 0 8px 24px rgba(31, 27, 24, .06);
    --shadow-lg: 0 2px 6px rgba(31, 27, 24, .06), 0 18px 44px rgba(31, 27, 24, .10);
    --wrap: 1180px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; color: var(--ink); margin: 0 0 .6rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); font-size: .92rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.section { padding: 2.6rem 20px; }
.narrow { max-width: 760px; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
    position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff;
    padding: .7rem 1.2rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* --- Nagłówek ------------------------------------------------------ */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo . toggle" "search search search";
    align-items: center;
    gap: .6rem 1rem;
    padding-top: .7rem; padding-bottom: .7rem;
}
.logo { grid-area: logo; display: flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-mark { font-size: 1.5rem; line-height: 1; }
.nav { grid-area: nav; display: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem; }
.nav > ul > li > a {
    display: block; padding: .5rem .75rem; border-radius: 999px;
    color: var(--ink-2); font-size: .95rem; font-weight: 500;
}
.nav > ul > li > a:hover { background: var(--accent-soft); color: var(--accent-dark); text-decoration: none; }
.nav .has-sub { position: relative; }
.submenu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 210px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: .4rem; flex-direction: column;
}
.nav .has-sub:hover .submenu, .nav .has-sub:focus-within .submenu { display: flex; }
.submenu a { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--ink-2); font-size: .93rem; }
.submenu a:hover { background: var(--accent-soft); text-decoration: none; }

.nav-toggle {
    grid-area: toggle; display: inline-flex; flex-direction: column; justify-content: center;
    gap: 4px; width: 42px; height: 42px; padding: 0 10px;
    background: var(--bg-warm); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.nav.is-open { display: block; grid-column: 1 / -1; }
.nav.is-open ul { flex-direction: column; }
.nav.is-open .submenu { display: flex; position: static; box-shadow: none; border: 0; padding-left: 1rem; }

.search { grid-area: search; position: relative; display: flex; }
.search input {
    flex: 1; min-width: 0; padding: .6rem 2.6rem .6rem 1rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--bg-warm);
    font: inherit; font-size: .95rem; color: var(--ink);
}
.search input:focus { background: #fff; border-color: var(--accent); outline: none; }
.search button {
    position: absolute; right: 4px; top: 4px; bottom: 4px; width: 38px;
    display: grid; place-items: center; border: 0; border-radius: 999px;
    background: var(--accent); color: #fff; cursor: pointer;
}
.search button:hover { background: var(--accent-dark); }
.suggest {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.suggest a { display: block; padding: .6rem .9rem; color: var(--ink-2); font-size: .93rem; }
.suggest a:hover, .suggest a.is-active { background: var(--accent-soft); text-decoration: none; }

@media (min-width: 900px) {
    .header-inner {
        grid-template-columns: auto 1fr 300px;
        grid-template-areas: "logo nav search";
        gap: 1.5rem;
    }
    .nav { display: block; }
    .nav-toggle { display: none; }
}

/* --- Okruszki ------------------------------------------------------ */
.breadcrumbs { background: var(--bg-warm); border-bottom: 1px solid var(--line); font-size: .85rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: .6rem 0; }
.breadcrumbs li + li::before { content: "›"; color: var(--muted); margin-right: .4rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs [aria-current] { color: var(--ink-2); }

/* --- Hero ---------------------------------------------------------- */
.hero {
    background: linear-gradient(170deg, var(--accent-soft) 0%, #fff 78%);
    padding: 3rem 0 2.6rem; text-align: center;
}
.hero h1 { max-width: 20ch; margin: 0 auto .8rem; }
.hero-lead { max-width: 62ch; margin: 0 auto 1.6rem; color: var(--ink-2); font-size: 1.05rem; }
.hero-search { display: flex; gap: .5rem; max-width: 620px; margin: 0 auto; flex-wrap: wrap; }
.hero-search input {
    flex: 1 1 240px; padding: .85rem 1.1rem; font: inherit;
    border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--shadow);
}
.hero-search input:focus { border-color: var(--accent); outline: none; }
.hero-search button {
    padding: .85rem 1.6rem; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600;
}
.hero-search button:hover { background: var(--accent-dark); }
.hero-cats { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1.6rem 0 0; padding: 0; }
.hero-cats a {
    display: block; padding: .4rem .9rem; background: #fff; border: 1px solid var(--line);
    border-radius: 999px; font-size: .9rem; color: var(--ink-2);
}
.hero-cats a:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }

/* --- Sekcje i siatka ------------------------------------------------ */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-more { font-size: .92rem; font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.empty { padding: 2.5rem; text-align: center; background: var(--bg-warm); border-radius: var(--radius-lg); color: var(--muted); }

/* --- Karta przepisu ------------------------------------------------- */
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg-warm); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.badge-time {
    position: absolute; left: 10px; bottom: 10px;
    background: rgba(255, 255, 255, .93); color: var(--ink); font-size: .78rem; font-weight: 600;
    padding: .22rem .6rem; border-radius: 999px; backdrop-filter: blur(4px);
}
.card-body { padding: .95rem 1.05rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--accent); }
.card-title { margin: 0; font-size: 1.08rem; line-height: 1.3; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-dark); text-decoration: none; }
.card-lead { margin: 0; color: var(--muted); font-size: .89rem; line-height: 1.5; flex: 1; }
.card-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .3rem; }

/* Gwiazdki: dwie warstwy tekstu, górna przycięta szerokością = ocena w %. */
.stars { position: relative; display: inline-block; font-size: 15px; line-height: 1; color: var(--line); letter-spacing: 1px; }
.stars::before { content: "★★★★★"; }
.stars-on { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #f0a500; }
.stars-on::before { content: "★★★★★"; }
.stars-lg { font-size: 21px; letter-spacing: 2px; }
.chip { font-size: .75rem; padding: .15rem .55rem; border-radius: 999px; background: var(--bg-warm); color: var(--ink-2); }
.chip-latwy { background: #eaf6ec; color: #2c6b39; }
.chip-sredni { background: #fdf3e3; color: #91621a; }
.chip-trudny { background: #fbeceb; color: #973229; }

/* --- Polecane ------------------------------------------------------- */
.featured { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.feature { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 220px; }
.feature img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; }
.feature a { display: block; height: 100%; color: #fff; }
.feature a:hover { text-decoration: none; }
.feature-text {
    position: absolute; inset: auto 0 0 0; padding: 1.4rem 1.2rem 1.1rem;
    background: linear-gradient(to top, rgba(20, 14, 10, .86), rgba(20, 14, 10, 0));
}
.feature-text h3 { color: #fff; margin: .2rem 0 .3rem; font-size: 1.25rem; }
.feature-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; opacity: .9; }
.feature-time { font-size: .85rem; opacity: .85; }
@media (min-width: 760px) {
    .featured { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
    .feature-big { grid-row: span 2; }
    .feature-big .feature-text h3 { font-size: 1.7rem; }
}

/* --- Listing -------------------------------------------------------- */
.listing-head { margin-bottom: 1.4rem; }
.listing-intro { max-width: 70ch; color: var(--ink-2); }
.subcats { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1.2rem; }
.subcats a { display: block; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; color: var(--ink-2); }
.sortbar { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.4rem; }
.sort { padding: .35rem .9rem; border-radius: 999px; font-size: .88rem; color: var(--muted); background: var(--bg-warm); }
.sort.is-active { background: var(--accent); color: #fff; }
.sort:hover { text-decoration: none; }

.pagination { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 2.4rem 0 0; }
.page {
    min-width: 42px; padding: .5rem .8rem; text-align: center; border-radius: 10px;
    border: 1px solid var(--line); color: var(--ink-2); font-size: .93rem;
}
.page:hover { border-color: var(--accent); text-decoration: none; }
.page.current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.page.gap { border: 0; }

/* --- Strona przepisu ------------------------------------------------ */
.recipe-top { display: grid; gap: 1.6rem; padding-top: 2.2rem; padding-bottom: 1.2rem; }
.recipe-intro .lead { font-size: 1.05rem; color: var(--ink-2); max-width: 60ch; }
.recipe-photo { margin: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.recipe-photo img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
@media (min-width: 900px) {
    .recipe-top { grid-template-columns: 1fr 1fr; align-items: center; gap: 2.5rem; }
}

.recipe-rating { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.rating-value { font-weight: 700; }
.rate-widget { display: inline-flex; margin-left: .4rem; }
.rate-btn { background: none; border: 0; cursor: pointer; font-size: 1.25rem; color: var(--line); padding: 0 1px; line-height: 1; }
.rate-btn:hover, .rate-btn.hot { color: #f0a500; }

.recipe-facts { display: flex; flex-wrap: wrap; gap: .8rem 1.8rem; margin: 0 0 1.2rem; padding: 1rem 1.2rem; background: var(--bg-warm); border-radius: var(--radius); }
.recipe-facts div { min-width: 90px; }
.recipe-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.recipe-facts dd { margin: .1rem 0 0; font-weight: 600; }

.recipe-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn {
    display: inline-block; padding: .65rem 1.3rem; border-radius: 999px; border: 1px solid var(--accent);
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-ghost { background: #fff; color: var(--accent-dark); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }

.recipe-body { display: grid; gap: 2.5rem; padding-bottom: 3rem; }
@media (min-width: 1000px) { .recipe-body { grid-template-columns: minmax(0, 1fr) 300px; } }

.ingredients { background: var(--accent-soft); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; margin-bottom: 2.2rem; }
.portions { display: inline-flex; align-items: center; gap: .55rem; background: #fff; border-radius: 999px; padding: .25rem .5rem; border: 1px solid var(--line); font-size: .9rem; }
.portion-btn { width: 27px; height: 27px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-dark); font-size: 1.05rem; cursor: pointer; line-height: 1; }
.portion-btn:hover { background: var(--accent); color: #fff; }
.ing-group { margin: 1.2rem 0 .4rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { border-bottom: 1px dashed rgba(0, 0, 0, .09); }
.ing-list li:last-child { border-bottom: 0; }
.ing-list label { display: flex; align-items: baseline; gap: .5rem; padding: .55rem 0; cursor: pointer; }
.ing-list input { margin: 0; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.ing-list input:checked ~ * { opacity: .45; text-decoration: line-through; }
.ing-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.ing-unit { font-weight: 600; }
.ing-name { color: var(--ink); }

.steps h2 { margin-bottom: 1rem; }
.step-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.step-list li { display: grid; grid-template-columns: 42px 1fr; gap: 1rem; padding-bottom: 1.5rem; }
.step-no {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: #fff; font-weight: 700; font-family: var(--font-display);
}
.step-text img { margin-top: .8rem; border-radius: var(--radius); }
.prose { max-width: 68ch; color: var(--ink-2); }
.recipe-notes { margin-top: 1rem; }
.source-note { margin-top: 2rem; padding: .9rem 1.1rem; background: var(--bg-warm); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; font-size: .9rem; color: var(--ink-2); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: 1.8rem 0 0; }
.tags a { display: block; padding: .3rem .8rem; background: var(--bg-warm); border-radius: 999px; font-size: .85rem; color: var(--ink-2); }

.recipe-side .side-list { display: flex; flex-direction: column; gap: .9rem; }
.side-item { display: grid; grid-template-columns: 88px 1fr; gap: .8rem; align-items: center; color: var(--ink); }
.side-item img { border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; }
.side-item:hover { text-decoration: none; color: var(--accent-dark); }

/* --- Komentarze ----------------------------------------------------- */
.comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comment { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { margin: 0 0 .3rem; font-size: .9rem; }
.comment-form { margin-top: 1.6rem; display: grid; gap: .9rem; max-width: 640px; }
.comment-form .row { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .comment-form .row { grid-template-columns: 1fr 1fr; } }
.comment-form label { display: grid; gap: .3rem; font-size: .88rem; color: var(--ink-2); font-weight: 600; }
.comment-form input, .comment-form textarea {
    font: inherit; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 400;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); outline: none; }
.comment-form button { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.notice { padding: .8rem 1rem; border-radius: var(--radius); font-size: .93rem; }
.notice.ok { background: #eaf6ec; color: #2c6b39; }
.notice.err { background: #fbeceb; color: #973229; }

/* --- Błąd ----------------------------------------------------------- */
.error-page { text-align: center; padding-top: 3.5rem; }
.error-code { font-family: var(--font-display); font-size: 5rem; line-height: 1; color: var(--accent); margin: 0; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: .35rem 0; }

/* --- Stopka --------------------------------------------------------- */
.site-footer { background: var(--bg-warm); border-top: 1px solid var(--line); margin-top: 3rem; padding: 2.6rem 0 1.4rem; }
.footer-grid { display: grid; gap: 1.8rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin: 0 0 .3rem; }
.site-footer h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--font); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: .2rem 0; }
.site-footer a { color: var(--ink-2); font-size: .93rem; }
.footer-exchange { margin-top: 1.6rem; font-size: .82rem; color: var(--muted); line-height: 2; }
.footer-exchange a { color: var(--muted); }
.footer-exchange a:hover { color: var(--accent-dark); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 1.8rem; padding-top: 1.1rem; font-size: .85rem; color: var(--muted); }
.footer-bottom p { margin: 0; }

@media print {
    .site-header, .site-footer, .breadcrumbs, .recipe-side, .comments, .recipe-actions, .sortbar, .pagination { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
