
/* --- 3. ZONE D'ÉDITION --- */
#post-textarea {
    width: 100%;
    min-height: 28px;
    padding: 12px 0;
    font-size: 19px;
    line-height: 1.4;
    font-family: inherit;
    border: none;
    outline: none;
    resize: none;
    overflow: hidden; /* Empêche le scroll interne pendant l'agrandissement */
    background: transparent;
    display: block;
}

#post-textarea::placeholder {
    color: #536471;
    opacity: 1;
}

/* --- 4. GESTION DES MÉDIAS (Vignette & Upload) --- */
.media-container {
    padding: 15px 0;
    margin-top: 30px;
    width: 100%;
}

.post-media-grid {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.post-media-grid:empty {
    display: none;
}

/* Configuration des grilles */
.post-media-grid.count-1 { 
    grid-template-columns: 1fr;
    aspect-ratio: auto;
}

.post-media-grid.count-2 { 
    grid-template-columns: 1fr 1fr;
}

.post-media-grid.count-3 { 
    grid-template-columns: 1fr 1fr; 
    grid-template-rows: 1fr 1fr;
}

.post-media-grid.count-4 { 
    grid-template-columns: 1fr 1fr; 
    grid-template-rows: 1fr 1fr;
}

/* Cas particulier : 3 images, la 1ère prend toute la hauteur à gauche */
.post-media-grid.count-3 .img-wrapper:first-child { 
    grid-row: span 2;
}

.post-media-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #eee;
}

/* Bouton de suppression sur chaque image */
.img-wrapper { 
    position: relative; 
    width: 100%; 
    height: 100%;
    overflow: hidden;
}

.remove-img, .edit-img {
    position: absolute;
    top: 8px;
    background: rgba(15, 20, 25, 0.75);
    color: white;
    border: none;
    border-radius: 50%;
    height: 30px; 
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-img:hover, .edit-img:hover {
    background: rgba(39, 44, 48, 0.75);
}

/* Le bouton EDIT (Format Pilule) */
.edit-img {
    left: 8px;
    padding: 0 12px; /* Espace sur les côtés pour le texte */
    border-radius: 9999px; /* Forme pilule */
}

.edit-img .btn-text {
    font-size: 12px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Le bouton REMOVE (Cercle parfait) */
.remove-img {
    right: 8px;
    width: 30px; /* Largeur = Hauteur */
    border-radius: 50%;
    font-size: 14px;
}
