/* ==========================================================================
   Collections: automatisches Cover (5.10.34-ui)

   Ein Cover-Feld ist immer zuerst der Aeonwall-Platzhalter - ein dezenter
   violetter Verlauf mit dem Collection-Zeichen. Gibt es ein sichtbares Werk,
   liegt sein Bild darueber. Fehlt die Datei doch, nimmt das Bild sich selbst
   weg (onerror) und der Platzhalter bleibt: nie das graue Bruchsymbol, und
   kein Blick auf die Platte je Karte.

   Die Farbe kommt aus css/color.php (--base-h/s/l), wie ueberall.
   ========================================================================== */

.aw-sammelcover {
    --sc-h: var(--base-h, 256);

    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    container-type: size;
    background:
        radial-gradient(120% 90% at 18% 10%, hsl(var(--sc-h) 95% 97%) 0%, hsl(var(--sc-h) 95% 97% / 0) 62%),
        linear-gradient(150deg, hsl(var(--sc-h) 75% 93%) 0%, hsl(var(--sc-h) 58% 83%) 100%);
}

.aw-sammelcover__leer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--sc-h) 42% 44% / 0.72);
    font-size: 24px;
    font-size: clamp(14px, 30cqmin, 46px);
    line-height: 1;
}

.aw-sammelcover > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    background: transparent;
}

/* ==========================================================================
   Das Fenster "Add to collection" (5.10.34-ui)

   Einspaltig und kompakt: Kopf, waehlbare Zeilen, "neue Collection" als
   zweiter Bereich, unten Cancel und Save. Logische Eigenschaften
   (inline-start/end), damit Arabisch ohne Sonderregeln spiegelt.
   Bedienflaechen mindestens 44px hoch; sichtbarer Fokus ueberall.
   ========================================================================== */

.aw-sammelfenster {
    --sw-h: var(--base-h, 256);
    --sw-v: hsl(var(--sw-h) var(--base-s, 100%) var(--base-l, 65%));
    --sw-v-600: hsl(var(--sw-h) calc(var(--base-s, 100%) - 12%) calc(var(--base-l, 65%) - 16%));
    --sw-v-a08: hsl(var(--sw-h) var(--base-s, 100%) var(--base-l, 65%) / 0.08);
    --sw-v-a24: hsl(var(--sw-h) var(--base-s, 100%) var(--base-l, 65%) / 0.24);
    --sw-ink: #17171f;
    --sw-muted: #5f5f6e;
    --sw-line: #e7e5ef;
    --sw-radius: 16px;
}

.aw-sammelfenster .aw-sammelfenster__dialog {
    max-width: 480px;
    margin-inline: auto;
}

@media (max-width: 575.98px) {
    .aw-sammelfenster .aw-sammelfenster__dialog {
        max-width: none;
        margin: 8px;
    }
}

.aw-sammelfenster .modal-content {
    overflow: hidden;
    border: 1px solid var(--sw-line);
    border-radius: var(--sw-radius);
    box-shadow: 0 24px 60px -24px hsl(var(--sw-h) 40% 20% / 0.35);
}

.aw-sammelwahl {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    color: var(--sw-ink);
}

@supports (height: 100dvh) {
    .aw-sammelwahl { max-height: calc(100dvh - 32px); }
}

/* ---------------------------------------------------------------- Kopf --- */

.aw-sammelwahl__kopf {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--sw-line);
}

.aw-sammelwahl__zeichen {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(150deg, hsl(var(--sw-h) 75% 95%), hsl(var(--sw-h) 60% 87%));
    color: var(--sw-v-600);
    font-size: 18px;
}

.aw-sammelwahl__titelblock { flex: 1 1 auto; min-width: 0; }

.aw-sammelwahl__titel {
    margin: 0 0 2px;
    color: var(--sw-ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.aw-sammelwahl__text {
    margin: 0;
    color: var(--sw-muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.aw-sammelwahl__zu {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -8px;
    margin-inline-start: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--sw-muted);
    font-size: 20px;
    cursor: pointer;
}

.aw-sammelwahl__zu:hover { background: var(--sw-v-a08); color: var(--sw-ink); }

/* -------------------------------------------------------------- Auswahl --- */

.aw-sammelwahl__auswahl {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 10px 12px;
    overflow-y: auto;
    border: 0;
    overscroll-behavior: contain;
}

.aw-sammelwahl__liste {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.aw-sammelwahl__leer {
    margin: 6px 6px 4px;
    color: var(--sw-muted);
    font-size: 14px;
}

.aw-sammelzeile {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.aw-sammelzeile:hover { background: var(--sw-v-a08); }

/* Die Checkbox ist die Bedienung; sichtbar ist die ganze Zeile. */
.aw-sammelzeile__wahl {
    position: absolute;
    inset-inline-start: 10px;
    top: 50%;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.aw-sammelzeile:has(.aw-sammelzeile__wahl:focus-visible) {
    outline: 2px solid var(--sw-v);
    outline-offset: 2px;
}

.aw-sammelzeile:has(.aw-sammelzeile__wahl:checked) {
    border-color: var(--sw-v-a24);
    background: var(--sw-v-a08);
}

.aw-sammelzeile__cover {
    display: block;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 10px;
}

.aw-sammelzeile__cover .aw-sammelcover__leer { font-size: 18px; }

.aw-sammelzeile__text { display: grid; gap: 3px; min-width: 0; }

.aw-sammelzeile__name {
    overflow: hidden;
    color: var(--sw-ink);
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aw-sammelzeile__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    color: var(--sw-muted);
    font-size: 12.5px;
    line-height: 1.3;
}

.aw-sammelzeile__sicht { display: inline-flex; align-items: center; gap: 3px; }

.aw-sammelzeile__haken {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid #c9c6d6;
    border-radius: 50%;
    color: transparent;
    font-size: 15px;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.aw-sammelzeile:has(.aw-sammelzeile__wahl:checked) .aw-sammelzeile__haken {
    border-color: var(--sw-v-600);
    background: var(--sw-v-600);
    color: #fff;
}

/* --------------------------------------------------------- Neue Collection */

.aw-sammelwahl__neu {
    padding: 12px 18px 14px;
    border-top: 1px solid var(--sw-line);
    background: hsl(var(--sw-h) 40% 98.5%);
}

.aw-sammelwahl__neu-titel {
    display: block;
    margin: 0 0 6px;
    color: var(--sw-muted);
    font-size: 12.5px;
    font-weight: 650;
}

.aw-sammelwahl__neu-zeile { display: flex; flex-wrap: wrap; gap: 8px; }

.aw-sammelwahl__eingabe {
    flex: 1 1 180px;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d9d6e4;
    border-radius: 10px;
    background: #fff;
    color: var(--sw-ink);
    font-size: 14px;
}

.aw-sammelwahl__eingabe:focus-visible {
    border-color: var(--sw-v);
    outline: 2px solid var(--sw-v-a24);
    outline-offset: 0;
}

.aw-sammelwahl__eingabe.is-invalid { border-color: #b3261e; }

.aw-sammelwahl__anlegen,
.aw-sammelwahl__abbrechen,
.aw-sammelwahl__speichern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.aw-sammelwahl__anlegen,
.aw-sammelwahl__abbrechen {
    border: 1px solid #d9d6e4;
    background: #fff;
    color: var(--sw-ink);
}

.aw-sammelwahl__anlegen:hover,
.aw-sammelwahl__abbrechen:hover { border-color: var(--sw-v-a24); background: var(--sw-v-a08); }

/* ------------------------------------------------------------------ Fuss --- */

.aw-sammelwahl__fuss {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--sw-line);
}

.aw-sammelwahl__speichern {
    min-width: 112px;
    border: 1px solid var(--sw-v-600);
    background: var(--sw-v-600);
    color: #fff;
}

.aw-sammelwahl__speichern:hover { filter: brightness(1.06); }
.aw-sammelwahl__speichern:disabled { cursor: progress; opacity: .75; }

.aw-sammelwahl__zu:focus-visible,
.aw-sammelwahl__anlegen:focus-visible,
.aw-sammelwahl__abbrechen:focus-visible,
.aw-sammelwahl__speichern:focus-visible {
    outline: 2px solid var(--sw-v);
    outline-offset: 2px;
}

@media (max-width: 359.98px) {
    .aw-sammelwahl__kopf { padding: 14px 12px 12px; }
    .aw-sammelwahl__auswahl { padding: 8px; }
    .aw-sammelwahl__neu,
    .aw-sammelwahl__fuss { padding-inline: 12px; }
    .aw-sammelwahl__fuss > * { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
    .aw-sammelzeile,
    .aw-sammelzeile__haken,
    .aw-sammelwahl__anlegen,
    .aw-sammelwahl__abbrechen,
    .aw-sammelwahl__speichern { transition: none; }
}

/* ==========================================================================
   Statushinweis am eigenen, fuer andere verborgenen Werk (5.10.36)

   Nur auf der Collection-Detailseite und nur fuer den Urheber: "Nur fuer
   dich sichtbar" und der Grund. Fester Hintergrund, nicht nur Farbe -
   Symbol und Text sagen dasselbe.
   ========================================================================== */

.gallery__item:has(> .aw-werkstatus) { position: relative; }

.aw-werkstatus {
    position: absolute;
    z-index: 3;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: calc(100% - 16px);
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(23, 23, 31, 0.86);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.3;
    pointer-events: none;
}

.aw-werkstatus > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
