/* ============================================================
   CE "Downloads nach Produktgruppe" (fux_downloadcenter, Etappe Downloads
   2026-10-15). Vorbild: _prototypes/downloads-produktgruppen/variante-d.html
   (css/downloads.css, Varianten C/D) — Werte von dort, Klassen mit eigenem
   Praefix dc-, damit nichts mit Bestandsklassen kollidiert.
   Filter-Sidebar, mobiler Filter-Button und Modal: products.css (gemeinsam
   mit /produkte und der Auswahlmatrix). Pfeil-Buttons des Slider: global
   carousel.css (.fux-carousel-btn).

   Kontraste (nachgerechnet): Text #1d1d1f auf #fff/#f5f5f7 16,8/15,5:1;
   Grau #6e6e73 auf #fff/#f5f5f7 5,07/4,66:1; Links #0066cc auf #fff
   5,57:1; Button Weiss auf #0066cc/#0051a3 5,57/7,6:1; haftender
   Tabellenkopf Weiss auf #6e6e73 5,07:1 (Badge "Dark", User 2026-10-15).
   ============================================================ */

.downloadcenter {
    padding: var(--space-lg) 0 var(--space-xl);
    background: var(--white);
    /* Abstand des haftenden Tabellenkopfs zur Navigation = Abstand der
       Sidebar (User 2026-10-15); mobil unter dem klebenden Filter-Button */
    --dc-thead-gap: 1.75rem;
}

/* Standardabstand des Inhaltsbereichs (User-Vorgabe 2026-10-30): im
   Relaunch-Rahmen steht das Center als Abschnitt am Rand der Inhaltshuelle,
   die dort auf ihren Abstand verzichtet (relaunch-frame.css, Abschnitt
   "Inhaltsbereich"). Der Rand-Innenabstand ist deshalb der Standard
   (48 px, unter 769 px 32 px) statt --space-lg/--space-xl. */
body.fux-relaunch .downloadcenter:first-child {
    padding-top: var(--fux-content-gap, var(--space-lg));
}

body.fux-relaunch .downloadcenter:last-child {
    padding-bottom: var(--fux-content-gap, var(--space-lg));
}

.dc-layout [hidden] {
    display: none !important;
}

.dc-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- Produktgruppe (Karte) ---------- */
.dc-group {
    padding: 2rem;
    border: 1px solid var(--gray-tertiary);
    border-radius: var(--radius-lg);
    background: var(--gray-quaternary);
}

.dc-group-title {
    margin: 0 0 1.5rem;
    font-size: var(--font-size-h2);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--gray-primary);
    hyphens: auto;
    overflow-wrap: break-word;
}

/* In der schmalen Ergebnisspalte steht der Prospekt quer ueber den
   Unterlagen (Titelbild links, Button rechts), die Tabelle hat volle Breite */
.dc-group-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
}

.dc-group-aside {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 0.75rem 1.5rem;
    align-items: start;
    justify-items: start;
}

.dc-brochure {
    display: contents;
}

.dc-cover {
    grid-row: span 3;
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    background: var(--white);
    border-radius: var(--radius-md);
}

.dc-cover img {
    display: block;
    /* Feste Breite: Hoehe steht ueber aspect-ratio schon vor dem Laden des
       Bildes, Badge und Icon liegen sofort richtig (A11y ADV-6) */
    width: 6.5rem;
    height: auto;
    max-width: 10rem;
    aspect-ratio: 236 / 325;
    object-fit: cover;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.12);
}

.dc-group-aside > :not(.dc-brochure),
.dc-brochure > :not(.dc-cover) {
    grid-column: 2;
}

/* Ohne Titelbild bzw. Prospekt ausgefiltert: keine leere Bildspalte */
.dc-group-aside:not(:has(.dc-brochure:not([hidden]) .dc-cover)) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.dc-group-aside:not(:has(.dc-brochure:not([hidden]) .dc-cover)) > *,
.dc-group-aside:not(:has(.dc-brochure:not([hidden]) .dc-cover)) .dc-brochure > * {
    grid-column: auto;
}

.dc-group-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* Inhaltsfilter blendet alle Bloecke aus: leeren Bereich entfernen */
.dc-group-content:not(:has(> :not([hidden]))) {
    display: none;
}

.dc-subhead {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-primary);
}

.dc-meta {
    margin: 0;
    font-size: var(--font-size-small);
    color: var(--gray-secondary);
}

.dc-group-aside .dc-meta {
    margin-top: -0.25rem;
}

/* ---------- Prospekt: Titelbild als Download (User 2026-10-15) ----------
   Badge oben links, rundes Download-Icon unten rechts in CTA-Farbe */
a.dc-cover {
    position: relative;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

a.dc-cover img {
    transition: transform 0.2s ease;
}

a.dc-cover:hover img,
a.dc-cover:focus-visible img {
    transform: translateY(-2px);
}

a.dc-cover:focus-visible {
    outline: 2px solid var(--hsgm-blue);
    outline-offset: 2px;
}

.dc-cover-badge {
    position: absolute;
    top: 0.375rem;
    left: 0.375rem;
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
    background: var(--white);
    color: var(--gray-primary);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dc-cover-icon {
    position: absolute;
    right: 0.375rem;
    bottom: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--hsgm-blue);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: background-color 0.2s ease;
}

.dc-cover-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

a.dc-cover:hover .dc-cover-icon,
a.dc-cover:focus-visible .dc-cover-icon {
    background: var(--hsgm-blue-dark);
}

.dc-brochure-link {
    color: var(--hsgm-blue);
    font-weight: 500;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.dc-brochure-link .dc-format {
    font-weight: 400;
}

.dc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 1.5rem;
    color: var(--hsgm-blue);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dc-link:hover,
.dc-link:focus-visible {
    text-decoration-thickness: 2px;
}

/* ---------- Geraete-Tabelle ---------- */
.dc-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    /* kein overflow:hidden — es wuerde den sticky Tabellenkopf verhindern;
       die Rundung tragen die Eckzellen */
    font-size: 0.9375rem;
}

.dc-table caption {
    text-align: left;
}

.dc-table th,
.dc-table td {
    box-sizing: border-box; /* 20 % der ersten Spalte inkl. Innenabstand, wie Prototyp */
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--gray-tertiary);
}

.dc-table tbody tr:last-child > * {
    border-bottom: 0;
}

/* Spaltenkoepfe in Kapitaelchen-Optik statt text-transform (manche
   Screenreader buchstabieren Grossbuchstaben) */
.dc-table thead th {
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-caps: all-small-caps;
    letter-spacing: 0.04em;
    color: var(--gray-secondary);
    background: var(--white);
}

.dc-table thead th:first-child,
.dc-table tbody th {
    width: 20%;
    font-weight: 600;
    color: var(--gray-primary);
    overflow-wrap: anywhere;
}

.dc-table thead th:first-child {
    border-top-left-radius: var(--radius-md);
}

.dc-table thead th:last-child {
    border-top-right-radius: var(--radius-md);
}

.dc-table tbody tr:last-child > :first-child {
    border-bottom-left-radius: var(--radius-md);
}

.dc-table tbody tr:last-child > :last-child {
    border-bottom-right-radius: var(--radius-md);
}

.dc-cell-label {
    display: none;
}

.dc-cell-none {
    color: var(--gray-secondary);
}

.dc-lang-links,
.dc-doc-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dc-doc-list {
    gap: 0.5rem;
}

.dc-lang-links a {
    display: inline-block;
    padding: 0.25rem 0; /* Zielhoehe >= 24 px (WCAG 2.5.8) */
    line-height: 1.4;
    color: var(--hsgm-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    hyphens: auto;
}

/* Dokumentlisten wie im Prototyp: Fliesstext-Links, Zeilenabstand ueber
   das Grid (gap 0.5rem) */
.dc-doc-list a {
    color: var(--hsgm-blue);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.dc-lang-links a:hover,
.dc-lang-links a:focus-visible,
.dc-doc-list a:hover,
.dc-doc-list a:focus-visible {
    text-decoration-thickness: 2px;
}

.dc-format {
    color: var(--gray-secondary);
    white-space: nowrap;
}

/* Sticky Tabellenkopf (User 2026-10-15): Spaltenbezeichnungen bleiben beim
   Scrollen sichtbar, im Abstand der Sidebar zur Navigation; haftend grau
   wie das Badge „Dark“ (downloadcenter.js setzt is-stuck). Nur ab 768 px —
   darunter wird die Tabelle zum Slider mit Beschriftung je Zelle. Der
   Spalt zur Navigation wird mit der Kartenfarbe gefuellt. */
@media (min-width: 768px) {
    .dc-table thead th {
        position: sticky;
        top: calc(var(--fux-sticky-offset, 0px) + var(--dc-thead-gap));
        z-index: 1;
        transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    }

    .dc-table thead.is-stuck th,
    .dc-table thead.is-stuck th:first-child {
        background: var(--gray-secondary);
        color: var(--white);
        border-bottom-color: var(--gray-secondary);
        /* Zwei Fuellschatten: der Spalt kann hoeher sein als der Kopf
           (768-991 px unter dem klebenden Filter-Button, A11y ADV-1) */
        box-shadow: 0 calc(-1 * var(--dc-thead-gap)) 0 var(--gray-quaternary), 0 calc(-0.5 * var(--dc-thead-gap)) 0 var(--gray-quaternary), 0 4px 12px rgba(0, 0, 0, 0.12);
    }

    .dc-table tbody a {
        scroll-margin-top: calc(var(--fux-sticky-offset, 0px) + var(--dc-thead-gap) + 3.25rem);
    }
}

/* Zwischen 768 und 991 px klebt der Filter-Button (products.css): der
   Tabellenkopf rueckt darunter */
@media (min-width: 768px) and (max-width: 991.98px) {
    .downloadcenter {
        --dc-thead-gap: calc(0.75rem + var(--fux-filter-toggle-h, 2.75rem) + 0.75rem);
    }
}

/* ---------- Aufklapper (Erklaerungen) ---------- */
.dc-disclosure {
    padding: 0 1rem;
    border-radius: var(--radius-md);
    background: var(--white);
}

.dc-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
    list-style: none;
    font-weight: 500;
    color: var(--gray-primary);
    border-radius: var(--radius-sm);
}

.dc-disclosure > summary::-webkit-details-marker {
    display: none;
}

.dc-disclosure > summary::after {
    content: "";
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.375rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.dc-disclosure[open] > summary::after {
    transform: translateY(2px) rotate(-135deg);
}

.dc-disclosure > summary:hover {
    color: var(--hsgm-blue);
}

body.fux-relaunch .dc-disclosure > summary:focus-visible {
    outline: 3px solid var(--hsgm-blue);
    outline-offset: 2px;
}

.dc-disclosure-body {
    padding: 0 0 0.75rem;
}

/* ---------- Mobil: Gerätekarten als Slider (< 768 px) ---------- */
@media (max-width: 767.98px) {
    .dc-group {
        padding: 1.25rem;
    }

    .dc-group-aside {
        grid-template-columns: 6.5rem minmax(0, 1fr);
        gap: 0.75rem 1rem;
    }

    .dc-cover {
        padding: 0.5rem;
    }

    .dc-cover img {
        width: 5.5rem;
    }

    .dc-table,
    .dc-table tbody,
    .dc-table tr,
    .dc-table th,
    .dc-table td {
        display: block;
        width: 100%;
    }

    .dc-table {
        background: transparent;
    }

    /* Spaltenkoepfe nur fuer Screenreader (Zellen tragen ihre Beschriftung) */
    .dc-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .dc-table tbody th,
    .dc-table td {
        border-bottom: 0;
        padding: 0.5rem 1rem;
    }

    .dc-table tbody th {
        width: 100%;
        padding-top: 0.875rem;
        font-size: 1.0625rem;
    }

    .dc-table td:last-child {
        padding-bottom: 1rem;
    }

    /* Beschriftung je Zelle nur sichtbar (aria-hidden im Markup) — der
       Screenreader nennt die Spaltenueberschrift ohnehin */
    .dc-cell-label {
        display: block;
        margin-bottom: 0.125rem;
        font-size: 0.875rem;
        font-weight: 600;
        font-variant-caps: all-small-caps;
        letter-spacing: 0.04em;
        color: var(--gray-secondary);
    }

    /* Leere Zelle nur optisch ausblenden: bleibt sie im Accessibility-Baum,
       ordnet der Screenreader die Spaltenkoepfe der Folgezellen richtig zu
       (A11y-Review MAJOR-1, 1.3.1) */
    .dc-table td.dc-cell-none {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    /* Slider: scroll-snap, naechste Karte angeschnitten; position:relative
       haelt die absolut positionierten .visually-hidden-Texte der Links im
       Scroll-Container (sonst scrollt die ganze Seite seitlich) */
    .dc-table tbody {
        position: relative;
        display: flex;
        gap: 0.75rem;
        width: auto;
        margin: -0.25rem -0.25rem -0.5rem;
        padding: 0.25rem 0.25rem 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 0.25rem;
    }

    html.fux-nav-js .dc-table tbody {
        scrollbar-width: none;
    }

    html.fux-nav-js .dc-table tbody::-webkit-scrollbar {
        display: none;
    }

    .dc-table tbody.is-dragging {
        cursor: grabbing;
        scroll-snap-type: none;
        scroll-behavior: auto;
        user-select: none;
    }

    .dc-table tbody tr {
        flex: 0 0 min(85%, 20rem);
        width: auto;
        background: var(--white);
        border-radius: var(--radius-md);
        scroll-snap-align: start;
    }

    .dc-table tbody tr:last-child {
        scroll-snap-align: end;
    }

    .dc-table tr > * {
        border-radius: 0;
    }

    .dc-slider-nav {
        margin-top: 1rem;
    }
}

@media (min-width: 768px) {
    .dc-slider-nav {
        display: none !important;
    }
}

@media (max-width: 479.98px) {
    .dc-group-aside {
        grid-template-columns: minmax(0, 1fr);
    }

    .dc-group-aside > :not(.dc-brochure),
    .dc-brochure > :not(.dc-cover) {
        grid-column: auto;
    }

    .dc-cover {
        grid-row: auto;
        justify-content: flex-start;
        background: transparent;
        padding: 0;
    }

    .dc-cover img {
        width: 6rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .dc-table tbody {
        scroll-behavior: smooth;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dc-table thead th,
    a.dc-cover img,
    .dc-cover-icon,
    .dc-disclosure > summary::after {
        transition: none;
    }
}

@media (forced-colors: active) {
    .dc-group,
    .dc-table {
        border: 1px solid CanvasText;
    }

    /* Schatten gibt es hier nicht: Spalt zur Navigation selbst fuellen
       (A11y-Review MINOR-3) */
    .dc-table thead.is-stuck th,
    .dc-table thead.is-stuck th:first-child {
        forced-color-adjust: none;
        background: Canvas;
        color: CanvasText;
        border-bottom: 1px solid CanvasText;
        box-shadow: 0 calc(-1 * var(--dc-thead-gap)) 0 Canvas, 0 calc(-0.5 * var(--dc-thead-gap)) 0 Canvas;
    }

    .dc-cover-badge,
    .dc-cover-icon {
        border: 1px solid CanvasText;
    }

    a.dc-cover:hover .dc-cover-icon,
    a.dc-cover:focus-visible .dc-cover-icon {
        forced-color-adjust: none;
        background: Highlight;
        color: HighlightText;
    }
}
