/* karley.eu CMS — eigene Anpassungen, geladen NACH der gemergten Porto-CSS */

/* --- Header-Logo verkleinern (img hat width/height=512 -> sonst riesig) --- */
#header .logo img.standard-logo,
#header .logo img {
    max-height: 62px;
    width: auto !important;
    height: auto !important;
}
@media (max-width: 991px) {
    #header .logo img.standard-logo,
    #header .logo img { max-height: 48px; }
}

/* --- Footer: Porto-Platzhalterlogo ausblenden --- */
.footer-wrapper .footer-left .logo,
#footer .footer-left .logo { display: none !important; }
#footer .footer-bottom { padding: 1.25rem 0; }
#footer .footer-copyright { color: #adb5bd; }

/* --- Gutenberg-Core-Block-Styles (kommen sonst aus WP-Core, fehlen hier) --- */
.wp-block-columns { display: flex; flex-wrap: wrap; gap: 1.75rem; margin-bottom: 1.5rem; }
.wp-block-column  { flex: 1 1 0%; min-width: 0; }
@media (max-width: 781px) {
    .wp-block-columns { gap: 1rem; }
    .wp-block-column  { flex-basis: 100% !important; }
}
.wp-block-image { margin: 0 0 1rem; }
.wp-block-image img,
.entry-content img,
.page-content img { max-width: 100%; height: auto; }
.wp-block-image.aligncenter,
.wp-block-image .aligncenter { text-align: center; }
figure.wp-block-image { display: block; }
.wp-block-image figcaption,
figcaption { font-size: .85rem; color: #6c757d; text-align: center; margin-top: .35rem; }

.wp-block-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.wp-block-button__link {
    display: inline-block; background: var(--phoenix-primary, #0d6efd); color: #fff;
    padding: .5rem 1.25rem; border-radius: .35rem; text-decoration: none;
}
.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent; border: 1px solid currentColor; color: inherit;
}
/* Kaputte schwarz-auf-schwarz-Buttons (Gutenberg-Inline #000000) lesbar machen */
.wp-block-button__link[style*="#000000"],
.wp-block-button__link[style*="#000;"] {
    background-color: var(--phoenix-primary, #0d6efd) !important; color: #fff !important;
}

.wp-block-table { overflow-x: auto; margin-bottom: 1.5rem; }
.wp-block-table table { width: 100%; border-collapse: collapse; }
.wp-block-table td, .wp-block-table th { border: 1px solid #dee2e6; padding: .5rem .75rem; }
.wp-block-table.is-style-stripes tr:nth-child(odd) td { background: #f8f9fa; }

.wp-block-separator { border: 0; border-top: 1px solid #dee2e6; margin: 1.75rem auto; max-width: 100px; }
.wp-block-separator.is-style-wide { max-width: 100%; }
/* has-background-Trenner als duenne Linie statt dickem Balken (z.B. schwarz-auf-schwarz) */
.wp-block-separator.has-background { height: 2px; border: 0; opacity: .35; }
.wp-block-quote { border-left: 4px solid #dee2e6; padding-left: 1rem; color: #495057; font-style: italic; }
.wp-block-list { padding-left: 1.25rem; }

/* --- News-Teaser-Block --- */
.cms-news-block .news-teaser img { width: 100%; object-fit: cover; aspect-ratio: 16/10; border-radius: .35rem; }
.cms-news-block h4 a { color: inherit; }

/* --- News-Karten (Uebersicht + Kategorie) — gleiche Hoehe, Porto-Look --- */
.news-card { border-radius: .5rem; overflow: hidden; transition: box-shadow .2s, transform .2s; background: #fff; }
.news-card:hover { box-shadow: 0 .75rem 1.75rem rgba(0,0,0,.12) !important; transform: translateY(-3px); }
.news-card .news-thumb { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; background: #eef1f4; }
.news-card .news-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.news-card:hover .news-thumb img { transform: scale(1.06); }
.news-card .news-thumb.no-img { display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f3f6f9, #e6edf4); }
.news-card .news-thumb.no-img img.news-thumb-logo {
    width: auto; height: auto; max-width: 62%; max-height: 72%; object-fit: contain;
    opacity: .9; transition: transform .35s ease;
}
.news-card:hover .news-thumb.no-img img.news-thumb-logo { transform: scale(1.04); }
.news-card .news-date {
    position: absolute; top: 12px; left: 12px; z-index: 2; text-align: center; line-height: 1;
    background: var(--phoenix-primary, #0d6efd); color: #fff; border-radius: .35rem; padding: .35rem .5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.25); min-width: 46px;
}
.news-card .news-date .d { display: block; font-size: 1.15rem; font-weight: 700; }
.news-card .news-date .m { display: block; font-size: .7rem; text-transform: uppercase; opacity: .9; }
.news-card .card-body { padding: 1rem 1.1rem 1.1rem; }
.news-card .news-title { line-height: 1.3; }
.news-card .news-title a { color: #222; }
.news-card:hover .news-title a { color: var(--phoenix-primary, #0d6efd); }
.news-card .news-excerpt {
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.news-card .read-more { color: var(--phoenix-primary, #0d6efd); text-decoration: none; }
.news-card .read-more:hover { text-decoration: underline; }

/* --- Hauptmenue: Dropdown/Flyout (Design wie alt: Icons + Trenner) --- */
#main-menu .main-menu { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
#main-menu .main-menu li { position: relative; }
/* Top-Level: Grossbuchstaben, etwas fetter (wie alte Seite) */
#main-menu .main-menu > li > a {
    padding: .55rem .9rem; text-transform: uppercase; font-weight: 600; letter-spacing: .02em;
    border-radius: .45rem !important; transition: background-color .15s ease, color .15s ease;
}
#main-menu .main-menu > li > a > i { margin-right: .4rem; }
/* Hover/aktiv: weicher abgerundeter Block statt scharfem Rechteck */
#main-menu .main-menu > li:hover > a,
#main-menu .main-menu > li.current-menu-item > a,
#main-menu .main-menu > li.current-menu-ancestor > a {
    border-radius: .45rem !important;
}

#main-menu .sub-menu {
    position: absolute; top: 100%; left: 0; min-width: 260px; max-width: 340px;
    background: #fff; box-shadow: 0 12px 34px rgba(0,0,0,.13); border-radius: .55rem;
    list-style: none; margin: 0; padding: .4rem 0; z-index: 1050; display: none;
    /* KEIN overflow:hidden — sonst werden die 3.-Ebene-Flyouts (left:100%) abgeschnitten */
}
#main-menu .main-menu li:hover > .sub-menu { display: block; }
/* Top-Level-Dropdown: Abstand zur Menueleiste + unsichtbare Hover-Bruecke */
#main-menu .main-menu > li > .sub-menu { margin-top: 12px; }
#main-menu .main-menu > li > .sub-menu::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
#main-menu .sub-menu .sub-menu { top: -.4rem; left: 100%; margin-top: 0; }   /* 3. Ebene als Flyout */
#main-menu .sub-menu .sub-menu::before { display: none; }

/* Untermenue-Eintraege: Icon + Label, Trenner, Hover */
#main-menu .sub-menu > li:not(:last-child) > a { border-bottom: 1px solid #f0f1f3; }
#main-menu .sub-menu a {
    display: flex; align-items: center; gap: .7rem; padding: .65rem 1.25rem;
    white-space: normal; line-height: 1.3; color: #333; font-size: .92rem; text-transform: none; font-weight: 400;
}
#main-menu .sub-menu a > i { flex: 0 0 auto; width: 1.2em; text-align: center; font-size: 1em; color: #8a93a0; transition: color .15s; }
#main-menu .sub-menu a:hover { background: #f5f7fa; color: var(--phoenix-primary, #0d6efd); }
#main-menu .sub-menu a:hover > i { color: var(--phoenix-primary, #0d6efd); }
#main-menu .sub-menu .menu-item-has-children > a::after { content: "\203A"; margin-left: auto; opacity: .55; font-size: 1.1em; }

/* --- Migrierte Slider (Owl) --- */
.cms-slider { background: #f4f6f8; border-radius: .4rem; overflow: hidden; min-height: 220px; position: relative; }
.cms-slider .item { text-align: center; }
.cms-slider img { max-height: 460px; width: auto; max-width: 100%; height: auto; margin: 0 auto; display: block; }
.cms-slider:not(.owl-loaded) .item:not(:first-child) { display: none; }   /* vor JS-Init nur 1. Bild */
.cms-slider .owl-nav button.owl-prev,
.cms-slider .owl-nav button.owl-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; background: rgba(0,0,0,.4) !important; color: #fff !important;
    border-radius: 50%; font-size: 1.4rem !important; line-height: 1;
}
.cms-slider .owl-nav button.owl-prev { left: 10px; }
.cms-slider .owl-nav button.owl-next { right: 10px; }
.cms-slider .owl-dots { text-align: center; padding: .5rem 0; }
.cms-slider .owl-dots .owl-dot span { width: 10px; height: 10px; margin: 4px; background: #bbb; display: inline-block; border-radius: 50%; }
.cms-slider .owl-dots .owl-dot.active span { background: var(--phoenix-primary, #0d6efd); }

/* --- Links in farbigen Bloecken lesbar (sonst blaue Links auf blauem Hintergrund unsichtbar) --- */
.wp-block-column.has-background a,
.wp-block-group.has-background a,
.wp-block-cover a,
[class*="wp-block"].has-background a { color: inherit; text-decoration: underline; }

/* --- Mobiles Menü (Hamburger + Akkordeon) --- */
.mobile-toggle { display: none; }
@media (max-width: 991.98px) {
    #header .header-main { position: relative; }
    .mobile-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 44px; height: 40px; border-radius: .4rem;
        background: var(--phoenix-primary, #0088cc); color: #fff; font-size: 1.2rem;
    }
    .mobile-toggle:hover { color: #fff; }

    /* Voll-breites Menü von oben (position:fixed -> viewport-relativ, ganze Breite) */
    #main-menu {
        position: fixed !important; left: 0 !important; right: 0 !important; width: 100% !important;
        top: var(--mobilemenu-top, 60px);
        background: #fff; box-shadow: 0 14px 30px rgba(0,0,0,.18);
        max-height: calc(100vh - var(--mobilemenu-top, 60px));
        overflow-y: auto; overflow-x: hidden; display: none !important; z-index: 1060;
        border-top: 1px solid #eee;
    }
    #main-menu.open { display: block !important; }
    #main-menu .main-menu { display: block; }
    #main-menu .main-menu > li,
    #main-menu .sub-menu > li { position: static; border-bottom: 1px solid #f0f1f3; }
    #main-menu .main-menu > li > a {
        text-transform: none; font-weight: 600; border-radius: 0 !important; padding: .85rem 1.1rem;
    }
    #main-menu .main-menu a { display: flex; align-items: center; gap: .65rem; padding: .8rem 1.1rem; }

    /* Untermenues: statisch, per Akkordeon (li.open) — !important gegen Porto-Override */
    #main-menu .sub-menu {
        position: static !important; display: none !important; box-shadow: none !important;
        border: 0; border-radius: 0; min-width: 0; max-width: none; margin: 0; padding: 0;
        background: #f7f8fa; border-top: 1px solid #f0f1f3; transform: none !important; opacity: 1 !important;
    }
    #main-menu li.open > .sub-menu { display: block !important; }
    #main-menu .sub-menu .sub-menu { left: auto; top: auto; padding-left: .8rem; }
    #main-menu .sub-menu a { padding-left: 2rem; }
    #main-menu .sub-menu .sub-menu a { padding-left: 2.8rem; }

    /* Ausklapp-Pfeil fuer Eltern (alle Ebenen, !important gegen Desktop-Regel) */
    #main-menu .menu-item-has-children > a::after {
        content: "\25BE" !important; margin-left: auto; transition: transform .2s; opacity: .6; font-size: 1em;
    }
    #main-menu li.open > a::after { transform: rotate(180deg); }
}

/* --- Allgemein --- */
#content .page-content,
#content .entry-content { line-height: 1.6; }
#content .entry-content a, #content .page-content a { word-break: break-word; }

/* --- Team-Mitarbeiter (Baustein) --- */
.team-member { text-align: center; margin-bottom: 30px; }
.team-member .team-member-photo {
    width: 130px; height: 130px; margin: 0 auto;
    border-radius: 12px; overflow: hidden; background: #eef2f7;
}
.team-member .team-member-photo img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.team-member .team-member-name { margin: 14px 0 2px; font-size: 1.2rem; }
.team-member .team-member-role { margin: 0; color: #0088cc; font-weight: 600; }
.team-member .team-member-dept { margin: 2px 0 0; color: #777; font-size: .9em; }
.team-member .team-member-text { margin: 8px 0 0; color: #555; font-size: .92em; }

/* --- Stellenanzeige (Baustein) --- */
.job-posting {
    border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px 28px;
    margin: 0 0 24px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.job-posting .job-title { margin: 0 0 10px; color: #222529; }
.job-posting .job-meta { margin: 0 0 14px; }
.job-posting .job-badge {
    display: inline-block; background: #eef6ff; color: #0a4d8c;
    border-radius: 20px; padding: 4px 13px; font-size: .85em; margin: 0 6px 6px 0; font-weight: 600;
}
.job-posting .job-body { margin-bottom: 16px; }
.job-posting .job-body ul { padding-left: 1.2em; }
.job-posting .job-badge i { margin-right: 5px; opacity: .8; }

/* --- Bewerbungsformular pro Stelle (JS-frei via <details>) --- */
.job-apply { border-top: 1px solid #eef0f3; padding-top: 14px; }
.job-apply > summary {
    cursor: pointer; display: inline-block; font-weight: 600; color: #0a4d8c;
    list-style: none; padding: 8px 18px; border: 1px solid #0a4d8c; border-radius: 24px;
    transition: background .15s, color .15s;
}
.job-apply > summary::-webkit-details-marker { display: none; }
.job-apply > summary:hover { background: #0a4d8c; color: #fff; }
.job-apply[open] > summary { background: #0a4d8c; color: #fff; margin-bottom: 18px; }
.job-apply > summary i { margin-right: 6px; }
.job-apply-form { max-width: 720px; }
.jobs-list .alert { border-radius: 10px; }

/* --- Team-Grid (Block [team]) --- */
.team-grid .team-dept-heading {
    margin: 28px 0 16px; padding-bottom: 8px; border-bottom: 2px solid #eef0f3;
    font-size: 1.35rem; color: #222529;
}
.team-grid .team-dept-heading:first-child { margin-top: 0; }
.team-member .team-member-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; background: #eef2f7;
    color: #9aa7b8; font-size: 2.6rem;
}

/* --- YouTube Klick-zum-Laden / Facade (DSGVO – kein YouTube/DoubleClick vor Klick) --- */
.yt-embed {
    position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1rem 0;
    background: #0b0f14; border-radius: 10px; overflow: hidden;
}
.yt-embed > iframe, .yt-embed > .yt-facade { position: absolute; inset: 0; width: 100%; height: 100%; }
.yt-facade {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .75rem; border: 0; cursor: pointer; color: #fff; text-align: center;
    background: radial-gradient(120% 120% at 50% 35%, #1d2733 0%, #0b0f14 100%);
}
.yt-facade__play {
    width: 76px; height: 54px; border-radius: 14px;
    background: rgba(8, 12, 18, .65); position: relative; transition: background-color .15s;
}
.yt-facade__play::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid; border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent #fff;
}
.yt-facade:hover .yt-facade__play, .yt-facade:focus-visible .yt-facade__play { background: #cd2c1e; }
.yt-facade__hint { font-size: .9rem; line-height: 1.3; padding: 0 1rem; }
.yt-facade__hint small { opacity: .8; font-size: .78rem; }
.yt-facade:focus-visible { outline: 3px solid #ffd54a; outline-offset: -3px; }

/* --- Cookie-/Datenschutz-Hinweis (nur YouTube ist zustimmungsrelevant) --- */
.cookie-notice {
    position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1080;
    max-width: 560px; margin: 0 auto; background: #11161d; color: #eef2f7;
    border: 1px solid #2a3543; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35); padding: 1rem 1.15rem;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice__text { margin: 0 0 .75rem; font-size: .9rem; line-height: 1.5; }
.cookie-notice__text a { color: #7db8ff; text-decoration: underline; }
.cookie-notice__actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.cookie-notice__btn {
    border: 0; border-radius: 8px; padding: .5rem 1.1rem; font-weight: 600;
    cursor: pointer; font-size: .88rem;
}
.cookie-notice__btn--ok { background: #0d6efd; color: #fff; }
.cookie-notice__btn--ok:hover { background: #0b5ed7; }
@media (max-width: 575.98px) { .cookie-notice { left: .5rem; right: .5rem; bottom: .5rem; } }
