/* ========================================
   Rezepte Mask Element
   ======================================== */

/* Container */
.frame-layout-recipe {
    padding: 50px 0;
    max-width: 1672px;
    margin: 0 auto;
}

/* ========================================
   Content Wrapper - 2 Spalten mit Overlap
   13-Spalten Grid
   ======================================== */

.recipe-content-wrapper {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 0;
    align-items: start;
    position: relative;
    max-width: 1441px;
    margin: 0 auto;
}

/* ========================================
   NORMAL: Spalte 1 LINKS, Spalte 2 RECHTS
   ======================================== */

/* Spalte 1: Header + Bild (6 Spalten, Grid 1-6) */
.recipe-column-left {
    grid-column: 1 / 7;
    grid-row: 1;
    z-index: 2; /* ✅ Bild im Vordergrund */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Spalte 2: Content (9 Spalten, Grid 6-13 mit Overlap) */
.recipe-column-right {
    grid-column: 6 / 14;
    grid-row: 1;
    z-index: 1; /* Unter Bild */
    position: relative;
}

/* ========================================
   Header (oben in Spalte 1)
   ======================================== */

.recipe-header {
    margin: 0;
}

.recipe-title {
    font-size: 2.25rem;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 22px;
    color: #000000;
}

.recipe-subtitle {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.8;
    color: #000000;
}

/* SPIEGELVERKEHRT: Header rechts */
.frame-layout-recipe.recipe-mirror .recipe-header {
    text-align: right;
}

/* ========================================
   Bild (horizontal zentriert zu Spalte 2)
   ======================================== */

.recipe-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 546px;
    position: relative;
    z-index: 2;
}

.recipe-figure {
    margin: 0;
    padding: 0;
    width: 100%;
}

.recipe-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   SPIEGELVERKEHRT: Spalte 2 LINKS, Spalte 1 RECHTS
   ======================================== */

.frame-layout-recipe.recipe-mirror .recipe-column-left {
    grid-column: 8 / 14; /* Rechts: Grid 8-13 (6 Spalten) */
    order: 2; /* Rechts anordnen */
}

.frame-layout-recipe.recipe-mirror .recipe-column-right {
    grid-column: 1 / 9; /* Links: Grid 1-8 (8 Spalten) */
    order: 1; /* Links anordnen */
    margin-left: 0;
    margin-right: 0;
}

/* ========================================
   Tabs (einmalig oben rechts)
   ======================================== */

.recipe-tabs {
    position: absolute;
    top: 30px;
    right: 60px;
    display: flex;
    flex-wrap: nowrap; /* Kein Umbruch */
    align-items: baseline; /* Baseline für bessere Ausrichtung */
    gap: 0; /* Kein Gap, Slash regelt Abstand */
    z-index: 10;
    white-space: nowrap; /* Verhindert Zeilenumbruch */
}

/* SPIEGELVERKEHRT: Tabs oben links */
.frame-layout-recipe.recipe-mirror .recipe-tabs {
    right: auto;
    left: 60px;
}

.recipe-tab {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.3s ease;
    font-size: 1.75rem;
    color: #000000;
    font-weight: 200;
    line-height: 1;
    display: inline-block;
}

.recipe-tab-number {
    display: inline-block;
    line-height: 1;
}

/* Active Tab */
.recipe-tab-active .recipe-tab-number {
    color: #e73331;
    font-weight: 200;
    display: none;
}

/* Hover State */
.recipe-tab:hover .recipe-tab-number {
    color: #e73331;
}

/* Slash between tabs - IN EINER ZEILE */
/*
.recipe-tabs .recipe-tab:not(:last-child)::after {
    content: ' / ';
    margin: 0 8px;
    color: #000000;
    font-weight: 200;
    display: inline;
}*/

/* ========================================
   Toggle Container (Page-1 und Page-2)
   ======================================== */

.recipe-toggle-container {
    position: relative;
    min-height: 594px;
}

/* Pages (beide 594px Höhe) */
.recipe-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Active Page */
.recipe-page-active {
    display: block;
    opacity: 1;
}

/* Textboxen (beide Pages) */
.recipe-textbox {
    background: #f5f1e9;
    padding: 80px 60px 60px 175px;
    border-radius: 8px;
    height: 594px;
    overflow-y: hidden;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
}

.frame-layout-recipe.recipe-mirror .recipe-textbox {
    padding: 80px 175px 60px 60px;
    /* Oben Rechts(175) Unten Links(60) */
}

/* ========================================
   Text Styling (Page-1)
   ======================================== */

.recipe-text {
    font-size: 1.25rem;
    font-weight: 200;
    line-height: 1.8;
    color: #000000;
    margin-bottom: 24px;
}

.recipe-text h2 {
    font-size: 2.25rem;
    font-weight: 200;
    line-height: 1.3;
    color: #000000;
    margin: 66px 0 16px 0;
}

.recipe-text p {
    margin: 0 0 16px 0;
}

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

.recipe-text strong {
    font-weight: 700;
}

/* ========================================
   Zutaten-Tabelle (Page-2)
   ======================================== */

.recipe-ingredients h2 {
    font-size: 2.25rem;
    font-weight: 200;
    line-height: 1.3;
    color: #000000;
    margin: 66px 0 16px 0;
}

.recipe-ingredients table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    margin: 0;
    background: transparent;
    border: none;

}

.recipe-ingredients table th {
    text-align: left;
    padding: 4px 12px;
    background: transparent;
    font-weight: 700;
    font-size: 1.25rem;
    color: #000000;
    border: none;
    border-bottom: none;
}

.recipe-ingredients table td {
    padding: 4px 12px;
    font-size: 1.25rem;
    font-weight: 200;
    background: transparent;
    border: none;
    border-bottom: none;
    color: #000000;
}

.recipe-ingredients table td strong {
    font-weight: 700;
}

.recipe-ingredients table tr {
    background: transparent;
    border: none;
}

.recipe-ingredients table tr:last-child td {
    border-bottom: none;
}

/* ========================================
   Actions Box (12px unter Toggle)
   ======================================== */

.recipe-actions {
    background: #f5f1e9;
    padding: 30px 60px 30px 175px;
    border-radius: 8px;
    margin-top: -50px;
    min-height: 120px;
}

.frame-layout-recipe.recipe-mirror .recipe-actions {
    padding: 30px 175px 30px 60px;
    /* Oben Rechts(175) Unten Links(60) */
}

.recipe-footer-text {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 45px 0 16px 0;
    color: #000000;
}

.recipe-button {
    display: inline-block;
    background: #e73331;
    color: #ffffff;
    padding: 11px 48px;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e73331;
    margin: 0 0 25px 0;
}

.recipe-button:hover {
    color: #e73331;
    background-color: transparent;
    border-color: #e73331;
}

.recipe-button:active {
    transform: scale(0.98);
}

/* ========================================
   Scrollbar Styling
   ======================================== */

.recipe-textbox::-webkit-scrollbar {
    width: 8px;
}

.recipe-textbox::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.recipe-textbox::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.recipe-textbox::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ========================================
   Responsive - Desktop
   ======================================== */

@media (max-width: 1400px) {
    .recipe-content-wrapper {
        max-width: 1200px;
    }

    .recipe-title {
        font-size: 2.5rem;
    }

    .recipe-subtitle {
        font-size: 1.25rem;
    }

    .recipe-textbox {
        padding: 50px;
        padding-top: 70px;
    }

    .recipe-tabs {
        top: 25px;
        right: 50px;
    }

    .frame-layout-recipe.recipe-mirror .recipe-tabs {
        right: auto;
        left: 50px;
    }

    .recipe-actions {
        padding: 25px 50px;
    }

    .recipe-column-left {
        grid-column: 1 / 6;
    }

    .frame-layout-recipe.recipe-mirror .recipe-column-left {
        grid-column: 9 / 14;
    }
}

@media (max-width: 1200px) {
    .recipe-content-wrapper {
        max-width: 1100px;
    }

    .recipe-title {
        font-size: 2.25rem;
    }

    .recipe-textbox {
        padding: 40px;
        padding-top: 60px;
        height: 650px;
    }

    .recipe-text,
    .recipe-ingredients table td {
        /*   font-size: 1.1rem;*/
    }

    .recipe-footer-text {
        /*   font-size: 1.1rem;*/
    }

    .recipe-ingredients table th,
    .recipe-ingredients table td {
        padding: 1px 12px;
    }

    .recipe-toggle-container {
        min-height: 650px;
    }

    .recipe-image-wrapper {
        min-height: calc(650px + 12px + 120px);
    }

    .recipe-tabs {
        top: 70px;
        right: 40px;
    }

    .frame-layout-recipe.recipe-mirror .recipe-tabs {
        right: auto;
        left: 40px;
    }

    .recipe-text h2,
    .recipe-ingredients h2 {
        font-size: 1.75rem;
    }

    .recipe-actions {
        padding: 20px 40px;
    }

    /* Weniger Overlap */
    .recipe-column-right {
        grid-column: 6 / 14;
    }

    .frame-layout-recipe.recipe-mirror .recipe-column-right {
        grid-column: 1 / 9;
    }
}

/* ========================================
   Responsive - Tablet
   ======================================== */

@media (max-width: 991px) {
    .frame-layout-recipe {
        padding: 60px 0;
    }

    /* Stack Layout - Kein Grid */
    .recipe-content-wrapper {
        display: flex;
        flex-direction: column;
        gap: 30px;
        padding-left: 30px;
    }

    .recipe-column-left,
    .recipe-column-right {
        grid-column: auto;
        grid-row: auto;
        z-index: auto;
        max-width: 100%;
    }

    .recipe-column-left {
        order: 1;
    }

    .recipe-column-right {
        order: 2;
    }

    .recipe-image-wrapper {
        min-height: auto;
    }

    /* SPIEGELVERKEHRT auf Tablet: Gleich wie Normal */
    .frame-layout-recipe.recipe-mirror .recipe-header {
        text-align: left;
    }

    .frame-layout-recipe.recipe-mirror .recipe-tabs {
        left: auto;
        right: 40px;
        top: 70px;
    }

    /* Spalten: Grid und Order zurücksetzen */
    .frame-layout-recipe.recipe-mirror .recipe-column-left {
        grid-column: auto;
        order: 1;
    }

    .frame-layout-recipe.recipe-mirror .recipe-column-right {
        grid-column: auto;
        order: 2;
        margin-left: 0;
        margin-right: 0;
    }

    /* Textbox: Padding zurücksetzen (symmetrisch) */
    .frame-layout-recipe.recipe-mirror .recipe-textbox {
        padding: 40px;
        padding-top: 60px;
    }

    /* Actions: Padding zurücksetzen (symmetrisch) */
    .frame-layout-recipe.recipe-mirror .recipe-actions {
        padding: 25px 40px;
    }

    /* Pages nicht absolut auf Tablet */
    .recipe-toggle-container {
        min-height: auto;
    }

    .recipe-page {
        position: relative;
    }

    .recipe-text,
    .recipe-ingredients table td {
        font-size: 1.125rem;
    }

    .recipe-footer-text {
        font-size: 1.125rem;
    }

    .recipe-textbox {
        height: auto;
        min-height: 450px;
        width: 100%;
        box-sizing: border-box;
    }

    .recipe-title {
        font-size: 2rem;
    }

    .recipe-subtitle {
        font-size: 1.125rem;
    }

    .recipe-tab {
        font-size: 1.25rem;
    }
}

/* ========================================
   Responsive - Mobile
   ======================================== */

@media (max-width: 768px) {
    .frame-layout-recipe {
        padding: 40px 0;
    }

    .recipe-content-wrapper {
        padding: 0 20px;
    }

    .recipe-title {
        font-size: 1.75rem;
    }

    .recipe-subtitle {
        font-size: 1rem;
    }

    .recipe-textbox {
        padding: 40px 30px;
        padding-top: 60px;
        min-height: 500px;
        width: 100%;
        box-sizing: border-box;
    }

    .recipe-tabs {
        right: 30px;
        top: 70px;
    }


    .frame-layout-recipe.recipe-mirror .recipe-tabs {
        left: auto;
        right: 30px;
    }


    .frame-layout-recipe.recipe-mirror .recipe-actions {
        padding: 20px 30px;
    }

    .recipe-text h2,
    .recipe-ingredients h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
    }

    .recipe-text,
    .recipe-ingredients table td {
        font-size: 1.1rem;
    }

    .recipe-footer-text {
        font-size: 1.1rem;
    }

    .recipe-button {
        width: 100%;
        text-align: center;
        font-size: 1.125rem;
    }

    .recipe-tab {
        font-size: 1.4rem;
    }

    .recipe-actions {
        padding: 20px 30px;
    }
}

@media (max-width: 576px) {
    .recipe-title {
        font-size: 1.5rem;
    }

    .recipe-subtitle {
        font-size: 0.9375rem;
    }

    .recipe-textbox {
        padding: 30px 25px;
        padding-top: 55px;
    }

    .recipe-tabs {
        top: 70px;
        right: 25px;
    }

    /* Mirror: Tabs Position beibehalten */
    .frame-layout-recipe.recipe-mirror .recipe-tabs {
        left: auto;
        right: 25px;
    }

    /* Mirror: Actions Padding symmetrisch */
    .frame-layout-recipe.recipe-mirror .recipe-actions {
        padding: 20px 25px;
    }

    .recipe-text h2,
    .recipe-ingredients h2 {
        font-size: 1.35rem;
    }


    .recipe-button {
        padding: 11px 36px;
        font-size: 1rem;
    }


    .recipe-ingredients table th,
    .recipe-ingredients table td {
        padding: 1px 12px;
    }

    .recipe-actions {
        padding: 20px 25px;
    }
}

/* ========================================
   Accessibility
   ======================================== */

.recipe-tab:focus {
    outline: 3px solid #e73331;
    outline-offset: 4px;
    border-radius: 4px;
}

.recipe-button:focus {
    outline: 3px solid #e73331;
    outline-offset: 4px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .recipe-page,
    .recipe-tab,
    .recipe-button {
        transition: none;
    }
}

/* ========================================
   Print
   ======================================== */

@media print {
    .recipe-tabs {
        display: none;
    }

    .recipe-page {
        position: relative !important;
        display: block !important;
        opacity: 1 !important;
        page-break-inside: avoid;
        margin-bottom: 40px;
    }

    .recipe-content-wrapper {
        display: flex;
        flex-direction: column;
    }

    .recipe-column-left {
        order: 1;
        z-index: auto;
    }

    .recipe-column-right {
        order: 2;
        z-index: auto;
    }

    .recipe-image-wrapper {
        min-height: auto;
    }

    .recipe-button {
        border: 2px solid #e73331;
    }

    .recipe-textbox,
    .recipe-actions {
        background: #f5f1e9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        height: auto !important;
        overflow: visible !important;
    }
}