/*
 * Fotoalben (5.10.44): die Marke auf den Karten, die Galerie der Werkseite,
 * die Kacheln beim Hochladen und Bearbeiten.
 *
 * Weiss, feine Kontur, Violett nur als Akzent. Logische Eigenschaften, damit
 * eine Seite von rechts nach links ohne eigene Regeln stimmt. Jede Flaeche zum
 * Anklicken ist mindestens 44 px gross.
 */

/* ------------------------------------------------ Die Marke auf der Karte */

.aw-album-marke {
    /* Oben rechts, auch von rechts nach links: die Marken der Karte stehen
       links, die Kennzeichnung Premium/Exclusive laege sonst darauf. */
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(14, 12, 24, .62);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.aw-album-marke i {
    font-size: 14px;
}

/* ------------------------------------------------ Die Galerie */

/* Der dunkle Rahmen der Werkseite umschliesst ein einzelnes Medium. Eine Galerie
   braucht die volle Breite und einen ruhigen, hellen Grund fuer freien Raum. */
.awu-det .awu-det__frame:has(.aw-album) {
    width: 100%;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.aw-album {
    position: relative;
    width: 100%;
}

.aw-album__bahn {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: 12px;
    background: #f5f3fb;
}

.aw-album__bahn::-webkit-scrollbar {
    display: none;
}

.aw-album__bahn:focus-visible {
    outline: 3px solid hsl(var(--base)) !important;
    outline-offset: 2px !important;
}

.aw-album__folie {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.aw-album__gross {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: min(72vh, 640px);
    cursor: zoom-in;
}

/* Das ganze Bild, nichts beschnitten; der freie Raum gehoert der Flaeche. */
.aw-album__bild {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.aw-album__gross:focus-visible {
    outline: 3px solid hsl(var(--base)) !important;
    outline-offset: -3px !important;
}

.aw-album__zaehler {
    position: absolute;
    inset-block-start: 10px;
    inset-inline-end: 10px;
    z-index: 2;
    margin: 0;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(14, 12, 24, .62);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    /* Zahlen laufen auch von rechts nach links in dieser Reihenfolge: 3 / 10. */
    direction: ltr;
    unicode-bidi: isolate;
}

.aw-album__knopf {
    position: absolute;
    inset-block-start: calc(min(72vh, 640px) / 2 - 22px);
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid hsl(var(--dark) / 0.15);
    border-radius: 50%;
    background: hsl(var(--white));
    color: hsl(var(--dark));
    font-size: 20px;
    cursor: pointer;
}

.aw-album__knopf:hover:not(:disabled) {
    border-color: hsl(var(--base));
    color: hsl(var(--base));
}

.aw-album__knopf:disabled {
    opacity: .4;
    cursor: default;
}

.aw-album__knopf--zurueck {
    inset-inline-start: 10px;
}

.aw-album__knopf--vor {
    inset-inline-end: 10px;
}

[dir="rtl"] .aw-album__knopf i {
    transform: scaleX(-1);
}

/* Zaehler und Pfeile gibt es nur, wenn sie auch etwas tun. */
.aw-album:not(.aw-album--bereit) .aw-album__zaehler {
    display: none;
}

.aw-album__streifen {
    display: none;
    gap: 8px;
    margin: 10px 0 0;
    padding: 2px;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: thin;
}

.aw-album__klein {
    display: block;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    opacity: .75;
}

.aw-album__klein img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aw-album__klein:hover,
.aw-album__klein:focus-visible,
.aw-album__klein.is-aktiv {
    border-color: hsl(var(--base));
    opacity: 1;
}

@media (min-width: 768px) {
    .aw-album--bereit .aw-album__knopf {
        display: inline-flex;
    }

    .aw-album__streifen {
        display: flex;
    }
}

/* Am Handy: das naechste Bild schaut herein, die Geste erklaert sich selbst. */
@media (max-width: 767.98px) {
    .aw-album__bahn {
        padding-inline: 8px;
        scroll-padding-inline: 8px;
    }

    .aw-album__folie {
        flex-basis: calc(100% - 28px);
    }

    .aw-album__gross {
        height: min(64vh, 110vw);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .aw-album__bahn {
        scroll-behavior: smooth;
    }
}

/* ------------------------------------------------ Die Kacheln */

.aw-af {
    margin-block-start: 16px;
    padding: 16px;
    border: 1px solid hsl(var(--dark) / 0.12);
    border-radius: 12px;
    background: hsl(var(--white));
    text-align: start;
}

.aw-af__titel {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
}

.aw-af__hinweis {
    margin: 0 0 12px;
    color: hsl(var(--dark) / 0.72);
    font-size: 14px;
}

.aw-af__liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
    gap: 10px;
    margin-block-end: 12px;
}

.aw-af__liste[hidden] {
    display: none;
}

.aw-af__kachel {
    position: relative;
    min-width: 0;
    border: 1px solid hsl(var(--dark) / 0.12);
    border-radius: 10px;
    background: hsl(var(--white));
    overflow: hidden;
}

.aw-af__kachel--gezogen {
    opacity: .5;
}

.aw-af__kachel--laeuft img {
    opacity: .55;
}

.aw-af__kachel--fehler {
    border-color: hsl(var(--danger));
}

.aw-af__bild {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: hsl(var(--dark) / 0.05);
}

.aw-af__nummer {
    position: absolute;
    inset-block-start: 6px;
    inset-inline-start: 6px;
    min-width: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(14, 12, 24, .62);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}

.aw-af__cover {
    position: absolute;
    inset-block-start: 6px;
    inset-inline-end: 6px;
    padding: 0 8px;
    border-radius: 999px;
    background: hsl(var(--base));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 24px;
}

.aw-af__cover[hidden] {
    display: none;
}

.aw-af__name {
    margin: 6px 8px 0;
    overflow: hidden;
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aw-af__fehler {
    margin: 4px 8px 0;
    color: hsl(var(--danger));
    font-size: 12.5px;
    line-height: 1.3;
}

.aw-af__fehler[hidden] {
    display: none;
}

/* Nie unter 44 px: was nicht in eine Reihe passt, rutscht in die naechste. */
.aw-af__knoepfe {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 2px;
    padding: 4px;
}

.aw-af__tat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: hsl(var(--dark));
    font-size: 18px;
    cursor: pointer;
}

.aw-af__tat:hover:not(:disabled) {
    color: hsl(var(--base));
}

.aw-af__tat:disabled {
    opacity: .3;
    cursor: default;
}

.aw-af__tat[hidden] {
    display: none;
}

.aw-af__tat--cover {
    grid-column: 1 / -1;
    font-size: 13px;
    font-weight: 600;
}

[dir="rtl"] .aw-af__tat--pfeil i {
    transform: scaleX(-1);
}

.aw-af__waehlen {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
    padding: 8px 14px;
    border: 1px dashed hsl(var(--dark) / 0.3);
    border-radius: 10px;
    color: hsl(var(--dark));
    font-weight: 600;
    cursor: pointer;
}

.aw-af__waehlen:hover,
.aw-af__waehlen:focus-within {
    border-color: hsl(var(--base));
    color: hsl(var(--base));
}

.aw-af__eingabe {
    max-width: 100%;
    font-size: 13px;
}

/* Mit Skript traegt die Beschriftung die Bedienung. Das Feld bleibt
   erreichbar und fokussierbar; ohne Skript steht es ganz gewoehnlich da. */
.aw-af--bereit .aw-af__waehlen {
    position: relative;
}

.aw-af--bereit .aw-af__eingabe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.aw-af--bereit .aw-af__eingabe:disabled {
    cursor: not-allowed;
}

.aw-af__waehlen:has(.aw-af__eingabe:disabled) {
    opacity: .5;
}

.aw-af__waehlen:has(.aw-af__eingabe:focus-visible) {
    outline: 3px solid hsl(var(--base));
    outline-offset: 2px;
}
.aw-af__status {
    min-height: 1.4em;
    margin: 8px 0 0;
    font-size: 13.5px;
}

.aw-af__leiste {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-block-start: 12px;
}

.aw-af__leiste .btn {
    min-height: 44px;
}

/* Der Weg vom Angebot zu den gekauften Dateien. */
.awu-det__variant-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-block-start: 6px;
    color: hsl(var(--base));
    font-weight: 600;
}

.awu-det__variant-note {
    margin: 8px 0 0;
    font-size: 14px;
}

/* ------------------------------------------------ Liste eines Kaufs */

.aw-ak {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding: 0;
    list-style: none;
}

.aw-ak__zeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 56px;
    padding: 8px 12px;
    border: 1px solid hsl(var(--dark) / 0.12);
    border-radius: 10px;
    background: hsl(var(--white));
}

.aw-ak__name {
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aw-ak__laden {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid hsl(var(--dark) / 0.2);
    border-radius: 10px;
    color: hsl(var(--dark));
    font-size: 20px;
    text-decoration: none;
}

.aw-ak__laden:hover {
    border-color: hsl(var(--base));
    color: hsl(var(--base));
}
