Files
laraundfelix/resources/css/components/lf-bild-text.css
T
LarsandClaude Sonnet 5.5 9353e2e38a Biete Bildausschnitt und Zoom für Bilder und Videos in Widgets an (ADR-70)
Redaktionelle Karten erhalten je Karte Fokus und Zoom, Einstieg, Bild und Text sowie
Premium-Karten zusätzlich einen Zoom (100 bis 250 Prozent, darunter entstünden leere
Ränder). Die Darstellung ist reines CSS um den Fokuspunkt; Video und Clip folgen dem
Ausschnitt. Die Regler zeigen beim Laden die Vorgabe statt 0 (FramingSlider).

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

306 lines
12 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-Bild-und-Text – übernommen aus docs/Brand-UI-Kit/12_premium_widgets_adaptiv_v1.6/components/lf-bild-text.v1.6.css.
* Ersetzt das bisherige Bild-und-Text-CSS (nicht parallel laden). Die Darstellung folgt der tatsächlichen
* Containerbreite, nicht der Einheitenzahl.
*
* Anpassungen an das Repository:
* - Oberfläche „clear“ übernimmt die Bedeutungswerte des Abschnitts (auch auf dunklen Abschnitten lesbar).
* - Überschrift erbt Farbe und Schrift (globale h1–h3-Regeln setzen sonst Navy).
* - Fokusfarbe aus den Tokens; Schriften über --lf-font-display und --lf-font-ui.
* - Größen aus der gemeinsamen Skala (ADR-44, tokens.css): Titel bis --text-h2, Text --text-body, Schaltflächen
* --text-button, Innenabstand --pad-card/--pad-surface, Bildhöhe --ds-media. Die Dichtestufe (--dens) bestimmt Bildhöhe,
* Abstand und Innenabstand der Varianten kompakt, normal und großzügig.
*/
.lf-bt-host { container: lf-bt / inline-size; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; }
.lf-bt-host, .lf-bt-host * { box-sizing: border-box; }
.lf-bt {
--bt-navy: var(--lf-navy, #032551);
--bt-green: var(--lf-green-deep, #3b7b09);
--bt-yellow: var(--lf-yellow, #fcd10a);
--bt-cream: var(--lf-cream, #f7f6f2);
--bt-muted: var(--lf-muted, #46556b);
--bt-eyebrow: #295b08;
--bt-focus-x: 64%;
--bt-focus-y: 43%;
--bt-img-h: calc(var(--ds-media) * var(--dens) / 16 * 1rem);
--color-focus: var(--lf-focus);
display: grid;
grid-template-columns: minmax(0, 1fr);
align-items: start;
gap: calc(clamp(var(--space-3), 2.4cqi, var(--space-6)) * var(--dens));
padding: calc(clamp(var(--pad-card), 3cqi, var(--pad-surface)) * var(--dens));
border-radius: clamp(1rem, 1.8cqi, 1.65rem);
min-inline-size: 0;
max-inline-size: 100%;
background: var(--bt-cream);
color: var(--bt-navy);
font: 400 1rem/1.6 var(--lf-font-ui);
overflow-wrap: break-word;
}
.lf-bt--navy {
--bt-muted: #f0f4f9;
--bt-eyebrow: #fff2b0;
--color-focus: var(--lf-yellow);
background: var(--bt-navy);
color: #fff;
}
/* Farbe aus der Palette (ADR-68): Fläche, Schrift und Fokus kommen von der Hülle des Widgets (style-Attribut, WidgetAppearance). */
.lf-bt--palette {
--bt-muted: var(--color-text-muted);
--bt-eyebrow: var(--color-heading);
--color-focus: inherit;
background: var(--color-surface);
color: var(--color-heading);
}
.scope-dark .lf-bt--palette .lf-bt__button--secondary:hover { background: rgb(255 255 255 / 12%); }
.scope-dark .lf-bt--palette .lf-bt__media::before { background: var(--bt-yellow); }
/* Ohne eigene Fläche: Farben des Abschnitts (hell, dunkel, Markenakzent). */
.lf-bt--clear {
--bt-muted: var(--color-text-muted);
--bt-eyebrow: var(--color-heading);
--color-focus: inherit;
background: transparent;
color: var(--color-heading);
padding-inline: 0;
}
.lf-bt__copy { min-inline-size: 0; max-inline-size: 49rem; align-self: center; }
.lf-bt__eyebrow {
display: flex;
align-items: center;
gap: 0.6rem;
margin: 0 0 0.8rem;
color: var(--bt-eyebrow);
font-size: 0.73rem;
line-height: 1.45;
font-weight: 800;
letter-spacing: 0.065em;
text-transform: uppercase;
overflow-wrap: anywhere;
}
.lf-bt__eyebrow::before {
content: '';
flex: 0 0 auto;
inline-size: 1.35rem;
block-size: 0.25rem;
background: var(--bt-yellow);
border-radius: 999px;
}
.lf-bt__headline {
margin: 0;
color: inherit;
font-family: var(--lf-font-display);
font-size: clamp(1.4rem, 3.6cqi, var(--text-h2));
line-height: 1.14;
letter-spacing: -0.03em;
font-weight: 850;
overflow-wrap: anywhere;
hyphens: manual;
text-wrap: balance;
}
.lf-bt__accent {
display: block;
inline-size: clamp(4.6rem, 12cqi, 7rem);
block-size: 0.36rem;
margin: clamp(0.55rem, 1.7cqi, 1rem) 0 clamp(0.8rem, 2.3cqi, 1.25rem) 0.12rem;
background: var(--bt-yellow);
border-radius: 90% 35% 75% 40%;
transform: rotate(-1deg);
}
.lf-bt__body { color: var(--bt-muted); font-size: var(--text-body); line-height: 1.6; overflow-wrap: anywhere; }
.lf-bt__body > :first-child { margin-block-start: 0; }
.lf-bt__body > :last-child { margin-block-end: 0; }
.lf-bt__body p { margin: 0 0 0.9em; }
.lf-bt__body ul,
.lf-bt__body ol { padding-inline-start: 1.35em; margin: 0.6em 0; }
/* Der Grundstil setzt list-style zurück; Aufzählungszeichen und Nummern des formatierten Textes müssen erscheinen. */
.lf-bt__body ul { list-style: disc; }
.lf-bt__body ol { list-style: decimal; }
.lf-bt__body li > p { margin: 0; }
.lf-bt__body a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }
.lf-bt__actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.65rem; margin-block-start: clamp(1rem, 2cqi, 1.5rem); min-inline-size: 0; }
.lf-bt__button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
max-inline-size: 100%;
min-inline-size: 0;
min-block-size: var(--touch-target);
padding: 0.6rem 1rem;
background: var(--bt-green);
border: 2px solid var(--bt-green);
color: #fff;
border-radius: 999px;
text-decoration: none;
text-align: center;
font-size: var(--text-button);
font-weight: 800;
line-height: 1.33;
overflow-wrap: anywhere;
white-space: normal;
transition: background-color 0.14s ease, transform 0.14s ease;
}
.lf-bt__button:visited { color: #fff; }
.lf-bt__button:hover { background: #285a06; color: #fff; transform: translateY(-1px); }
.lf-bt__button--secondary,
.lf-bt__button--secondary:visited { background: transparent; border-color: currentColor; color: inherit; }
.lf-bt__button--secondary:hover { background: rgb(3 37 81 / 6%); color: inherit; }
.lf-bt--navy .lf-bt__button--secondary:hover,
.scope-dark .lf-bt--clear .lf-bt__button--secondary:hover,
.scope-accent .lf-bt--clear .lf-bt__button--secondary:hover { background: rgb(255 255 255 / 12%); }
.lf-bt__button:focus-visible,
.lf-bt__body a:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.lf-bt__media { position: relative; display: block; order: -1; min-inline-size: 0; isolation: isolate; }
.lf-bt__media::before {
content: '';
position: absolute;
inset: auto -0.42rem -0.45rem 1rem;
z-index: -1;
block-size: 53%;
border-radius: 1.1rem;
background: #8ab848;
transform: rotate(1.5deg);
}
.lf-bt--navy .lf-bt__media::before { background: var(--bt-yellow); }
.lf-bt__image {
display: block;
inline-size: 100%;
max-inline-size: none;
block-size: auto;
aspect-ratio: 16 / 10;
/* Nie höher als die Zielhöhe auf Desktop (Mediengröße × Dichtestufe); der Bildausschnitt folgt dem Fokuspunkt. */
max-block-size: var(--bt-img-h);
object-fit: cover;
object-position: var(--bt-focus-x) var(--bt-focus-y);
border-radius: clamp(0.78rem, 1.8cqi, 1.3rem);
box-shadow: 0 10px 28px rgb(3 37 81 / 11%);
}
.lf-bt--height-compact .lf-bt__image { aspect-ratio: 16 / 9; }
.lf-bt--height-spacious .lf-bt__image { aspect-ratio: 4 / 3; }
.lf-bt--without-image { grid-template-columns: minmax(0, 1fr); }
/*
* Bildanteil (Einstellung „Bildanteil“): Verhältnis der Bild- zur Textspalte, nur im zweispaltigen Stand (ab 900 px, siehe
* unten). Ohne Einstellung bleibt die bisherige Verteilung. Die Klassen erscheinen nur mit Bild und Text.
*/
.lf-bt--share-third { --bt-img: 1fr; --bt-txt: 2fr; }
.lf-bt--share-two_fifths { --bt-img: 2fr; --bt-txt: 3fr; }
.lf-bt--share-half { --bt-img: 1fr; --bt-txt: 1fr; }
.lf-bt--share-three_fifths { --bt-img: 3fr; --bt-txt: 2fr; }
.lf-bt--share-two_thirds { --bt-img: 2fr; --bt-txt: 1fr; }
/* Ohne Text steht das Bild allein über die ganze Breite (Bildanteil entfällt). */
.lf-bt--without-text { grid-template-columns: minmax(0, 1fr); }
/*
* Video auf dem Bild (CardClip, resources/js/card-clip.js, Bausteine der Premium-Karte): Der Clip liegt über dem Bild, mit
* demselben Ausschnitt und denselben Ecken, und blendet erst mit dem ersten Bild ein; bis dahin bleibt das Bild stehen.
*/
.lf-bt__media > .lf-pc__clip {
object-position: var(--bt-focus-x) var(--bt-focus-y);
border-radius: clamp(0.78rem, 1.8cqi, 1.3rem);
}
/* Schmale Plätze: vollständiger Text und Links, keine erzwungene Höhe. */
@container lf-bt (max-width: 539.99px) {
.lf-bt__actions { display: grid; grid-template-columns: minmax(0, 1fr); }
.lf-bt__button { inline-size: 100%; }
.lf-bt__headline { font-size: clamp(1.375rem, 6.8cqi, var(--text-h2)); }
.lf-bt__eyebrow { letter-spacing: 0.03em; }
}
/* Mittlere Containerbreite (meist zwei Einheiten): flacher Bildstreifen statt gequetschter Zweispaltigkeit. */
@container lf-bt (min-width: 540px) and (max-width: 899.99px) {
.lf-bt--clear { padding-inline: 0; }
.lf-bt__media { inline-size: 100%; }
.lf-bt__image { aspect-ratio: 2.15 / 1; }
.lf-bt--height-compact .lf-bt__image { aspect-ratio: 2.5 / 1; }
.lf-bt--height-spacious .lf-bt__image { aspect-ratio: 1.8 / 1; }
.lf-bt__actions { margin-block-start: 0.95rem; }
.lf-bt__button { flex: 1 1 13rem; }
}
/* Breiter Container: zweispaltige Komposition, Bild links oder rechts. */
@container lf-bt (min-width: 900px) {
.lf-bt {
grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
align-items: center;
gap: calc(clamp(var(--space-5), 3cqi, var(--space-7)) * var(--dens));
}
.lf-bt--clear { padding-inline: 0; }
/*
* Bildhöhe = Zielhöhe (Mediengröße × Dichtestufe); sie wächst nur, wenn der Text höher ist. Das Bild füllt die
* Fläche und gibt keine eigene Höhe vor (unabhängig vom Seitenverhältnis der Datei); der Ausschnitt folgt dem Fokuspunkt.
*/
.lf-bt__media { order: 0; align-self: stretch; min-block-size: var(--bt-img-h); }
.lf-bt--image-left .lf-bt__media { order: -1; }
.lf-bt__image { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; max-block-size: none; aspect-ratio: auto; }
.lf-bt--without-image { grid-template-columns: minmax(0, 1fr); }
/* Bildanteil: erste Spur ist die linke; bei „Bild links“ ist das die Bildspalte, sonst die Textspalte. */
.lf-bt--shared.lf-bt--image-left { grid-template-columns: minmax(0, var(--bt-img)) minmax(0, var(--bt-txt)); }
.lf-bt--shared.lf-bt--image-right { grid-template-columns: minmax(0, var(--bt-txt)) minmax(0, var(--bt-img)); }
/*
* Bild ohne Text: Eine Spalte über die volle Breite. Das Bild bestimmt hier seine Höhe selbst (Seitenverhältnis nach
* der Höhen-Einstellung), statt eine Fläche neben dem Text zu füllen.
*/
.lf-bt--without-text { grid-template-columns: minmax(0, 1fr); }
.lf-bt--without-text .lf-bt__media { min-block-size: 0; }
.lf-bt--without-text .lf-bt__image { position: static; inset: auto; block-size: auto; max-block-size: none; aspect-ratio: 21 / 9; }
.lf-bt--without-text.lf-bt--height-compact .lf-bt__image { aspect-ratio: 3 / 1; }
.lf-bt--without-text.lf-bt--height-spacious .lf-bt__image { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
.lf-bt__button { transition: none; }
.lf-bt__button:hover { transform: none; }
}
/*
* Zoom (ADR-70): Bild und Video liegen in einem Rahmen mit den Ecken und dem Schatten des Bilds und werden um den
* Fokuspunkt vergrößert; ab 100 % füllt das Bild den Rahmen, es entstehen keine Ränder. Ohne Zoom gibt es den Rahmen nicht.
*/
.lf-bt__frame {
position: relative;
display: block;
overflow: hidden;
border-radius: clamp(0.78rem, 1.8cqi, 1.3rem);
box-shadow: 0 10px 28px rgb(3 37 81 / 11%);
}
.lf-bt__frame > .lf-bt__image,
.lf-bt__frame > .lf-pc__clip {
border-radius: 0;
box-shadow: none;
object-position: var(--bt-focus-x) var(--bt-focus-y);
transform-origin: var(--bt-focus-x) var(--bt-focus-y);
scale: var(--bt-zoom, 1);
}
/* Zweispaltig füllt das Bild die Fläche neben dem Text (siehe oben); dann füllt der Rahmen sie. Ohne Text bestimmt das Bild seine Höhe selbst. */
@container lf-bt (min-width: 900px) {
.lf-bt__frame { position: absolute; inset: 0; }
.lf-bt--without-text .lf-bt__frame { position: relative; inset: auto; }
}