/* ============================================================================
   MEMBER-DETAIL.CSS — Against Stones
   "Le Mur de l'Artiste" — Dark social wall · Kintsugi spirit
   Couvre uniquement .content (header/footer gérés par style.css)
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Montserrat:wght@300;400;500;600;700&display=swap');

/* ============================================================================
   §0 — PAGE SHELL (full-bleed hero)
   style.css .content padding loads after layout.css and overrides
   .content--full horizontal reset — re-apply here (member-detail.css is last).
   ============================================================================ */
body:has(.member-profile) .content.content--full {
    max-width: none;
    width: 100%;
    padding: 0;
}

/* ============================================================================
   §1 — TOKENS
   ============================================================================ */
.member-profile {
    --ink:      #0a0c12;
    --ink-1:    #0f1219;
    --ink-2:    #141820;
    --ink-3:    #1a2030;
    --ink-4:    #1f2638;
    --line:     rgba(255,255,255,0.07);
    --line-g:   rgba(255,215,0,0.18);
    --gold:     #FFD700;
    --gold-2:   #D4AF37;
    --gold-glow: rgba(255,215,0,0.10);
    --t1:       #f0f2f7;
    --t2:       #8b95a8;
    --t3:       #4a5568;
    --ease:     cubic-bezier(.25,.46,.45,.94);
    font-family: 'Montserrat', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--t1);
    background: var(--ink);
    min-height: 100vh;
}

.member-profile *,
.member-profile *::before,
.member-profile *::after { box-sizing: border-box; }


/* ============================================================================
   §2 — HERO / BANNER
   Pattern aligned with compte.css .banner-settings-preview (cover + overflow)
   ============================================================================ */
.profile-hero {
    --profile-avatar-size: 110px;
    --profile-banner-h: clamp(120px, 18vw, 180px);
    position: relative;
    display: block;
    width: 100%;
    padding-top: clamp(16px, 2.5vh, 28px);
    background: var(--ink);
    color: white;
    overflow: visible;
}

/* Bandeau photo plein-largeur */
.profile-banner {
    width: 100%;
    height: var(--profile-banner-h);
    overflow: hidden;
    background: var(--ink-3);
    position: relative;
    isolation: isolate;
}

/* Fond par défaut — toujours présent sous la photo membre */
.default-banner {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        url('/images/profile-banner.png') center / cover no-repeat,
        linear-gradient(135deg, var(--as-surface-3, #222833) 0%, var(--as-surface, #141820) 100%);
}

/* Grain subtil sur le banner par défaut */
.default-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
}

.profile-banner-img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .6s var(--ease);
}

.profile-banner-img.is-hidden {
    display: none;
}

.profile-banner:hover .profile-banner-img:not(.is-hidden) {
    transform: scale(1.03);
}

/* Dégradé bas du banner pour fondre dans le profil */
.profile-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65%;
    background: linear-gradient(to top, var(--ink) 0%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

/* Avatar — chevauche la moitié basse de la bannière (comme preview compte) */
.profile-avatar-wrapper {
    position: relative;
    z-index: 10;
    width: fit-content;
    margin: calc(var(--profile-avatar-size) * -0.5) auto 0;
}

.profile-avatar {
    width: var(--profile-avatar-size);
    height: var(--profile-avatar-size);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ink);
    outline: 2.5px solid var(--gold);
    outline-offset: 3px;
    box-shadow:
        0 0 0 6px var(--ink),
        0 8px 32px rgba(0,0,0,.6),
        0 0 40px rgba(255,215,0,.12);
    transition: outline-color .3s, box-shadow .3s;
    display: block;
}
.profile-avatar-wrapper:hover .profile-avatar {
    outline-color: var(--gold-2);
    box-shadow: 0 0 0 6px var(--ink), 0 8px 32px rgba(0,0,0,.6), 0 0 60px rgba(255,215,0,.22);
}

/* Méta du profil */
.profile-meta {
    padding: 18px 24px 36px;
    text-align: center;
    position: relative;
    z-index: 3;
    background: var(--ink);
    max-width: 720px;
    margin: 0 auto;
}

.profile-meta-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.profile-meta h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    color: var(--t1);
    margin: 0;
    letter-spacing: -.3px;
    line-height: 1.15;
}

.profile-meta .tagline {
    font-size: 11px;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    opacity: .85;
    max-width: 520px;
    line-height: 1.5;
}

.profile-meta .username {
    font-size: 14px;
    color: var(--t3);
    font-weight: 500;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

.profile-meta .location {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--t2);
    margin: 2px 0 0;
}
.profile-meta .location::before {
    content: '📍';
    font-size: 11px;
}

.profile-actions {
    display: flex;
    justify-content: center;
    margin: 20px 0 16px;
}

.profile-actions--contact {
    flex-wrap: wrap;
    gap: 10px;
}

.contact-hint--disabled {
    font-size: 12px;
    color: var(--t3);
    font-style: italic;
    max-width: 280px;
    text-align: center;
}

.btn-message--muted {
    background: var(--ink-4);
    box-shadow: none;
}

.contact-feedback {
    font-size: 13px;
    margin: 8px 0;
}

.contact-feedback--ok { color: #4ade80; }
.contact-feedback--err { color: #f87171; }

/* Bouton envoyer un message */
.btn-message {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 26px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
    color: #0a0a0c;
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .2px;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
    box-shadow: 0 4px 18px rgba(255, 215, 0, .22);
}

.btn-message svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-message:hover {
    background: linear-gradient(135deg, #FFE44D 0%, var(--gold) 100%);
    box-shadow: 0 8px 28px rgba(255, 215, 0, .32);
    transform: translateY(-2px);
}

.btn-message:active {
    transform: translateY(0);
}

/* Barre de partage centrée */
.profile-share {
    display: flex;
    justify-content: center;
    width: 100%;
}

.profile-meta .as-share-bar {
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.profile-meta .as-share-bar .share-buttons {
    justify-content: center;
}


/* ============================================================================
   §3 — LAYOUT PRINCIPAL (largeur max centrée)
   ============================================================================ */
.profile-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Titres de sections */
.profile-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--t1);
    margin: 0 0 16px;
    letter-spacing: .2px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    position: relative;
}

/* Trait doré sous le titre */
.profile-section h2::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 48px; height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 1px;
}

.profile-section h2 .count {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--t3);
}

/* ============================================================================
   §4 — BIO
   ============================================================================ */
.bio-section {
    margin-top: 28px;
    margin-bottom: 28px;
}

.bio-section p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--t2);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    margin: 0 0 20px;
    max-width: 680px;
}

/* Liens sociaux */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: var(--ink-3);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--t2);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: .3px;
    transition: all .2s var(--ease);
}
.social-links a:hover {
    background: var(--gold-glow);
    border-color: var(--line-g);
    color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,215,0,.12);
}


/* ============================================================================
   §5 — STATISTIQUES
   ============================================================================ */
.stats-section {
    margin-bottom: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stat-item {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color .25s, transform .25s, box-shadow .25s;
}

/* Lueur dorée au hover */
.stat-item:hover {
    border-color: var(--line-g);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(255,215,0,.08);
}

/* Gradient discret en fond */
.stat-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,.3), transparent);
    opacity: 0;
    transition: opacity .25s;
}
.stat-item:hover::before { opacity: 1; }

.stat-item strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -.5px;
}

.stat-item span {
    font-size: 11px;
    font-weight: 600;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: .6px;
    display: block;
    line-height: 1.3;
}


/* ============================================================================
   §6 — GRILLE D'ŒUVRES (mur Instagram)
   ============================================================================ */
.artworks-section {
    margin-bottom: 60px;
}

.artworks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    border-radius: 12px;
    overflow: hidden;
}

/* Carte d'œuvre */
.artwork-card {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    text-decoration: none;
    background: var(--ink-3);
    cursor: pointer;
}

.artwork-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s var(--ease), filter .4s;
}

/* Overlay hover */
.artwork-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    opacity: 0;
    transition: opacity .3s var(--ease);
    z-index: 1;
}
.artwork-card:hover::after { opacity: 1; }
.artwork-card:hover img {
    transform: scale(1.06);
    filter: brightness(.85);
}

/* Info titre au hover */
.artwork-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 14px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 100%);
    z-index: 2;
    transform: translateY(4px);
    opacity: 0;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.artwork-card:hover .artwork-info {
    opacity: 1;
    transform: translateY(0);
}

.artwork-info p {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .2px;
}

/* Icône loupe centrée */
.artwork-card::before {
    content: '⟨ ⟩';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.6);
    font-size: 28px;
    color: rgba(255,255,255,.9);
    z-index: 3;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    letter-spacing: -4px;
    pointer-events: none;
}
.artwork-card:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Pagination œuvres — layout in /assets/pagination.css */
.member-artworks-pagination,
.member-section-pagination {
    margin: 24px 0 0;
    padding: 12px 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.member-section-pagination[hidden] {
    display: none !important;
}

.list-page-btn {
    border-color: var(--line);
    color: var(--t2);
}

.list-page-btn:hover:not(:disabled) {
    background: var(--gold-glow);
    border-color: var(--line-g);
    color: var(--gold);
}

.list-page-info {
    color: var(--t2);
}

/* État vide */
.no-content {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--t3);
    font-size: 14px;
    padding: 48px 20px;
    font-style: italic;
    background: var(--ink-2);
    border: 1px dashed var(--line);
    border-radius: 12px;
}

/* Erreur membre introuvable */
.member-profile .error {
    text-align: center;
    padding: 80px 20px;
    color: var(--t3);
    font-size: 16px;
    font-style: italic;
}


/* ============================================================================
   §7 — DIVIDERS ENTRE SECTIONS
   ============================================================================ */
.profile-section + .profile-section {
    padding-top: 0;
}


/* ============================================================================
   §8 — MODALE "ENVOYER UN MESSAGE"
   ============================================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: mo-in .18s ease;
}
@keyframes mo-in { from{opacity:0} to{opacity:1} }

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(145deg, #161b28 0%, #111520 100%);
    border: 1px solid rgba(255,215,0,.18);
    border-radius: 18px;
    padding: 28px 26px 24px;
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 0 0 1px rgba(255,215,0,.05), 0 32px 80px rgba(0,0,0,.88);
    animation: mo-up .2s cubic-bezier(.25,.46,.45,.94);
}
@keyframes mo-up {
    from { opacity:0; transform: translateY(16px); }
    to   { opacity:1; transform: none; }
}

/* Trait doré décoratif */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    border-radius: 0 0 2px 2px;
}

/* Bouton fermer */
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--line);
    color: var(--t2);
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--t1); }

/* Titre */
.modal-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px; font-weight: 700;
    color: var(--t1);
    margin: 0 0 20px;
    padding-right: 32px;
    line-height: 1.3;
}

/* Formulaire */
#message-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#message-form textarea {
    width: 100%;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--line);
    padding: 13px 14px;
    border-radius: 10px;
    color: var(--t1);
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    resize: vertical;
    min-height: 130px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
#message-form textarea:focus {
    border-color: rgba(255,215,0,.3);
    box-shadow: 0 0 0 3px rgba(255,215,0,.06);
}
#message-form textarea::placeholder { color: var(--t3); }

#message-form button[type="submit"] {
    padding: 11px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .4px;
    transition: opacity .2s, transform .2s, box-shadow .2s;
}
#message-form button[type="submit"]:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255,215,0,.3);
}


/* Tablette / iPad paysage — bannière plus basse, dégagée du header */
@media (min-width: 769px) and (max-width: 1200px) {
    .profile-hero {
        --profile-banner-h: clamp(110px, 16vw, 150px);
        padding-top: 20px;
    }
}

@media (max-width: 768px) {
    .profile-hero {
        --profile-banner-h: 130px;
        padding-top: 14px;
    }

    .profile-meta {
        padding: 14px 16px 28px;
    }

    .profile-meta h1 { font-size: 24px; }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-item strong { font-size: 24px; }

    .artworks-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }

    .profile-section { padding: 0 16px; }

    .modal-content { padding: 24px 18px 20px; }
    .modal { align-items: flex-end; padding: 0; }
    .modal-content { border-radius: 18px 18px 0 0; max-width: 100%; }
}

/* ============================================================================
   §10 — RESPONSIVE MOBILE (≤ 480px)
   ============================================================================ */
@media (max-width: 480px) {
    .profile-hero {
        --profile-banner-h: 110px;
        --profile-avatar-size: 92px;
        padding-top: 12px;
    }

    .artworks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .btn-message {
        min-height: 40px;
        padding: 0 20px;
        font-size: 13px;
    }

    .social-links a { font-size: 11px; padding: 5px 12px; }

    .profile-section h2 { font-size: 16px; }
    .bio-section p { font-size: 14px; }
}

/* Network & forum blocks */
.network-section .network-meta-list,
.network-acquisitions,
.forum-threads-list,
.forum-posts-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.network-meta-list li,
.network-acquisitions li,
.forum-threads-list li,
.forum-posts-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.network-ok { color: #166534; font-weight: 600; }
.network-no { color: #b45309; }
.network-in-list { color: var(--gold); font-weight: 600; }
.network-emotion {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.12);
    color: var(--gold);
}

.forum-threads-list a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.forum-thread-meta {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
}

.forum-thread-row,
.forum-post-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.forum-post-thread-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}

.forum-post-excerpt {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--t2);
    line-height: 1.45;
}

.forum-categories-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.65rem;
    margin: 0.75rem 0 0;
}

.forum-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 215, 0, 0.28);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(18, 22, 32, 0.92) 100%);
    color: var(--gold, #d4af37);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.forum-category-pill:hover {
    background: rgba(255, 215, 0, 0.14);
    border-color: rgba(255, 215, 0, 0.5);
    color: #ffe566;
    transform: translateY(-1px);
    text-decoration: none;
}

.forum-category-pill__label {
    white-space: nowrap;
}

.forum-category-pill[style*="--forum-pill-accent"] {
    border-color: color-mix(in srgb, var(--forum-pill-accent) 55%, rgba(255, 255, 255, 0.2));
    color: color-mix(in srgb, var(--forum-pill-accent) 80%, #fff 20%);
}

.forum-moderation-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.forum-moderation-badge--pending {
    color: #92400e;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
}

.forum-moderation-badge--rejected {
    color: #991b1b;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.forum-moderation-badge--deleted {
    color: #475569;
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.3);
}
