/* ==========================================================
   DIGBANG SINGLE RECIPE — PAGE LAYOUT
========================================================== */

.db-recipe-page {
    width: 100%;
    direction: rtl;
}

.db-recipe-page__layout {
    display: grid;
    grid-template-columns: 336px minmax(0, 896px);
    column-gap: 88px;
    align-items: start;

    width: calc(100% - 40px);
    max-width: 1320px;
    margin-inline: auto;

    direction: ltr;
}

/* ==========================================================
   SIDEBAR
========================================================== */

.db-recipe-page__sidebar {
    grid-column: 1;

    width: 336px;
    min-width: 0;

    direction: rtl;
    padding-top: 237px;
}

/*
 * فعلاً Sticky غیرفعال است تا کل ستون چپ
 * با اسکرول عادی صفحه دیده شود.
 */
.db-recipe-page__sidebar-sticky {
    position: relative;

    width: 336px;
    height: auto;
    max-height: none;

    box-sizing: border-box;

    overflow: visible;
    padding: 0;
}

.db-recipe-sidebar {
    display: flex;
    flex-direction: column;

    width: 336px;
}

/* ==========================================================
   SIDEBAR BANNER
========================================================== */

.db-recipe-sidebar > .db-recipe-side-banner {
    position: relative;

    display: block;
    flex: 0 0 auto;

    width: 336px;
    height: 430px;
    margin: 0;

    overflow: hidden;

    border-radius: 16px;

    text-decoration: none;
}

.db-recipe-sidebar .db-recipe-side-banner__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.db-recipe-sidebar .db-recipe-side-banner__button {
    position: absolute;

    right: 80.37px;
    bottom: 32.72px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 175px;
    height: 35px;
    padding: 0;

    box-sizing: border-box;

    color: #FFFFFF;
    background: #CC5200;

    border-radius: 8px;

    font-family: Vazirmatn, sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    white-space: nowrap;

    transition: background-color 0.25s ease;
}

.db-recipe-sidebar
.db-recipe-side-banner:hover
.db-recipe-side-banner__button,
.db-recipe-sidebar
.db-recipe-side-banner:focus-visible
.db-recipe-side-banner__button {
    color: #FFFFFF;
    background: #FF8533;
}

/* ==========================================================
   RELATED PRODUCTS IN SIDEBAR
========================================================== */

.db-recipe-sidebar .db-recipe-related-products {
    display: block !important;
    flex: 0 0 auto;

    width: 336px !important;
    max-width: none !important;

    margin: 56px 0 0 !important;

    direction: rtl;
}

.db-recipe-sidebar .db-recipe-related-products__container {
    width: 336px !important;
    max-width: none !important;

    margin: 0 !important;
}

.db-recipe-sidebar .db-recipe-related-products__title {
    margin: 0;

    color: #8E7D71;

    font-family: Vazirmatn, sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;

    text-align: right;
}

.db-recipe-sidebar .db-recipe-related-products__list {
    display: flex;
    flex-direction: column;
    gap: 24px;

    width: 336px !important;
    margin-top: 32px;
}

.db-recipe-sidebar .db-related-product-card {
    display: flex !important;
    flex: 0 0 auto;

    width: 336px !important;
    min-height: 386.62px;
}

/* ==========================================================
   MAIN COLUMN
========================================================== */

.db-recipe-page__main {
    grid-column: 2;

    width: 896px;
    min-width: 0;

    direction: rtl;
}

/*
 * بنر قدیمی داخل hero.php مخفی می‌شود،
 * چون بنر اصلی داخل Sidebar قرار گرفته است.
 */
.db-recipe-page__main .db-recipe-side-banner {
    display: none !important;
}

/* ==========================================================
   HERO INSIDE MAIN COLUMN
========================================================== */

.db-recipe-page__main .db-recipe-hero {
    width: 100%;
}

.db-recipe-page__main .db-recipe-hero__container {
    width: 100%;
    max-width: none;

    margin-inline: 0;
}

.db-recipe-page__main .db-recipe-hero__media-grid {
    display: block;

    width: 100%;
    margin-top: 55px;

    direction: rtl;
}

.db-recipe-page__main .db-recipe-hero__main-column {
    width: 100%;
    min-width: 0;
}

.db-recipe-page__main .db-recipe-featured-image {
    width: 100%;
}

.db-recipe-page__main .db-recipe-excerpt {
    width: 100%;
}

/* ==========================================================
   MAIN CONTENT SECTIONS
========================================================== */

.db-recipe-page__main .db-recipe-ingredients,
.db-recipe-page__main .db-recipe-second-image,
.db-recipe-page__main .db-recipe-steps,
.db-recipe-page__main .db-recipe-third-image,
.db-recipe-page__main .db-recipe-tips,
.db-recipe-page__main .db-recipe-products-banner {
    display: block;

    width: 100%;
    max-width: none;

    margin-inline: 0;

    direction: rtl;
}

.db-recipe-page__main .db-recipe-ingredients__container,
.db-recipe-page__main .db-recipe-second-image__container,
.db-recipe-page__main .db-recipe-steps__container,
.db-recipe-page__main .db-recipe-third-image__container,
.db-recipe-page__main .db-recipe-tips__container,
.db-recipe-page__main .db-recipe-products-banner__container {
    width: 100%;
    max-width: none;

    margin-inline: 0;
}

.db-recipe-page__main .db-recipe-second-image__figure,
.db-recipe-page__main .db-recipe-third-image__figure,
.db-recipe-page__main .db-recipe-products-banner__link {
    width: 100%;
}

/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1399px) {

    .db-recipe-page__layout {
        grid-template-columns:
            minmax(260px, 336px)
            minmax(0, 1fr);

        column-gap: 40px;
    }

    .db-recipe-page__sidebar,
    .db-recipe-page__sidebar-sticky,
    .db-recipe-sidebar {
        width: 100%;
    }

    .db-recipe-page__main {
        width: 100%;
    }

    .db-recipe-sidebar > .db-recipe-side-banner,
    .db-recipe-sidebar .db-recipe-related-products,
    .db-recipe-sidebar .db-recipe-related-products__container,
    .db-recipe-sidebar .db-recipe-related-products__list {
        width: 100% !important;
    }

    .db-recipe-sidebar .db-related-product-card {
        width: 100% !important;
        max-width: 336px;
    }

    .db-recipe-sidebar .db-recipe-side-banner__button {
        right: 50%;
        transform: translateX(50%);
    }
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 900px) {

    .db-recipe-page__layout {
        display: flex;
        flex-direction: column;

        width: calc(100% - 32px);

        direction: rtl;
    }

    .db-recipe-page__main {
        order: 1;

        width: 100%;
    }

    .db-recipe-page__sidebar {
        order: 2;

        width: 100%;
        margin-top: 40px;
    }

    .db-recipe-page__sidebar-sticky {
        position: static;

        width: 100%;
        height: auto;
        max-height: none;

        overflow: visible;
    }

    .db-recipe-sidebar {
        width: 100%;
    }

    .db-recipe-sidebar > .db-recipe-side-banner {
        width: 100%;
        max-width: 336px;
        height: auto;
        aspect-ratio: 336 / 430;

        margin-inline: auto;
    }

    .db-recipe-sidebar .db-recipe-related-products {
        width: 100% !important;
        margin-top: 40px !important;
    }

    .db-recipe-sidebar .db-recipe-related-products__container,
    .db-recipe-sidebar .db-recipe-related-products__list {
        width: 100% !important;
    }

    .db-recipe-sidebar .db-recipe-related-products__title {
        font-size: 26px;
    }

    .db-recipe-sidebar .db-recipe-related-products__list {
        align-items: center;
        margin-top: 24px;
    }

    .db-recipe-sidebar .db-related-product-card {
        width: 100% !important;
        max-width: 336px;
    }
}