/* ==========================================================================
   Startseite simeon.swiss (body.split) – Übergang Classic Cars -> Simeon IT
   Wird in site/snippets/head.php nur bei $brand === 'split' geladen.
   Markup: site/snippets/hub/hero.php          (Variante B, freigestellter Wagen – aktiv)
           site/snippets/hub/hero-showroom.php (Variante A, Showroom-Foto – Reserve)
   ========================================================================== */

body.split {
    --hub-warm: #EDEDE9;
    --hub-navy: #0A2A55;
    --hub-navy-2: #0A3F86;
    --hub-red: #E03A3E;
    --hub-gutter: max(2.5rem, calc(50vw - 640px + 2.5rem));
}

body.split .hub-main {
    padding: 0;
    background: var(--hub-navy);
}

/* kurze Seiten (Tablet hochkant): unter dem Inhalt kein heller Streifen */
body.split:has(.hub) { background-color: var(--hub-navy); }

.hub {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "cars" "stage" "it";
    background: var(--hub-navy);
}

.hub-cars  { grid-area: cars; }
.hub-it    { grid-area: it; }
.hub-stage { grid-area: stage; overflow: hidden; }

/* ---------- Texte ---------- */

.hub-text-inner { max-width: 32rem; }

.hub-cars { padding: 5rem 2.5rem 1rem; background: var(--hub-warm); }
.hub-it   { padding: 1.5rem 2.5rem 4.5rem; }

.hub h2 { line-height: 1.05; }

.hub-it h2,
.hub-it .block-type-button span { color: #fff; }
.hub-it h4 { color: #8DBBF7; }
.hub-it p  { color: rgba(255, 255, 255, .8); }

/* roter Cursor-Punkt hinter «Simeon IT» */
.hub-it h2 strong::after {
    content: "";
    display: inline-block;
    width: .16em;
    height: .16em;
    margin-left: .06em;
    border-radius: 50%;
    background: var(--hub-red);
}

.hub-it .block-type-button a { border-color: rgba(255, 255, 255, .85); }
.hub-it .block-type-button svg { fill: #fff; }
.hub-it .block-type-button a:hover { border-color: #8DBBF7; }
.hub-it .block-type-button a:hover span { color: #8DBBF7; }
.hub-it .block-type-button a:hover svg { fill: #8DBBF7; }

.hub a:focus-visible {
    outline: 3px solid #2F6FED;
    outline-offset: 4px;
    border-radius: 4px;
}

/* nur für Screenreader und Suchmaschinen sichtbar */
.hub-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Marken-Logos über den Titeln (Schutzzone und Mindestgrösse gemäss Logo-Anleitung) */
.hub-logo-link { display: inline-block; margin-bottom: .75rem; border-radius: 6px; }
.hub-logo, .hub-it .sit-logo { display: block; width: auto; }
.hub .block-type-heading:first-of-type h2 { margin-top: 0 !important; }
.hub-logo-cars { height: 56px; }
.hub-it .sit-logo { height: 34px; margin-block: 11px; }   /* gleiche optische Höhe wie das Schild */
/* IT-Logo auf Nachtblau: Negativ-Farben aus dem Logo-Paket */
.hub-it .sit-logo path[fill="#0A2A55"] { fill: #FFFFFF; }
.hub-it .sit-logo path[fill="#2F6FED"] { fill: #8DBBF7; }

@media (min-width: 1024px) {
    .hub-logo-cars { height: 64px; }
    .hub-it .sit-logo { height: 38px; margin-block: 13px; }
}

/* ---------- Bühne (gemeinsam) ---------- */

.hub-stage-inner { position: relative; }

.hub-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ---------- Variante B: freigestellter Wagen (2400 x 700) ---------- */

.hub--cutout .hub-stage {
    /* Handy: heller Grund unter dem Wagen, unten Übergang ins Nachtblau der IT-Spalte */
    background: linear-gradient(180deg, var(--hub-warm) 0, var(--hub-warm) 84%, var(--hub-navy) 100%);
}

.hub--cutout .hub-stage-inner {
    aspect-ratio: 2400 / 700;
    width: 135%;           /* Handy: Wagen grösser, Linie läuft nach rechts aus dem Bild */
    margin-left: -6%;
}

.hub--cutout .hub-car img {
    position: absolute;
    left: 6.6667%;         /*  160 / 2400 */
    top: 40.357%;          /* 282.5 / 700 */
    width: 47.9167%;       /* 1150 / 2400 */
    height: auto;
    max-width: none;
}

/* Foto -> Technik: Foto bis zum Radlauf hinten voll, ab Hinterrad-Mitte technische Zeichnung
   (Prozent bezogen auf die Bildbreite: Radlauf ≈ 68 %, Radmitte ≈ 77 %, Heck ≈ 100 %) */
.hub--cutout .hub-car:not(.hub-car-tech) img {
    -webkit-mask-image: linear-gradient(to right, #000 64%, transparent 86%);
    mask-image: linear-gradient(to right, #000 64%, transparent 86%);
}

.hub--cutout .hub-car-tech img {
    -webkit-mask-image: linear-gradient(to right, transparent 60%, #000 80%);
    mask-image: linear-gradient(to right, transparent 60%, #000 80%);
    animation: hub-tech-in 1.2s ease .2s both;
}

@keyframes hub-tech-in { from { opacity: 0; } to { opacity: 1; } }

/* Tablet: genug Platz für die ganze Linie bis zum roten Punkt */
@media (min-width: 640px) {
    .hub--cutout .hub-stage-inner { width: 100%; margin-left: 0; }
}

/* ---------- Variante A: Showroom-Foto (2400 x 1000) ---------- */

.hub--showroom .hub-cars {
    padding-bottom: 5rem;
    background: linear-gradient(180deg, var(--hub-warm) 0, var(--hub-warm) calc(100% - 4rem), var(--hub-navy) 100%);
}

.hub--showroom .hub-stage-inner { aspect-ratio: 2400 / 1000; overflow: hidden; }

.hub--showroom .hub-photo img {
    position: absolute;
    left: 0;
    top: -20%;
    width: 66.6667%;
    height: 120%;
    max-width: none;
    -webkit-mask-image:
        linear-gradient(to right, #000 84%, transparent 99%),
        linear-gradient(to bottom, transparent 20%, #000 31%, #000 80%, transparent 99%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to right, #000 84%, transparent 99%),
        linear-gradient(to bottom, transparent 20%, #000 31%, #000 80%, transparent 99%);
    mask-composite: intersect;
}

/* ---------- Desktop: Texte nebeneinander, Bühne darunter ---------- */

@media (min-width: 1024px) {
    .hub {
        min-height: 100vh;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr;
        grid-template-areas: "cars it" "stage stage";
        /* breiter, weicher Übergang (eased) von Hell zu Nachtblau */
        background: linear-gradient(90deg,
            var(--hub-warm) 0,
            var(--hub-warm) 34%,
            #DCDFE2 40%,
            #9FAEC2 47%,
            #4A6488 54%,
            #1A3966 60%,
            var(--hub-navy) 65%,
            var(--hub-navy-2) 100%);
    }

    .hub-cars,
    .hub-it {
        background: none;
        padding-top: 7rem;
        padding-bottom: 2rem;
    }

    .hub--showroom .hub-cars { background: none; padding-bottom: 2rem; }

    .hub-cars { padding-left: var(--hub-gutter); padding-right: 2rem; }
    .hub-it   { padding-left: 6rem; padding-right: var(--hub-gutter); }

    .hub-cars .hub-text-inner { max-width: 30rem; }

    .hub-stage { align-self: center; }

    .hub--cutout .hub-stage { background: none; padding-bottom: 3vh; }
    .hub--cutout .hub-stage-inner { width: 100%; margin-left: 0; }

    .hub--showroom .hub-photo img {
        -webkit-mask-image:
            linear-gradient(to right, #000 84%, transparent 99%),
            linear-gradient(to bottom, transparent 20%, #000 31%);
        mask-image:
            linear-gradient(to right, #000 84%, transparent 99%),
            linear-gradient(to bottom, transparent 20%, #000 31%);
    }
}

/* ---------- Fusszeile (Impressum, Datenschutz) ---------- */

.hub-footer {
    background: var(--hub-navy);
    border-top: 1px solid rgba(141, 187, 247, .15);
    color: rgba(255, 255, 255, .6);
    font-size: .8125rem;
}

.hub-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 2rem;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem 1.25rem;
}

.hub-footer span { color: inherit; font-size: inherit; }
.hub-footer nav { display: flex; gap: 1.5rem; }
.hub-footer a { color: rgba(255, 255, 255, .85); font-size: inherit; text-decoration: none; }
.hub-footer a:hover { color: #8DBBF7; text-decoration: underline; text-underline-offset: 3px; }
.hub-footer a:focus-visible { outline: 3px solid #2F6FED; outline-offset: 3px; border-radius: 3px; }

@media (min-width: 1024px) {
    .hub { min-height: calc(100vh - 3.5rem); }
    .hub-footer-inner { padding-left: var(--hub-gutter); padding-right: var(--hub-gutter); }
}

/* ---------- Animation: Linien zeichnen sich, Punkt blinkt wie ein Cursor ---------- */

.hub-line,
.hub-trace {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: hub-draw 1.6s cubic-bezier(.6, 0, .2, 1) .4s forwards;
}

.hub-trace { animation-duration: 1.2s; animation-delay: .9s; }

.hub-node {
    opacity: 0;
    animation: hub-fade .4s ease 1.9s forwards;
}

.hub-dot {
    opacity: 0;
    animation: hub-blink 1.1s steps(1) 2s infinite;
}

@keyframes hub-draw  { to { stroke-dashoffset: 0; } }
@keyframes hub-fade  { to { opacity: 1; } }
@keyframes hub-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .hub-line,
    .hub-trace { animation: none; stroke-dashoffset: 0; }
    .hub-node,
    .hub-dot   { animation: none; opacity: 1; }
    .hub--cutout .hub-car-tech img { animation: none; }
}
