/* =============================================
   CARTE DES SECTEURS — accueil (includes/secteurs.php, assets/js/carte-secteurs.js)

   Le shell du chat (plugin carnetcatalan-ai, chat.css) retourné : la carte dans le canevas à GAUCHE (2/3),
   le fil à DROITE (1/3), avec la fiche du secteur en tête. Encre, filets 1 px, angles droits, comme le chat.
   ============================================= */

.cc-secteurs-section { background: var(--color-ink, #14201C); scroll-margin-top: 91px; }
.admin-bar .cc-secteurs-section { scroll-margin-top: 123px; }
.cc-secteurs-section .cc-secteurs-entete { padding: 3.25rem 0 1.75rem; text-align: center; }
.cc-secteurs-section .cc-zones-lead { margin-bottom: 0; }

.cc-secteurs-shell { border-top: 1px solid rgba(249, 248, 246, 0.12); }
.cc-secteurs-shell #cc-canvas-scroll { padding: 0; }
.cc-secteurs-shell #cc-canvas-empty { max-width: none; height: 100%; }
.cc-secteurs-shell #cc-canvas-head-right { font-family: var(--font-mono, 'IBM Plex Mono', monospace); }

@media (min-width: 1000px) {
    .cc-secteurs-shell #cc-chat-shell { grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr); }
    .cc-secteurs-shell #cc-chat-rail {
        order: 2;
        border-right: none;
        border-left: 1px solid rgba(249, 248, 246, 0.1);
    }
    .cc-secteurs-shell #cc-chat-canvas { order: 1; }
    /* Historique ouvert : la colonne se glisse entre la carte et la conversation (à gauche du fil, comme ailleurs). */
    .cc-secteurs-shell #cc-chat-shell.cc-historique-ouvert { grid-template-columns: minmax(0, 2fr) 260px minmax(360px, 1fr); }
    .cc-secteurs-shell .cc-historique-ouvert #cc-chat-canvas { grid-column: 1; }
    .cc-secteurs-shell .cc-historique-ouvert #cc-chat-history-panel { grid-column: 2; border-left: 1px solid rgba(249, 248, 246, 0.1); }
    .cc-secteurs-shell .cc-historique-ouvert #cc-chat-rail { grid-column: 3; }
}

/* ── La carte ── */

.cc-secteurs {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.cc-secteurs-map { flex: 1 1 auto; min-height: 300px; background: #E8E4DA; }

.cc-secteurs-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid var(--color-border, #E3DCC8);
    background: var(--color-paper, #F9F8F6);
}
.cc-secteurs-lien {
    padding: 5px 10px;
    border: 1px solid var(--color-border, #E3DCC8);
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 11.5px;
    color: var(--color-ink, #14201C);
    text-decoration: none;
    background: #fff;
    transition: border-color 0.15s, background-color 0.15s;
}
.cc-secteurs-lien::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    vertical-align: 0;
    background: var(--cc-sect, #8A6D5A);
}
.cc-secteurs-lien--littoral { --cc-sect: #2A8FB8; }
.cc-secteurs-lien--plaine { --cc-sect: #C89445; }
.cc-secteurs-lien--montagne { --cc-sect: #3F8F5A; }
.cc-secteurs-lien:hover { border-color: var(--color-secondary, #C89445); }
.cc-secteurs-lien.is-actif { background: var(--color-ink, #14201C); border-color: var(--color-ink, #14201C); color: #F9F8F6; }
.cc-secteurs-lien:focus-visible { outline: 2px solid var(--color-teal, #4FA8C9); outline-offset: 2px; }

.leaflet-tooltip.cc-secteurs-etiquette {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #14201C;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff;
    white-space: nowrap;
    pointer-events: none;
}
.leaflet-tooltip.cc-secteurs-etiquette::before { display: none; }
.leaflet-tooltip.cc-secteurs-point {
    font-family: var(--font-textes, 'Inter', sans-serif);
    font-size: 12px;
    border-radius: 0;
}

/* ── La fiche du secteur (en tête du fil sombre au bureau, sous la carte sur mobile) ── */

.cc-secteur-fiche {
    color: #F9F8F6;
    padding: 4px 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(249, 248, 246, 0.16);
    text-align: left;
}
.cc-sf-kicker {
    margin: 0 0 6px;
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-secondary, #C89445);
    text-align: left;
}
.cc-sf-invite-texte {
    margin: 0;
    font-family: var(--font-titres, 'Merriweather', Georgia, serif);
    font-size: 14px;
    line-height: 1.7;
    color: rgba(249, 248, 246, 0.86);
    text-align: left;
}
.cc-sf-tete { position: relative; padding-right: 34px; }
.cc-sf-nom {
    margin: 0 0 12px;
    font-family: var(--font-titres, 'Merriweather', Georgia, serif);
    font-size: 22px;
    line-height: 1.25;
    color: #F9F8F6;
}
.cc-sf-fermer {
    all: unset;
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 26px;
    font-size: 20px;
    cursor: pointer;
    color: rgba(249, 248, 246, 0.6);
    border: 1px solid rgba(249, 248, 246, 0.2);
}
.cc-sf-fermer:hover { color: #F9F8F6; border-color: var(--color-secondary, #C89445); }
.cc-sf-fermer:focus-visible { outline: 2px solid var(--color-teal, #4FA8C9); outline-offset: 2px; }

.cc-sf-meteo { margin: 0 0 12px; }
.cc-sf-maintenant { display: flex; align-items: center; gap: 10px; color: var(--color-gold-light, #E3B563); }
.cc-sf-temp { font-family: var(--font-titres, 'Merriweather', Georgia, serif); font-size: 26px; color: #F9F8F6; }
.cc-sf-ciel { font-size: 13px; line-height: 1.35; color: rgba(249, 248, 246, 0.85); }
.cc-sf-ciel small { font-size: 11.5px; color: rgba(249, 248, 246, 0.55); }
.cc-sf-jours {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
}
.cc-sf-jours li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid rgba(249, 248, 246, 0.14);
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 11px;
    color: rgba(249, 248, 246, 0.8);
}
.cc-sf-jours .cc-sf-picto { color: var(--color-gold-light, #E3B563); }

.cc-sf-conseils { list-style: none; margin: 0 0 14px; padding: 0; }
.cc-sf-conseils:empty { display: none; }
.cc-sf-conseils li {
    margin: 0 0 6px;
    padding: 9px 12px;
    border-left: 2px solid var(--color-teal, #4FA8C9);
    background: rgba(79, 168, 201, 0.08);
    font-size: 13px;
    line-height: 1.5;
    color: rgba(249, 248, 246, 0.9);
}
.cc-sf-conseils a { color: var(--color-gold-light, #E3B563); text-decoration: none; white-space: nowrap; }
.cc-sf-conseils a:hover { text-decoration: underline; }

.cc-sf-portrait p {
    margin: 0 0 10px;
    font-family: var(--font-titres, 'Merriweather', Georgia, serif);
    font-size: 13.5px;
    line-height: 1.7;
    color: rgba(249, 248, 246, 0.86);
    text-align: left;
}
.cc-sf-portrait strong { color: #F9F8F6; }
.cc-sf-attente { font-size: 12px; color: rgba(249, 248, 246, 0.5); font-style: italic; margin: 0; }

.cc-sf-bloc { margin: 16px 0 0; }
.cc-sf-titre {
    margin: 0 0 8px;
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-secondary, #C89445);
    text-align: left;
}
.cc-sf-bloc ul { list-style: none; margin: 0; padding: 0; }
.cc-sf-bloc li + li { border-top: 1px solid rgba(249, 248, 246, 0.08); }
.cc-sf-bloc a {
    display: grid;
    gap: 1px 10px;
    padding: 8px 0;
    color: #F9F8F6;
    text-decoration: none;
}
.cc-sf-bloc a:hover .cc-sf-item-nom { color: var(--color-gold-light, #E3B563); }
.cc-sf-item-nom { font-size: 13.5px; line-height: 1.35; font-weight: 500; }
.cc-sf-item-sub { font-size: 11.5px; color: rgba(249, 248, 246, 0.55); line-height: 1.35; }
.cc-sf-quand {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 11px;
    color: var(--color-gold-light, #E3B563);
}
.cc-sf-voir a { grid-template-columns: 52px 1fr; align-items: center; }
.cc-sf-voir img,
.cc-sf-vignette-vide {
    grid-row: span 2;
    width: 52px;
    height: 52px;
    object-fit: cover;
    display: block;
    background: rgba(249, 248, 246, 0.08);
}

.cc-sf-demander { margin: 18px 0 0; display: flex; flex-direction: column; gap: 6px; }
.cc-sf-question {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    padding: 9px 12px;
    border: 1px solid rgba(249, 248, 246, 0.2);
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: 12px;
    line-height: 1.45;
    color: #F9F8F6;
}
.cc-sf-question::before { content: '› '; color: var(--color-teal, #4FA8C9); }
.cc-sf-question:hover { border-color: var(--color-secondary, #C89445); background: rgba(249, 248, 246, 0.05); }
.cc-sf-question:focus-visible { outline: 2px solid var(--color-teal, #4FA8C9); outline-offset: 2px; }

/* ── Mobile : carte en haut du canevas, fiche dessous (sur fond encre, comme au bureau) ── */

@media (max-width: 999px) {
    .cc-secteurs-section .cc-secteurs-entete { padding: 2.25rem 16px 1.25rem; }
    .cc-secteurs-shell #cc-canvas-empty { height: auto; }
    .cc-secteurs { height: auto; }
    .cc-secteurs-map { flex: none; height: 52vh; min-height: 280px; }
    .cc-secteurs-liste { padding: 10px 16px; }
    .cc-secteurs .cc-secteur-fiche {
        background: var(--color-ink, #14201C);
        padding: 18px 16px 20px;
        margin: 0;
        border-bottom: 0;
    }
}

@media (max-width: 420px) {
    .cc-sf-jours li { padding: 5px 6px; white-space: nowrap; }
    .cc-sf-jours .cc-sf-picto { display: none; }
}
