/* ── Artist Bio — Styles publics ─────────────────────────────── */

/* ── Single artiste : photo portrait 280px centrée ─────────── */

/* Double sélecteur :
   - body.single-pmab_artist  → visite directe (WordPress body_class natif)
   - body.pmab-single-artist  → navigation PJAX (classe ajoutée par notre JS pjax:load)
   Le thème ne met pas à jour document.body.className lors des navigations PJAX,
   donc body.single-pmab_artist n'est jamais présent dans ce cas.
   Préfixe html pour surclasser tout !important du thème. */

html body.single-pmab_artist figure:has(img.wp-post-image),
html body.pmab-single-artist figure:has(img.wp-post-image) {
    max-width: 280px !important;
    width: 280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 32px !important;
    border-radius: var(--rt-radius-lg, 8px) !important;
    overflow: hidden !important;
}

html body.single-pmab_artist img.wp-post-image,
html body.pmab-single-artist img.wp-post-image {
    width: 280px !important;
    max-width: 280px !important;
    height: 280px !important;
    object-fit: cover !important;
    object-position: top center !important;
    display: block !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

/* ── Page Biographies [pmab_biographies] ──────────────────── */

/* ── Full-bleed : neutraliser les contraintes ancêtres ────────
   :has() cible le conteneur qui contient .pmab-biographies,
   quelle que soit la classe appliquée par le template (rt-page-text
   ou rt-page-full). Pas de body-class, pas de JS, pas de timing. */
.rt-prose:has(.pmab-biographies),
.rt-page-text:has(.pmab-biographies) {
    max-width: none !important;
    overflow:  visible !important;
}
.rt-container:has(.pmab-biographies),
.rt-section:has(.pmab-biographies) {
    overflow: visible !important;
}

/* Full-bleed effectif sur .pmab-biographies.
   calc(50% - 50vw) est correct quand le parent est centré et sans max-width. */
.pmab-biographies {
    box-sizing: border-box;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-left:  clamp(16px, 5vw, 80px);
    padding-right: clamp(16px, 5vw, 80px);
}

/* ── Barre de recherche ─────────────────────────────────────── */

.pmab-bio-search-wrap {
    position: relative;
    margin-bottom: 16px;
}

.pmab-bio-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--rt-muted, rgba(0,0,0,.4));
    pointer-events: none;
    flex-shrink: 0;
}

.pmab-bio-search {
    width: 100%;
    padding: 10px 40px 10px 42px;
    font-size: 14px;
    font-family: inherit;
    background: var(--rt-surface, #fff);
    border: 1px solid var(--rt-border, rgba(0,0,0,.1));
    border-radius: var(--rt-radius, 4px);
    color: var(--rt-text, #111);
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}

.pmab-bio-search:focus {
    border-color: var(--rt-accent, #ed261e);
}

.pmab-bio-search::placeholder {
    color: var(--rt-muted, rgba(0,0,0,.4));
}

.pmab-bio-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--rt-muted, rgba(0,0,0,.4));
    padding: 4px 6px;
    line-height: 1;
    border-radius: var(--rt-radius, 4px);
    transition: color .15s;
}

.pmab-bio-search-clear:hover {
    color: var(--rt-text, #111);
}

/* ── Navigation alphabétique ────────────────────────────────── */

.pmab-bio-alpha-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 20px;
}

/* Reprend .rt-btn-outline du thème */
.pmab-alpha-btn {
    padding: 4px 10px;
    min-width: 32px;
    border: 1px solid var(--rt-border, rgba(0,0,0,.1));
    border-radius: var(--rt-radius, 4px);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    cursor: pointer;
    color: var(--rt-text, #111);
    font-family: inherit;
    transition: border-color .15s, color .15s, background .15s;
    line-height: 1.5;
}

.pmab-alpha-btn:hover:not(:disabled) {
    border-color: var(--rt-accent, #ed261e);
    color: var(--rt-accent, #ed261e);
}

.pmab-alpha-btn.active {
    background: var(--rt-accent, #ed261e);
    border-color: var(--rt-accent, #ed261e);
    color: #fff;
}

.pmab-alpha-btn--empty,
.pmab-alpha-btn:disabled {
    opacity: .25;
    cursor: default;
}

/* ── Grille d'artistes ──────────────────────────────────────── */

.pmab-bio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 16px;
}

/* ── Carte artiste — calquée sur .rt-card du thème ─────────── */

.pmab-bio-card {
    position: relative; /* ancre du stretched-link */
    background: var(--rt-surface, #fff);
    border: 1px solid var(--rt-border, rgba(0,0,0,.1));
    border-radius: var(--rt-radius-lg, 8px);
    overflow: hidden;
    transition: border-color .2s, transform .2s;
}

.pmab-bio-card:hover {
    border-color: var(--rt-accent, #ed261e);
    transform: translateY(-2px);
}

.pmab-bio-card[hidden] {
    display: none;
}

/* Stretched-link : le seul lien de la carte couvre toute la surface cliquable.
   Élimine le double-lien image+titre qui causait l'erreur aria-hidden. */
.pmab-bio-card__stretched-link {
    text-decoration: none;
    color: inherit;
    transition: color .15s;
    outline-offset: 2px;
}

.pmab-bio-card__stretched-link::after {
    content: '';
    position: absolute;
    inset: 0; /* couvre toute la carte */
    z-index: 1;
}

/* Photo — carré, calé en haut comme .rt-card-img */
.pmab-bio-card__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: top center;
    background-color: var(--rt-surface2, #ebebeb);
    transition: opacity .2s;
}

.pmab-bio-card:hover .pmab-bio-card__img {
    opacity: .88;
}

.pmab-bio-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--rt-muted, rgba(0,0,0,.2));
}

.pmab-bio-card__body {
    padding: 10px 12px 12px;
}

/* Titre — reprend .rt-card-title */
.pmab-bio-card__title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--rt-text, #111);
}


/* Pays — reprend .rt-card-meta */
.pmab-bio-card__country {
    font-size: 12px;
    color: var(--rt-muted, rgba(0,0,0,.5));
    margin: 0;
}

/* ── État vide ──────────────────────────────────────────────── */

.pmab-bio-empty,
.pmab-bio-empty-global {
    text-align: center;
    padding: 48px 20px;
    color: var(--rt-muted, rgba(0,0,0,.5));
    font-size: 15px;
    margin: 0;
}

/* ── Responsive (breakpoints thème : 1024 / 768 / 480) ──────── */

@media (max-width: 1024px) {
    .pmab-bio-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .pmab-bio-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }

    .pmab-alpha-btn {
        padding: 4px 7px;
        min-width: 26px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pmab-bio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .pmab-biographies {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ── Lien automatique artiste ───────────────────────────────── */

a.pmab-artist-link {
    color: var(--rt-accent, #ed261e);
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
    transition: border-color .15s, opacity .15s;
}

a.pmab-artist-link:hover {
    opacity: .8;
    border-bottom-style: solid;
}

/* ── Discographie ───────────────────────────────────────────── */

.pmab-discography {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--rt-border, rgba(0,0,0,.1));
}

.pmab-disco-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.pmab-disco-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--rt-muted, rgba(0,0,0,.4));
}

.pmab-disco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}

.pmab-disco-card {
    background: var(--rt-surface, #fff);
    border: 1px solid var(--rt-border, rgba(0,0,0,.08));
    border-radius: var(--rt-radius-lg, 8px);
    overflow: hidden;
    transition: transform .2s, border-color .2s;
}

.pmab-disco-card:hover {
    transform: translateY(-2px);
    border-color: var(--rt-accent, #ed261e);
}

/* Pochette carrée — background-image CSS, fallback gris si 404 */
.pmab-disco-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--rt-surface2, #ebebeb);
    background-size: cover;
    background-position: center;
}

.pmab-disco-body {
    padding: 8px 10px 10px;
}

.pmab-disco-name {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--rt-text, #111);
    /* Tronquer à 2 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pmab-disco-meta {
    margin: 0;
    font-size: 11px;
    color: var(--rt-muted, rgba(0,0,0,.5));
    display: flex;
    align-items: center;
    gap: 5px;
}

.pmab-disco-type {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    background: var(--rt-surface2, #ebebeb);
    color: var(--rt-text, #333);
}

.pmab-disco-type--album  { background: #e8f4fd; color: #1565c0; }
.pmab-disco-type--single { background: #fce4ec; color: #c62828; }
.pmab-disco-type--ep     { background: #f3e5f5; color: #6a1b9a; }

/* ── Responsive discographie ─────────────────────────────────── */

@media (max-width: 768px) {
    .pmab-disco-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .pmab-disco-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}
