/* Sourdosphère — profil (fiche, galerie, édition) */

.pf { display: flex; flex-direction: column; gap: 1rem; }
.pf-card { background: #fff; border: 1px solid var(--card-border, #E6E4DC); border-radius: 14px; }

/* En-tête */
.pf-head { display: flex; gap: 1.5rem; padding: 1.5rem; align-items: flex-start; }
.pf-head__avatar { flex-shrink: 0; }
.pf-head__avatar img {
    width: 136px; height: 136px; border-radius: 50%; object-fit: cover; display: block;
    border: 4px solid var(--green-light); box-shadow: 0 0 0 2px var(--green-mid);
    background: var(--gray-light);
}
.pf-head__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.pf-head__top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.pf-head__name { margin: 0; font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.025em; color: var(--green-dark); overflow-wrap: anywhere; }
.pf-head__meta { margin: 0.3rem 0 0; color: var(--gray-text); font-size: 0.95rem; }
.pf-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pf-head__badges { margin: 0; }
.pf-head__bio { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--black); max-width: 60ch; }

.pf-comm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pf-comm__label { font-size: 0.9rem; font-weight: 600; color: var(--gray-text); margin-right: 2px; }
.pf-chip {
    display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
    font-size: 0.85rem; font-weight: 600; background: var(--green-light); color: #0a6b4e;
}
.pf-chip--lsf { background: var(--green-mid); color: #072016; }
.pf-chip--soustitres { background: var(--purple-light); color: var(--purple-text); }
.pf-chip--oral { background: var(--amber-light); color: var(--amber-text); }
.pf-chip--ecrit { background: var(--blue-light); color: var(--blue-text); }

.pf-stats { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; padding-top: 0.85rem; border-top: 1px solid var(--card-border, #E6E4DC); font-size: 0.92rem; color: var(--gray-text); }
.pf-stats b { font-size: 1.1rem; font-weight: 600; color: var(--green-dark); margin-right: 3px; }

/* Onglets */
.pf-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--gray-border); }
.pf-tab {
    padding: 0.5rem 0 0.7rem; font-size: 1.05rem; font-weight: 600; color: var(--gray-text);
    border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none;
}
.pf-tab:hover { color: var(--green-dark); text-decoration: none; }
.pf-tab--active { color: var(--green-dark); border-bottom-color: var(--green-mid); }
.pf-tab__count { font-size: 0.8rem; background: var(--gray-light); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.pf .profile__posts-title { display: none; }
.pf .profile__posts { margin-top: 0; }

/* Galerie */
.pf-gallery { display: flex; flex-direction: column; gap: 1rem; }
.pf-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 1rem 1.1rem; }
.pf-upload__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.pf-upload__text span { font-size: 0.85rem; color: var(--gray-text); }
.pf-upload input[type=file] { flex: 1 1 220px; min-width: 0; font-size: 0.9rem; }
.pf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pf-grid__item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #0f2a20; }
.pf-grid__btn { display: block; width: 100%; height: 100%; padding: 0; border: none; background: none; cursor: pointer; position: relative; }
.pf-grid__btn img, .pf-grid__btn video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-grid__btn:hover img, .pf-grid__btn:hover video { opacity: .92; }
.pf-grid__play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,42,32,0.25); }
.pf-grid__del { position: absolute; top: 6px; right: 6px; margin: 0; }
.pf-grid__del button {
    width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,0.92); color: var(--green-dark); display: flex; align-items: center; justify-content: center;
}
.pf-grid__del button:hover { background: #fff; color: var(--danger); }
.pf-lightbox { position: fixed; inset: 0; z-index: 600; background: rgba(10,26,20,0.92); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.pf-lightbox[hidden] { display: none; }
.pf-lightbox__stage { max-width: 100%; max-height: 100%; display: flex; }
.pf-lightbox__stage img, .pf-lightbox__stage video { max-width: min(96vw, 1100px); max-height: 90vh; border-radius: 12px; background: #000; }
.pf-lightbox__close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border: none; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.pf-lightbox__close:hover { background: rgba(255,255,255,0.28); }

/* Édition */
.profile-edit__avatar-preview { width: 112px !important; height: 112px !important; border-radius: 50%; object-fit: cover; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.5rem; }
.pf-chipbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-chipbox span {
    display: inline-flex; align-items: center; padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
    border: 1.5px solid var(--green-dark); color: var(--green-dark); font-weight: 600; font-size: 0.92rem; background: #fff;
}
.pf-chipbox input:checked + span { background: var(--green-dark); color: #F7F6F2; }
.pf-chipbox input:focus-visible + span { outline: 3px solid var(--green-mid); outline-offset: 2px; }

@media (max-width: 700px) {
    .pf-head { flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 1rem; }
    .pf-head__top { justify-content: center; }
    .pf-head__actions, .pf-comm, .pf-stats { justify-content: center; }
    .pf-head__bio { margin: 0 auto; }
    .pf-head__avatar img { width: 120px; height: 120px; }
    .pf-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
}
