/* ═══════════════════════════════════════════════════════════════════════════
   Vitrines de la section RolePlay : concessionnaire, immobilier, journalisme.

   Les trois pages montrent la même chose sous des noms différents : ce qu'une
   entreprise met en ligne depuis sa gestion. Un seul habillage, donc, plutôt
   que trois feuilles qui divergeraient au premier ajustement.
   ═══════════════════════════════════════════════════════════════════════════ */

.vt-barre {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.vt-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
}

.vt-search:focus-within { border-color: var(--primary-color); }
.vt-search .material-symbols-outlined { color: var(--text-secondary); font-size: 1.15rem; }

.vt-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.vt-filtres { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.vt-filtre {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.vt-filtre:hover { color: var(--text-primary); border-color: var(--primary-color); }
.vt-filtre.active { background: var(--gradient-primary); border-color: transparent; color: #fff; }

/* Grille d'annonces. Les cartes gardent une largeur lisible : étirées sur un
   grand écran, une photo de véhicule devient un panneau publicitaire. */
.vt-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.vt-carte {
    display: flex;
    flex-direction: column;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.vt-carte:hover { transform: translateY(-3px); border-color: var(--primary-color); }

.vt-photo {
    height: 168px;
    background-size: cover;
    background-position: center;
    background-color: var(--background-card);
    position: relative;
}

.vt-photo-vide { display: grid; place-items: center; color: var(--text-secondary); }
.vt-photo-vide .material-symbols-outlined { font-size: 2.6rem; opacity: 0.45; }

.vt-etiquette {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.24rem 0.5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.vt-corps { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.vt-titre { font-size: 1rem; font-weight: 800; line-height: 1.35; }
.vt-prix { font-size: 1.05rem; font-weight: 900; color: var(--primary-color); }

.vt-desc {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vt-pied {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid var(--border-color);
}

.vt-logo {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    object-fit: cover;
    flex: none;
    background: var(--background-card);
    border: 1px solid var(--border-color);
}

.vt-logo-vide { display: grid; place-items: center; color: var(--text-secondary); }
.vt-logo-vide .material-symbols-outlined { font-size: 0.9rem; }

.vt-vendeur {
    flex: 1;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vt-date { font-size: 0.72rem; color: var(--text-secondary); opacity: 0.75; white-space: nowrap; }

/* État vide : il explique d'où viendra le contenu. Un simple « rien ici »
   laisse croire que la page est cassée. */
.vt-vide { text-align: center; padding: 3.5rem 1rem; color: var(--text-secondary); }
.vt-vide .material-symbols-outlined { font-size: 2.8rem; opacity: 0.5; display: block; margin-bottom: 0.7rem; }
.vt-vide h3 { font-size: 1.05rem; font-weight: 800; color: var(--text-primary); margin-bottom: 0.5rem; }
.vt-vide p { line-height: 1.65; max-width: 48ch; margin: 0 auto; }

.vt-sk {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%,
                rgba(255, 255, 255, 0.10) 37%, rgba(255, 255, 255, 0.04) 63%);
    background-size: 400% 100%;
    animation: vtShim 1.4s ease infinite;
}

@keyframes vtShim { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── Publication ──────────────────────────────────────────────────────────
   Le bouton n'est posé par le script que si le serveur reconnaît à
   l'utilisateur une entreprise du bon métier. */
.vt-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 0.62rem 1.05rem;
    border: none;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    white-space: nowrap;
    text-decoration: none;
}

.vt-btn:disabled { opacity: 0.55; cursor: default; }

.vt-btn.secondaire {
    background: var(--background-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.vt-btn .material-symbols-outlined { font-size: 1.1rem; }

/* Le bouton est collé à droite de la barre, loin de la recherche. */
#vtPublier { margin-left: auto; }

.vt-voile {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    place-items: center;
    padding: 1.2rem;
    background: rgba(6, 6, 16, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    overflow-y: auto;
}

.vt-voile.actif { display: grid; }

.vt-modale {
    width: min(560px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.6rem;
}

.vt-modale h3 { font-size: 1.15rem; font-weight: 900; margin-bottom: 1rem; }

.vt-form-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.vt-form { display: flex; flex-direction: column; gap: 0.85rem; }

.vt-champ { display: flex; flex-direction: column; gap: 0.3rem; }

.vt-champ label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.vt-champ small { font-size: 0.72rem; color: var(--text-secondary); opacity: 0.8; }

.vt-champ input,
.vt-champ select,
.vt-champ textarea {
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 100%;
}

.vt-champ textarea { resize: vertical; line-height: 1.55; }

.vt-champ input:focus,
.vt-champ select:focus,
.vt-champ textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.vt-form-err { font-size: 0.82rem; color: var(--danger); font-weight: 600; }

.vt-form-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.vt-form-actions .vt-btn { flex: 1; justify-content: center; }

/* ── Aperçu (journalisme uniquement) : rendu approximatif de l'article ── */
.vt-apercu {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.9rem;
}

.vt-apercu-tete {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-secondary); margin-bottom: 0.6rem;
}
.vt-apercu-tete .material-symbols-outlined { font-size: 1rem; }

.vt-apercu-vide {
    font-size: 0.82rem; color: var(--text-secondary); font-style: italic;
}

.vt-apercu-carte {
    background: var(--background-card); border: 1px solid var(--border-color);
    border-radius: 14px; padding: 1rem;
}

.vt-apercu-carte h4 { font-size: 1rem; font-weight: 800; line-height: 1.3; }

.vt-apercu-meta {
    display: flex; gap: 0.6rem; font-size: 0.74rem; color: var(--text-secondary);
    margin-top: 0.25rem;
}

.vt-apercu-images {
    display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto;
}
.vt-apercu-images img {
    width: 88px; height: 66px; border-radius: 10px; object-fit: cover; flex: none;
}

.vt-apercu-corps {
    font-size: 0.85rem; color: var(--text-primary); line-height: 1.6;
    margin-top: 0.75rem; white-space: pre-wrap;
}


/* ── Vue de lecture ───────────────────────────────────────────────────────
   Plein écran, et non une boîte centrée : un article de presse avec ses
   photos ne tient pas dans 560 px, les visuels y devenaient des vignettes. */
.vt-carte[role="button"] { cursor: pointer; }

.vt-lecture {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    flex-direction: column;
    background: var(--background-primary, #0a0a18);
}

.vt-lecture.actif { display: flex; }

.vt-lecture-barre {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
    border-bottom: 1px solid var(--border-color);
    background: var(--background-secondary);
    flex: none;
}

.vt-lecture-fermer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.vt-lecture-fermer:hover { border-color: var(--primary-color); }
.vt-lecture-actions { margin-left: auto; display: flex; gap: 0.5rem; }
.vt-btn.danger { background: var(--danger); }

.vt-lecture-corps {
    flex: 1;
    overflow-y: auto;
    padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 4rem;
}

/* Largeur de lecture confortable : au-delà, l'œil perd la ligne. */
.vt-article { max-width: 74ch; margin: 0 auto; }

.vt-article-tete { margin-bottom: 1.6rem; }

.vt-article-tete h1 {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.vt-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.vt-article-source { color: var(--primary-color); font-weight: 800; }

.vt-article-corps {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
    white-space: pre-wrap;
    margin-bottom: 2rem;
}

/* Les visuels débordent la colonne de texte, et largement : c'est ce qu'on
   vient voir, la lecture doit avoir de la place. Trois dispositions, choisies
   à la publication (rp-vitrine.js, FORMULAIRES.article). */
.vt-article-images {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: min(100%, 1500px);
    margin-inline: calc(50% - min(50%, 750px));
}

.vt-article-images figure { margin: 0; }

.vt-article-images img {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    display: block;
    border-radius: 16px;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    cursor: zoom-in;
}

/* Carrousel : une image à la fois, flèches + compteur pour naviguer — le
   simple défilement à la souris ne suffit pas, rien n'indiquait qu'il restait
   des images hors champ. */
.vt-carrousel {
    position: relative;
    width: min(100%, 1500px);
    margin-inline: calc(50% - min(50%, 750px));
}

.vt-carrousel-track {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
}
.vt-carrousel-track::-webkit-scrollbar { display: none; }

.vt-carrousel-track figure {
    flex: none;
    margin: 0;
    width: min(88%, 900px);
    scroll-snap-align: center;
}

.vt-carrousel-track img {
    width: 100%;
    height: 62vh;
    max-height: 62vh;
    object-fit: cover;
    display: block;
    border-radius: 16px;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    cursor: zoom-in;
}

.vt-carrousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--background-secondary) 78%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    z-index: 2;
}
.vt-carrousel-nav .material-symbols-outlined { font-size: 1.6rem; }
.vt-carrousel-nav:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.06);
}
.vt-carrousel-nav:disabled { opacity: 0.35; cursor: default; }
.vt-carrousel-nav.prev { left: 0.6rem; }
.vt-carrousel-nav.next { right: 0.6rem; }

.vt-carrousel-compte {
    position: absolute;
    bottom: 1.1rem;
    right: 1rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    background: color-mix(in srgb, var(--background-secondary) 82%, transparent);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 2;
}

@media (max-width: 640px) {
    .vt-carrousel-nav { width: 38px; height: 38px; }
    .vt-carrousel-track img { height: 46vh; max-height: 46vh; }
}

/* Mosaïque : une grille dense, la première image plus grande. */
.vt-article-images--mosaique {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.vt-article-images--mosaique figure:first-child { grid-column: span 2; grid-row: span 2; }
.vt-article-images--mosaique img { height: 100%; max-height: none; aspect-ratio: 1; object-fit: cover; }
.vt-article-images--mosaique figure:first-child img { aspect-ratio: 1; }

@media (max-width: 640px) {
    .vt-article-images--mosaique { grid-template-columns: repeat(2, 1fr); }
    .vt-article-images--mosaique figure:first-child { grid-column: span 2; grid-row: span 1; }
}

/* ── Zoom plein écran ──────────────────────────────────────────────────────
   FLIP : l'image part de sa vignette (rect posé en JS) et grandit vers le
   centre, puis revient exactement à sa place à la fermeture — jamais un
   simple fondu, l'oeil doit pouvoir suivre d'où elle vient. */
.vt-zoom {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(4, 4, 12, 0);
    cursor: zoom-out;
    transition: background 0.32s ease;
}

.vt-zoom.actif { background: rgba(4, 4, 12, 0.94); }

.vt-zoom-img {
    position: fixed;
    display: block;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    transition: left 0.32s cubic-bezier(0.22, 0.9, 0.32, 1),
                top 0.32s cubic-bezier(0.22, 0.9, 0.32, 1),
                width 0.32s cubic-bezier(0.22, 0.9, 0.32, 1),
                height 0.32s cubic-bezier(0.22, 0.9, 0.32, 1),
                border-radius 0.32s ease;
}

.vt-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.6rem;
}

.vt-details > div {
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
}

.vt-details dt {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.vt-details dd { font-size: 0.92rem; font-weight: 700; margin: 0.15rem 0 0; }
.vt-detail-prix { color: var(--primary-color); font-weight: 800; }

/* ── Glisser-déposer ── */
.vt-depot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
    cursor: pointer;
    padding: 1.4rem 1rem;
    border-radius: 14px;
    border: 2px dashed var(--border-color);
    background: var(--background-card);
    color: var(--text-secondary);
}

.vt-depot:hover, .vt-depot:focus-visible, .vt-depot.survol {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.07);
    outline: none;
}

.vt-depot .material-symbols-outlined { font-size: 1.9rem; color: var(--primary-color); }
.vt-depot strong { font-size: 0.88rem; color: var(--text-primary); }
.vt-depot small { font-size: 0.74rem; }

.vt-depot-liste { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.vt-depot-liste:empty { display: none; }

.vt-depot-vignette {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--background-card);
    display: grid;
    place-items: center;
}

.vt-depot-vignette img { width: 100%; height: 100%; object-fit: cover; }

.vt-depot-vignette button {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.68);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
}

.vt-depot-couv {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    font-size: 0.6rem;
    font-weight: 800;
    text-align: center;
    padding: 0.15rem 0;
    background: var(--primary-color);
    color: #fff;
}

.vt-depot-spin {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    animation: vtSpin 0.7s linear infinite;
}

@keyframes vtSpin { to { transform: rotate(360deg); } }
