/* ============================================================
   SD-Link — Kundengalerie (produktbezogen) + Übersicht „Aus dem Cockpit".
   Stilbrücke nach docs/design_handoff_galerie_news (community.css).
   Nutzt ausschließlich Tokens aus sdlink-tokens.css — keine eigenen Farben.
   Scope: .sd-comm-* (PDP + Übersicht), .sd-gallery-page (Übersicht), .sd-lbx (Lightbox).
   ============================================================ */

/* ===== Section-Heading (kompakt, PDP + YouTube-Block) ====== */
.sd-comm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.sd-comm-head .t .eyebrow {
	font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--sd-amber-600); margin: 0 0 8px; display: inline-flex; align-items: center; gap: 7px;
}
.sd-comm-head .t h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -0.01em; color: var(--fg-brand); margin: 0; }
.sd-comm-head .t p { margin: 8px 0 0; color: var(--fg-2); font-size: 15px; max-width: 56ch; }
.sd-comm-head .more {
	display: inline-flex; align-items: center; gap: 6px; flex: none;
	font-weight: 600; font-size: 14px; color: var(--sd-navy-600); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.sd-comm-head .more:hover { color: var(--sd-amber-600); }

/* ===== Galerie-Grid (produktbezogen, gebunden) ============= */
.sd-comm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sd-comm-grid.is-four { grid-template-columns: repeat(4, 1fr); }

.sd-comm-tile {
	position: relative; display: block; padding: 0; border: 0; cursor: pointer;
	border-radius: var(--r-lg); overflow: hidden; background: var(--sd-navy-100);
	box-shadow: var(--shadow-1); aspect-ratio: 4 / 3; width: 100%;
	transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.sd-comm-tile:hover { box-shadow: var(--shadow-2); }
.sd-comm-tile:focus-visible { outline: none; box-shadow: var(--shadow-focus), var(--shadow-2); }
.sd-comm-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-slow) var(--ease-out); }
.sd-comm-tile:hover img { transform: scale(1.04); }

/* caption overlay (nur wenn vorhanden) */
.sd-comm-tile .cap {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px;
	background: linear-gradient(to top, rgba(10,27,46,.82), rgba(10,27,46,0));
	color: #fff; text-align: left; pointer-events: none;
	display: flex; flex-direction: column; gap: 1px;
}
.sd-comm-tile .cap .dev { font-family: var(--font-mono); font-size: 11px; letter-spacing: .02em; color: var(--sd-amber-500); }
.sd-comm-tile .cap .ac { font-size: 13px; font-weight: 600; line-height: 1.3; }

/* video marker */
.sd-comm-tile .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.sd-comm-tile .play svg {
	width: 52px; height: 52px; padding: 14px; border-radius: 50%;
	background: rgba(15,39,66,.62); color: #fff;
	box-shadow: var(--shadow-2); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
	transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.sd-comm-tile:hover .play svg { background: var(--sd-amber-600); transform: scale(1.06); }
.sd-comm-tile .type-pill {
	position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px;
	font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase;
	background: rgba(10,27,46,.72); color: #fff; padding: 4px 8px; border-radius: var(--r-pill);
}

/* ===== Beitragen-CTA (Band) =============================== */
.sd-comm-cta {
	display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
	margin-top: 22px; padding: 20px 26px; border-radius: var(--r-lg);
	background: var(--sd-navy-050); border: 1px solid var(--sd-line);
}
.sd-comm-cta .ic { flex: none; width: 46px; height: 46px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; background: var(--sd-paper); color: var(--sd-navy-600); box-shadow: var(--shadow-1); }
.sd-comm-cta .tx { flex: 1; min-width: 220px; }
.sd-comm-cta .tx h4 { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin: 0 0 3px; color: var(--fg-brand); }
.sd-comm-cta .tx p { margin: 0; font-size: 14px; color: var(--fg-2); }
.sd-comm-cta .btn { flex: none; }
.sd-comm-note { margin: 14px 0 0; font-size: 12.5px; color: var(--fg-3); font-style: italic; }

/* PDP-Abschnitt-Wrapper: an die Produktseiten-Inhaltsbreite anlehnen.
   Die Produktseite ist ein 2-Spalten-Grid (Galerie | Summary, sdlink-shop.css);
   volle Breite wie Tabs/Finder-Band/Related — sonst säße der Abschnitt nur in
   der linken Spalte (grid-column: 1 / -1 wird ignoriert, wenn kein Grid-Item). */
.sd-comm { width: 100%; }
body.single-product div.product > .sd-comm { grid-column: 1 / -1; }

/* ===== Übersichtsseite „Aus dem Cockpit" =================== */
.sd-gallery-page { max-width: 1280px; margin: 0 auto; padding: 8px 24px 32px; }

/* Breadcrumb (eigenes Markup, wie Content/FAQ-Seiten) */
.sd-gallery-page .sd-breadcrumb {
	padding: 18px 0 0; font-size: 13px; color: var(--fg-3);
	display: flex; gap: 6px; align-items: center;
}
.sd-gallery-page .sd-breadcrumb a { color: var(--fg-2); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.sd-gallery-page .sd-breadcrumb a:hover { color: var(--sd-navy-600); }
.sd-gallery-page .sd-breadcrumb .sep { color: var(--sd-line); display: inline-flex; }

.sd-gallery-intro { margin-top: 14px; }
.sd-gallery-intro .eyebrow {
	font-weight: 600; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--sd-amber-600); margin: 0; display: inline-flex; align-items: center; gap: 7px;
}
.sd-gallery-intro h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -0.01em; color: var(--fg-brand); margin: 8px 0 6px; }
.sd-gallery-intro p { margin: 0; color: var(--fg-2); font-size: 16px; max-width: 64ch; }

/* Filter-Chips */
.sd-gallery-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 6px; }
.sd-chip {
	appearance: none; border: 1px solid var(--sd-line); background: var(--sd-paper); cursor: pointer;
	font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--fg-2);
	padding: 7px 14px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 7px;
	transition: all var(--dur-fast) var(--ease-out);
}
.sd-chip:hover { border-color: var(--sd-navy-300); color: var(--fg-1); }
.sd-chip.is-active { background: var(--sd-navy-700); border-color: var(--sd-navy-700); color: #fff; }
.sd-chip:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.sd-chip .n { font-family: var(--font-mono); font-size: 11px; opacity: .7; }

/* Masonry (Zellen wegen Filter-Toggle + break-inside) */
.sd-masonry { columns: 4 240px; column-gap: 14px; margin-top: 18px; }
.sd-comm-cell { break-inside: avoid; margin-bottom: 14px; }
.sd-masonry .sd-comm-tile { aspect-ratio: auto; min-height: 140px; }
.sd-masonry .sd-comm-tile img { height: auto; }

/* YouTube-Block */
.sd-yt { margin-top: 40px; }

/* Buttons (lokal, wie Content-Seiten — auf der Galerie-Seite ist nur tokens+base+galerie geladen) */
.sd-gallery-page .btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font-family: var(--font-body); font-weight: 700; font-size: 15px;
	height: 44px; padding: 0 20px; border-radius: var(--r-md);
	cursor: pointer; user-select: none; text-decoration: none;
	border: 1px solid transparent; white-space: nowrap;
	transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.sd-gallery-page .btn-primary { background: var(--sd-amber-600); color: #fff; border-color: rgba(0,0,0,.08); box-shadow: var(--shadow-1); }
.sd-gallery-page .btn-primary:hover { background: var(--sd-amber-500); box-shadow: var(--shadow-2); color: #fff; }
.sd-gallery-page .btn-secondary { background: transparent; color: var(--sd-navy-700); border-color: var(--sd-navy-700); }
.sd-gallery-page .btn-secondary:hover { background: var(--sd-navy-100); }

/* ===== Lightbox =========================================== */
.sd-lbx {
	position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
	background: rgba(8,18,30,.88); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
	padding: 32px;
}
.sd-lbx[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
	.sd-lbx { animation: sd-lbx-fade var(--dur-base) var(--ease-out); }
	.sd-lbx .sd-lbx-stage { animation: sd-lbx-pop var(--dur-base) var(--ease-out); }
}
@keyframes sd-lbx-fade { from { opacity: 0; } }
@keyframes sd-lbx-pop { from { opacity: 0; transform: scale(.97); } }

.sd-lbx-stage { position: relative; max-width: min(1100px, 92vw); max-height: 86vh; display: flex; flex-direction: column; }
.sd-lbx-media { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-3); background: #000; display: flex; align-items: center; justify-content: center; }
.sd-lbx-media img { max-width: 100%; max-height: 78vh; display: block; object-fit: contain; }
.sd-lbx-media .vid { width: min(960px, 88vw); aspect-ratio: 16 / 9; }
.sd-lbx-media .vid iframe { width: 100%; height: 100%; border: 0; display: block; }
.sd-lbx-cap { color: #fff; padding: 12px 4px 0; display: flex; align-items: baseline; gap: 12px; min-height: 22px; }
.sd-lbx-cap .dev { font-family: var(--font-mono); font-size: 12px; color: var(--sd-amber-500); }
.sd-lbx-cap .ac { font-size: 14px; font-weight: 600; }
.sd-lbx-cap .idx { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--sd-navy-300); }

.sd-lbx-btn {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center;
	transition: background var(--dur-fast) var(--ease-out);
}
.sd-lbx-btn:hover { background: rgba(255,255,255,.24); }
.sd-lbx-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.5); }
.sd-lbx-btn[hidden] { display: none; }
.sd-lbx-prev { left: -64px; }
.sd-lbx-next { right: -64px; }
.sd-lbx-close {
	position: fixed; top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
	background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2;
}
.sd-lbx-close:hover { background: rgba(255,255,255,.24); }

/* ===== Responsive ========================================= */
@media (max-width: 980px) {
	.sd-comm-grid, .sd-comm-grid.is-four { grid-template-columns: repeat(3, 1fr); }
	.sd-lbx-prev { left: 8px; } .sd-lbx-next { right: 8px; }
}
@media (max-width: 720px) {
	.sd-comm-grid, .sd-comm-grid.is-four { grid-template-columns: 1fr 1fr; }
	.sd-masonry { columns: 2 160px; }
	.sd-comm-head .more { order: 3; }
}
@media (max-width: 480px) {
	.sd-comm-grid, .sd-comm-grid.is-four { grid-template-columns: 1fr 1fr; }
}
