/* ==========================================================================
   STYLE DÉDIÉ : ARTISTES PLASTICIENS DU PAYS DE MEAUX
   (Indépendant du site principal pour future migration)
   ========================================================================== */

:root {
    --am-bg: #f4f4f4;          /* Fond général gris très doux */
    --am-card-bg: #ffffff;     /* Fond des cartes */
    --am-text: #333333;        /* Texte principal */
    --am-accent: #000000;      /* Couleur d'accentuation */
    --am-border: #e0e0e0;      /* Bordures */
    
    --font-main: 'Montserrat', sans-serif;
    --font-serif: 'Lora', serif;
}

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

body {
    margin: 0;
    padding: 0;
    background-color: var(--am-bg);
    color: var(--am-text);
    font-family: var(--font-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: color 0.3s; }
img { max-width: 100%; height: auto; display: block; }

/* --- HEADER SPÉCIFIQUE --- */
.am-header {
    background: #fff;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid var(--am-border);
    margin-bottom: 40px;
}

.am-header h1 {
    margin: 0;
    font-size: 2em;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

.am-header p {
    margin-top: 10px;
    font-family: var(--font-serif);
    font-style: italic;
    color: #666;
}

/* --- CONTENEUR PRINCIPAL --- */
.am-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

/* --- GRILLE DES ARTISTES (CARDS) --- */
.am-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr; /* Mobile */
}

/* Tablette */
@media (min-width: 600px) {
    .am-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop */
@media (min-width: 900px) {
    .am-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Grand écran */
@media (min-width: 1200px) {
    .am-grid { grid-template-columns: repeat(4, 1fr); }
}

/* --- LA CARTE ARTISTE --- */
.artist-card {
    background: var(--am-card-bg);
    border: 1px solid var(--am-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.artist-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #ccc;
}

/* Zone Image (Carrée ou Portrait) */
.artist-thumb {
    width: 100%;
    height: 250px; /* Hauteur fixe pour alignement */
    overflow: hidden;
    background-color: #eee;
    position: relative;
}

.artist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit la case sans déformer */
    transition: transform 0.5s;
}

.artist-card:hover .artist-thumb img {
    transform: scale(1.05);
}

/* Zone Texte */
.artist-info {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.artist-name {
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 5px;
    color: var(--am-accent);
}

.artist-tags {
    font-size: 0.85em;
    color: #777;
    font-family: var(--font-serif);
    font-style: italic;
    margin-bottom: 15px;
}

.artist-link {
    display: inline-block;
    margin-top: auto;
    padding: 8px 15px;
    border: 1px solid var(--am-border);
    border-radius: 20px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.artist-link:hover {
    background: var(--am-accent);
    color: #fff;
    border-color: var(--am-accent);
}

/* --- FOOTER SPÉCIFIQUE --- */
.am-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--am-border);
    font-size: 0.85em;
    color: #888;
    background: #fff;
    margin-top: 40px;
}




/* ... (Garder tout le code précédent pour les cartes) ... */

/* ==========================================================================
   PAGE LISTE DÉTAILLÉE (liste.php)
   ========================================================================== */

.am-list-container {
    max-width: 900px; /* Plus étroit pour une lecture confortable */
    margin: 0 auto;
    padding: 40px 20px;
}

/* Le bloc complet d'un artiste */
.artist-detail-block {
    clear: both; /* Assure qu'on repart à la ligne */
    margin-bottom: 80px;
    padding-bottom: 60px;
    border-bottom: 1px solid var(--am-border);
}

.artist-detail-block:last-child {
    border-bottom: none;
}

/* L'image (Portrait) */
.artist-portrait {
    float: left; /* Permet au texte d'habiller l'image */
    width: 300px; /* Largeur fixe sur bureau */
    margin-right: 40px;
    margin-bottom: 20px;
}

.artist-portrait img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Le Texte */
.artist-content h2 {
    margin-top: 0;
    font-size: 1.8em;
    text-transform: uppercase;
    color: var(--am-accent);
    line-height: 1.2;
}

.artist-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
    display: block;
}

.artist-bio {
    text-align: justify;
}

.artist-links {
    margin-top: 20px;
    font-weight: 700;
}

.artist-links a {
    text-decoration: underline;
    color: var(--am-accent);
}

/* RESPONSIVE : Mobile */
@media (max-width: 800px) {
    .artist-portrait {
        float: none; /* On annule le flottement */
        width: 100%; /* Pleine largeur */
        margin-right: 0;
        margin-bottom: 30px;
    }
    
    .artist-portrait img {
        max-width: 400px; /* On limite quand même la taille */
        margin: 0 auto; /* Centré */
    }
    
    .artist-content h2 {
        text-align: center;
    }
    .artist-subtitle {
        text-align: center;
    }
}


/* ==========================================================================
   DISTINCTION COLLECTIFS / ASSOCIATIONS
   ========================================================================== */

/* --- SUR LES CARTES (GRILLE) --- */
.artist-card.type-collective {
    background-color: #f8f8f8; /* Fond légèrement grisé */
    border-top: 4px solid var(--am-accent); /* Bordure haute épaisse (style dossier) */
}

.artist-card.type-collective .artist-name::before {
    content: "♦ "; /* Petit symbole distinctif */
    font-size: 0.8em;
    vertical-align: middle;
}

/* --- SUR LA LISTE DÉTAILLÉE --- */
.artist-detail-block.type-collective {
    background-color: #f8f8f8; /* Fond grisé pour le bloc entier */
    padding: 40px; /* Marges internes pour créer une "boîte" */
    border-radius: 8px;
    border: 1px solid #ddd;
    margin-bottom: 80px;
}

/* Ajustement responsive pour le bloc collectif */
@media (max-width: 800px) {
    .artist-detail-block.type-collective {
        padding: 20px;
    }
}


/* ==========================================================================
   NAVIGATION ALPHABÉTIQUE (STICKY)
   ========================================================================== */

/* Comportement de défilement fluide pour toute la page */
html {
    scroll-behavior: smooth;
}

/* La barre de navigation */
.alphabet-nav {
    position: -webkit-sticky; /* Pour Safari */
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--am-border);
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    
    /* Pour le mobile : défilement horizontal si ça dépasse */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.alphabet-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    min-width: 100%; /* Assure que ça prend toute la largeur */
}

.alphabet-nav li {
    display: inline-block;
    margin: 0 2px;
}

.alphabet-nav a {
    display: block;
    padding: 8px 12px;
    font-weight: 700;
    color: #aaa;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Lettres actives (qui ont des artistes) */
.alphabet-nav a.active {
    color: var(--am-accent);
    background-color: #f0f0f0;
}

.alphabet-nav a.active:hover {
    background-color: var(--am-accent);
    color: #fff;
}

/* Ajustement pour l'ancre (pour ne pas être caché par le menu sticky) */
.artist-detail-block {
    scroll-margin-top: 80px; /* Marge de sécurité au scroll */
}


/* ==========================================================================
   VUE ALTERNATIVE (LISTE COMPACTE) & SWITCH
   ========================================================================== */

/* Le conteneur du bouton Switch */
.view-switcher {
    text-align: right;
    margin-bottom: 20px;
    padding-right: 20px;
}

.btn-switch {
    background: none;
    border: 1px solid var(--am-border);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85em;
    color: #666;
    transition: all 0.3s;
}

.btn-switch:hover, .btn-switch.active {
    background-color: var(--am-accent);
    color: #fff;
    border-color: var(--am-accent);
}

/* La Vue Liste Compacte (Cachée par défaut) */
.am-list-view {
    display: none; /* Caché au départ */
    flex-direction: column;
    gap: 10px;
}

.am-list-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 15px;
    border: 1px solid var(--am-border);
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s;
}

.am-list-item:hover {
    background-color: #f9f9f9;
    border-color: #ccc;
}

.am-list-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.am-list-name {
    font-weight: 700;
    color: var(--am-text);
    flex-grow: 1;
}

.am-list-tags {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

/* Classe utilitaire pour masquer la grille quand la liste est active */
.hidden {
    display: none !important;
}

/* Classe utilitaire pour afficher la liste quand elle est active */
.visible {
    display: flex !important;
}


/* ==========================================================================
   GALERIE D'ŒUVRES (HYBRIDE : SCROLL MOBILE / LIGNE FIXE DESKTOP)
   ========================================================================== */

.artist-gallery-ribbon {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    margin-bottom: 10px;
}

/* Style commun des liens/images */
.artist-gallery-ribbon a {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.artist-gallery-ribbon a:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 2; /* Passe au-dessus des autres au survol */
}

.artist-gallery-ribbon img {
    display: block;
    height: 100%;
}

/* --- COMPORTEMENT MOBILE & TABLETTE (< 1000px) --- */
/* Mode "Scroll" : On ne rogne pas, on fait défiler */
@media (max-width: 999px) {
    .artist-gallery-ribbon {
        overflow-x: auto;      /* Scroll horizontal */
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        
        /* Cache la barre de défilement */
        scrollbar-width: none; 
        -ms-overflow-style: none;
        padding-right: 20px;
    }
    
    .artist-gallery-ribbon::-webkit-scrollbar { display: none; }

    .artist-gallery-ribbon a {
        flex: 0 0 auto; /* Ne s'écrase pas */
        height: 180px;  /* Hauteur fixe mobile */
        width: auto;    /* Largeur naturelle (PAS DE ROGNAGE) */
    }
    
    .artist-gallery-ribbon img {
        width: auto;
        height: 100%;
        object-fit: contain; /* Sécurité */
    }
}

/* --- COMPORTEMENT DESKTOP (>= 1000px) --- */
/* Mode "Ligne Statique" : On remplit la ligne, on rogne si besoin */
@media (min-width: 1000px) {
    .artist-gallery-ribbon {
        overflow: hidden; /* Pas de scroll */
        flex-wrap: nowrap;
        height: 250px; /* Hauteur fixe desktop */
    }

    .artist-gallery-ribbon a {
        flex: 1; /* Partage équitable de la largeur */
        min-width: 0;
        height: 100%;
    }

    .artist-gallery-ribbon img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Remplit la case (ROGNAGE AUTOMATIQUE) */
        object-position: center;
    }
}


/* ==========================================================================
   NAVIGATION PRINCIPALE & PAGE QUESTIONS
   ========================================================================== */

/* --- LE MENU (Ajouté dans le header) --- */
.am-nav {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.am-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.am-nav li {
    display: inline-block;
    margin: 0 15px;
}

.am-nav a {
    font-family: var(--font-main);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 700;
    padding-bottom: 2px;
}

.am-nav a:hover,
.am-nav a.current {
    color: var(--am-accent);
    border-bottom: 2px solid var(--am-accent);
}

/* --- STYLE DES QUESTIONS / RÉPONSES --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.faq-block {
    margin-bottom: 50px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.faq-block:last-child {
    border-bottom: none;
}

.faq-question {
    font-family: var(--font-main);
    font-size: 1.3em;
    font-weight: 700;
    color: var(--am-accent);
    margin-bottom: 20px;
    position: relative;
    padding-left: 25px;
}

/* Petite puce décorative devant la question */
.faq-question::before {
    content: "Q.";
    position: absolute;
    left: 0;
    color: #ccc;
    font-size: 0.8em;
    top: 3px;
}

.faq-answer {
    font-family: var(--font-serif);
    font-size: 1.05em;
    color: var(--am-text);
    line-height: 1.8;
    text-align: justify;
}

.faq-answer ul {
    margin-top: 15px;
    padding-left: 20px;
}

.faq-answer li {
    margin-bottom: 10px;
}



/* ==========================================================================
   PAGE CONTACT & FORMULAIRE
   ========================================================================== */

.am-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid var(--am-border);
    border-radius: 8px;
}

.am-input-group {
    margin-bottom: 20px;
}

.am-input-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--am-accent);
    font-size: 0.9em;
    text-transform: uppercase;
}

.am-input-group input[type="text"],
.am-input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: var(--font-serif);
    font-size: 1em;
    background-color: #fcfcfc;
}

.am-input-group textarea {
    height: 150px;
    resize: vertical;
}

.am-btn-submit {
    background-color: var(--am-accent);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-family: var(--font-main);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 4px;
    display: block;
    width: 100%;
}

.am-btn-submit:hover {
    background-color: #333;
}

/* Messages d'erreur et succès */
.am-msg-error {
    color: #d9534f;
    background-color: #fdf7f7;
    border: 1px solid #d9534f;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.am-msg-success {
    color: #28a745;
    background-color: #f4fcf6;
    border: 1px solid #28a745;
    padding: 20px;
    text-align: center;
    border-radius: 4px;
}