/* ==========================================================
   Cutfolio – Layout-Anleitung
   Ergänzung zur website.css
   ========================================================== */

.layout-guide {
    background: #f5f7fa;
}

.layout-guide .container {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
}


/* ==========================================================
   Hero
   ========================================================== */

.layout-guide-hero {
    min-height: 68vh;
    display: flex;
    align-items: center;
    padding: 90px 0;
}

.layout-guide-hero .container {
    max-width: 850px;
    margin-left: max(20px, calc((100% - 1200px) / 2));
}

.layout-guide-hero h1 {
    margin: 10px 0 24px;
    font-size: clamp(2.5rem, 6vw, 4.4rem);
    line-height: 1.06;
    letter-spacing: -.03em;
}

.layout-guide-hero .hero-text {
    max-width: 760px;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.75;
}


/* ==========================================================
   Allgemeine Bereiche
   ========================================================== */

.layout-example,
.layout-toc-section,
.layout-info-section,
.layout-steps-section,
.layout-guide-cta {
    padding: 80px 0;
}

.layout-toc-section {
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.layout-guide .section-heading {
    max-width: 760px;
    margin-bottom: 38px;
}

.layout-guide .section-heading h2,
.layout-guide .layout-info-section h2,
.layout-guide .layout-guide-cta h2 {
    margin: 10px 0 20px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
}

.layout-guide .section-heading p,
.layout-guide .layout-info-section p,
.layout-guide .layout-guide-cta p {
    color: var(--muted);
    line-height: 1.75;
}


/* ==========================================================
   Beispiel
   ========================================================== */

.layout-example-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
    gap: 60px;
    align-items: center;
}

.layout-example-image {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.layout-example-image .media-image-button {
    display: flex;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.layout-example-image img {
    display: block;
    width: 100%;
    height: auto;
}


/* ==========================================================
   Verzeichnis
   ========================================================== */

.layout-toc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.layout-toc a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition:
        transform .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.layout-toc a:hover {
    background: var(--card);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.layout-toc a span {
    min-width: 28px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.layout-toc a strong {
    font-weight: 600;
}


/* ==========================================================
   Inhalt / Erklärungen
   ========================================================== */

.layout-info-section {
    background: var(--bg);
}

.layout-info-section.alt {
    background: var(--card);
    border-top: 1px solid rgba(0, 0, 0, .04);
    border-bottom: 1px solid rgba(0, 0, 0, .04);
}

.layout-info-block {
    max-width: 850px;
}

.layout-info-heading {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.layout-info-number {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
}

.layout-info-block h3 {
    margin: 32px 0 12px;
    font-size: 1.25rem;
    line-height: 1.3;
}

.layout-info-block p {
    margin: 0 0 18px;
}

.layout-info-block strong {
    color: var(--text);
}

.layout-info-note {
    margin-top: 28px;
    padding: 18px 20px;
    border-left: 3px solid var(--text);
    background: var(--card);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.layout-info-note strong {
    display: inline;
    margin-right: 4px;
}

.layout-info-note p {
    margin: 0;
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 35px;
}

.concept-grid article {
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.layout-info-section.alt .concept-grid article {
    background: var(--bg);
}

.concept-grid strong {
    display: block;
    margin-bottom: 8px;
}

.concept-grid p {
    margin: 0;
    font-size: .95rem;
}

.concept-highlight {
    margin-top: 28px;
    padding: 22px 24px;
    border-left: 3px solid var(--text);
    background: var(--card);
}

.layout-info-section.alt .concept-highlight {
    background: var(--bg);
}

.concept-highlight strong {
    display: block;
    margin-bottom: 7px;
}

.concept-highlight p {
    margin: 0;
}


/* ==========================================================
   Schritte
   ========================================================== */

.layout-steps-section {
    background: var(--bg);
}

.layout-step-slider {
    width: 100%;
}

.layout-step-viewport {
    overflow: visible;
}

.layout-step-track {
    display: grid;
    gap: 28px;
}

.layout-step {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.step-header {
    padding: 25px 28px 18px;
}

.step-number {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.step-header h3 {
    margin: 0;
    font-size: 1.5rem;
}


/* ==========================================================
   Medien – Desktop
   ========================================================== */

.step-media {
    padding: 0 28px;
}

.step-media-desktop {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

.step-media-column {
    min-width: 0;
}

.media-label {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.media-stage {
    position: relative;
    min-width: 0;
    height: 530px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.media-slide {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.media-slide.is-active {
    display: flex;
}

.media-image-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.media-image-button img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

.media-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 100%;
    padding: 30px;
    text-align: center;
    color: var(--muted);
}

.media-placeholder strong {
    color: var(--text);
}

.media-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-height: 7px;
    margin-top: 11px;
}

.media-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c8ccd2;
    cursor: pointer;
}

.media-dot.is-active {
    background: var(--text);
}


/* ==========================================================
   Fertiges Bild eines Schrittes
   ========================================================== */

.step-final-image {
    width: 100%;
    min-height: 530px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.step-final-image .media-image-button {
    width: 100%;
    height: 100%;
    min-height: 530px;
}

.step-final-image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 530px;
    height: auto;
    object-fit: contain;
}

/* ==========================================================
   Medien – Mobile
   ========================================================== */

.step-media-mobile {
    display: none;
}

.media-switch {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 0 0 10px;
}

.media-type-button {
    padding: 8px 15px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .86rem;
    cursor: pointer;
}

.media-type-button.is-active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.step-media-mobile-stage {
    position: relative;
    width: 100%;
    height: clamp(380px, 112vw, 560px);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.media-mobile-type {
    display: none;
    width: 100%;
    height: 100%;
}

.media-mobile-type.is-active {
    display: block;
}

.media-mobile-type .media-slide {
    width: 100%;
    height: 100%;
}

.mobile-preview-dots {
    min-height: 7px;
}


/* ==========================================================
   Schritt-Text
   ========================================================== */

.step-content {
    padding: 25px 28px 10px;
}

.step-content p {
    max-width: 850px;
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.75;
}

.back-to-toc {
    display: inline-block;
    margin: 0 28px 25px;
    color: var(--muted);
    font-size: .88rem;
    text-decoration: none;
}

.back-to-toc:hover {
    color: var(--text);
}


/* ==========================================================
   Karten-Navigation
   ========================================================== */

.layout-step-navigation {
    display: none;
}

.layout-step-arrow {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
}

.layout-step-arrow:disabled {
    opacity: .35;
    cursor: default;
}

.layout-step-counter {
    min-width: 60px;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}


/* ==========================================================
   CTA
   ========================================================== */

.layout-guide-cta {
    background: var(--card);
    border-top: 1px solid var(--border);
    text-align: center;
}

.layout-guide-cta .narrow-content {
    margin: 0 auto;
}

.layout-guide-cta .section-actions {
    justify-content: center;
}


/* ==========================================================
   Lightbox
   ========================================================== */

.layout-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(20, 22, 25, .88);
}

.layout-lightbox[hidden] {
    display: none;
}

.layout-lightbox img {
    display: block;
    max-width: min(1400px, 96vw);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(0, 0, 0, .25);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

body.layout-lightbox-open {
    overflow: hidden;
}


/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 899px) {

    .layout-guide .container {
        width: min(calc(100% - 30px), 760px);
    }

    .layout-guide-hero {
        min-height: auto;
        padding: 65px 0 55px;
    }

    .layout-guide-hero .container {
        margin-left: auto;
    }

    .layout-example-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .layout-toc,
    .concept-grid {
        grid-template-columns: 1fr;
    }

    .layout-example,
    .layout-toc-section,
    .layout-info-section,
    .layout-steps-section,
    .layout-guide-cta {
        padding: 60px 0;
    }

    /* ------------------------------------------------------
       Eine Karte sichtbar. Die Position wird per JS über
       offsetLeft der echten Zielkarte bestimmt.
       ------------------------------------------------------ */
    .layout-step-viewport {
        overflow: hidden;
        margin: 0 -15px;
        padding: 0 15px;
        touch-action: pan-y;
    }

    .layout-step-track {
        display: flex;
        gap: 0;
        width: max-content;
        transform: translate3d(0, 0, 0);
        transition: transform .32s ease;
        will-change: transform;
    }

    .layout-step {
        flex: 0 0 calc(100vw - 30px);
        width: calc(100vw - 30px);
        min-width: calc(100vw - 30px);
        box-sizing: border-box;
    }

    .step-final-image {
        min-height: clamp(235px, 67vw, 350px);
        height: clamp(235px, 67vw, 350px);
    }

    .step-final-image .media-image-button {
        min-height: 100%;
        height: 100%;
    }

    .step-final-image img {
        max-width: 100%;
        max-height: 100%;
    }

    .step-header {
        padding: 22px 18px 16px;
    }

    .step-media {
        padding: 0 12px;
    }

    .step-media-desktop {
        display: none;
    }

    .step-media-mobile {
        display: block;
    }

    /* ------------------------------------------------------
       Mobile: Panel + Vorschau gleichzeitig sichtbar.
       Kein innerer Medien-Slider mehr.
       ------------------------------------------------------ */
    .media-switch {
        display: none;
    }

    .step-media-mobile-stage {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        position: relative;
        width: 100%;
        height: clamp(235px, 67vw, 350px);
        background: transparent;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    .media-mobile-type,
    .media-mobile-type.is-active {
        display: block;
        width: 100%;
        height: 100%;
        min-width: 0;
        overflow: hidden;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 10px;
    }

    .media-mobile-type .media-slide {
        display: none;
        width: 100%;
        height: 100%;
        align-items: center;
        justify-content: center;
    }

    .media-mobile-type .media-slide.is-active {
        display: flex;
    }

    .media-mobile-type .media-image-button {
        width: 100%;
        height: 100%;
    }

    .media-mobile-type .media-image-button img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    /* Beschriftungen über den beiden Ansichten */
    .media-mobile-type[data-media-type="panel"]::before,
    .media-mobile-type[data-media-type="preview"]::before {
        display: block;
        position: absolute;
        z-index: 2;
        margin: 8px;
        padding: 4px 7px;
        border-radius: 999px;
        background: rgba(255,255,255,.9);
        color: var(--muted);
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        pointer-events: none;
    }

    .media-mobile-type[data-media-type="panel"]::before {
        content: "Panel";
    }

    .media-mobile-type[data-media-type="preview"]::before {
        content: "Vorschau";
    }

    .mobile-preview-dots {
        display: flex;
        justify-content: center;
        gap: 5px;
        position: absolute;
        left: 50%;
        bottom: 7px;
        transform: translateX(-50%);
        z-index: 3;
        min-height: 7px;
        margin: 0;
        padding: 3px 6px;
        border-radius: 999px;
        background: rgba(255,255,255,.85);
    }

    .step-content {
        padding: 22px 18px 8px;
    }

    .back-to-toc {
        display: none !important;
    }

    /* ------------------------------------------------------
       Karten-Navigation: Pfeile + Punkte + Zähler
       ------------------------------------------------------ */
    .layout-step-navigation {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin-top: 14px;
        flex-wrap: nowrap;
    }

    .layout-step-arrow {
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        border: 1px solid var(--border);
        border-radius: 50%;
        background: var(--card);
        color: var(--text);
        cursor: pointer;
        font-size: 1.1rem;
    }

    .layout-step-arrow:disabled {
        opacity: .35;
        cursor: default;
    }

    .layout-step-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        max-width: min(48vw, 250px);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .layout-step-dots::-webkit-scrollbar {
        display: none;
    }

    .layout-step-dot {
        flex: 0 0 7px;
        width: 7px;
        height: 7px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #c8ccd2;
        cursor: pointer;
    }

    .layout-step-dot.is-active {
        width: 9px;
        height: 9px;
        flex-basis: 9px;
        background: var(--text);
    }

    .layout-step-counter {
        flex: 0 0 auto;
        min-width: 48px;
        text-align: center;
        color: var(--muted);
        font-size: .9rem;
    }

    .section-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .section-actions .btn {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}



/* ==========================================================
   Desktop
   ========================================================== */

@media (min-width: 900px) {

    /* Desktop zeigt Panel und Vorschau nebeneinander */
    .step-media-desktop {
        display: grid;
    }

    .step-media-mobile {
        display: none;
    }
}


/* ==========================================================
   Mobile Header: gleitet beim Scrollen nach oben aus
   ========================================================== */
@media (max-width: 899px) {
    .site-header {
        transition: transform .25s ease;
        will-change: transform;
    }

    .site-header.is-hidden {
        transform: translateY(-100%);
    }
}
