/**
 * Kurant Stellenangebote & Zertifikate Frontend Styles
 * 
 * 1. Stellenangebote: 2-Spalten-Layout mit grünem Titel, Beschreibung & Button "Zum Stellenangebot"
 * 2. Zertifikate: Interaktives Karussell mit A4-Dokumentenvorschau des PDFs (Klick öffnet die PDF)
 */

:root {
    --kurant-green: #8cb811;
    --kurant-green-hover: #7ba30d;
    --kurant-text: #334155;
    --kurant-font: inherit;
}

.kurant-jobs-container,
.kurant-carousel-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    box-sizing: border-box;
    font-family: var(--kurant-font);
}

.kurant-jobs-container *,
.kurant-carousel-container * {
    box-sizing: border-box;
}

/* =========================================================
   1. STELLENANGEBOTE: 2-SPALTEN-LAYOUT (TITEL, BESCHREIBUNG, BUTTON)
   ========================================================= */

.kurant-jobs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 50px;
    row-gap: 40px;
    align-items: start;
}

.kurant-job-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: transparent;
    border: none;
    padding: 0;
}

/* Grüner Titel wie in Ihrer Bildvorlage */
.kurant-job-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 12px 0;
    color: var(--kurant-green);
}

.kurant-job-title a {
    color: var(--kurant-green);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.kurant-job-title a:hover {
    opacity: 0.85;
    text-decoration: underline;
}

/* Beschreibungstext */
.kurant-job-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--kurant-text);
    margin: 0 0 16px 0;
}

.kurant-job-desc p {
    margin: 0 0 10px 0;
}

.kurant-job-desc p:last-child {
    margin-bottom: 0;
}

/* Button "Zum Stellenangebot" (öffnet das PDF) */
.kurant-job-action {
    margin-top: 4px;
}

.kurant-job-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--kurant-green);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none !important;
    transition: background-color 0.15s ease, transform 0.1s ease;
    cursor: pointer;
}

.kurant-job-btn:hover {
    background-color: var(--kurant-green-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.kurant-no-jobs {
    grid-column: 1 / -1;
    color: #64748b;
    font-style: italic;
    padding: 20px 0;
}

/* =========================================================
   2. ZERTIFIKATE: KARUSSELL MIT A4-PDF-VORSCHAU (OHNE BUTTON & BESCHREIBUNG)
   ========================================================= */

.kurant-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.kurant-carousel-track {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 15px 5px 25px 5px;
    width: 100%;
    scrollbar-width: none; /* Firefox */
}

.kurant-carousel-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* 3 Zertifikate nebeneinander auf Desktop */
.kurant-carousel-slide {
    flex: 0 0 calc((100% - 60px) / 3);
    min-width: 260px;
    scroll-snap-align: start;
    box-sizing: border-box;
}

.kurant-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: transparent;
}

.kurant-item-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 16px 0;
    color: var(--kurant-green);
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kurant-item-title a {
    color: var(--kurant-green);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.kurant-item-title a:hover {
    opacity: 0.85;
    text-decoration: underline;
}

/* PDF-Dokumentenvorschau (A4 Blatt) */
.kurant-pdf-preview-link {
    display: block;
    width: 100%;
    text-decoration: none;
}

.kurant-pdf-sheet {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.414; /* DIN A4 Seitenverhältnis */
    background: #ffffff linear-gradient(180deg, #f8fafc 0%, #ffffff 20%);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Dokumenten-Silhouette im Hintergrund */
.kurant-pdf-fallback-doc {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #fafafa;
    z-index: 0;
}

.kurant-fallback-icon {
    margin-bottom: 16px;
    opacity: 0.85;
}

.kurant-fallback-lines {
    width: 75%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kurant-line {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    width: 100%;
}

.kurant-line-lg {
    height: 8px;
    background: #cbd5e1;
    width: 60%;
    margin-bottom: 4px;
}

.kurant-line-sm {
    width: 45%;
}

.kurant-pdf-img,
.kurant-pdf-iframe-preview {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border: none;
}

.kurant-pdf-img {
    object-fit: cover;
    object-position: top center;
    display: block;
}

.kurant-pdf-iframe-preview {
    pointer-events: none; /* Klick geht direkt an den Link zum Öffnen! */
    background: #ffffff;
}

.kurant-pdf-sheet:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px -4px rgba(0, 0, 0, 0.18);
    border-color: var(--kurant-green);
}

/* Hover-Overlay: Zeigt Icon & "PDF ansehen" */
.kurant-pdf-hover-badge {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 15px;
    font-weight: 600;
    z-index: 2;
}

.kurant-pdf-sheet:hover .kurant-pdf-hover-badge {
    opacity: 1;
}

.kurant-zoom-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kurant-green);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* =========================================================
   KARUSSELL-STEUERUNG (PFEILE & PUNKTE)
   ========================================================= */

.kurant-carousel-arrow {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    z-index: 10;
    transition: all 0.15s ease;
}

.kurant-carousel-arrow:hover {
    background: var(--kurant-green);
    color: #ffffff;
    border-color: var(--kurant-green);
    transform: translateY(-50%) scale(1.08);
}

.kurant-carousel-prev {
    left: -22px;
}

.kurant-carousel-next {
    right: -22px;
}

.kurant-carousel-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.kurant-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.kurant-carousel-dot.is-active {
    background: var(--kurant-green);
    width: 24px;
}

/* =========================================================
   RESPONSIVE (TABLET & SMARTPHONE)
   ========================================================= */

@media (max-width: 992px) {
    .kurant-carousel-slide {
        flex: 0 0 calc((100% - 30px) / 2);
    }
}

@media (max-width: 768px) {
    .kurant-jobs-grid {
        grid-template-columns: 1fr;
        row-gap: 32px;
    }

    .kurant-carousel-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }

    .kurant-item-title {
        font-size: 17px;
        min-height: auto;
    }

    .kurant-carousel-prev {
        left: -10px;
    }

    .kurant-carousel-next {
        right: -10px;
    }
}

/* =========================================================
   3. KURANTBILDER: BILDERCAROUSEL (ALLE BILDER GLEICH GROSS)
   ========================================================= */

.kurant-img-only-card {
    width: 100%;
}

.kurant-img-preview-link {
    display: block;
    width: 100%;
    text-decoration: none;
    cursor: pointer;
}

.kurant-img-sheet {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3; /* Alle Bilder exakt im gleichen Format */
    background: #f1f5f9;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
}

.kurant-img-sheet:focus-visible {
    border-color: var(--kurant-green);
    box-shadow: 0 0 0 3px rgba(140, 184, 17, 0.35);
}

.kurant-img-sheet:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 26px -4px rgba(0, 0, 0, 0.18);
    border-color: var(--kurant-green);
}

.kurant-img-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
    pointer-events: none !important;
}

.kurant-img-sheet:hover .kurant-img-thumb {
    transform: scale(1.03);
}

/* Hover-Badge wie bei den Zertifikaten */
.kurant-img-hover-badge {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 15px;
    font-weight: 600;
    z-index: 2;
    pointer-events: none !important;
}

.kurant-img-sheet:hover .kurant-img-hover-badge {
    opacity: 1;
}

/* =========================================================
   LIGHTBOX / VOLLBILD-VORSCHAU FÜR BILDER
   ========================================================= */

body.kurant-lightbox-open {
    overflow: hidden !important;
}

.kurant-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.94);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: kurantLightboxFadeIn 0.2s ease;
    cursor: zoom-out;
}

.kurant-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: zoom-out;
}

.kurant-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    display: block;
    background: #1e293b;
    cursor: zoom-out;
    user-select: none;
    -webkit-user-drag: none;
}

.kurant-lightbox-close {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--kurant-green);
    border: 2px solid #ffffff;
    color: #ffffff;
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background-color 0.15s ease;
    z-index: 1000001;
}

.kurant-lightbox-close:hover {
    background: var(--kurant-green-hover);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .kurant-lightbox-close {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}

@keyframes kurantLightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
