/* Ten plik dotyczy glownego ukladu strony przepisu:
   siatki z kolumna udostepniania, sticky boksem skladnikow
   i glownej kolumny tresci w single-recipe.html. */

/* ── Recipe Layout (Content + Sticky Sidebar) ───────────────── */
.recipe-layout {
    display: grid;
    gap: 24px;
    align-items: flex-start;
    grid-template-columns: 46px 360px minmax(0, 1fr);
    margin: 0 auto;
    max-width: 1260px;
    padding: 40px 0;
    position: relative;
}

.recipe-main {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
}

.recipe-main .recipe-section h2 {
    font-size: 1.2rem;
}

.recipe-sidebar--sticky {
    position: sticky;
    top: 30px;
    width: 360px;
    height: fit-content;
    flex-shrink: 0;
    grid-column: 2;
    grid-row: 1;
}

.recipe-share-rail {
    align-self: start;
    grid-column: 1;
    position: sticky;
    top: 30px;
}

.recipe-share-rail__list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.recipe-share-rail__link,
.recipe-share-rail__button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--c-border);
    color: var(--c-heading);
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.recipe-share-rail__button {
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.recipe-share-rail__link:hover,
.recipe-share-rail__link:focus-visible,
.recipe-share-rail__button:hover,
.recipe-share-rail__button:focus-visible {
    background: var(--c-heading);
    color: #fff;
    text-decoration: none;
}

.recipe-share-rail__link svg,
.recipe-share-rail__button svg {
    height: 16px;
    width: 16px;
}

/* Sticky behavior for ingredients sidebar */
.sticky-wrapper {
    position: static;
    padding: 20px 20px 20px 20px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 0;
}

.recipe-section--ingredients {
    margin: 0;
}

.recipe-section--ingredients h2 {
    margin-top: 0;
    margin-bottom: 12px;
    padding-top: 0;
    font-size: 1.2rem;
}

.ingredients-photo {
    border: 1px solid var(--c-border);
    border-radius: 8px;
    margin: 10px 0 12px;
    overflow: hidden;
}

.ingredients-photo img {
    aspect-ratio: 4 / 3;
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

/* ── Responsive: Tablet (≤1080px) ──────────────────────────── */
@media screen and (max-width: 980px) {
    .recipe-layout {
        display: flex;
        flex-direction: column;
        gap: 40px;
        padding: 40px 0;
    }

    .recipe-sidebar--sticky {
        position: relative;
        width: 100%;
        height: auto;
        flex-shrink: 1;
        order: 0;
    }

    .recipe-share-rail {
        display: none;
    }

    .sticky-wrapper {
        position: relative;
        top: auto;
        margin-top: 0;
    }
}

/* ── Responsive: Mobile (≤640px) ───────────────────────────── */
@media screen and (max-width: 640px) {
    .recipe-sidebar--sticky {
        order: -1;
    }

    .recipe-main {
        margin-top: 32px;
        order: 1;
    }

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