.discogs-me-wrap {
    width: 100%;
}

/* ── Contrôles visiteur ── */
.discogs-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
}

/* ── Onglets de tri (frontend) ── */
.dm-sort-tab {
    padding: 5px 14px;
    border: 1px solid #ccc;
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: .85rem;
    color: inherit;
    transition: background .15s, border-color .15s;
}
.dm-sort-tab:hover { background: rgba(0,0,0,.06); border-color: #999; }
.dm-sort-tab.is-active {
    background: #333;
    border-color: #333;
    color: #fff;
    font-weight: 600;
}
.dm-sort-arrow { margin-left: 3px; }

.dm-total {
    font-size: .85rem;
    color: #666;
    margin-left: auto;
}

/* ── Grille ── */
.discogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--gap, 20px);
}

@media (max-width: 599px) {
    .discogs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .discogs-card__overlay {
        padding: 10px 8px 8px;
    }

    .discogs-card__title  { font-size: .78rem; }
    .discogs-card__artist { font-size: .7rem; }
    .discogs-card__label  { font-size: .63rem; }
    .discogs-card__year   { font-size: .6rem; }
    .discogs-card__style-tag { font-size: .55rem; padding: 1px 4px; }
}

/* ── Carte ── */
.discogs-card {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    background: #111;
    cursor: pointer;
}

.discogs-card__img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform .35s ease, filter .35s ease;
}

.discogs-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,0) 60%);
    opacity: 0;
    transition: opacity .3s ease;
}

.discogs-card:hover .discogs-card__overlay {
    opacity: 1;
}

.discogs-card:hover .discogs-card__img {
    transform: scale(1.06);
    filter: brightness(.75);
}

.discogs-card__title,
.discogs-card__artist,
.discogs-card__label,
.discogs-card__year {
    display: block;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discogs-card__title  { font-weight: 700; font-size: .95rem; }
.discogs-card__artist { font-size: .85rem; margin-top: 3px; }
.discogs-card__label  { font-size: .75rem; opacity: .75; margin-top: 4px; }
.discogs-card__year   { font-size: .75rem; opacity: .65; }

/* ── Tags de styles Discogs ── */
.discogs-card__styles {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}
.discogs-card__style-tag {
    font-size: .62rem;
    padding: 1px 5px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 2px;
    color: rgba(255,255,255,.9);
    line-height: 1.4;
    white-space: nowrap;
}

/* ── Pagination numérotée ── */
.discogs-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 30px;
}

.discogs-pagination .dm-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-size: .85rem;
    transition: background .2s;
}

.discogs-pagination .dm-page.active,
.discogs-pagination .dm-page:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ── Badge format (vinyle / CD) ── */
.dm-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    line-height: 0;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.dm-badge--vinyl svg,
.dm-badge--cd svg {
    display: block;
    border-radius: 50%;
}

.dm-badge--cassette {
    font-size: 16px;
    line-height: 1;
    background: rgba(0,0,0,.55);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

/* ── Infinite scroll / Load more ── */
.discogs-load-more {
    text-align: center;
    margin-top: 30px;
}

.dm-load-more-btn {
    padding: 10px 28px;
    border: 2px solid #333;
    background: transparent;
    border-radius: 4px;
    font-size: .9rem;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.dm-load-more-btn:hover {
    background: #333;
    color: #fff;
}

.dm-spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(0,0,0,.15);
    border-top-color: #333;
    border-radius: 50%;
    animation: dm-spin .7s linear infinite;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes dm-spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   Modale — détail album
════════════════════════════════════════════════════════════ */
.dm-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.dm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .78);
    cursor: pointer;
}

.dm-modal__panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
}

.dm-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .2s;
}
.dm-modal__close:hover { background: rgba(0, 0, 0, .85); }

.dm-modal__inner {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 92vh;
}

@media (min-width: 500px) {
    .dm-modal__inner { flex-direction: row; }
}

/* ── Pochette ── */
.dm-modal__cover {
    flex: 0 0 auto;
    background: #111;
    line-height: 0;
}

.dm-modal__cover-img {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
}

@media (min-width: 500px) {
    .dm-modal__cover-img {
        width: 220px;
        height: 220px;
        max-height: none;
        object-fit: cover;
    }
}

/* ── Informations ── */
.dm-modal__info {
    padding: 20px 20px 20px;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

.dm-modal__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.35;
    padding-right: 20px; /* évite le bouton Fermer */
}

.dm-modal__orig-year {
    font-weight: 400;
    font-size: .82em;
    color: #888;
    margin-left: 4px;
}

.dm-modal__artist {
    font-size: .9rem;
    color: #555;
    margin: 0 0 14px;
}

/* Tableau label / valeur */
.dm-modal__rows {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.dm-modal__row {
    display: table-row;
}

.dm-modal__row-lbl,
.dm-modal__row-val {
    display: table-cell;
    padding: 5px 0;
    font-size: .82rem;
    line-height: 1.45;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.dm-modal__row-lbl {
    color: #999;
    font-weight: 600;
    white-space: nowrap;
    padding-right: 14px;
    width: 1%;
}

.dm-modal__notes {
    margin-top: 14px;
    font-size: .8rem;
    color: #777;
    line-height: 1.55;
    white-space: pre-line;
}

.dm-modal__link {
    display: inline-block;
    margin-top: 14px;
    font-size: .8rem;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    transition: color .15s, border-color .15s;
}
.dm-modal__link:hover { color: #111; border-color: #333; }

.dm-modal-loading {
    color: #aaa;
    font-size: .88rem;
    padding: 8px 0;
}
