/* =========================================================
   KCC PUBLISHING MANAGER – FRONTEND
   ========================================================= */

/* Theme-Ausgaben für automatisch erzeugte KCC-Inhalte ausblenden.
   Der KCC-Header wird vom Plugin bzw. von der Galerie-Vorlage gerendert. */
body.kccpm-generated-post .entry-header,
body.kccpm-generated-post .entry-title,
body.kccpm-generated-post .entry-meta,
body.kccpm-generated-post .post-thumb,
body.kccpm-generated-post .ast-single-post-featured-section,
body.kccpm-generated-post .page-title,
body.kccpm-generated-gallery-page .entry-header,
body.kccpm-generated-gallery-page .entry-title,
body.kccpm-generated-gallery-page .entry-meta,
body.kccpm-generated-gallery-page .post-thumb,
body.kccpm-generated-gallery-page .ast-single-post-featured-section,
body.kccpm-generated-gallery-page .page-title {
    display: none !important;
}

body.kccpm-generated-post .site-content .ast-container,
body.kccpm-generated-gallery-page .site-content .ast-container {
    width: 100% !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.kccpm-generated-post .content-area,
body.kccpm-generated-post .site-main,
body.kccpm-generated-post .ast-article-single,
body.kccpm-generated-post .entry-content,
body.kccpm-generated-gallery-page .content-area,
body.kccpm-generated-gallery-page .site-main,
body.kccpm-generated-gallery-page .ast-article-single,
body.kccpm-generated-gallery-page .entry-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

body.kccpm-generated-post .ast-article-single,
body.kccpm-generated-gallery-page .ast-article-single {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

/* =========================================================
   NEWS – HERO
   ========================================================= */
.kccpm-news-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    width: 100vw;
    min-height: clamp(430px, 58vw, 690px);
    margin-left: calc(50% - 50vw);
    background-color: #07101f;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/*
 * Edler KCC Hero-Look:
 * - dunkles Navy-Overlay für ruhige Bildwirkung
 * - Vignette an den Rändern
 * - dezenter goldener Schimmer im unteren Bereich
 * Der Overlay liegt auf News- UND Galerie-Hero.
 */
.kccpm-news-hero::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 38%,
            rgba(0,0,0,0) 0%,
            rgba(2,5,15,.10) 42%,
            rgba(2,5,15,.54) 100%
        ),
        radial-gradient(ellipse at 50% 105%,
            rgba(212,175,55,.10) 0%,
            rgba(212,175,55,0) 46%
        ),
        linear-gradient(180deg,
            rgba(3,8,24,.36) 0%,
            rgba(3,8,24,.28) 32%,
            rgba(3,8,24,.48) 58%,
            rgba(3,8,24,.78) 79%,
            rgba(3,8,24,.94) 100%
        );
    box-shadow: inset 0 0 120px rgba(0,0,0,.24);
    pointer-events: none;
}

/* Weicher Übergang vom Hero in den dunklen Inhaltsbereich. */
.kccpm-news-hero::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: auto 0 0;
    height: 30%;
    background: linear-gradient(180deg, transparent, rgba(7,16,31,.96) 100%);
    pointer-events: none;
}

.kccpm-news-hero-inner {
    position: relative;
    z-index: 2;
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0 0 clamp(54px, 7vw, 92px);
    color: #fffaf0;
}

.kccpm-news-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 17px;
    color: #e4bc43;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.kccpm-news-hero-kicker::before {
    content: "";
    width: 34px;
    height: 1px;
    background: currentColor;
}

.kccpm-news-hero h1 {
    max-width: 980px;
    margin: 0;
    color: #fffaf0 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 6vw, 78px);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -.035em;
    text-shadow: 0 12px 38px rgba(0,0,0,.5);
}

.kccpm-news-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.kccpm-news-hero-meta time,
.kccpm-news-hero-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(228,188,67,.34);
    border-radius: 999px;
    color: rgba(255,250,240,.88);
    background: rgba(4,8,20,.52);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .04em;
}

/* =========================================================
   NEWS – ARTIKEL
   ========================================================= */
.kccpm-news-article {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: clamp(54px, 7vw, 92px) 24px clamp(68px, 8vw, 110px);
    color: rgba(255,250,240,.78);
    background:
        radial-gradient(circle at 50% 0%, rgba(212,175,55,.08), transparent 34%),
        #07101f;
    box-sizing: border-box;
}

.kccpm-news-copy {
    width: min(860px, 100%);
    margin: 0 auto;
    font-size: clamp(17px, 1.5vw, 19px);
    line-height: 1.9;
}

.kccpm-news-copy > :first-child {
    margin-top: 0 !important;
}

.kccpm-news-copy > :last-child {
    margin-bottom: 0 !important;
}

.kccpm-news-copy p {
    margin: 0 0 1.45em;
    color: rgba(255,250,240,.78) !important;
}

.kccpm-news-copy strong,
.kccpm-news-copy b {
    color: #fffaf0;
    font-weight: 700;
}

.kccpm-news-copy h2,
.kccpm-news-copy h3,
.kccpm-news-copy h4 {
    margin: 1.7em 0 .65em;
    color: #fffaf0 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.16;
}

.kccpm-news-copy h2 { font-size: clamp(30px, 4vw, 44px); }
.kccpm-news-copy h3 { font-size: clamp(24px, 3vw, 32px); }

.kccpm-news-copy a {
    color: #f0cf6c;
}

.kccpm-news-gallery-block {
    width: min(1240px, 100%);
    margin: clamp(58px, 7vw, 90px) auto 0;
}

.kccpm-section-heading {
    margin: 0 0 26px;
    text-align: center;
}

.kccpm-section-heading span {
    display: block;
    margin-bottom: 8px;
    color: #d4af37;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.kccpm-section-heading h2 {
    margin: 0;
    color: #fffaf0 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 4.8vw, 56px);
    font-weight: 400;
    line-height: 1.1;
}

.kccpm-news-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.kccpm-news-gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,.18);
    border-radius: 14px;
    background: #111827;
    box-shadow: 0 12px 34px rgba(0,0,0,.22);
}

.kccpm-news-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .38s ease, filter .38s ease;
}

.kccpm-news-gallery-item:hover img {
    transform: scale(1.045);
    filter: saturate(1.05) contrast(1.03);
}

.kccpm-gallery-link-wrap {
    margin: 38px 0 0;
    text-align: center;
}

.kccpm-gallery-link,
.kccpm-event-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    border: 1px solid rgba(212,175,55,.48);
    border-radius: 999px;
    color: #fff8df !important;
    background: rgba(212,175,55,.09);
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.kccpm-gallery-link:hover,
.kccpm-event-button:hover {
    transform: translateY(-2px);
    border-color: rgba(212,175,55,.8);
    background: rgba(212,175,55,.16);
}

/* =========================================================
   EIGENE NEWS-LIGHTBOX
   ========================================================= */
.kccpm-lightbox {
    width: min(94vw, 1500px);
    max-width: none;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}

.kccpm-lightbox::backdrop { background: rgba(0,0,0,.9); }
.kccpm-lightbox img { display: block; max-width: 94vw; max-height: 90vh; margin: auto; border-radius: 8px; }
/* Close-Button bewusst komplett vom Theme entkoppeln.\n   Das X wird aus zwei Linien gezeichnet, damit Schriftart/line-height/padding\n   des Themes es nicht mehr verschieben können. */\n.kccpm-lightbox-close {\n    -webkit-appearance: none !important;\n    appearance: none !important;\n    position: fixed !important;\n    z-index: 2147483647 !important;\n    top: max(18px, env(safe-area-inset-top)) !important;\n    right: max(18px, env(safe-area-inset-right)) !important;\n    display: grid !important;\n    place-items: center !important;\n    width: 50px !important;\n    height: 50px !important;\n    min-width: 50px !important;\n    min-height: 50px !important;\n    padding: 0 !important;\n    margin: 0 !important;\n    border: 1px solid rgba(212,175,55,.68) !important;\n    border-radius: 999px !important;\n    background: rgba(7,16,31,.84) !important;\n    box-shadow: 0 10px 30px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.08) !important;\n    color: transparent !important;\n    font-size: 0 !important;\n    line-height: 0 !important;\n    text-indent: 0 !important;\n    overflow: hidden !important;\n    cursor: pointer !important;\n    transform: none !important;\n    backdrop-filter: blur(10px);\n    -webkit-backdrop-filter: blur(10px);\n    transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease !important;\n}\n\n.kccpm-lightbox-close::before,\n.kccpm-lightbox-close::after {\n    content: "" !important;\n    position: absolute !important;\n    left: 50% !important;\n    top: 50% !important;\n    width: 21px !important;\n    height: 2px !important;\n    margin: 0 !important;\n    padding: 0 !important;\n    border: 0 !important;\n    border-radius: 999px !important;\n    background: #fff !important;\n    transform-origin: center !important;\n    pointer-events: none !important;\n}\n\n.kccpm-lightbox-close::before {\n    transform: translate(-50%, -50%) rotate(45deg) !important;\n}\n\n.kccpm-lightbox-close::after {\n    transform: translate(-50%, -50%) rotate(-45deg) !important;\n}\n\n.kccpm-lightbox-close:hover {\n    background: #d4af37 !important;\n    border-color: #f5df91 !important;\n    transform: scale(1.05) !important;\n    box-shadow: 0 12px 34px rgba(0,0,0,.42), 0 0 22px rgba(212,175,55,.18) !important;\n}\n\n.kccpm-lightbox-close:hover::before,\n.kccpm-lightbox-close:hover::after {\n    background: #07101f !important;\n}\n\n.kccpm-lightbox-close:focus-visible {\n    outline: 3px solid rgba(245,223,145,.55) !important;\n    outline-offset: 3px !important;\n}\n\n@media (max-width: 700px) {\n    .kccpm-lightbox-close {\n        top: max(12px, env(safe-area-inset-top)) !important;\n        right: max(12px, env(safe-area-inset-right)) !important;\n        width: 46px !important;\n        height: 46px !important;\n        min-width: 46px !important;\n        min-height: 46px !important;\n    }\n}

/* =========================================================
   GALERIE-SEITE
   Gleicher Look wie der News-Beitrag – nur ohne Beitragstext.
   ========================================================= */
body.kccpm-generated-gallery-page {
    background: #07101f;
}

.kccpm-gallery-hero {
    min-height: clamp(430px, 58vw, 690px);
}

.kccpm-gallery-article {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: clamp(54px, 7vw, 90px) 24px clamp(68px, 8vw, 110px);
    color: rgba(255,250,240,.78);
    background:
        radial-gradient(circle at 50% 0%, rgba(212,175,55,.08), transparent 34%),
        #07101f;
    box-sizing: border-box;
}

.kccpm-gallery-content {
    width: min(1240px, 100%);
    margin: 0 auto;
}

.kccpm-rl-gallery-wrap {
    width: 100%;
    margin: 0 auto;
}

/* Responsive Lightbox & Gallery in den KCC-Bereich integrieren. */
.kccpm-rl-gallery-wrap .rl-gallery,
.kccpm-rl-gallery-wrap .rl-gallery-container,
.kccpm-rl-gallery-wrap .rl-gallery-item {
    box-sizing: border-box;
}

.kccpm-rl-gallery-wrap img {
    border-radius: 12px;
}

/* Falls das Galerie-Plugin eigene weiße Flächen mitbringt, transparent halten. */
.kccpm-rl-gallery-wrap,
.kccpm-rl-gallery-wrap > div {
    background-color: transparent !important;
}

/* =========================================================
   OPTIONALE NEUE VERANSTALTUNGSÜBERSICHT
   ========================================================= */
.kccpm-events-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 30px 0; }
.kccpm-event-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: #0f0f1a; box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.kccpm-event-card-image { display: block; height: 440px; background: #1c1c2b; }
.kccpm-event-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kccpm-event-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: #d4af37; font-size: 30px; font-weight: 700; }
.kccpm-event-card-content { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 22px; }
.kccpm-event-card-content h3 { color: #fff; margin: 0 0 18px; font-size: 1.3rem; }
.kccpm-event-button { margin-top: auto; }

@media (max-width: 900px) {
    .kccpm-news-gallery,
    .kccpm-events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kccpm-event-card-image { height: 380px; }
}

@media (max-width: 640px) {
    .kccpm-news-hero { min-height: 440px; }
    .kccpm-news-hero-inner { width: calc(100% - 30px); padding-bottom: 48px; }
    .kccpm-news-hero h1 { font-size: 39px; }
    .kccpm-news-article,
    .kccpm-gallery-article { padding: 48px 15px 70px; }
    .kccpm-news-copy { font-size: 16px; line-height: 1.78; }
    .kccpm-news-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .kccpm-news-gallery-item { border-radius: 10px; }
    .kccpm-events-grid { grid-template-columns: 1fr; }
    .kccpm-event-card-image { height: 470px; }
}
