/**
 * Shop-Einstieg — `/shop/` (page-shop-einstieg.php).
 *
 * ⛔ Eigene Seite, eigenes Stylesheet (seit 0.74.0). Betreiber am 2026-09-22:
 *    *„shopeinstieg brauch ich auch noch keine fortschritts tabs. hier klare
 *    trennung"*. Diese Datei laedt NUR hier; wizard.css laedt hier NICHT.
 *
 * @package james-care-storefront
 */

.jc-shop-einstieg {
    max-width: var(--jc-container);
    margin-inline: auto;
    padding: clamp(24px, 3vw, 44px) var(--jc-gutter) clamp(48px, 6vw, 90px);
}

/* Dieselbe Handschrift wie der Schrittkopf des Konfigurators (wizard.css,
   `.jc-wiz-step__title`) — der Einstieg ist die Tuer, nicht Schritt 1. */
.jc-shop-einstieg__titel {
    font-family: var(--jc-font-display);
    font-weight: var(--jc-weight-regular);
    font-size: clamp(38px, 5.4vw, 72px);
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--jc-text);
    margin: 0;
}

.jc-shop-einstieg__lead {
    font-size: 16px;
    line-height: 1.7;
    color: var(--jc-text-muted);
    margin: 12px 0 0;
    max-width: 52ch;
}

/* ---------------------------------------------------------------
 * Einstieg: vier Kacheln mit Film (seit 0.73.0, eigene Seite seit 0.74.0)
 *
 * Auftrag 2026-09-21: *„die 4 bereiche mit bild das aufzoomt bei
 * mouseover oder am mobile aufklappt … 4 videos, die man halb sieht und
 * steht"*. Am Desktop vier stehende Kacheln nebeneinander, die offene
 * waechst auf Kosten der anderen; am Telefon Streifen untereinander, die
 * offene klappt nach unten auf.
 *
 * ⛔ Text auf einer Flaeche, nicht auf dem Bild oder einem Verlauf (dieselbe
 *    Regel wie im Hero). Keine Rundung, kein Schatten (Hard Rule 7).
 * ⛔ Rot nur als Kante und Schrift — die gewaehlte Kachel ist KEIN roter
 *    Block: vier Filmkacheln plus eine rote Flaeche waeren zu viel im Bild
 *    (Hard Rule 9).
 * ⚠️ Die Kachel ist ein LINK (seit 0.74.0, vorher ein Knopf im Wizard):
 *    Alles darin ist `span`, sonst waeren es verschachtelte Bedienelemente.
 * ------------------------------------------------------------- */

/* ⛔ Die Hoehe haengt am Sichtfenster, nicht an einer festen Zahl: Kopf
   und Seitenkopf brauchen am Desktop rund 330 px (bis 0.73.0 mit dem
   Reiterband des Wizards 400 px). Mit `64vh` lagen die Titel bei
   1440 x 900 unter dem Bildrand — gesehen, nicht gerechnet. */
.jc-einstieg {
    display: flex;
    gap: 12px;
    height: clamp(380px, calc(100svh - 330px), 640px);
    margin-top: 22px;
}

.jc-einstieg__kachel {
    position: relative;
    display: block;
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: var(--jc-surface-image);
    color: var(--jc-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: flex-grow 650ms var(--jc-motion-ease);
}

.jc-einstieg__kachel.ist-offen {
    flex-grow: 2.3;
}

.jc-einstieg__kachel:focus-visible {
    outline: 2px solid var(--jc-accent);
    outline-offset: 3px;
}

/* Bild und Film fuellen die Kachel; beim Oeffnen zoomt das Motiv langsam. */
.jc-einstieg__medium {
    position: absolute;
    inset: 0;
    transform: scale(1);
    transition: transform 1400ms var(--jc-motion-ease);
}

.jc-einstieg__kachel.ist-offen .jc-einstieg__medium {
    transform: scale(1.05);
}

.jc-einstieg__film {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--jc-focus, 50% 50%);
    opacity: 0;
    transition: opacity 500ms var(--jc-motion-ease);
}

.jc-einstieg__film.laeuft {
    opacity: 1;
}

.jc-einstieg__flaeche {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    padding: 16px 18px 18px;
    background: var(--jc-white);
    border-top: 3px solid transparent;
    transition: border-color var(--jc-motion-hover) var(--jc-motion-ease);
}

.jc-einstieg__kachel.ist-offen .jc-einstieg__flaeche,
.jc-einstieg__kachel.is-on .jc-einstieg__flaeche {
    border-top-color: var(--jc-accent);
}

.jc-einstieg__symbol {
    display: block;
    width: 30px;
    height: 30px;
    color: var(--jc-accent);
}

.jc-einstieg__titel {
    font-family: var(--jc-font-display);
    font-weight: var(--jc-weight-regular);
    font-size: clamp(22px, 1.9vw, 28px);
    line-height: 1.1;
}

/* Text und „Weiter" klappen mit der Kachel auf (0fr -> 1fr). */
.jc-einstieg__mehr {
    grid-column: 1 / -1;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 650ms var(--jc-motion-ease);
}

.jc-einstieg__kachel.ist-offen .jc-einstieg__mehr {
    grid-template-rows: 1fr;
}

.jc-einstieg__mehr-innen {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    min-height: 0;
    overflow: hidden;
}

.jc-einstieg__text {
    flex: 1 1 22ch;
    padding-top: 10px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--jc-text-muted);
}

/* ⛔ Der Pfeil als Escape, nicht als Zeichen — `text/css` kommt ohne charset
   (Seitendurchgang 2026-08-12, Mojibake). */
.jc-einstieg__los {
    font-weight: 600;
    color: var(--jc-accent);
    white-space: nowrap;
}

.jc-einstieg__los::after {
    content: "\00a0\2192" / "";
}

/* ---------------------------------------------------------------
 * Kachel ohne Bild — die Hilfe auf `/shop/` (seit 2026-10-22)
 *
 * Betreiber: *„der platz wo demenz war (rechts oben) kommt ein hilfe button
 * … quasi ein rettungsanker"*. Dunkle Flaeche statt Foto: Sie liest sich als
 * Hilfe, nicht als viertes Produkt — und ist KEIN Rotblock (Hard Rule 9).
 * Der Text steht immer da: Es gibt kein Motiv, das er freigeben muesste.
 * ------------------------------------------------------------- */
.jc-einstieg__kachel--ohne-bild {
    background: var(--jc-surface-dark);
    color: var(--jc-text-on-dark);
}

.jc-einstieg__kachel--ohne-bild .jc-einstieg__flaeche {
    top: 0;
    grid-template-rows: minmax(0, 1fr) auto auto;   /* Symbol oben, Titel und Text unten */
    background: transparent;
}

.jc-einstieg__kachel--ohne-bild .jc-einstieg__symbol {
    grid-column: 1 / -1;
    align-self: start;
    width: 40px;
    height: 40px;
    color: var(--jc-text-on-dark);
}

.jc-einstieg__kachel--ohne-bild .jc-einstieg__titel {
    grid-column: 1 / -1;
    color: var(--jc-white);
}

.jc-einstieg__kachel--ohne-bild .jc-einstieg__mehr {
    grid-template-rows: 1fr;
}

.jc-einstieg__kachel--ohne-bild .jc-einstieg__text {
    color: var(--jc-text-on-dark);
}

.jc-einstieg__kachel--ohne-bild .jc-einstieg__los {
    color: var(--jc-white);
}

/* ---------------------------------------------------------------
 * Stille Kacheln — `/shop/` seit 17.11.
 *
 * Betreiber: *„statische bilder, keine video animation"*. Kein Film, kein
 * Aufklappen, kein Skript: Text und „Weiter" stehen immer da, ein Klick oder
 * Tipp fuehrt weiter. Rueckmeldung beim Darueberfahren nur ueber die rote Kante.
 * `/shop/meine-uhr/` behaelt Film und Aufklappen (shop-einstieg.js).
 * ------------------------------------------------------------- */
.jc-einstieg--still .jc-einstieg__mehr {
    grid-template-rows: 1fr;
    transition: none;
}

.jc-einstieg--still .jc-einstieg__medium {
    transition: none;
}

.jc-einstieg--still .jc-einstieg__kachel:hover .jc-einstieg__flaeche,
.jc-einstieg--still .jc-einstieg__kachel:focus-visible .jc-einstieg__flaeche {
    border-top-color: var(--jc-accent);
}

.jc-einstieg--still .jc-einstieg__kachel--ohne-bild:hover .jc-einstieg__flaeche {
    border-top-color: transparent;
}

/* ---------------------------------------------------------------
 * Feste Plaetze statt vier gleicher Kacheln (0.83.0, Auftrag 2026-10-02)
 *
 * `/shop/`: links gross „Ich brauche eine Notrufuhr" und „Ich habe schon eine
 * Uhr", rechts schmal „Noch Fragen?" (seit 22.10., vorher „Bei Demenz") ueber
 * „Nur Zubehoer" (~25 %, 02.10.).
 * `/shop/meine-uhr/`: „Uhr aktivieren" gross links, rechts uebereinander
 * „Zusatztarif buchen" und „Zubehoer kaufen" (Betreiber 02.10.).
 *
 * ⛔ Die Plaetze haengen an `data-situation`, nicht an der Reihenfolge im
 *    Markup — die ist die fuer Telefon und Screenreader (die grossen zuerst).
 *    Das Aufziehen der offenen Kachel (`flex-grow`) entfaellt im Raster;
 *    Zoom, Film und aufklappender Text bleiben.
 * ------------------------------------------------------------- */
@media (min-width: 881px) {
    .jc-einstieg--shop,
    .jc-einstieg--meine-uhr {
        display: grid;
    }

    /* Betreiber 17.11.: grosse Kacheln oben (damals drei: Notrufuhr fuer mich / fuer
       Angehoerige / „Ich habe schon eine Uhr"), schmale Reihe darunter (Zubehoer, Hilfe).
       Seit 0.99.52 legt die Redaktion in Directus fest, welche Kachel in welche Reihe kommt —
       jede Reihe teilt sich gleich auf, egal wie viele Kacheln sie traegt. */
    .jc-einstieg--shop {
        height: auto;
        grid-template-columns: minmax(0, 1fr);
    }

    .jc-einstieg__reihe {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .jc-einstieg__reihe--gross {
        height: clamp(340px, calc(100svh - 500px), 520px);
    }

    /* Die schmale Reihe: Flaeche links, Motiv rechts (wie der Streifen am Telefon). */
    .jc-einstieg--still .jc-einstieg__kachel--klein {
        min-height: 128px;
    }

    .jc-einstieg--still .jc-einstieg__kachel--klein .jc-einstieg__medium {
        left: 55%;
    }

    .jc-einstieg--still .jc-einstieg__kachel--klein .jc-einstieg__flaeche {
        top: 0;
        right: 45%;
        align-content: center;
        border-top: 0;
        border-left: 3px solid transparent;
    }

    .jc-einstieg--still .jc-einstieg__kachel--klein:hover .jc-einstieg__flaeche {
        border-left-color: var(--jc-accent);
    }

    .jc-einstieg--still .jc-einstieg__kachel--klein.jc-einstieg__kachel--ohne-bild .jc-einstieg__flaeche {
        right: 0;
        grid-template-rows: auto auto;
        border-left: 0;
    }

    .jc-einstieg--still .jc-einstieg__kachel--ohne-bild .jc-einstieg__symbol,
    .jc-einstieg--still .jc-einstieg__kachel--ohne-bild .jc-einstieg__titel {
        grid-column: auto;
        align-self: center;
    }

    /* Betreiber 02.10.: „rechts die beiden zubehör und zusatztarife" —
       „Uhr aktivieren" gross links, rechts uebereinander „Zusatztarif
       buchen" und „Zubehoer kaufen". Spiegelbild von `/shop/`. */
    .jc-einstieg--meine-uhr {
        /* „Zur Auswahl" ueber dem Titel kostet ~50px mehr als auf `/shop/` —
           sonst endeten die Kacheln bei 1440 x 900 unter dem Bildrand. */
        height: clamp(380px, calc(100svh - 385px), 640px);
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "tarif zusatz"
            "tarif zubehoer";
    }

    .jc-einstieg--meine-uhr [data-situation="tarif"]    { grid-area: tarif; }
    .jc-einstieg--meine-uhr [data-situation="zusatz"]   { grid-area: zusatz; }
    .jc-einstieg--meine-uhr [data-situation="zubehoer"] { grid-area: zubehoer; }

    /* Kleine Kacheln: kleinere Schrift, der Text bleibt zu. */
    .jc-einstieg__kachel--klein .jc-einstieg__titel {
        font-size: clamp(20px, 1.6vw, 24px);
    }
}

/* Der Weg zurueck auf `/shop/` ueber dem Titel (page-shop-meine-uhr.php). */
.jc-shop-einstieg__zurueck {
    gap: 6px;   /* inline-flex schluckt das Leerzeichen nach dem Pfeil */
    margin: 0 0 10px;
    font-size: var(--jc-size-ui);
}

/* Telefon und schmales Tablet: Streifen untereinander. Zu zeigt die Kachel
   links die Flaeche und rechts das halbe Motiv, offen das ganze. */
@media (max-width: 880px) {
    .jc-einstieg {
        flex-direction: column;
        height: auto;
        gap: 10px;
        margin-top: 18px;
    }

    /* `/shop/` (0.99.52): die beiden Reihen stapeln sich wie die Kacheln selbst. */
    .jc-einstieg__reihe {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .jc-einstieg__kachel {
        flex: none;
        height: 124px;
        transition: height 600ms var(--jc-motion-ease);
        /* Der Kopf klebt oben (~70 px bei 390 px Breite) — scrollIntoView()
           in shop-einstieg.js haelt diesen Abstand. */
        scroll-margin-top: 96px;
        scroll-margin-bottom: 16px;
    }

    .jc-einstieg__kachel.ist-offen {
        height: min(72vh, 540px);
    }

    .jc-einstieg__medium {
        left: 56%;
        transition: left 600ms var(--jc-motion-ease), transform 1400ms var(--jc-motion-ease);
    }

    .jc-einstieg__kachel.ist-offen .jc-einstieg__medium {
        left: 0;
    }

    .jc-einstieg__flaeche {
        top: 0;
        right: 44%;
        align-content: center;
        border-top: 0;
        border-left: 3px solid transparent;
        padding: 14px 16px;
    }

    .jc-einstieg__kachel.ist-offen .jc-einstieg__flaeche {
        top: auto;
        right: 0;
        border-left-color: transparent;
        border-top: 3px solid var(--jc-accent);
    }

    .jc-einstieg__kachel.is-on:not(.ist-offen) .jc-einstieg__flaeche {
        border-left-color: var(--jc-accent);
    }

    .jc-einstieg__symbol {
        width: 26px;
        height: 26px;
    }

    .jc-einstieg__titel {
        font-size: 21px;
    }

    /* Ohne Motiv kein halbes Bild rechts: die Flaeche nimmt die ganze Breite,
       die Kachel waechst mit ihrem Text (er steht immer da). */
    .jc-einstieg__kachel--ohne-bild,
    .jc-einstieg__kachel--ohne-bild.ist-offen {
        height: auto;
        min-height: 124px;
    }

    .jc-einstieg__kachel--ohne-bild .jc-einstieg__flaeche,
    .jc-einstieg__kachel--ohne-bild.ist-offen .jc-einstieg__flaeche {
        position: relative;
        right: 0;
        border: 0;
        grid-template-rows: auto auto;
    }

    .jc-einstieg__kachel--ohne-bild .jc-einstieg__symbol,
    .jc-einstieg__kachel--ohne-bild .jc-einstieg__titel {
        grid-column: auto;
        align-self: center;
    }
}

/* Telefon, stille Kacheln: Streifen mit Text, die Hoehe kommt vom Text. */
@media (max-width: 880px) {
    .jc-einstieg--still .jc-einstieg__kachel {
        height: auto;
        min-height: 132px;
        transition: none;
    }

    .jc-einstieg--still .jc-einstieg__flaeche {
        position: relative;
        right: auto;
        width: 56%;
        min-height: 132px;
    }

    .jc-einstieg--still .jc-einstieg__kachel--ohne-bild .jc-einstieg__flaeche {
        width: auto;
    }

    .jc-einstieg--still .jc-einstieg__kachel:hover .jc-einstieg__flaeche {
        border-top-color: transparent;
    }

    .jc-einstieg--still .jc-einstieg__text {
        font-size: 14px;
        padding-top: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jc-einstieg__kachel,
    .jc-einstieg__medium,
    .jc-einstieg__film,
    .jc-einstieg__mehr {
        transition: none;
    }

    .jc-einstieg__kachel.ist-offen .jc-einstieg__medium {
        transform: none;
    }
}
