/* ==============================================================
   BENUTZERBEREICH – FAVORITEN: EINZELN UND ALLE ENTFERNEN
   ============================================================== */
.gallery-favorites-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
}

.gallery-favorites-heading h2 {
    margin: 0;
}

.gallery-favorites-clear-form,
.gallery-favorites-remove-form {
    margin: 0;
}

.gallery-favorites-grid {
    align-items: start;
}

.gallery-favorites-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    min-width: 0;
}

.gallery-favorites-item > a {
    min-width: 0;
}

.gallery-favorites-item button,
.gallery-favorites-clear-form button {
    min-height: 36px;
    border: 1px solid #c9d7df;
    border-radius: 8px;
    background: #f2f7f9;
    color: #355b6c;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}

.gallery-favorites-item button:hover,
.gallery-favorites-clear-form button:hover {
    background: #e0ebf0;
    color: #274758;
}

.gallery-favorites-remove-form button {
    width: 100%;
}

.gallery-favorites-clear-form .gallery-favorites-remove-all {
    background: #fff1f1;
    border-color: #e4c8c8;
    color: #90434a;
}

.gallery-favorites-clear-form .gallery-favorites-remove-all:hover {
    background: #fbe4e5;
    color: #792a33;
}

/* ==============================================================
   FAVORITEN – EINHEITLICHE FOTOKARTEN UND ENTFERNEN-AKTION
   ============================================================== */
.gallery-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.gallery-favorites-item {
    overflow: hidden;
    border: 1px solid #dce6ea;
    border-radius: 12px;
    background: #ffffff;
    gap: 0;
}

.gallery-favorites-item > a {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.gallery-favorites-item > a img {
    display: block;
    width: 100%;
    height: 135px;
    object-fit: cover;
}

.gallery-favorites-item > a span {
    display: block;
    padding: 10px 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.gallery-favorites-remove-form {
    padding: 0 12px 12px;
}

.gallery-favorites-remove-form .gallery-favorites-remove-one {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 39px;
}

.gallery-favorites-remove-one span {
    font-size: 18px;
    line-height: 1;
}

/* ==============================================================
   FAVORITEN – KOMPAKTES MÜLLTONNEN-SYMBOL AUF DER FOTOKARTE
   ============================================================== */
.gallery-favorites-item {
    position: relative;
}

.gallery-favorites-remove-form {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 0;
}

.gallery-favorites-remove-form .gallery-favorites-remove-one {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid #d9e1e5;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    color: #8b3840;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.14);
}

.gallery-favorites-remove-form .gallery-favorites-remove-one:hover,
.gallery-favorites-remove-form .gallery-favorites-remove-one:focus-visible {
    background: #fff1f1;
    color: #792a33;
}

.gallery-favorites-remove-form .gallery-favorites-remove-one svg {
    display: block;
    flex: none;
}

/* ==============================================================
   FAVORITEN – GRÖSSERE FOTOKARTEN UND BESSER LESBARE TITEL
   ============================================================== */
.gallery-favorites-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 20px;
}

.gallery-favorites-item > a img {
    height: 185px;
}

.gallery-favorites-item > a span {
    padding: 13px 14px 16px;
    font-size: 15px;
    line-height: 1.45;
    overflow-wrap: break-word;
}

@media (max-width: 560px) {
    .gallery-favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
        gap: 14px;
    }

    .gallery-favorites-item > a img {
        height: 155px;
    }
}

/* ==============================================================
   FAVORITEN – KARTENBREITE WIE IN DER ALBUMANSICHT
   --------------------------------------------------------------
   Die gemeinsame Klasse .gallery-recent-account-grid besitzt
   ebenfalls eine Rasterdefinition. Dieser spezifischere Selektor
   stellt sicher, dass die Favoriten ihre eigene Breite behalten.
   ============================================================== */
.gallery-recent-account-grid.gallery-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
    gap: 17px;
    align-items: stretch;
}

.gallery-recent-account-grid.gallery-favorites-grid .gallery-favorites-item {
    min-width: 0;
    width: 100%;
}

.gallery-recent-account-grid.gallery-favorites-grid .gallery-favorites-item > a img {
    display: block;
    width: 100%;
    height: 175px;
    aspect-ratio: auto;
    object-fit: cover;
    margin-bottom: 0;
}

.gallery-recent-account-grid.gallery-favorites-grid .gallery-favorites-item > a span {
    display: block;
    padding: 11px 13px;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 560px) {
    .gallery-recent-account-grid.gallery-favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr));
        gap: 12px;
    }

    .gallery-recent-account-grid.gallery-favorites-grid .gallery-favorites-item > a img {
        height: 155px;
    }
}
