Files
laraundfelix/resources/css/components/lf-hero.css
T
LarsandClaude Sonnet 5.5 9c4bbc7b44
CI Feature / test (push) Successful in 7m5s
Deploy Test / test (push) Successful in 6m24s
Deploy Test / deploy (push) Successful in 39s
Lass die Höhe des Einstiegs mit Foto auf breiten Plätzen mitwachsen (ADR-71)
Bei Abschnittsbreite Breit oder Vollbreite blieb die Mindesthöhe fest, das Foto wurde zu
einem schmalen Streifen beschnitten (bei 2560 px nur 28 Prozent der Bildhöhe). Die
Mindesthöhe folgt nun der Breite oberhalb des Standardabschnitts, begrenzt auf 80 Prozent
der Fensterhöhe. Standardabschnitt, Tablet und Handy bleiben unverändert.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-01 13:32:43 +01:00

337 lines
13 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Premium-Einstieg – übernommen aus docs/Brand-UI-Kit/12_premium_widgets_adaptiv_v1.6/components/lf-hero.v1.6.css.
* Ersetzt das bisherige Hero-CSS (nicht parallel laden).
*
* Anpassungen an das Repository (dokumentiert in docs/architektur/cms-widget-registry.md):
* - Überschrift und Akzent erben Farbe und erhalten Blockdarstellung (die globalen h1–h3-Regeln setzen sonst Navy).
* - Akzentwahl underline/rays/none; Strahlen aus resources/views/components/brand/rays.blade.php.
* - Fokusfarbe und Schriften über die gemeinsamen Tokens (--lf-font-display, --lf-font-ui, --color-focus).
* Die Höhen sind Mindesthöhen ab 860 px Containerbreite; Inhalte vergrößern jede Variante.
*/
.lf-hero-host { container: lf-hero / inline-size; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; }
.lf-hero-host, .lf-hero-host * { box-sizing: border-box; }
.lf-hero {
--lf-hero-navy: var(--lf-navy, #032551);
--lf-hero-green: var(--lf-green-deep, #3b7b09);
--lf-hero-yellow: var(--lf-yellow, #fcd10a);
--lf-hero-cream: var(--lf-cream, #f7f6f2);
--lf-hero-focus-x: 68%;
--lf-hero-focus-y: 50%;
--color-focus: var(--lf-focus);
isolation: isolate;
position: relative;
display: grid;
align-items: center;
min-inline-size: 0;
min-block-size: calc(var(--ds-media) * 1.2 * var(--dens) / 16 * 1rem);
max-inline-size: 100%;
border-radius: clamp(1rem, 1.9cqi, 1.75rem);
background: var(--lf-hero-cream);
color: var(--lf-hero-navy);
font-family: var(--lf-font-display);
}
/* Mindesthöhen kommen aus der Mediengröße und der Dichtestufe (--dens, tokens.css): kompakt 0,9 ×, normal 1,2 ×, groß 1,56 × --ds-media. */
.lf-hero--height-compact,
.lf-hero--height-normal,
.lf-hero--height-large { min-block-size: calc(var(--ds-media) * 1.2 * var(--dens) / 16 * 1rem); }
/*
* Foto auf breiten Plätzen: Die Mindesthöhe wächst mit der Breite, sobald der Einstieg breiter ist als im Standardabschnitt
* (82 rem = 1312 px, dort ändert sich nichts). Das Bild füllt die ganze Fläche (cover); bei fester Höhe und Vollbreite würde
* es zu einem schmalen Streifen beschnitten (bei 2560 px nur noch gut ein Viertel der Bildhöhe, Köpfe ohne Körper). So bleibt
* das Seitenverhältnis der Fläche bei höchstens etwa 3,4 : 1. Begrenzt auf 80 % der Fensterhöhe, damit der Einstieg den
* Bildschirm nicht sprengt; die Mindesthöhe der Variante bleibt der Boden. 0,0009146 = 1,2 / 1312 (Standardhöhe je Pixel Breite).
*/
.lf-hero--photo-split {
min-block-size: min(
max(calc(var(--ds-media) * 1.2 * var(--dens) / 16 * 1rem), calc(100cqi * var(--ds-media) * 0.0009146 * var(--dens))),
max(calc(var(--ds-media) * 1.2 * var(--dens) / 16 * 1rem), 80svh)
);
}
.lf-hero__photo {
position: absolute;
inset: 0;
z-index: -2;
inline-size: 100%;
block-size: 100%;
max-inline-size: none;
object-fit: cover;
object-position: var(--lf-hero-focus-x) var(--lf-hero-focus-y);
border-radius: inherit;
}
/*
* Video auf der Fläche des Fotos (nur photo_split, resources/js/hero-video.js). Das Foto bleibt darunter sichtbar, bis
* das erste Videobild da ist; ohne JavaScript, bei Fehlern und ohne freigegebenen Clip bleibt es beim Foto.
*/
.lf-hero__video {
position: absolute;
inset: 0;
z-index: -2;
inline-size: 100%;
block-size: 100%;
max-inline-size: none;
object-fit: cover;
object-position: var(--lf-hero-focus-x) var(--lf-hero-focus-y);
border-radius: inherit;
opacity: 0;
transition: opacity 0.4s ease;
pointer-events: none;
}
.lf-hero.is-hero-started .lf-hero__video { opacity: 1; }
/*
* Abspiel-Schaltfläche: Solange der Clip nicht läuft, sitzt sie groß und halbtransparent mittig auf dem Vorschaubild
* (rechts neben dem Text, in der schmalen Darstellung mittig auf dem Bild oberhalb des Textes). Läuft der Clip,
* wandert sie als kleine „Video anhalten“-Schaltfläche in die Ecke (WCAG 2.2.2), damit sie das Bild nicht verdeckt.
* Gleiche Gestaltung wie auf den Karten (.lf-pc__clip-toggle).
*/
.lf-hero__video-toggle {
position: absolute;
inset-block-start: 50%;
inset-inline-start: 72%;
z-index: 2;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
inline-size: clamp(64px, 9cqi, 96px);
block-size: clamp(64px, 9cqi, 96px);
padding: 0;
border: 0;
border-radius: 50%;
color: #fff;
background: rgb(3 37 81 / 62%);
box-shadow: 0 0 0 2px rgb(255 255 255 / 70%), 0 6px 24px rgb(3 37 81 / 35%);
font: 600 0.8125rem/1.2 var(--lf-font-ui, system-ui, sans-serif);
cursor: pointer;
transform: translate(-50%, -50%);
transition: background-color 0.2s ease, transform 0.2s ease;
}
.lf-hero__video-toggle[hidden] { display: none; }
.lf-hero__video-toggle:hover { background: rgb(3 37 81 / 82%); transform: translate(-50%, -50%) scale(1.06); }
.lf-hero__video-toggle:focus-visible { outline: 3px solid var(--lf-hero-yellow); outline-offset: 4px; }
.lf-hero__video-icon { inline-size: 44%; block-size: 44%; }
/* Das Dreieck sitzt optisch etwas links; ein kleiner Versatz zentriert es im Kreis. */
.lf-hero__video-play { transform: translateX(1px); }
.lf-hero__video-label { display: none; }
.lf-hero__video-pause,
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-play { display: none; }
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-pause { display: inline; }
/* Läuft der Clip: kleine Schaltfläche oben rechts, mit 44 px Trefferfläche. */
.lf-hero__video-toggle[aria-pressed="true"] {
inset-block-start: 12px;
inset-inline-start: auto;
inset-inline-end: 12px;
inline-size: auto;
block-size: auto;
min-block-size: 44px;
padding: 8px 14px 8px 10px;
border-radius: 999px;
background: rgb(3 37 81 / 62%);
box-shadow: 0 0 0 1px rgb(255 255 255 / 40%);
transform: none;
}
.lf-hero__video-toggle[aria-pressed="true"]:hover { background: rgb(3 37 81 / 86%); transform: none; }
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-icon { inline-size: 20px; block-size: 20px; }
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-label { display: inline; }
.lf-hero--photo-split::before {
content: '';
position: absolute;
inset: 0;
z-index: -1;
border-radius: inherit;
background: linear-gradient(90deg, rgb(250 249 243 / 99%) 0%, rgb(250 249 243 / 98%) 28%, rgb(250 249 243 / 85%) 41%, rgb(250 249 243 / 12%) 69%, transparent 80%);
}
.lf-hero--editorial-solid {
--color-focus: var(--lf-yellow);
background: var(--lf-hero-navy);
color: #fff;
}
.lf-hero--editorial-solid::before {
content: '';
position: absolute;
inset: auto -7% -50% auto;
z-index: -1;
inline-size: 40%;
aspect-ratio: 1;
background: var(--lf-hero-green);
border-radius: 50%;
opacity: 0.8;
}
.lf-hero--editorial-solid { overflow: hidden; }
.lf-hero__inner {
inline-size: 100%;
max-inline-size: 1440px;
min-inline-size: 0;
margin-inline: auto;
padding: clamp(var(--pad-card), 3.4cqi, var(--pad-surface));
padding-block: clamp(var(--pad-card), 3.4cqi, var(--pad-surface));
}
.lf-hero__copy { position: relative; max-inline-size: min(660px, 58%); min-inline-size: 0; }
.lf-hero--editorial-solid .lf-hero__copy { max-inline-size: 760px; }
.lf-hero__eyebrow {
display: inline-block;
margin: 0;
padding: 0.35em 0.75em;
border-radius: 999px;
background: #dff0c0;
color: #17370b;
font-weight: 800;
font-size: clamp(0.78rem, 1.25cqi, 0.95rem);
overflow-wrap: anywhere;
}
.lf-hero__title {
margin: 0.25em 0;
color: inherit;
font-family: inherit;
font-size: clamp(1.75rem, 4cqi, var(--text-display));
line-height: 1.06;
letter-spacing: -0.035em;
font-weight: 900;
text-wrap: balance;
overflow-wrap: anywhere;
hyphens: manual;
}
.lf-hero__title-accent {
display: block;
inline-size: clamp(6rem, 15cqi, 15rem);
block-size: 0.42rem;
margin: 0 0 clamp(1.1rem, 2cqi, 1.5rem);
background: var(--lf-hero-yellow);
border-radius: 90% 30% 45% 25%;
transform: rotate(-1deg);
}
.lf-hero__rays {
position: absolute;
inset-block-start: -2.4rem;
inset-inline-start: -2.2rem;
inline-size: clamp(2.6rem, 4.5cqi, 3.6rem);
color: var(--lf-hero-yellow);
transform: rotate(-24deg);
pointer-events: none;
}
.lf-hero__description {
max-inline-size: 56ch;
margin: 0 0 clamp(1.25rem, 2.1cqi, 2rem);
font-family: var(--lf-font-ui);
font-size: clamp(1rem, 1.5cqi, var(--text-lede));
line-height: 1.5;
overflow-wrap: anywhere;
}
.lf-hero__actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.75rem; min-inline-size: 0; }
.lf-hero__button {
display: inline-flex;
align-items: center;
justify-content: center;
min-inline-size: 0;
max-inline-size: 100%;
min-block-size: var(--touch-target);
padding: 0.6rem 1.1rem;
border: 2px solid transparent;
border-radius: 999px;
font: 800 var(--text-button)/1.28 var(--lf-font-ui);
text-decoration: none;
text-align: center;
white-space: normal;
overflow-wrap: anywhere;
transition: transform 0.15s ease, background-color 0.15s ease;
}
.lf-hero__button:hover { transform: translateY(-1px); }
.lf-hero__button:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.lf-hero__button--primary,
.lf-hero__button--primary:visited { background: var(--lf-hero-green); color: #fff; }
.lf-hero__button--primary:hover { background: #285a06; color: #fff; }
.lf-hero__button--secondary,
.lf-hero__button--secondary:visited { background: rgb(255 255 255 / 95%); color: var(--lf-hero-navy); border-color: var(--lf-hero-navy); }
.lf-hero__button--secondary:hover { color: var(--lf-hero-navy); }
.lf-hero__bottom {
position: absolute;
inset: auto 0 0;
block-size: 15px;
border-radius: 0 0 1.5rem 1.5rem;
background: linear-gradient(105deg, var(--lf-hero-yellow) 0%, var(--lf-hero-yellow) 22%, var(--lf-hero-green) 72%);
clip-path: polygon(0 45%, 30% 90%, 65% 75%, 100% 0, 100% 100%, 0 100%);
pointer-events: none;
}
/* Sicherheitsumbruch, wenn der Container physisch zu schmal ist; keine eigene redaktionelle Variante. */
@container lf-hero (max-width: 859.99px) {
.lf-hero { display: block; min-block-size: 0; }
.lf-hero--height-compact,
.lf-hero--height-normal,
.lf-hero--height-large { min-block-size: 0; }
.lf-hero__photo { position: relative; display: block; block-size: auto; aspect-ratio: 16 / 9; }
.lf-hero__video { inset: 0 0 auto 0; block-size: auto; aspect-ratio: 16 / 9; border-radius: inherit; }
/* Das Bild liegt oben im Format 16:9: Mitte = halbe Breite, halbe Bildhöhe. */
.lf-hero__video-toggle:not([aria-pressed="true"]) { inset-block-start: calc(100cqi * 9 / 32); inset-inline-start: 50%; inline-size: clamp(56px, 16cqi, 80px); block-size: clamp(56px, 16cqi, 80px); }
.lf-hero--photo-split::before { display: none; }
.lf-hero__inner { padding: clamp(var(--pad-card), 3.5cqi, calc(var(--pad-card) * 1.6)); padding-block-end: calc(var(--pad-card) * 1.6); }
.lf-hero__copy { max-inline-size: 100%; }
.lf-hero__title { font-size: clamp(1.75rem, 5.5cqi, var(--text-display)); }
.lf-hero__description { font-size: var(--text-lede); }
.lf-hero--editorial-solid .lf-hero__copy { max-inline-size: 100%; }
.lf-hero__rays { inset-block-start: -1.6rem; inset-inline-start: auto; inset-inline-end: 0; transform: rotate(10deg); }
}
@container lf-hero (max-width: 440px) {
.lf-hero__actions { display: grid; grid-template-columns: minmax(0, 1fr); }
.lf-hero__button { inline-size: 100%; }
}
@media (prefers-reduced-motion: reduce) {
.lf-hero__video { transition: none; }
.lf-hero__video-toggle { transition: none; }
.lf-hero__video-toggle:hover { transform: translate(-50%, -50%); }
.lf-hero__button { transition: none; }
.lf-hero__button:hover { transform: none; }
}
/*
* Zoom (ADR-70): Foto und Video liegen in einem Rahmen, der den vergrößerten Ausschnitt abschneidet. Vergrößert wird um den
* Fokuspunkt, ab 100 % füllt das Bild den Rahmen, es entstehen keine Ränder. Ohne Zoom gibt es den Rahmen nicht.
*/
.lf-hero__frame {
position: absolute;
inset: 0;
z-index: -2;
overflow: hidden;
border-radius: inherit;
}
.lf-hero__frame > .lf-hero__photo,
.lf-hero__frame > .lf-hero__video {
z-index: auto;
border-radius: 0;
transform-origin: var(--lf-hero-focus-x) var(--lf-hero-focus-y);
scale: var(--lf-hero-zoom, 1);
}
@container lf-hero (max-width: 859.99px) {
.lf-hero__frame { position: relative; inset: auto; display: block; aspect-ratio: 16 / 9; }
.lf-hero__frame > .lf-hero__photo,
.lf-hero__frame > .lf-hero__video { position: absolute; inset: 0; block-size: 100%; aspect-ratio: auto; }
}