/**
 * LC Simple Teaser - Frontend Styles
 * Modernes und responsives Teaser-Design
 */

/* ==========================================================================
   Container
   ========================================================================== */

.lc-teaser-container {
    margin: 1.5em 0;
}

/* ==========================================================================
   Grid für mehrere Teaser
   ========================================================================== */

.lc-teaser-grid {
    display: grid;
    gap: 24px;
}

.lc-teaser-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.lc-teaser-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.lc-teaser-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.lc-teaser-grid--5,
.lc-teaser-grid--6,
.lc-teaser-grid--7,
.lc-teaser-grid--8,
.lc-teaser-grid--9,
.lc-teaser-grid--10 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
    .lc-teaser-grid--3,
    .lc-teaser-grid--4,
    .lc-teaser-grid--5,
    .lc-teaser-grid--6,
    .lc-teaser-grid--7,
    .lc-teaser-grid--8,
    .lc-teaser-grid--9,
    .lc-teaser-grid--10 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .lc-teaser-grid,
    .lc-teaser-grid--2,
    .lc-teaser-grid--3,
    .lc-teaser-grid--4,
    .lc-teaser-grid--5,
    .lc-teaser-grid--6,
    .lc-teaser-grid--7,
    .lc-teaser-grid--8,
    .lc-teaser-grid--9,
    .lc-teaser-grid--10 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Teaser Basis-Styles
   ========================================================================== */

.lc-teaser {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lc-teaser:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Teaser Link (Kompletter Teaser verlinkt)
   ========================================================================== */

.lc-teaser__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.lc-teaser__link:hover,
.lc-teaser__link:focus {
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   Bild-Bereich
   ========================================================================== */

.lc-teaser__image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.lc-teaser__image-wrapper::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 Ratio */
}

.lc-teaser__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.lc-teaser:hover .lc-teaser__image {
    transform: scale(1.05);
}

/* Einzelne Bild-Links */
.lc-teaser__image-link {
    display: block;
}

/* ==========================================================================
   Content-Bereich
   ========================================================================== */

.lc-teaser__content {
    padding: 20px 24px 24px;
}

/* ==========================================================================
   Titel (für Blog-Posts)
   ========================================================================== */

.lc-teaser__title {
    margin: 0 0 12px 0;
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
    transition: color 0.2s ease;
}

.lc-teaser__link:hover .lc-teaser__title {
    color: #0066cc;
}

/* ==========================================================================
   Excerpt / Text
   ========================================================================== */

.lc-teaser__excerpt,
.lc-teaser__text {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
}

.lc-teaser__excerpt {
    margin-bottom: 16px;
}

/* Text-Link */
.lc-teaser__text-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.lc-teaser__text-link:hover {
    color: #0066cc;
}

/* ==========================================================================
   Weiterlesen-Button
   ========================================================================== */

.lc-teaser__more {
    display: inline-flex;
    align-items: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #0066cc;
    transition: color 0.2s ease;
}

.lc-teaser__more::after {
    content: "→";
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.lc-teaser__link:hover .lc-teaser__more {
    color: #004499;
}

.lc-teaser__link:hover .lc-teaser__more::after {
    transform: translateX(4px);
}

/* ==========================================================================
   Varianten
   ========================================================================== */

/* Eigener Teaser ohne Text */
.lc-teaser--custom .lc-teaser__image-wrapper:only-child::before {
    padding-top: 0;
}

.lc-teaser--custom .lc-teaser__image-wrapper:only-child .lc-teaser__image {
    position: relative;
    height: auto;
}

/* Teaser nur mit Bild (z.B. für PDFs) */
.lc-teaser--image-link:not(:has(.lc-teaser__content)) {
    border-radius: 12px;
}

.lc-teaser--image-link:not(:has(.lc-teaser__content)) .lc-teaser__image-wrapper::before {
    padding-top: 0;
}

.lc-teaser--image-link:not(:has(.lc-teaser__content)) .lc-teaser__image {
    position: relative;
    height: auto;
}

/* ==========================================================================
   Error Message (nur für Admins)
   ========================================================================== */

.lc-teaser-error {
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
}

/* ==========================================================================
   Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .lc-teaser {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .lc-teaser:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .lc-teaser__image-wrapper {
        background: #2a2a2a;
    }

    .lc-teaser__title {
        color: #f5f5f5;
    }

    .lc-teaser__link:hover .lc-teaser__title {
        color: #60a5fa;
    }

    .lc-teaser__excerpt,
    .lc-teaser__text {
        color: #a0a0a0;
    }

    .lc-teaser__more {
        color: #60a5fa;
    }

    .lc-teaser__link:hover .lc-teaser__more {
        color: #93c5fd;
    }

    .lc-teaser__text-link:hover {
        color: #60a5fa;
    }
}

/* ==========================================================================
   PDF-Teaser Styles
   ========================================================================== */

.lc-teaser--pdf {
    /* Erbt Standard-Teaser-Styling */
}

.lc-teaser__download {
    margin-top: 16px;
}

/* Download-Button - nutzt Theme-Styling via wp-block-button__link */
.lc-teaser__download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.lc-teaser__download-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Fallback wenn Theme keine Button-Styles hat */
.lc-teaser__download-btn:not(.wp-element-button) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0066cc;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lc-teaser__download-btn:not(.wp-element-button):hover {
    background: #004499;
    color: #fff;
    transform: translateY(-2px);
}

/* Download-Textlink */
.lc-teaser__download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0066cc;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lc-teaser__download-link:hover {
    color: #004499;
    text-decoration: underline;
}

.lc-teaser__download-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #d63638;
}

/* PDF-Teaser ohne Bild - kompaktere Darstellung */
.lc-teaser--pdf:not(:has(.lc-teaser__image-wrapper)) {
    display: flex;
    align-items: center;
}

.lc-teaser--pdf:not(:has(.lc-teaser__image-wrapper)) .lc-teaser__content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

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

@media print {
    .lc-teaser {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .lc-teaser:hover {
        transform: none;
    }

    .lc-teaser__image {
        transform: none !important;
    }

    /* PDF-Download-Links drucken */
    .lc-teaser__download-btn::after,
    .lc-teaser__download-link::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-weight: normal;
    }
}
