/* ==========================================================================
   RS OPC Portlets - ContentCard
   Vollständig gekapselt unter der Root-Klasse .rs-cc
   ========================================================================== */

.rs-cc {
    --rs-cc-bg: #f6f7f9;
    --rs-cc-accent: #111827;
    --rs-cc-radius: 16px;
    --rs-cc-overlay: rgba(9, 12, 20, 0.4);
    --rs-cc-minh: 0px;
    --rs-cc-pad: clamp(1.25rem, 1rem + 2vw, 2rem);
    --rs-cc-gap: 0.625rem;

    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
    isolation: isolate;
    min-height: var(--rs-cc-minh);
    padding: var(--rs-cc-pad);
    background: var(--rs-cc-bg);
    color: var(--rs-cc-color, inherit);
    border-radius: var(--rs-cc-radius);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* --- Innenabstand-Varianten ---------------------------------------------- */

.rs-cc--pad-compact {
    --rs-cc-pad: clamp(0.875rem, 0.75rem + 1vw, 1.25rem);
}

.rs-cc--pad-spacious {
    --rs-cc-pad: clamp(1.75rem, 1.25rem + 3vw, 3rem);
}

/* --- Höhe / vertikale Ausrichtung ---------------------------------------- */

.rs-cc--full-height {
    height: 100%;
}

/* Festes Seitenverhältnis: Höhe folgt der Kartenbreite.
   Karten in gleich breiten Spalten werden dadurch exakt gleich hoch,
   unabhängig von der Inhaltsmenge. Bei zu viel Inhalt wächst die Karte
   trotzdem mit (aspect-ratio wirkt als Mindesthöhe, kein Abschneiden). */
.rs-cc--ratio {
    aspect-ratio: var(--rs-cc-ratio, auto);
}

.rs-cc--ratio.rs-cc--full-height {
    height: auto;
    min-height: max(var(--rs-cc-minh), 100%);
}

.rs-cc--v-top {
    justify-content: flex-start;
}

.rs-cc--v-center {
    justify-content: center;
}

.rs-cc--v-bottom {
    justify-content: flex-end;
}

/* --- Textausrichtung ------------------------------------------------------ */

.rs-cc--align-left {
    text-align: left;
}

.rs-cc--align-center {
    text-align: center;
}

.rs-cc--align-center .rs-cc__body {
    align-items: center;
}

.rs-cc--align-right {
    text-align: right;
}

.rs-cc--align-right .rs-cc__body {
    align-items: flex-end;
}

/* --- Schatten ------------------------------------------------------------- */

.rs-cc--shadow-soft {
    box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.18);
}

.rs-cc--shadow-medium {
    box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.28);
}

.rs-cc--shadow-strong {
    box-shadow: 0 20px 44px -12px rgba(15, 23, 42, 0.4);
}

/* --- Hintergrundbild & Overlay ------------------------------------------- */

.rs-cc__media {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.rs-cc__overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, var(--rs-cc-overlay), rgba(9, 12, 20, 0.08));
    pointer-events: none;
}

.rs-cc--has-image {
    color: var(--rs-cc-color, #ffffff);
}

/* --- Inhalt ---------------------------------------------------------------- */

.rs-cc__body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--rs-cc-gap);
    max-width: 100%;
}

.rs-cc--content-panel .rs-cc__body,
.rs-cc--content-glass .rs-cc__body {
    padding: clamp(1rem, 0.75rem + 1.5vw, 1.5rem);
    border-radius: calc(var(--rs-cc-radius) * 0.66);
}

.rs-cc--content-panel .rs-cc__body {
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
    box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.25);
}

.rs-cc--content-glass .rs-cc__body {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.35);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .rs-cc--content-glass .rs-cc__body {
        background: rgba(17, 24, 39, 0.55);
        color: #ffffff;
    }
}

.rs-cc__kicker {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rs-cc-accent);
    opacity: 0.9;
}

.rs-cc--has-image .rs-cc__kicker {
    color: currentColor;
    opacity: 0.85;
}

.rs-cc__title {
    margin: 0;
    font-size: clamp(1.25rem, 1.05rem + 1.2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
}

.rs-cc__text {
    margin: 0;
    font-size: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);
    line-height: 1.55;
    opacity: 0.92;
}

/* --- Vordergrund-Grafik (freigestelltes PNG/SVG, z. B. Logo) --------------- */

.rs-cc__fg {
    display: block;
    width: 100%;
    max-width: min(var(--rs-cc-fg-w, 140px), 60%);
    height: auto;
}

.rs-cc__fg--shadow {
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.35));
}

/* Variante: innerhalb des Inhaltsbereichs (folgt der Textausrichtung) */
.rs-cc__fg--content {
    margin-bottom: 0.25rem;
}

/* Varianten: in den Ecken der Karte, schwebt über dem Hintergrund */
.rs-cc__fg--top-left,
.rs-cc__fg--top-right,
.rs-cc__fg--bottom-left,
.rs-cc__fg--bottom-right {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.rs-cc__fg--top-left {
    top: calc(var(--rs-cc-pad) * 0.75);
    left: calc(var(--rs-cc-pad) * 0.75);
}

.rs-cc__fg--top-right {
    top: calc(var(--rs-cc-pad) * 0.75);
    right: calc(var(--rs-cc-pad) * 0.75);
}

.rs-cc__fg--bottom-left {
    bottom: calc(var(--rs-cc-pad) * 0.75);
    left: calc(var(--rs-cc-pad) * 0.75);
}

.rs-cc__fg--bottom-right {
    bottom: calc(var(--rs-cc-pad) * 0.75);
    right: calc(var(--rs-cc-pad) * 0.75);
}

/* --- Button ---------------------------------------------------------------- */

.rs-cc__actions {
    display: inline-flex;
    margin-top: 0.5rem;
    position: relative;
    z-index: 2; /* bleibt über dem Karten-Cover-Link klickbar */
}

.rs-cc__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.625em 1.25em;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 999px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease,
        color 0.25s ease, border-color 0.25s ease;
}

.rs-cc__btn:focus-visible {
    outline: 3px solid var(--rs-cc-accent);
    outline-offset: 3px;
}

.rs-cc__btn--solid {
    background: var(--rs-cc-accent);
    color: #ffffff;
    border: 1px solid var(--rs-cc-accent);
}

.rs-cc__btn--solid:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -10px rgba(15, 23, 42, 0.5);
    color: #ffffff;
    text-decoration: none;
}

.rs-cc__btn--outline {
    background: transparent;
    color: inherit;
    border: 1.5px solid currentColor;
}

.rs-cc__btn--outline:hover {
    background: var(--rs-cc-accent);
    border-color: var(--rs-cc-accent);
    color: #ffffff;
    text-decoration: none;
}

.rs-cc__btn--ghost {
    padding: 0.25em 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: inherit;
}

.rs-cc__btn--ghost::after {
    content: "\2192";
    transition: transform 0.25s ease;
}

.rs-cc__btn--ghost:hover {
    text-decoration: none;
    color: inherit;
}

.rs-cc__btn--ghost:hover::after {
    transform: translateX(4px);
}

/* --- Sub-Area für weitere Portlets ---------------------------------------- */

.rs-cc__slot {
    position: relative;
    z-index: 1;
    margin-top: var(--rs-cc-gap);
}

.rs-cc__body + .rs-cc__slot {
    margin-top: 1rem;
}

/* --- Karten-Vollflächen-Link ----------------------------------------------- */

.rs-cc__cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.rs-cc__cover:focus-visible {
    outline: 3px solid var(--rs-cc-accent);
    outline-offset: -3px;
}

/* --- Hover-Effekte ---------------------------------------------------------- */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .rs-cc--hover-lift:hover,
    .rs-cc--hover-both:hover {
        transform: translateY(-6px);
    }

    .rs-cc--hover-lift.rs-cc--shadow-none:hover,
    .rs-cc--hover-both.rs-cc--shadow-none:hover {
        box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.3);
    }

    .rs-cc--hover-lift:hover.rs-cc--shadow-soft,
    .rs-cc--hover-both:hover.rs-cc--shadow-soft {
        box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.3);
    }

    .rs-cc--hover-zoom:hover .rs-cc__media,
    .rs-cc--hover-both:hover .rs-cc__media {
        transform: scale(1.05);
    }
}

/* --- Reduzierte Bewegung ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .rs-cc,
    .rs-cc__media,
    .rs-cc__btn,
    .rs-cc__btn--ghost::after {
        transition: none;
    }
}
