/* Ten plik dotyczy wyłącznie tresci i komponentow strony przepisu:
    sekcji recipe, listy skladnikow, wskazowek, zrodla i lokalnych elementow single. */

/* ── Recipe Sections ────────────────────────────────────────── */
.recipe-section { margin-top: 40px; }
.recipe-section:first-of-type { margin-top: 0; }

.recipe-section h2 {
    color: var(--c-heading);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 18px;
    text-transform: uppercase;
}

/* ── Servings ───────────────────────────────────────────────── */
.recipe-servings {
    color: var(--c-meta);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.recipe-servings strong { color: var(--c-heading); }

/* ── Ingredients List ───────────────────────────────────────── */
.ingredients-list { padding: 0; }
.ingredients-list li { border-bottom: 1px solid var(--c-border); }
.ingredients-list li:first-child { border-top: 1px solid var(--c-border); }

.ingredient-row {
    align-items: center;
    cursor: pointer;
    display: grid;
    gap: 12px;
    grid-template-columns: 19px 1fr;
    padding: 10px 0;
}

.ingredient-check {
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #777777;
    border-radius: 50%;
    display: grid;
    height: 19px;
    margin: 0;
    place-items: center;
    width: 19px;
}

.ingredient-check::before {
    border-bottom: 2px solid #ffffff;
    border-right: 2px solid #ffffff;
    content: "";
    height: 10px;
    transform: rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.18s ease;
    width: 6px;
}

.ingredient-check:checked {
    background: var(--c-accent);
    border-color: var(--c-accent);
}

.ingredient-check:checked::before {
    transform: rotate(45deg) scale(1);
}

.ingredient-check:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

.ingredient-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.ingredient-text {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.ingredient-name {
    font-size: 0.95rem;
}

.ingredient-amount {
    color: #9a9a9a;
    font-size: 0.9rem;
}

.ingredient-note {
    color: var(--c-meta);
    display: block;
    font-size: 0.82rem;
    font-style: italic;
    line-height: 1.5;
    margin-top: 2px;
}

.ingredient-check:checked + .ingredient-content .ingredient-name,
.ingredient-check:checked + .ingredient-content .ingredient-amount,
.ingredient-check:checked + .ingredient-text .ingredient-name,
.ingredient-check:checked + .ingredient-text .ingredient-amount {
    color: #9a9a9a;
    text-decoration: line-through;
}

/* ── Ingredient section titles (sections mode) ─────────────── */
.ingredients-section-title {
    color: var(--c-meta);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    margin: 20px 0 6px;
    text-transform: uppercase;
}

/* First section title sits close below the servings line */
.recipe-servings + .ingredients-section-title {
    margin-top: 14px;
}

/* When multi-section: gap between end of one list and next title */
.ingredients-list + .ingredients-section-title {
    margin-top: 22px;
}

/* ── Tips ───────────────────────────────────────────────────── */
.recipe-tips {
    background: var(--c-tip-bg);
    border-left: 3px solid var(--c-heading);
    font-size: 0.95rem;
    line-height: 1.7;
    padding: 16px 20px;
}

/* ── Source ─────────────────────────────────────────────────── */
.recipe-section--source a { font-size: 0.9rem; word-break: break-all; }

/* ── Go4Taste Ads Strip ─────────────────────────────────────── */
.g4t-ads-strip { padding: 32px 0 56px; }

.g4t-ads-strip__top {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 20px;
}
.g4t-ads-strip__top h2 {
    color: var(--c-heading);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.g4t-ads { align-items: center; display: grid; gap: 10px; grid-template-columns: 38px 1fr 38px; }

.g4t-ads__nav {
    align-items: center;
    background: none;
    border: 1px solid var(--c-heading);
    color: var(--c-heading);
    cursor: pointer;
    display: flex;
    font-size: 1rem;
    height: 38px;
    justify-content: center;
    width: 38px;
}
.g4t-ads__nav:hover { background: var(--c-heading); color: #fff; }
.g4t-ads__nav:focus-visible { outline: 2px solid var(--c-accent); }

.g4t-ads__viewport { overflow: hidden; }

.g4t-ads__track {
    display: grid;
    gap: 20px;
    grid-auto-columns: minmax(180px, 1fr);
    grid-auto-flow: column;
    list-style: none;
    margin: 0;
    padding: 0;
    transition: transform 260ms ease;
    will-change: transform;
}

.g4t-product-card { min-width: 0; }

.g4t-product-card__link { color: var(--c-text); display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.g4t-product-card__link:hover .g4t-product-card__title { color: var(--c-accent); text-decoration: none; }

.g4t-product-card__figure { aspect-ratio: 1 / 1; margin-bottom: 10px; overflow: hidden; }
.g4t-product-card__image { height: 100%; object-fit: cover; transition: transform 300ms ease; width: 100%; }
.g4t-product-card__link:hover .g4t-product-card__image { transform: scale(1.04); }

.g4t-product-card__title { color: var(--c-heading); font-size: 0.85rem; font-weight: 700; line-height: 1.35; margin-bottom: 4px; }
.g4t-product-card__price { color: var(--c-meta); flex-grow: 1; font-size: 0.88rem; margin-bottom: 10px; }
.g4t-product-card__cta {
    background: var(--c-heading);
    color: #fff;
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    padding: 8px;
    text-align: center;
    text-transform: uppercase;
}
.g4t-product-card__link:hover .g4t-product-card__cta { background: var(--c-accent); }

/* ── Mobile Recipe Tabs ────────────────────────────────────── */
.mobile-recipe-tabs {
    display: none;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .mobile-recipe-tabs {
        backdrop-filter: blur(6px);
        background: #ffffff;
        border: 1px solid transparent;
        border-radius: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        opacity: 0;
        padding-bottom: 8px;
        padding-top: 8px;
        pointer-events: none;
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        transform: translateY(-6px);
        transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1), transform 460ms cubic-bezier(0.22, 1, 0.36, 1), border-color 360ms ease;
        z-index: 60;
    }

    .mobile-recipe-tabs.is-visible {
        border-color: var(--c-border);
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    body.theme-light .mobile-recipe-tabs {
        background: #ffffff;
        border-color: var(--c-border);
    }

    .mobile-recipe-tabs.is-sticky {
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    }

    body.theme-light .mobile-recipe-tabs.is-sticky {
        box-shadow: 0 8px 18px rgba(19, 43, 16, 0.16);
    }

    .mobile-recipe-tabs__button {
        background: #ffffff;
        border: 0;
        border-radius: 10px;
        color: var(--c-heading);
        cursor: pointer;
        font-family: var(--font-head);
        font-size: 0.92rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        min-height: 42px;
        padding: 8px 10px;
        transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
    }

    body.theme-light .mobile-recipe-tabs__button {
        background: #ffffff;
        color: var(--c-heading);
    }

    .mobile-recipe-tabs__button.is-active {
        background: #f1f6ec;
        border-color: #8ea884;
        box-shadow: inset 0 0 0 1px rgba(142, 168, 132, 0.22);
        color: #183013;
    }

    body.theme-light .mobile-recipe-tabs__button.is-active {
        background: #f5f8f1;
        border-color: #8ea884;
        box-shadow: inset 0 0 0 1px rgba(142, 168, 132, 0.2);
        color: #183013;
    }

    .mobile-recipe-tabs__button:focus-visible {
        outline: 2px solid var(--c-accent);
        outline-offset: 2px;
    }

    #sec-ingredients,
    #sec-preparation {
        scroll-margin-top: 86px;
    }

    .g4t-ads { grid-template-columns: 1fr; }
    .g4t-ads__nav { display: none; }
    .g4t-ads__viewport { overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
    .g4t-product-card { scroll-snap-align: start; }
}

@media print {
    @page {
        margin: 14mm;
    }

    body {
        background: #ffffff !important;
        color: #111111 !important;
    }

    .skip-link,
    .site-footer,
    .breadcrumb,
    .mobile-recipe-tabs,
    .recipe-share-rail,
    .g4t-ads-strip,
    .quick-actions-bar,
    .quick-actions-filter-panel {
        display: none !important;
    }

    .site-container,
    .recipe-hero__inner,
    .recipe-layout,
    .recipe-main,
    .recipe-sidebar--sticky {
        margin: 0 !important;
        max-width: none !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .site-header {
        background: #ffffff !important;
        border-bottom: 1px solid #cfcfcf !important;
        break-after: avoid-page;
        display: block !important;
        margin: 0 0 4mm !important;
        page-break-after: avoid;
    }

    .site-header .wrap {
        display: block !important;
        margin: 0 !important;
        max-width: none !important;
        padding: 0 0 2mm !important;
    }

    .title-area {
        text-align: left !important;
        width: auto !important;
    }

    .site-title img {
        width: min(180px, 100%) !important;
    }

    .header-widget-area,
    .hamburger-menu,
    .close-menu {
        display: none !important;
    }

    .recipe-hero,
    .recipe-hero--dark,
    body.theme-light .recipe-hero--dark,
    .sticky-wrapper,
    .step-item,
    .recipe-tips {
        background: #ffffff !important;
        box-shadow: none !important;
        color: #111111 !important;
    }

    .recipe-hero,
    .recipe-hero--dark {
        border: 0 !important;
        break-after: page;
        break-inside: avoid;
        margin: 0 !important;
        overflow: visible !important;
        page-break-after: always;
        page-break-inside: avoid;
    }

    .recipe-hero--dark::before {
        content: none !important;
    }

    .recipe-hero__inner,
    .recipe-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 6mm !important;
    }

    .recipe-layout {
        margin-top: 0 !important;
        page-break-before: auto;
    }

    .recipe-sidebar--sticky {
        break-before: auto;
        order: 0;
        height: auto !important;
        position: static !important;
        page-break-before: auto;
    }

    .recipe-main {
        order: 1;
    }

    .recipe-hero__visual,
    .recipe-hero__identity,
    .recipe-section,
    .step-item,
    .ingredient-item,
    .recipe-section--source,
    .recipe-section--ingredients,
    .recipe-section--preparation-box {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .ingredients-section-title {
        break-after: avoid;
        page-break-after: avoid;
    }

    .recipe-hero__title,
    .recipe-hero__lead,
    .recipe-hero__pill,
    .recipe-hero__time-label,
    .recipe-hero__time-value,
    .recipe-servings,
    .ingredient-name,
    .ingredient-amount,
    .ingredient-note,
    .step-title,
    .step-text,
    .step-tip,
    .recipe-section h2,
    .recipe-section--source a {
        color: #111111 !important;
    }

    .recipe-hero__pill,
    .recipe-hero__time,
    .step-item,
    .ingredients-list li,
    .sticky-wrapper,
    .ingredients-photo,
    .step-media {
        border-color: #cfcfcf !important;
    }

    .recipe-hero__tag {
        border-color: #cfcfcf !important;
        color: #111111 !important;
    }

    .ingredients-photo img,
    .step-media img {
        max-height: 70mm;
        object-fit: cover;
    }

    .recipe-hero__visual {
        align-self: flex-start;
        max-width: 100%;
        padding: 3mm !important;
        width: 100%;
    }

    .recipe-hero__figure {
        aspect-ratio: auto !important;
        height: 100mm;
        overflow: hidden !important;
    }

    .recipe-hero__figure img,
    .recipe-hero__visual img {
        height: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center center !important;
        width: 100% !important;
    }

    .sticky-wrapper {
        padding: 0 !important;
        border: 0 !important;
    }

    .recipe-section {
        margin-top: 8mm;
    }

    .recipe-section:first-of-type,
    .recipe-section--ingredients {
        margin-top: 0;
    }

    .recipe-section--preparation-box {
        break-before: page;
        page-break-before: always;
    }

    .step-item,
    .step-row,
    .step-content,
    .step-media,
    .ingredients-photo,
    .recipe-hero__visual,
    .recipe-hero__figure {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-column-break-inside: avoid;
    }

    .step-row,
    .step-content {
        display: block !important;
    }

    .step-check {
        display: none !important;
    }

    .step-title,
    .step-text,
    .step-tip {
        display: block !important;
    }

    .step-media,
    .ingredients-photo,
    .recipe-hero__figure {
        overflow: hidden !important;
    }

    .step-media img,
    .ingredients-photo img,
    .recipe-hero__visual img,
    .recipe-hero__figure img {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-column-break-inside: avoid;
        display: block !important;
    }

    .step-row,
    .ingredient-row {
        cursor: default;
    }

    .step-check,
    .ingredient-check {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .recipe-section--source a {
        text-decoration: none;
        word-break: break-word;
    }

    .recipe-section--source a::after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
    }
}
