/* =========================================================
   RECIPE WORLD — RECIPE DETAIL PAGE
   ========================================================= */


/* =========================================================
   PAGE
   ========================================================= */

.recipe-detail-page {
    min-height: 100vh;
    padding: 40px 0 90px;
}


/* =========================================================
   BACK NAVIGATION
   ========================================================= */

.recipe-back {
    margin-bottom: 28px;
}

.recipe-back a {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    color: #64748b;
    font-size: 14px;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.recipe-back a:hover {
    color: #f97316;
    transform: translateX(-3px);
}


/* =========================================================
   RECIPE HERO
   ========================================================= */

.recipe-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);

    gap: 50px;

    align-items: center;

    margin-bottom: 55px;
}


/* =========================================================
   RECIPE IMAGE
   ========================================================= */

.recipe-image-wrapper {
    position: relative;

    width: 100%;
    aspect-ratio: 16 / 11;

    overflow: hidden;

    border-radius: 28px;

    background: #f1f5f9;

    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.12);
}

.detail-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.6s ease;
}

.recipe-image-wrapper:hover .detail-image {
    transform: scale(1.04);
}


/* =========================================================
   IMAGE PLACEHOLDER
   ========================================================= */

.recipe-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    font-size: 70px;

    background:
        linear-gradient(
            135deg,
            #fff7ed,
            #ffedd5
        );
}


/* =========================================================
   RECIPE INFO
   ========================================================= */

.recipe-info {
    min-width: 0;
}

.recipe-category {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 8px 14px;

    margin-bottom: 18px;

    border-radius: 999px;

    background: #fff7ed;
    color: #ea580c;

    font-size: 13px;
    font-weight: 700;

    border: 1px solid #fed7aa;
}

.recipe-info h1 {
    margin: 0 0 18px;

    color: #0f172a;

    font-size: clamp(34px, 4vw, 58px);
    line-height: 1.08;

    letter-spacing: -1.8px;

    font-weight: 800;
}


/* =========================================================
   DESCRIPTION
   ========================================================= */

.recipe-description {
    max-width: 620px;

    margin: 0 0 30px;

    color: #64748b;

    font-size: 16px;
    line-height: 1.8;
}

.recipe-description strong {
    color: #334155;
}


/* =========================================================
   RECIPE META
   ========================================================= */

.recipe-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 14px;
}

.meta-item {
    display: flex;
    align-items: center;

    gap: 11px;

    min-width: 150px;

    padding: 13px 15px;

    border-radius: 14px;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    box-shadow:
        0 8px 24px rgba(15, 23, 42, 0.05);
}

.meta-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    flex-shrink: 0;

    border-radius: 11px;

    background: #fff7ed;

    font-size: 18px;
}

.meta-label {
    display: block;

    margin-bottom: 3px;

    color: #94a3b8;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-item strong {
    color: #1e293b;

    font-size: 14px;
    font-weight: 700;
}


/* =========================================================
   CONTENT GRID
   ========================================================= */

.recipe-content-grid {
    display: grid;

    grid-template-columns:
        minmax(280px, 0.8fr)
        minmax(0, 1.2fr);

    gap: 28px;

    align-items: start;

    margin-bottom: 35px;
}


/* =========================================================
   CARDS
   ========================================================= */

.ingredients-card,
.instructions-card {
    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 24px;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.06);
}

.ingredients-card {
    position: sticky;
    top: 25px;

    overflow: hidden;
}

.instructions-card {
    overflow: hidden;
}


/* =========================================================
   SECTION HEADING
   ========================================================= */

.section-heading {
    display: flex;
    align-items: center;

    gap: 14px;

    padding: 25px 27px;

    border-bottom: 1px solid #f1f5f9;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    flex-shrink: 0;

    border-radius: 14px;

    background: #fff7ed;

    font-size: 22px;
}

.section-heading h2 {
    margin: 0 0 3px;

    color: #0f172a;

    font-size: 21px;
    line-height: 1.2;

    font-weight: 800;

    letter-spacing: -0.4px;
}

.section-heading p {
    margin: 0;

    color: #94a3b8;

    font-size: 13px;
    line-height: 1.4;
}


/* =========================================================
   INGREDIENTS SCROLL
   ========================================================= */

.ingredients-scroll {
    max-height: 430px;

    overflow-y: auto;

    padding: 12px 25px 20px;

    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.ingredients-scroll::-webkit-scrollbar {
    width: 6px;
}

.ingredients-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.ingredients-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;

    border-radius: 999px;
}

.ingredients-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}


/* =========================================================
   INGREDIENT LIST
   ========================================================= */

.ingredients-list {
    list-style: none;

    margin: 0;
    padding: 0;
}

.ingredients-list li {
    display: flex;
    align-items: flex-start;

    gap: 11px;

    padding: 13px 4px;

    color: #475569;

    font-size: 14px;
    line-height: 1.55;

    border-bottom: 1px solid #f1f5f9;
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.ingredient-check {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    flex-shrink: 0;

    margin-top: 1px;

    border-radius: 50%;

    background: #fff7ed;

    color: #f97316;

    font-size: 12px;
    font-weight: 800;
}


/* =========================================================
   INGREDIENT SCROLL HINT
   ========================================================= */

.ingredients-scroll-hint {
    padding: 12px 25px 18px;

    text-align: center;

    color: #f97316;

    font-size: 12px;
    font-weight: 700;

    border-top: 1px solid #f1f5f9;

    background: #fffbeb;
}


/* =========================================================
   INSTRUCTIONS
   ========================================================= */

.instructions {
    padding: 28px 30px 32px;
}

.instructions p {
    margin: 0 0 17px;

    color: #475569;

    font-size: 15px;
    line-height: 1.85;
}

.instructions p:last-child {
    margin-bottom: 0;
}


/*
   Django |linebreaks output
   creates paragraphs and <br> tags.
*/

.instructions p {
    position: relative;
}


/* =========================================================
   VIDEO HINT
   ========================================================= */

.video-hint {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    margin: 28px 0 15px;

    color: #f97316;

    font-size: 13px;
    font-weight: 700;
}

.video-arrow {
    font-size: 17px;

    animation: videoArrow 1.5s ease-in-out infinite;
}

@keyframes videoArrow {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}


/* =========================================================
   VIDEO SECTION
   ========================================================= */

.recipe-video-section {
    margin-top: 15px;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 24px;

    box-shadow:
        0 12px 35px rgba(15, 23, 42, 0.06);
}

.recipe-video-wrapper {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    background: #0f172a;
}

.recipe-video-wrapper iframe {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


/* =========================================================
   ORIGINAL RECIPE
   ========================================================= */

.source-section {
    display: flex;
    justify-content: center;

    margin-top: 35px;
}

.source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 13px 21px;

    border-radius: 12px;

    background: #f8fafc;

    border: 1px solid #e2e8f0;

    color: #475569;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.source-link:hover {
    background: #fff7ed;

    border-color: #fed7aa;

    color: #ea580c;

    transform: translateY(-2px);
}


/* =========================================================
   BOTTOM NAVIGATION
   ========================================================= */

.recipe-bottom-navigation {
    display: flex;
    justify-content: center;

    margin-top: 35px;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;

    padding: 0 24px;

    border-radius: 13px;

    background: #f97316;

    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    text-decoration: none;

    box-shadow:
        0 10px 25px rgba(249, 115, 22, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.primary-button:hover {
    background: #ea580c;

    transform: translateY(-2px);

    box-shadow:
        0 14px 30px rgba(249, 115, 22, 0.28);
}

.primary-button:active {
    transform: translateY(0);
}


/* =========================================================
   NOT FOUND
   ========================================================= */

.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 520px;

    padding: 50px 25px;

    text-align: center;

    background: #ffffff;

    border: 1px solid #e2e8f0;

    border-radius: 28px;

    box-shadow:
        0 15px 40px rgba(15, 23, 42, 0.06);
}

.not-found-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 90px;
    height: 90px;

    margin-bottom: 24px;

    border-radius: 50%;

    background: #fff7ed;

    font-size: 40px;
}

.not-found h1 {
    margin: 0 0 12px;

    color: #0f172a;

    font-size: 32px;
    font-weight: 800;

    letter-spacing: -0.8px;
}

.not-found p {
    margin: 0 0 28px;

    color: #64748b;

    font-size: 15px;
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .recipe-hero {
        grid-template-columns: 1fr;

        gap: 32px;
    }

    .recipe-image-wrapper {
        aspect-ratio: 16 / 10;
    }

    .recipe-info {
        max-width: 760px;
    }

    .recipe-content-grid {
        grid-template-columns: 1fr;
    }

    .ingredients-card {
        position: static;
    }

    .ingredients-scroll {
        max-height: 360px;
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .recipe-detail-page {
        padding: 25px 0 60px;
    }

    .recipe-back {
        margin-bottom: 20px;
    }

    .recipe-hero {
        gap: 25px;

        margin-bottom: 35px;
    }

    .recipe-image-wrapper {
        aspect-ratio: 4 / 3;

        border-radius: 20px;

        box-shadow:
            0 12px 30px rgba(15, 23, 42, 0.10);
    }

    .recipe-info h1 {
        font-size: 36px;

        letter-spacing: -1px;
    }

    .recipe-description {
        font-size: 14px;
        line-height: 1.7;
    }

    .recipe-meta {
        display: grid;

        grid-template-columns: 1fr 1fr;

        gap: 10px;
    }

    .meta-item {
        min-width: 0;

        padding: 11px;
    }

    .meta-icon {
        width: 35px;
        height: 35px;

        font-size: 16px;
    }

    .meta-label {
        font-size: 9px;
    }

    .meta-item strong {
        font-size: 12px;
    }

    .recipe-content-grid {
        gap: 18px;
    }

    .ingredients-card,
    .instructions-card,
    .recipe-video-section {
        border-radius: 20px;
    }

    .section-heading {
        padding: 20px;
    }

    .section-icon {
        width: 42px;
        height: 42px;

        border-radius: 12px;

        font-size: 19px;
    }

    .section-heading h2 {
        font-size: 18px;
    }

    .section-heading p {
        font-size: 11px;
    }

    .ingredients-scroll {
        max-height: 350px;

        padding: 8px 20px 15px;
    }

    .ingredients-list li {
        font-size: 13px;

        padding: 11px 2px;
    }

    .instructions {
        padding: 22px 20px 25px;
    }

    .instructions p {
        font-size: 14px;

        line-height: 1.75;
    }

    .video-hint {
        margin-top: 22px;
    }

    .recipe-video-section {
        margin-top: 10px;
    }

    .source-section {
        margin-top: 25px;
    }

    .source-link {
        width: 100%;
    }

    .recipe-bottom-navigation {
        margin-top: 25px;
    }

    .primary-button {
        width: 100%;

        padding: 0 18px;
    }

    .not-found {
        min-height: 420px;

        border-radius: 20px;
    }

    .not-found h1 {
        font-size: 27px;
    }
}


/* =========================================================
   RESPONSIVE — SMALL PHONES
   ========================================================= */

@media (max-width: 400px) {

    .recipe-info h1 {
        font-size: 31px;
    }

    .recipe-meta {
        grid-template-columns: 1fr;
    }

    .meta-item {
        width: 100%;
    }

    .section-heading {
        gap: 11px;
    }

    .section-icon {
        width: 38px;
        height: 38px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}