/**
 * WMI-Business — Project Detail Page Styles
 *
 * Standard-Layout fuer Projekt-/Referenzseiten.
 * Wird automatisch geladen wenn template-project.php aktiv ist.
 *
 * Sektionen:
 *   1. Page Background
 *   2. Layout (Sidebar + Content)
 *   3. Hero Banner
 *   4. Key Facts
 *   5. Highlight Cards (Herausforderung, Ansatz, Ergebnis, Fazit)
 *   6. Skills Grid & Cards (Kenntnisse)
 *   7. Detail Tiles
 *   8. Navigation Footer
 *   9. Responsive
 *
 * @package WMI_Business
 */


/* ==========================================================================
   1. Page Background — weiss, kein Parallax
   ========================================================================== */

body.wmi-page--project {
    background: #fff;

    /* Zentraler Farbschema-Override fuer Projektseiten (Schema 2 statt 1) */
    --wmi-c-primary:    var(--f-schema-2-5, #27BA27);
    --wmi-c-primary-dk: var(--f-schema-2-4, #238623);
    --wmi-c-primary-lt: var(--f-schema-2-8, #b3e0b3);
}
body.wmi-page--project::before {
    display: none;
}
body.wmi-page--project .site-content {
    background: #fff !important;
}


/* ==========================================================================
   2. Layout — Sidebar TOC + Content
   ========================================================================== */

.wmi-project-layout {
    display: flex;
    gap: 32px;
    max-width: calc(800px + 240px + 32px);
    margin: 0 auto;
    padding: 32px var(--wmi-spacing, 24px) 0;
}

/* Sticky TOC innerhalb Flex — feste Breite + align-self verhindert Stretch */
.wmi-project-layout > .wmi-toc-sidebar {
    width: 240px;
    flex-shrink: 0;
    align-self: flex-start;
}

.wmi-project-layout > .wmi-docs-content {
    flex: 1;
    min-width: 0;
}


/* ==========================================================================
   3. Hero Banner
   ========================================================================== */

.wmi-project-hero {
    position: relative;
    overflow: hidden;
    max-width: calc(800px + 240px + 32px);
    margin: 0 auto;
    padding: 0 var(--wmi-spacing, 24px);
}

.wmi-project-hero::after {
    display: none;
}

/* Hero mit Hintergrundbild + Milchglas-Filter direkt auf dem Element */
.wmi-project-hero--image {
    height: 280px;
    border-radius: 0 0 8px 8px;
    margin-bottom: 0;
    background-size: cover !important;
    background-position: center !important;
    filter: none;
}

/* Weisses Overlay ueber dem Milchglas-Bild */
.wmi-project-hero--image::after {
    content: '';
    display: block !important;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(2px) saturate(0.6);
    -webkit-backdrop-filter: blur(2px) saturate(0.6);
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

/* Content-Block auf dem Bild — mittig zentriert (Standard) */
.wmi-project-hero--image .wmi-project-hero__content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: auto;
    max-width: 480px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 32px;
    color: #fff;
    text-align: center !important;
    border-radius: 12px !important;
    border: none;
    background: color-mix(in srgb, var(--wmi-c-primary, var(--f-schema-1-5, #2563eb)) 75%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Projekt-Seiten: Content rechts positioniert */
body.wmi-page--project .wmi-project-hero--image .wmi-project-hero__content {
    left: auto !important;
    right: 32px !important;
    transform: translateY(-50%);
    text-align: right !important;
}

/* ── Sektionsbasierte Hero-Ausrichtung (automatisch per Body-Klasse) ── */

/* Leistungen: Content mittig, Text mittig (Standard — keine Aenderung noetig) */

/* Branchen + Technologien Unterseiten: Content links, Text links
   .page-child = hat ein Parent → ist eine Unterseite */
body.page-child.wmi-section--branchen .wmi-project-hero--image .wmi-project-hero__content,
body.page-child.wmi-section--technologien .wmi-project-hero--image .wmi-project-hero__content {
    left: 32px !important;
    right: auto !important;
    transform: translateY(-50%) !important;
    text-align: left !important;
}

body.page-child.wmi-section--branchen .wmi-project-hero--image .wmi-project-hero__title,
body.page-child.wmi-section--technologien .wmi-project-hero--image .wmi-project-hero__title {
    text-align: left !important;
}

body.page-child.wmi-section--branchen .wmi-project-hero--image .wmi-project-hero__sub,
body.page-child.wmi-section--technologien .wmi-project-hero--image .wmi-project-hero__sub {
    text-align: left !important;
}

/* Branchen + Technologien Uebersicht (page-parent): mittig (Standard) */

/* Projekte: Content rechts, Text rechts */
body.wmi-page--project .wmi-project-hero--image .wmi-project-hero__title {
    text-align: right !important;
}

body.wmi-page--project .wmi-project-hero--image .wmi-project-hero__sub {
    text-align: right !important;
}

.wmi-project-hero--image .wmi-project-hero__title {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-size: clamp(22px, 3.5vw, 32px) !important;
    font-weight: 700;
    text-align: center !important;
    line-height: 1.2;
    margin: 0 0 6px;
}

.wmi-project-hero--image .wmi-project-hero__sub {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: none;
    font-size: 15px !important;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hero-Content --left Variante nicht mehr noetig (alles zentriert) */

/* Hero OHNE Bild — volle Breite, dunkler Schema-Hintergrund */
.wmi-project-hero__content {
    position: relative;
    padding: 48px var(--wmi-spacing, 24px) 40px;
    color: #fff;
    max-width: none;
    background: linear-gradient(135deg, var(--f-schema-1-3, #2d1111), var(--f-schema-1-2, #1a0a0a));
    border-bottom: 4px solid var(--wmi-c-primary, var(--f-schema-1-5, #BA2727));
    border-radius: 0;
    text-align: center;
}

.wmi-project-hero__title {
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--wmi-c-primary, var(--f-schema-1-5, #2563eb));
    text-shadow: none;
    line-height: 1.2;
}

/* Wide-Template: Hero identisch zum Content-Block positionieren
   Content hat inline: max-width:var(--wmi-wide-width, 1080px);margin:0 auto;padding:32px var(--wmi-spacing, 24px) */
.wmi-docs-content--wide ~ .wmi-project-hero,
.site-main--docs:not(:has(.wmi-project-layout)) .wmi-project-hero {
    max-width: var(--wmi-wide-width, 1080px) !important;
    margin: 0 auto !important;
    padding: 0 var(--wmi-spacing, 24px) !important;
    box-sizing: content-box !important;
}

.site-main--docs:not(:has(.wmi-project-layout)) .wmi-project-hero__content {
    max-width: 340px;
    margin: 0;
    padding: 24px 20px;
}

/* Titel/Sub ohne Bild */
.wmi-project-hero:not(.wmi-project-hero--image) .wmi-project-hero__title {
    color: #fff !important;
    font-size: clamp(24px, 4vw, 38px) !important;
    text-shadow: none;
    text-align: center !important;
}

.wmi-project-hero:not(.wmi-project-hero--image) .wmi-project-hero__sub {
    color: var(--f-schema-1-8, rgba(255,255,255,0.8)) !important;
    font-size: 1rem !important;
    max-width: 600px;
    margin: 0 auto;
    text-align: center !important;
    opacity: 1;
}

.wmi-project-hero__sub {
    font-size: 14px;
    opacity: 0.85;
    margin: 0;
    color: var(--f-schema-4-3, #383838);
    line-height: 1.4;
}


/* ==========================================================================
   4. Key Facts
   ========================================================================== */

/* Key Facts — gleicher Look wie im Editor (editor-style.css).
   WordPress-Core setzt display:flex per !important auf .wp-block-columns,
   daher muessen wir ebenfalls !important nutzen. */
.wp-block-columns.wmi-project-facts,
.wmi-project-facts {
    display: flex !important;
    gap: 16px !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
    margin-top: 24px !important;
    margin-bottom: 48px !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    position: relative;
    z-index: 3;
    box-shadow: none !important;
    overflow: visible !important;
}

.wp-block-columns.wmi-project-facts > .wp-block-column,
.wmi-project-fact {
    text-align: center !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 20px 16px !important;
    background: #fff !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--f-schema-4-9, #e5e7eb) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    aspect-ratio: 1 / 1 !important;
    min-height: 100px !important;
    padding: 0 !important;
}

/* Gleiches Problem bei Highlight-Cards in wp-block-columns */
.wp-block-columns.wmi-project-highlight,
.wmi-project-highlight {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    flex-wrap: unset !important;
    margin: 32px 0 !important;
    align-items: stretch !important;
}

.wmi-project-fact__value {
    font-size: clamp(13px, 2vw, 17px);
    font-weight: 700;
    color: var(--wmi-c-primary, var(--f-schema-1-5, #2563eb));
    margin: 0 0 4px !important;
    display: block;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.wmi-project-fact__label {
    font-size: 11px;
    color: var(--f-schema-4-5, #6b7280);
    margin: 0 !important;
    display: block;
    line-height: 1.3;
}


/* ==========================================================================
   5. Highlight Cards — Herausforderung, Ansatz, Ergebnis, Fazit
   ========================================================================== */

.wmi-project-highlight__card {
    border-radius: 8px;
    padding: 24px;
    border-left: 4px solid;
}

/* Herausforderung — Rot (fest) */
.wmi-project-highlight__card--challenge {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    --_hl-title: #991b1b;
}

/* Ansatz — Grün (fest) */
.wmi-project-highlight__card--approach {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    --_hl-title: #14532d;
}

/* Ergebnis — Blau (fest) */
.wmi-project-highlight__card--result {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    --_hl-title: #1e3a8a;
}

/* Fazit — Violett (fest) */
.wmi-project-highlight__card--fazit {
    background: #f5f3ff;
    border-left: 4px solid #7c3aed;
    --_hl-title: #2e1065;
}

/* Hinweis — Himmelblau (fest) */
.wmi-project-highlight__card--info {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    --_hl-title: #0c4a6e;
}

/* Warnung — Amber (fest) */
.wmi-project-highlight__card--warning {
    background: #fffbeb;
    border-left: 4px solid #d97706;
    --_hl-title: #78350f;
}

/* Tipp — Teal (fest) */
.wmi-project-highlight__card--tip {
    background: #f0fdfa;
    border-left: 4px solid #0d9488;
    --_hl-title: #134e4a;
}

.wmi-project-highlight__title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--_hl-title, inherit);
}

.wmi-project-highlight__text {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.wmi-project-highlight__text ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.wmi-project-highlight__text li {
    margin-bottom: 4px;
}

/* Einzelkarte (als Pattern ohne Grid-Parent) — margin fuer Standalone-Nutzung */
.wmi-project-highlight__card {
    margin: 16px 0;
}

.wmi-project-highlight__card h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--_hl-title, inherit);
}

.wmi-project-highlight__card p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.wmi-project-highlight__card ul {
    font-size: 14px;
    line-height: 1.6;
    margin: 8px 0 0;
    padding-left: 18px;
}

.wmi-project-highlight__card li {
    margin-bottom: 4px;
}


/* ==========================================================================
   6. Skills Grid & Cards (Kenntnisse)
   ========================================================================== */

.wmi-skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}

.wmi-skills-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border-left: 4px solid var(--_skills-accent, var(--f-schema-4-5, #707070));
}

/* Header — leicht getoenter Hintergrund passend zur Akzentfarbe */
.wmi-skills-card__header {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--_skills-accent-dark, var(--f-schema-4-2, #1c1c1c));
    background: var(--_skills-header-bg, var(--f-schema-4-9, #e3e3e3));
}
.wmi-skills-card__header p {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    color: inherit;
}

/* Farb-Variablen pro Kenntnistyp auf Karten-Ebene (cascading zu Header + Body).
   header-bg = Stufe -9 (sichtbar getoent)
   bg        = Stufe -10 (ganz hell, fuer Pills)
   accent-dark = Stufe -2 (dunkel, guter Kontrast) */
.wmi-skills-card:has(.wmi-skills-card__header--infra)      { --_skills-accent: var(--f-schema-1-5); --_skills-accent-dark: var(--f-schema-1-2); --_skills-header-bg: var(--f-schema-1-9); --_skills-bg: var(--f-schema-1-10); }
.wmi-skills-card:has(.wmi-skills-card__header--db)         { --_skills-accent: var(--f-schema-3-5); --_skills-accent-dark: var(--f-schema-3-2); --_skills-header-bg: var(--f-schema-3-9); --_skills-bg: var(--f-schema-3-10); }
.wmi-skills-card:has(.wmi-skills-card__header--tools)      { --_skills-accent: var(--f-schema-2-5); --_skills-accent-dark: var(--f-schema-2-2); --_skills-header-bg: var(--f-schema-2-9); --_skills-bg: var(--f-schema-2-10); }
.wmi-skills-card:has(.wmi-skills-card__header--os)         { --_skills-accent: var(--f-schema-4-4); --_skills-accent-dark: var(--f-schema-4-1); --_skills-header-bg: var(--f-schema-4-9); --_skills-bg: var(--f-schema-4-10); }
.wmi-skills-card:has(.wmi-skills-card__header--cloud)      { --_skills-accent: var(--f-schema-1-4); --_skills-accent-dark: var(--f-schema-1-2); --_skills-header-bg: var(--f-schema-1-9); --_skills-bg: var(--f-schema-1-10); }
.wmi-skills-card:has(.wmi-skills-card__header--monitoring) { --_skills-accent: #7c3aed; --_skills-accent-dark: #2e1065; --_skills-header-bg: #ede9fe; --_skills-bg: #f5f3ff; }
.wmi-skills-card:has(.wmi-skills-card__header--scripting)  { --_skills-accent: #d97706; --_skills-accent-dark: #451a03; --_skills-header-bg: #fef3c7; --_skills-bg: #fffbeb; }
.wmi-skills-card:has(.wmi-skills-card__header--method)     { --_skills-accent: #0891b2; --_skills-accent-dark: #083344; --_skills-header-bg: #cffafe; --_skills-bg: #ecfeff; }

/* Body — Pill-Tags als Container-Buttons */
.wmi-skills-card__body {
    padding: 12px 16px;
}

.wmi-skills-card__body ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wmi-skills-card__body li {
    font-size: 12px;
    font-weight: 500;
    color: var(--_skills-accent-dark, var(--f-schema-4-3, #383838));
    padding: 5px 12px;
    background: var(--_skills-bg, var(--f-schema-4-10, #f8fafc));
    border: 1px solid var(--_skills-bg, var(--f-schema-4-9, #e2e8f0));
    border-radius: 20px;
    white-space: nowrap;
}


/* ==========================================================================
   7. Detail Tiles (optionale Zusatz-Kacheln)
   ========================================================================== */

.wmi-project-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}

.wmi-project-tile {
    background: #fff;
    border: 1px solid var(--f-schema-4-8, #e2e8f0);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.wmi-project-tile:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.wmi-project-tile__icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 20px;
}

.wmi-project-tile__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--f-schema-4-2, #1c1c1c);
    margin: 0 0 4px;
}

.wmi-project-tile__desc {
    font-size: 13px;
    color: var(--f-schema-4-4, #545454);
    line-height: 1.5;
    margin: 0;
}


/* ==========================================================================
   8. Navigation Footer
   ========================================================================== */

.wmi-project-nav-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--f-schema-4-8, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}


/* ==========================================================================
   9. Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .wmi-project-layout {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .wmi-project-highlight {
        grid-template-columns: 1fr;
    }

    .wmi-project-hero {
        height: 220px;
    }

    .wmi-project-hero__content {
        padding: 20px;
    }

    .wmi-project-hero--image .wmi-project-hero__content {
        width: auto;
        min-width: 0;
        max-width: none;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        min-height: auto;
    }
    .wmi-project-hero--image { margin-bottom: 0; }
}
