/* =========================================================
   Vorlagen-Seite: Hero, Filter-Toolbar, Hochkant-Carousel,
   Lightbox, Benefits, CTA
   ========================================================= */

/* ---------- Hero ---------- */
.hero-pdf {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    color: #1a1a1a;
    padding: 5.5rem 5% 4.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-pdf::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 60%;
    height: 160%;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
    pointer-events: none;
}

.hero-pdf::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom right, transparent 49%, #ffffff 50%);
}

.hero-content-pdf {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-pdf h1 {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-pdf p {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    color: #2d2d2d;
    margin-bottom: 1.6rem;
}

.hero-badge {
    display: flex;
    gap: 1rem 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.6rem;
}

.badges {
    background: rgba(255,255,255,0.35);
    padding: 0.7rem 1.4rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Browser-Bereich ---------- */
.vorlagen-browser {
    /* main.css setzt global section{display:grid}; als Grid-Items koennten
       Toolbar/Stage nicht unter ihre Inhaltsbreite schrumpfen und der
       Carousel-Overflow wuerde nie greifen. */
    display: block;
    padding-top: 0;
    background: linear-gradient(to bottom, #ffffff 0%, #fffbeb 45%, #ffffff 100%);
}

.vorlagen-browser > * {
    min-width: 0;
}

.vorlagen-browser [hidden] {
    display: none !important;
}

/* Toolbar: Suche + Filter-Chips (sticky unter dem Site-Header) */
.browser-toolbar {
    position: sticky;
    top: 0; /* wird per JS auf Header-Hoehe gesetzt */
    z-index: 900;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #fef3c7;
    box-shadow: 0 6px 24px rgba(26, 26, 26, 0.05);
}

.toolbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.8rem 5%;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.such-feld {
    flex: 0 1 260px;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: #ffffff;
    border: 2px solid #fef3c7;
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    margin: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: text;
}

.such-feld:focus-within {
    border-color: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.16);
}

.such-feld i {
    color: #d97706;
    font-size: 0.95rem;
}

.such-feld input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.95rem;
    color: #1a1a1a;
}

.such-feld input::placeholder {
    color: #a89a78;
}

.filter-strip {
    flex: 1 1 380px;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 24px;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 22px, #000 calc(100% - 22px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 22px, #000 calc(100% - 22px), transparent);
}

.filter-strip::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    flex: 0 0 auto;
    white-space: nowrap;
    background: #ffffff;
    color: #1a1a1a;
    border: 2px solid #fef3c7;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #fbbf24;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.3);
}

.filter-chip:focus-visible {
    outline: 3px solid rgba(251, 191, 36, 0.55);
    outline-offset: 2px;
}

.chip-count {
    display: inline-block;
    margin-left: 0.35rem;
    background: rgba(26, 26, 26, 0.07);
    border-radius: 999px;
    padding: 0 0.5em;
    font-size: 0.75em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.filter-chip.active .chip-count {
    background: rgba(26, 26, 26, 0.16);
}

/* Leerer Suchzustand */
.leer-hinweis {
    max-width: 1400px;
    margin: 1.2rem auto 0;
    padding: 0 5%;
    text-align: center;
    color: #555;
    font-size: 0.95rem;
}

.leer-hinweis i {
    color: #d97706;
    margin-right: 0.4rem;
}

.leer-hinweis a {
    color: #d97706;
    font-weight: 700;
}

/* ---------- Hochkant-Carousel ---------- */
.carousel-stage {
    position: relative;
    padding-top: 1rem;
}

.vorlagen-carousel {
    --gap: 1.5rem;
    --card-w: clamp(250px, calc((100vh - 360px) * 0.7071), 420px);
    display: flex;
    align-items: flex-start;
    gap: var(--gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding: 1.2rem calc(50vw - var(--card-w) / 2) 1.4rem;
    scrollbar-width: none;
    outline: none;
    cursor: grab;
}

.vorlagen-carousel::-webkit-scrollbar {
    display: none;
}

.vorlagen-carousel.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    scroll-behavior: auto;
}

.vorlagen-carousel:focus-visible {
    outline: 3px solid rgba(251, 191, 36, 0.55);
    outline-offset: -3px;
    border-radius: 16px;
}

.slide {
    flex: 0 0 var(--card-w);
    width: var(--card-w);
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transform: scale(0.94);
    opacity: 0.72;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.slide.is-active {
    transform: scale(1);
    opacity: 1;
}

/* A4-Rahmen (hochkant) */
.a4-frame {
    aspect-ratio: 210 / 297;
    width: 100%;
    margin: 0;
    position: relative;
    background: #ffffff;
    border: 1px solid #f3ead1;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(26, 26, 26, 0.08);
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.slide.is-active .a4-frame {
    border-color: #fbbf24;
    box-shadow: 0 24px 60px rgba(217, 119, 6, 0.2);
}

@media (hover: hover) {
    .slide:hover .a4-frame {
        border-color: #fbbf24;
        box-shadow: 0 26px 60px rgba(217, 119, 6, 0.26);
    }
}

.a4-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: #ffffff;
}

.a4-frame.img-fehlt img {
    display: none;
}

.a4-fallback {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    background: linear-gradient(to bottom, #fffbeb 0%, #ffffff 100%);
    color: #d97706;
    text-align: center;
    padding: 1rem;
}

.a4-frame.img-fehlt .a4-fallback,
.vlb-figure.img-fehlt .a4-fallback {
    display: flex;
}

.a4-fallback i {
    font-size: 3.2rem;
    opacity: 0.85;
}

.a4-fallback em {
    font-style: normal;
    font-size: 0.85rem;
    font-weight: 600;
    color: #92702a;
}

.std-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a1a;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
    z-index: 2;
}

.hover-hint {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translate(-50%, 8px);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(26, 26, 26, 0.85);
    color: #fbbf24;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
}

@media (hover: hover) {
    .slide:hover .hover-hint {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.slide-meta {
    padding: 0.9rem 0.3rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: center;
}

.slide-kategorie {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d97706;
}

.slide-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom-Design-Karte */
.custom-slide {
    position: relative;
    aspect-ratio: 210 / 297;
    border: 2px dashed #fbbf24;
    border-radius: 14px;
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.6rem 1.4rem;
    text-decoration: none;
    color: #1a1a1a;
}

.custom-slide:hover {
    color: #1a1a1a;
    text-decoration: none;
}

.custom-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    color: #fbbf24;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.custom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.custom-inner i {
    font-size: 3rem;
    color: #d97706;
}

.custom-inner strong {
    font-size: 1.25rem;
    font-weight: 800;
}

.custom-inner > span {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.55;
}

.custom-cta {
    background: #1a1a1a;
    color: #fbbf24;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (hover: hover) {
    .custom-slide:hover .custom-cta {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Pfeil-Navigation */
.car-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(26, 26, 26, 0.18);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.car-prev { left: clamp(8px, 3vw, 48px); }
.car-next { right: clamp(8px, 3vw, 48px); }

.car-nav:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 12px 34px rgba(217, 119, 6, 0.35);
}

.car-nav:focus-visible {
    outline: 3px solid rgba(251, 191, 36, 0.55);
    outline-offset: 2px;
}

@media (hover: none) {
    .car-nav {
        display: none;
    }
}

/* Fortschritt + Zaehler */
.carousel-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0 5% 2.6rem;
}

.progress-track {
    width: min(320px, 60%);
    height: 4px;
    background: #fef3c7;
    border-radius: 999px;
    overflow: hidden;
}

.progress-thumb {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.12s linear;
}

.car-counter {
    font-size: 0.85rem;
    font-weight: 700;
    color: #8a6a1f;
    font-variant-numeric: tabular-nums;
    min-height: 1.2em;
}

/* ---------- Lightbox ---------- */
.vlb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 2vw, 2rem);
}

.vlb[hidden] {
    display: none;
}

.vlb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 14, 3, 0.88);
}

.vlb-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
    max-width: min(1100px, 96vw);
    max-height: 94vh;
}

.vlb-stage {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.vlb-figure {
    margin: 0;
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.vlb-figure img {
    display: block;
    max-height: 80vh;
    max-width: 100%;
    width: auto;
    height: auto;
}

.vlb-figure.img-fehlt {
    width: min(420px, 82vw);
    aspect-ratio: 210 / 297;
}

.vlb-seiten {
    display: flex;
    gap: 0.5rem;
}

.vlb-seite-btn {
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.vlb-seite-btn:hover,
.vlb-seite-btn.active {
    background: #fbbf24;
    border-color: #fbbf24;
    color: #1a1a1a;
}

.vlb-panel {
    flex: 0 0 320px;
    background: #ffffff;
    border-radius: 16px;
    padding: 1.6rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 86vh;
    align-self: center;
    overflow: hidden;
}

.vlb-kategorie {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d97706;
}

.vlb-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.25;
    margin: 0;
}

.vlb-beschreibung {
    color: #555;
    font-size: 0.92rem;
    line-height: 1.65;
    overflow-y: auto;
    flex: 0 1 auto;
    margin: 0;
    white-space: pre-line;
}

.vlb-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 0.4rem;
}

.vlb-cta {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a1a;
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vlb-cta:hover {
    color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
}

.vlb-cta-sekundaer {
    border: 2px solid #fef3c7;
    border-radius: 999px;
    padding: 0.7rem 1.2rem;
    text-align: center;
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.vlb-cta-sekundaer:hover {
    border-color: #fbbf24;
    color: #1a1a1a;
}

.vlb-counter {
    text-align: center;
    font-size: 0.8rem;
    color: #999999;
    font-variant-numeric: tabular-nums;
}

.vlb-close {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #1a1a1a;
    color: #fbbf24;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.vlb-close:hover {
    background: #fbbf24;
    color: #1a1a1a;
    transform: rotate(90deg);
}

.vlb-nav {
    align-self: center;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.vlb-nav:hover {
    background: #fbbf24;
    color: #1a1a1a;
}

/* ---------- Benefits ---------- */
.benefits-section {
    max-width: 1400px;
    margin: 5rem auto;
    padding: 0 5%;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.benefit-card {
    background: linear-gradient(to bottom, #fffbeb 0%, #ffffff 100%);
    border: 2px solid #fef3c7;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.2);
}

.benefit-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.benefit-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #1a1a1a;
}

.benefit-card p {
    color: #555;
    line-height: 1.7;
}

/* ---------- CTA ---------- */
.cta-section {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    padding: 5rem 5%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top right, transparent 49%, #ffffff 50%);
}

.cta-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-weight: 800;
}

.cta-content p {
    font-size: 1.2rem;
    color: #2d2d2d;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(255,255,255,0.35);
    color: #1a1a1a;
    padding: 1.2rem 3rem;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.55);
    transform: translateY(-3px);
    color: #1a1a1a;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .vlb {
        padding: 0.5rem;
        align-items: flex-start;
    }

    .vlb-inner {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        overflow-y: auto;
        max-height: 96vh;
        padding-bottom: 0.5rem;
    }

    .vlb-figure img {
        max-height: 56vh;
    }

    .vlb-panel {
        flex: 0 0 auto;
        width: 100%;
        max-width: 560px;
        max-height: none;
    }

    .vlb-nav {
        position: absolute;
        top: 28vh;
        z-index: 2;
        background: rgba(26, 26, 26, 0.55);
    }

    .vlb-prev { left: 8px; }
    .vlb-next { right: 8px; }
}

@media (max-width: 767px) {
    .vorlagen-carousel {
        --gap: 1rem;
        --card-w: min(74vw, 330px);
    }

    .hero-pdf {
        padding: 4.5rem 5% 3.5rem;
    }

    .toolbar-inner {
        padding: 0.7rem 4%;
    }

    .such-feld {
        flex: 1 1 100%;
    }

    .filter-strip {
        flex: 1 1 100%;
        padding: 2px 16px;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-pdf::after,
    .cta-section::before {
        background: linear-gradient(to bottom, transparent 49%, #ffffff 50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .slide,
    .a4-frame,
    .hover-hint,
    .custom-cta,
    .car-nav,
    .progress-thumb,
    .vlb-cta,
    .benefit-card,
    .btn-secondary {
        transition: none;
    }

    .vorlagen-carousel {
        scroll-behavior: auto;
    }

    .slide {
        transform: none;
        opacity: 1;
    }
}
