/* ==========================================================
   TDH Visite Block — couleurs via contrôles natifs WordPress
   Les icônes SVG utilisent currentColor → suivent la couleur de texte
   ========================================================== */

.tdh-visite {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: fit-content;
    width: 100%;
    max-width: 903px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    font-family: var(--wp--preset--font-family--mulish, 'Mulish', sans-serif);

    /* Couleur par défaut (bleu TDH) — l'utilisateur peut l'overrider
       via le contrôle "Couleur du texte" dans la barre latérale */
    color: var(--wp--preset--color--tdh-blue, #2e5563);

    /* Bordure : style fixé en CSS, couleur et épaisseur gérées par WordPress
       (border.color et border.width dans supports) */
    border-style: solid;
    border-width: 1px;        /* épaisseur par défaut, modifiable via la sidebar */
    border-color: currentColor; /* suit la couleur du texte par défaut */
}

/* Quand aligné, retirer les marges auto */
.tdh-visite.alignwide,
.tdh-visite.alignfull,
.tdh-visite.alignleft,
.tdh-visite.alignright {
    max-width: none;
    margin-left: unset;
    margin-right: unset;
}

/* ---- En-tête ---- */
.tdh-visite__header {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    padding: 15px 25px;
    color: inherit;
}

/* ---- Bouton flèche (ouvrir) ---- */
.tdh-visite__toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.tdh-visite__toggle:hover { opacity: 0.8; }

/* ---- Titre (h3) ---- */
.tdh-visite__title {
    font-family: var(--wp--preset--font-family--mulish, 'Mulish', sans-serif);
    font-weight: 900;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
    margin: 0;
    color: inherit;
}

/* ---- Icônes SVG (inline, currentColor) ---- */
.tdh-visite__arrow {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Cacher la flèche du titre quand le bloc est ouvert */
.tdh-visite__toggle[aria-expanded="true"] .tdh-visite__arrow {
    display: none;
}

.tdh-visite__arrow--up {
    transform: rotate(180deg);
}

/* ---- Bouton fermer (flèche du bas) ---- */
.tdh-visite__close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    transition: opacity 0.2s;
}

.tdh-visite__close:hover { opacity: 0.8; }

/* ---- Corps (contenu InnerBlocks) ---- */
.tdh-visite__body {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    color: inherit;
}
.tdh-visite__body ul {
    box-sizing: border-box;
    margin-left: 20px;
    font-size: 15px;
}

.tdh-visite__body[hidden]       { display: none; }
.tdh-visite__body--visible      { display: flex !important; }

/* Les blocs enfants héritent la couleur du wrapper */
.tdh-visite__body > *           { color: inherit; }

/* ---- Zones éditeur ---- */

/* Conteneur de zone avec étiquette flottante */
.tdh-visite__editor-zone {
    position: relative;
    width: 100%;
}

/* Étiquette "TITRE" / "CONTENU" — visible uniquement dans l'éditeur */
.tdh-visite__editor-label {
    display: block;
    padding: 2px 6px;
    background: #1e1e1e;
    color: #fff;
    font-size: 9px;
    font-family: sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.6;
    user-select: none;
    pointer-events: none;
}

/* Séparateur visuel entre les deux zones */
.tdh-visite__editor-zone + .tdh-visite__editor-zone {
    border-top: 1px dashed currentColor;
    opacity: 0.9;
}
