/* ===== Recipe Detail Page ===== */
.recipe-detail {
    padding: 2.5rem 2rem 1rem;
    max-width: 1240px;
    margin: var(--header-offset) auto 0;
}

.recipe-breadcrumb {
    margin-bottom: 1.6rem;
    font-size: 0.9rem;
    text-align: left;
}

.recipe-breadcrumb-trail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.recipe-breadcrumb-trail::-webkit-scrollbar {
    display: none;
}

.recipe-breadcrumb a {
    color: rgba(25, 25, 25, 0.68);
    text-decoration: none;
}

.recipe-breadcrumb a:hover {
    color: var(--ink);
}

.recipe-breadcrumb-separator {
    color: rgba(25, 25, 25, 0.5);
}

.recipe-breadcrumb-current {
    color: var(--ink);
    font-weight: 600;
    line-height: 1.2;
}

.recipe-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
    gap: 3.5rem;
    align-items: start;
    margin-bottom: 3rem;
}

.recipe-header {
    text-align: left;
    margin-bottom: 0;
    padding-top: 0.35rem;
}

.recipe-header h1 {
    font-family: var(--font-serif), var(--font-cjk);
    font-size: 3.25rem;
    line-height: 1.06;
    letter-spacing: -0.03em;
    margin-bottom: 1.15rem;
    text-wrap: balance;
}

.recipe-summary {
    max-width: 40rem;
    margin: 0 0 1.6rem;
    font-size: 1.08rem;
    line-height: 1.85;
    color: var(--ink-light);
    text-wrap: pretty;
}

.recipe-meta-bar {
    display: flex;
    justify-content: flex-start;
    gap: 0.85rem;
    flex-wrap: wrap;
    align-items: center;
}

.recipe-detail-stat {
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    padding: 0.56rem 0.95rem;
    border-radius: 18px;
    border: 1px solid rgba(196, 30, 58, 0.1);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 20px rgba(26, 26, 26, 0.035);
}

.recipe-detail-stat-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(196, 30, 58, 0.1);
    color: var(--vermillion);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recipe-detail-stat-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.recipe-detail-stat-copy {
    display: inline-flex;
    align-items: baseline;
    gap: 0.36rem;
    min-width: 0;
}

.recipe-detail-stat-value {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--ink);
}

.recipe-detail-stat-unit {
    font-size: 0.82rem;
    color: rgba(26, 26, 26, 0.66);
    line-height: 1.1;
    white-space: nowrap;
}

.recipe-detail-stat-favorites .recipe-detail-stat-copy {
    gap: 0.4rem;
    align-items: center;
}

.recipe-detail-stat-favorites {
    border-color: rgba(196, 30, 58, 0.26);
    background: linear-gradient(180deg, rgba(255, 241, 244, 0.98), rgba(255, 255, 255, 0.99));
    box-shadow: 0 12px 24px rgba(196, 30, 58, 0.08);
}

.recipe-detail-stat-favorites .recipe-detail-stat-icon {
    width: 2.15rem;
    height: 2.15rem;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 0 0 1px rgba(196, 30, 58, 0.14), 0 8px 16px rgba(196, 30, 58, 0.1);
}

.recipe-detail-stat-favorites .recipe-detail-stat-value {
    color: var(--ink);
}

.recipe-detail-stat-favorites .recipe-detail-stat-unit {
    color: rgba(26, 26, 26, 0.66);
    font-weight: 500;
}

.recipe-detail-stat-icon-button {
    padding: 0;
}

.recipe-detail-favorite-btn {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 0 0 1px rgba(196, 30, 58, 0.14), 0 8px 16px rgba(196, 30, 58, 0.1);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.recipe-detail-favorite-btn svg {
    width: 19px;
    height: 19px;
}

.recipe-detail-favorite-btn:hover,
.recipe-detail-favorite-btn:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 10px 18px rgba(196, 30, 58, 0.14);
}

.recipe-detail-favorite-btn.active {
    background: rgba(255, 241, 244, 0.98);
    box-shadow: inset 0 0 0 1px rgba(196, 30, 58, 0.22), 0 10px 18px rgba(196, 30, 58, 0.16);
}

.recipe-share {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.recipe-share-bottom {
    margin-top: 1.5rem;
}

.share-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.recipe-share-title {
    font-family: var(--font-serif), var(--font-cjk);
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--ink);
}

.recipe-share-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.recipe-share-link,
.recipe-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--white);
    position: relative;
    z-index: 1;
    font-family: inherit;
}

.recipe-share-link svg,
.recipe-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.recipe-share-link:hover,
.recipe-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.share-facebook {
    background: #1877f2;
}

.share-facebook:hover {
    background: #0d6ce8;
    color: var(--white);
}

.share-twitter {
    background: #0f1419;
}

.share-twitter:hover {
    background: #272c30;
    color: var(--white);
}

.share-pinterest {
    background: #e60023;
}

.share-pinterest:hover {
    background: #c7001f;
    color: var(--white);
}

.share-whatsapp {
    background: #25d366;
}

.share-whatsapp:hover {
    background: #1fb855;
    color: var(--white);
}

.share-copy {
    background: var(--ink-light);
    color: var(--white);
    border: none;
}

.share-copy:hover {
    background: var(--ink);
}

.recipe-share-btn.is-hidden {
    display: none;
}

.recipe-main-image {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(246, 242, 234, 0.9) 100%);
    border: 1px solid rgba(196, 30, 58, 0.06);
    border-radius: 22px;
    overflow: hidden;
    margin: 0;
    padding: 0.65rem;
    box-shadow: 0 18px 34px rgba(50, 36, 25, 0.08);
}

.recipe-main-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 16px;
}

.recipe-content-grid {
    display: grid;
    grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
    gap: 3.25rem;
    align-items: start;
}

.recipe-story-grid {
    grid-template-columns: 1fr;
    margin-bottom: 2rem;
}

.story-panel,
.ingredients-section,
.instructions-panel {
    background: var(--white);
    border: 1px solid rgba(196, 30, 58, 0.08);
    box-shadow: 0 18px 36px rgba(50, 36, 25, 0.06);
}

.story-panel,
.instructions-panel {
    padding: 2rem 2.2rem;
    border-radius: 24px;
}

.story-panel {
    border-left: 4px solid rgba(196, 30, 58, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 243, 0.92));
}

.story-panel .step-content {
    max-width: 72ch;
}

.story-panel .step-content p + p {
    margin-top: 0.9rem;
}

.ingredients-section {
    position: sticky;
    top: calc(var(--header-offset) + 1.5rem);
    padding: 1.95rem;
    border-radius: 22px;
    height: fit-content;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 243, 0.94));
}

.story-panel h3,
.ingredients-section h3,
.instructions-panel h3 {
    font-family: var(--font-serif), var(--font-cjk);
    font-size: 1.55rem;
    letter-spacing: -0.02em;
    margin-bottom: 1.35rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(196, 30, 58, 0.16);
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--paper-dark);
}

.ingredient-name {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 1rem;
}

.ingredient-amount {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: right;
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ingredient-item:last-child {
    border-bottom: none;
}

.instructions-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 243, 0.86));
}

.step {
    display: flex;
    gap: 1.1rem;
    margin-bottom: 0;
    padding: 1.15rem 0;
    border-bottom: 1px solid rgba(26, 26, 26, 0.06);
}

.step:first-of-type {
    padding-top: 0;
}

.step:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.step-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--vermillion);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 10px 18px rgba(196, 30, 58, 0.18);
}

.step-content h4 {
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    line-height: 1.35;
}

.step-content p {
    color: var(--ink-light);
    font-size: 0.98rem;
    line-height: 1.8;
}

.recipe-detail-nav {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.recipe-detail-nav-card {
    display: block;
    text-decoration: none;
    border: 1px solid var(--paper-dark);
    border-radius: 14px;
    background: var(--white);
    padding: 0.85rem 1rem;
    color: var(--ink);
}

.recipe-detail-nav-card strong {
    display: block;
    font-family: var(--font-serif), var(--font-cjk);
    font-size: 1.02rem;
    margin-top: 0.15rem;
}

.recipe-detail-nav-card-next {
    text-align: right;
}

.recipe-detail-nav-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-light);
    font-weight: 700;
}

.recipe-detail-nav-card:hover {
    border-color: var(--vermillion);
    box-shadow: 0 8px 16px rgba(196, 30, 58, 0.12);
}

.recipe-detail-nav-spacer {
    display: block;
}

.related-recipes {
    padding: 0 2rem 4rem;
    max-width: 1240px;
    margin: 0 auto;
}

.related-recipes-header {
    margin-bottom: 2rem;
}

.related-recipes-grid {
    max-width: none;
}

@media (max-width: 1024px) {
    .recipe-detail {
        max-width: 960px;
        padding: 1.75rem 1.5rem 0.85rem;
    }

    .recipe-share,
    .related-recipes {
        max-width: 960px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .recipe-hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 2.25rem;
    }

    .recipe-header {
        text-align: center;
        padding-top: 0;
    }

    .recipe-header h1 {
        font-size: 2.45rem;
        max-width: none;
    }

    .recipe-summary {
        max-width: 44rem;
        margin: 0 auto 1.2rem;
        font-size: 1.03rem;
    }

    .recipe-meta-bar {
        justify-content: center;
    }

    .recipe-detail-stat {
        padding: 0.54rem 0.85rem;
    }

    .recipe-main-image {
        padding: 0.6rem;
        border-radius: 20px;
    }

    .recipe-main-image img {
        max-height: 460px;
        border-radius: 15px;
    }

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

    .recipe-story-grid {
        gap: 1.25rem;
    }

    .story-panel,
    .ingredients-section,
    .instructions-panel {
        width: 100%;
        box-sizing: border-box;
    }

    .story-panel,
    .instructions-panel {
        padding: 1.7rem 1.8rem;
    }

    .ingredients-section {
        position: static;
        padding: 1.6rem;
    }

    .ingredient-item {
        gap: 1rem;
        align-items: start;
    }

    .instructions-section h3 {
        margin-bottom: 1.2rem;
    }

    .step {
        gap: 0.85rem;
    }

    .step-number {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .recipe-detail {
        padding: 1rem 1rem 0.75rem;
    }

    .recipe-share,
    .related-recipes {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .recipe-hero-grid {
        gap: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .recipe-main-image {
        padding: 0.38rem;
        border-radius: 16px;
        box-shadow: 0 12px 24px rgba(50, 36, 25, 0.07);
    }

    .recipe-main-image img {
        max-height: 360px;
        border-radius: 12px;
    }

    .recipe-header h1 {
        font-size: 1.95rem;
        margin-bottom: 0.85rem;
    }

    .recipe-summary {
        font-size: 0.98rem;
        line-height: 1.72;
        margin-bottom: 1rem;
    }

    .recipe-meta-bar {
        gap: 0.55rem;
        justify-content: flex-start;
    }

    .recipe-detail-stat {
        min-height: 2.7rem;
        gap: 0.52rem;
        padding: 0.48rem 0.66rem;
        border-radius: 16px;
    }

    .recipe-detail-stat-icon {
        width: 1.8rem;
        height: 1.8rem;
    }

    .recipe-detail-stat-icon svg {
        width: 16px;
        height: 16px;
    }

    .recipe-detail-stat-value {
        font-size: 0.94rem;
    }

    .recipe-detail-stat-unit {
        font-size: 0.78rem;
    }

    .recipe-content-grid {
        gap: 1.4rem;
    }

    .ingredient-item {
        align-items: flex-start;
    }

    .ingredient-name {
        flex: 0 1 40%;
        min-width: 0;
        padding-right: 0.85rem;
    }

    .ingredient-amount {
        flex: 1 1 60%;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.45;
        text-align: right;
    }

    .story-panel,
    .instructions-panel,
    .ingredients-section,
    .share-container {
        padding: 1.25rem;
    }

    .step {
        gap: 0.85rem;
        padding: 1rem 0;
    }

    .step-number {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }

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

    .recipe-detail-nav-card-next {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .recipe-breadcrumb {
        font-size: 0.8rem;
        line-height: 1.35;
        margin-bottom: 1.1rem;
    }

    .recipe-breadcrumb-trail {
        flex-wrap: wrap;
        overflow-x: visible;
        white-space: normal;
        gap: 0.25rem 0.45rem;
    }

    .recipe-breadcrumb a,
    .recipe-breadcrumb-separator {
        opacity: 0.72;
    }

    .recipe-breadcrumb-current {
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.45;
    }
}

@media (max-width: 420px) {
    .recipe-detail-stat-favorites .recipe-detail-stat-unit {
        display: none;
    }
}

html[dir="rtl"] .recipe-detail {
    text-align: right;
}

html[dir="rtl"] .recipe-breadcrumb {
    text-align: right;
}

html[dir="rtl"] .recipe-breadcrumb-trail {
    justify-content: flex-start;
}

html[dir="rtl"] .story-panel {
    border-left: 1px solid rgba(196, 30, 58, 0.08);
    border-right: 4px solid rgba(196, 30, 58, 0.22);
}

html[dir="rtl"] .ingredient-name {
    padding-right: 0;
    padding-left: 1rem;
}

html[dir="rtl"] .ingredient-amount {
    text-align: left;
}

@media (max-width: 768px) {
    html[dir="rtl"] .recipe-breadcrumb {
        text-align: right;
    }

    html[dir="rtl"] .recipe-breadcrumb-trail {
        justify-content: flex-start;
    }

    html[dir="rtl"] .ingredient-name {
        padding-right: 0;
        padding-left: 0.85rem;
    }

    html[dir="rtl"] .ingredient-amount {
        text-align: left;
    }
}

html[dir="rtl"] .step {
    flex-direction: row-reverse;
}

html[dir="rtl"] .step-content,
html[dir="rtl"] .recipe-detail-nav-card,
html[dir="rtl"] .recipe-detail-nav-card-next {
    text-align: right;
}
