/* =========================================================
   ABC Kernthemen – Frontend Styles

   Design-Prinzipien:
   - Baut auf Theme CSS-Variablen auf (--abc-primary, --abc-yearly, etc.)
   - Eigene, elevated Card-Variante mit Glassmorphism & Glow
   - Scroll-triggered Entrance-Animationen via IntersectionObserver
   - Responsive: 3 → 2 → 1 Spalte
   ========================================================= */

/* Section */
.abc-kt-section {
    padding: 1rem 0;
}

.abc-kt-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--abc-text-main, #2b2b2b);
    text-align: center;
    margin: 0 0 2.5rem 0;
    position: relative;
}

/* Dekorative Linie unter dem Titel */
.abc-kt-section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--abc-yearly, #e6b31e);
    border-radius: 2px;
    margin: 0.75rem auto 0;
}

/* =========================================================
   GRID
   ========================================================= */

.abc-kt-grid {
    --abc-kt-columns: 3;
    display: grid;
    grid-template-columns: repeat(var(--abc-kt-columns), 1fr);
    gap: 2rem;
}

@media (max-width: 960px) {
    .abc-kt-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .abc-kt-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* =========================================================
   CARD – Elevated Design mit Wow-Effekt
   ========================================================= */

.abc-kt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
    transition:
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);

    /* Entrance Animation – startet unsichtbar */
    opacity: 0;
    transform: translateY(40px);
}

/* Sichtbar nach IntersectionObserver */
.abc-kt-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    /* Staggered delay basierend auf Index */
    transition-delay: calc(var(--abc-kt-index, 0) * 0.1s);
}

/* Hover: Anheben + Glow-Schatten */
.abc-kt-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(99, 6, 6, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(99, 6, 6, 0.05);
}

/* =========================================================
   CARD VISUAL (Bild-Bereich)
   ========================================================= */

.abc-kt-card-visual {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f0eb 0%, #ebe3da 100%);
}

.abc-kt-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.abc-kt-card:hover .abc-kt-card-img {
    transform: scale(1.08);
}

.abc-kt-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

/* Gradient-Overlay über dem Bild */
.abc-kt-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 40%,
        rgba(58, 3, 3, 0.08) 100%
    );
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.abc-kt-card:hover .abc-kt-card-overlay {
    background: linear-gradient(
        180deg,
        transparent 30%,
        rgba(58, 3, 3, 0.15) 100%
    );
}

/* Placeholder wenn kein Bild */
.abc-kt-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--abc-primary, #630606);
    opacity: 0.2;
}

.abc-kt-card-placeholder svg {
    width: 48px;
    height: 48px;
}

/* =========================================================
   TAGS (oben im Bild-Bereich)
   ========================================================= */

.abc-kt-card-tags {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}

.abc-kt-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    background: var(--abc-primary, #630606);
    border-radius: 20px;
    backdrop-filter: blur(4px);
    background: rgba(99, 6, 6, 0.85);
}

/* =========================================================
   CARD BODY (Text + Button)
   ========================================================= */

.abc-kt-card-body {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
    gap: 0.35rem;
}

.abc-kt-card-body::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 6.5rem;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.92) 38%,
        #ffffff 100%
    );
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition:
        opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.abc-kt-card-title {
    position: relative;
    z-index: 1;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--abc-text-main, #2b2b2b);
    margin: 0 0 0.5rem 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.abc-kt-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.abc-kt-card-title a:hover {
    color: var(--abc-primary, #630606);
}

.abc-kt-card-desc {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    font-size: 0.92rem;
    line-height: 1.65;
    color: #666;
    margin: 0 0 auto 0;
    padding-bottom: 1.25rem;
    transition:
        opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.32s ease;
}

/* =========================================================
   BUTTON – mit animiertem Pfeil
   ========================================================= */

.abc-kt-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.02em;
    color: var(--abc-primary, #630606);
    background: transparent;
    border: 2px solid var(--abc-primary, #630606);
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease,
        opacity 0.3s ease,
        box-shadow 0.3s ease;
    align-self: flex-start;
    position: relative;
    z-index: 2;
}

.abc-kt-card-btn:hover {
    color: #fff;
    background: var(--abc-primary, #630606);
    border-color: var(--abc-primary, #630606);
    transform: translateX(4px);
}

/* Pfeil-Animation */
.abc-kt-btn-arrow {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    flex-shrink: 0;
}

.abc-kt-card-btn:hover .abc-kt-btn-arrow {
    transform: translateX(4px);
}

@media (hover: hover) and (pointer: fine) {
    .abc-kt-card--has-link .abc-kt-card-body {
        min-height: 12.5rem;
        /*padding-bottom: 5.25rem;*/
    }

    .abc-kt-card--has-link .abc-kt-card-btn {
        position: absolute;
        left: 1.5rem;
        bottom: 1.5rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(18px);
        color: #fff;
        background: var(--abc-primary, #630606);
        border-color: var(--abc-primary, #630606);
        box-shadow:
            0 16px 30px rgba(99, 6, 6, 0.18),
            0 4px 10px rgba(99, 6, 6, 0.12);
    }

    .abc-kt-card--has-link:is(:hover, :focus-within) .abc-kt-card-body::after {
        opacity: 1;
        transform: translateY(0);
    }

    .abc-kt-card--has-link:is(:hover, :focus-within) .abc-kt-card-title {
        transform: translateY(-2px);
    }

    .abc-kt-card--has-link:is(:hover, :focus-within) .abc-kt-card-desc {
        opacity: 0;
        transform: translateY(18px);
        filter: blur(6px);
        pointer-events: none;
    }

    .abc-kt-card--has-link:is(:hover, :focus-within) .abc-kt-card-btn {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .abc-kt-card--has-link .abc-kt-card-btn:hover {
        color: #fff;
        background: #7a0b0b;
        border-color: #7a0b0b;
        transform: translateY(-2px);
        box-shadow:
            0 18px 34px rgba(99, 6, 6, 0.22),
            0 6px 14px rgba(99, 6, 6, 0.14);
    }
}

@media (prefers-reduced-motion: reduce) {
    .abc-kt-card,
    .abc-kt-card.is-visible,
    .abc-kt-card-img,
    .abc-kt-card-body::after,
    .abc-kt-card-title,
    .abc-kt-card-desc,
    .abc-kt-card-btn,
    .abc-kt-btn-arrow {
        transition: none;
    }
}

/* =========================================================
   AKZENT: Goldene Unterkante (Jahresfarbe)
   ========================================================= */

.abc-kt-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--abc-yearly, #e6b31e),
        color-mix(in srgb, var(--abc-yearly, #e6b31e) 60%, var(--abc-primary, #630606))
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.abc-kt-card:hover::after {
    opacity: 1;
}

/* =========================================================
   REDUCED MOTION – Barrierefreiheit
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .abc-kt-card {
        opacity: 1;
        transform: none;
        transition: box-shadow 0.2s ease;
    }

    .abc-kt-card.is-visible {
        transition: box-shadow 0.2s ease;
        transition-delay: 0s;
    }

    .abc-kt-card:hover {
        transform: none;
    }

    .abc-kt-card-img {
        transition: none;
    }

    .abc-kt-card:hover .abc-kt-card-img {
        transform: none;
    }

    .abc-kt-card-btn:hover {
        transform: none;
    }
}

/* =========================================================
   EDITOR: Cards sofort sichtbar (kein IntersectionObserver)
   ========================================================= */

.abc-kt-editor-preview .abc-kt-card {
    opacity: 1;
    transform: none;
}
