/* ==========================================================================
   Carte interactive Centre Tarn — shortcode [ct_carte]
   Reprend les variables du thème Centre Tarn quand elles existent.
   Points de rupture alignés sur Elementor : tablette ≤ 1024 px, mobile ≤ 767 px.
   ========================================================================== */

.ctc {
	--ctc-fond: #fdf4d6;
	--ctc-carte: #fffdf7;
	--ctc-encre: var(--ct-ink, #1e2430);
	--ctc-doux: var(--ct-muted, #5b6472);
	--ctc-accent: var(--ct-orange, #fd3d01);
	--ctc-accent-fonce: var(--ct-orange-dark, #c42f00);
	--ctc-titre: var(--ct-blue-dark, #083673);
	--ctc-police: var(--ct-font, system-ui, sans-serif);
	--ctc-police-titre: var(--ct-font-title, Georgia, serif);
	--ctc-ombre: 0 18px 50px -18px rgba(12, 31, 66, .4), 0 2px 8px rgba(12, 31, 66, .08);
	--ctc-rayon: var(--ct-radius, 16px);
	font-family: var(--ctc-police);
	color: var(--ctc-encre);
}
.ctc *, .ctc *::before, .ctc *::after { box-sizing: border-box; }

/* Repli hors thème Centre Tarn */
.ctc-wrap { width: 100%; max-width: var(--ct-wrap, 1240px); margin-inline: auto; padding-inline: var(--ct-gutter, 16px); }
.ctc-titre { font-family: var(--ctc-police-titre); color: var(--ctc-titre); text-align: center; }
.ctc .ctc-head { margin-bottom: clamp(20px, 3vw, 32px); }

/* ---------- Barre : consigne + filtres par catégorie ---------- */
.ctc-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; margin-bottom: 16px; }
.ctc-intro { margin: 0; color: var(--ctc-doux); font-size: 1rem; }
.ctc-filtres { display: flex; flex-wrap: wrap; gap: 8px; }
.ctc .ctc-filtre { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 8px 6px 12px; border: 2px solid var(--c); border-radius: 999px; background: #fff; color: var(--ctc-encre); font: inherit; font-size: .82rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.4; cursor: pointer; transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.ctc-filtre i { width: 11px; height: 11px; border-radius: 50%; background: var(--c); }
.ctc-filtre__n { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: var(--c); color: var(--ct); font-size: .75rem; letter-spacing: 0; text-align: center; }
.ctc .ctc-filtre:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.ctc .ctc-filtre[aria-pressed="true"] { background: var(--c); color: var(--ct); }
.ctc-filtre[aria-pressed="true"] i { background: var(--ct); }
.ctc-filtre[aria-pressed="true"] .ctc-filtre__n { background: var(--ct); color: var(--c); }
.ctc-vide { padding: 12px 16px; border-left: 4px solid var(--ctc-accent); background: #fff7f2; font-size: .95rem; }

/* ---------- Carte ---------- */
.ctc-cadre { position: relative; overflow: hidden; border-radius: calc(var(--ctc-rayon) + 6px); background: var(--ctc-fond); box-shadow: inset 0 0 0 1px rgba(4, 107, 95, .08); }
.ctc-defile { overflow: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.ctc-plan { position: relative; width: 100%; aspect-ratio: 1908.667 / 1511.813; }
.ctc-plan picture, .ctc-plan img, .ctc-plan .ctc-calque { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; display: block; }
.ctc-plan img { object-fit: contain; user-select: none; -webkit-user-drag: none; }

.ctc-voile { fill: #12322c; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.ctc-calque.is-actif .ctc-voile { opacity: .22; }
.ctc-calque.is-filtre .ctc-voile { opacity: .38; }

/* Contour d'un lieu : trait de la couleur de sa catégorie, pointillés blancs par-dessus */
.ctc-lieu { cursor: pointer; outline: none; }
.ctc-zone { fill: transparent; }
.ctc-halo { fill: none; stroke: var(--c); stroke-width: 7; opacity: 0; transition: opacity .25s ease; vector-effect: non-scaling-stroke; }
.ctc-anneau { fill: none; stroke: #fff; stroke-width: 2.5; stroke-dasharray: 7 6; opacity: 0; transition: opacity .25s ease; vector-effect: non-scaling-stroke; }
.ctc-lieu:hover :is(.ctc-halo, .ctc-anneau),
.ctc-lieu:focus-visible :is(.ctc-halo, .ctc-anneau),
.ctc-lieu.is-selection :is(.ctc-halo, .ctc-anneau),
.ctc-calque.is-filtre .ctc-lieu.is-match :is(.ctc-halo, .ctc-anneau) { opacity: 1; }
.ctc-calque.is-indice .ctc-halo { animation: ctc-indice 1.6s ease-out var(--d, 0s) 2; }
@keyframes ctc-indice { 0% { opacity: 0; } 30% { opacity: .85; } 100% { opacity: 0; } }

.ctc-astuce { position: absolute; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px 8px 11px; border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: var(--ctc-ombre); color: var(--ctc-titre); font-size: .92rem; font-weight: 700; pointer-events: none; transition: opacity .4s ease, transform .4s ease; }
.ctc-astuce svg { flex: none; }
.ctc-astuce.is-cache { opacity: 0; transform: translateY(8px); }

/* ---------- Fiche ---------- */
.ctc-fiche { position: absolute; z-index: 5; top: 16px; right: 16px; width: min(360px, calc(100% - 32px)); max-height: calc(100% - 32px); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--ctc-rayon); background: var(--ctc-carte); box-shadow: var(--ctc-ombre); opacity: 0; visibility: hidden; transform: translateX(calc(100% + 24px)); transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease, visibility 0s linear .45s; }
.ctc-fiche.is-gauche { right: auto; left: 16px; transform: translateX(calc(-100% - 24px)); }
.ctc-fiche.is-ouverte { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ctc-fiche:focus { outline: none; }

.ctc-visuel { position: relative; flex: none; height: 200px; background: radial-gradient(circle at 50% 60%, #fffaf0, var(--ctc-fond) 72%); border-bottom: 4px solid var(--c, var(--ctc-accent)); }
.ctc-visuel > img, .ctc-visuel > svg { width: 100%; height: 100%; display: block; max-width: none; }
.ctc-visuel > img { object-fit: cover; }
.ctc-visuel > svg { padding: 14px; }
.ctc-fermer { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--ctc-encre); box-shadow: 0 2px 8px rgba(0, 0, 0, .14); cursor: pointer; }
.ctc-fermer:hover { background: #fff; color: var(--ctc-accent-fonce); }

.ctc-corps { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 18px 22px 10px; }
.ctc-cat { display: inline-block; padding: 3px 10px; border-radius: 6px; background: var(--c, var(--ctc-accent)); color: var(--ct, #fff); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ctc .ctc-nom { margin: 10px 0 4px; font-family: var(--ctc-police-titre); font-size: 1.6rem; font-weight: 800; line-height: 1.12; color: var(--ctc-titre); }
.ctc-commune { display: flex; align-items: center; gap: 5px; margin: 0 0 10px; color: var(--ctc-doux); font-size: .92rem; }
.ctc-commune:empty { display: none; }
.ctc-texte { margin: 0; font-size: .98rem; line-height: 1.6; }

.ctc-pied { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--ct-line, #e3e6ec); }
.ctc .ctc-bouton { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; background: var(--ctc-accent); color: #fff; font-weight: 800; text-decoration: none; transition: background .2s ease; }
.ctc .ctc-bouton:hover, .ctc .ctc-bouton:focus { background: var(--ctc-accent-fonce); color: #fff; }
.ctc-nav { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ct-line, #d9dde4); border-radius: 50%; background: #fff; color: var(--ctc-titre); cursor: pointer; }
.ctc-nav:hover { border-color: var(--ctc-titre); }

/* ---------- Tablette ---------- */
@media (max-width: 1024px) {
	.ctc-fiche { width: min(300px, calc(100% - 24px)); top: 12px; right: 12px; max-height: calc(100% - 24px); }
	.ctc-fiche.is-gauche { left: 12px; }
	.ctc-visuel { height: 140px; }
	.ctc-corps { padding: 14px 18px 8px; }
	.ctc .ctc-nom { font-size: 1.3rem; }
	.ctc-texte { font-size: .92rem; }
	.ctc-pied { padding: 12px 18px 14px; }
}

/* ---------- Liste des lieux (mobile uniquement) ---------- */
.ctc-liste { display: none; }

/* ---------- Mobile : carte entière, liste des lieux dessous, fiche en bas d'écran ---------- */
@media (max-width: 767px) {
	.ctc-barre { flex-direction: column; align-items: flex-start; }
	.ctc-cadre { border-radius: var(--ctc-rayon); }
	.ctc-astuce { display: none; }
	/* Zone cliquable élargie de quelques pixels autour de chaque lieu, pour le doigt */
	.ctc-zone { stroke: transparent; stroke-width: 18px; vector-effect: non-scaling-stroke; }
	.ctc-halo { stroke-width: 4; }

	.ctc-liste { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
	.ctc-liste li { margin: 0; }
	.ctc-liste li[hidden] { display: none; }
	.ctc .ctc-item { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 8px 12px 8px 8px; border: 1px solid var(--ct-line, #e3e6ec); border-left: 5px solid var(--c); border-radius: 12px; background: #fff; color: var(--ctc-encre); text-decoration: none; }
	.ctc .ctc-item:hover, .ctc .ctc-item:focus { color: var(--ctc-encre); border-color: var(--c); }
	.ctc-item.is-selection { box-shadow: 0 0 0 2px var(--c); }
	.ctc-item__img { flex: none; width: 56px; height: 56px; overflow: hidden; border-radius: 8px; background: color-mix(in srgb, var(--c) 18%, #fff); }
	.ctc-item__img img { width: 100%; height: 100%; object-fit: cover; }
	.ctc-item__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
	.ctc-item__cat { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 55%, #000); } /* 55 % : 4,5:1 sur blanc même pour les couleurs claires (RGAA 3.2). */
	.ctc-item__nom { font-size: 1rem; }
	.ctc-item__commune { font-size: .85rem; color: var(--ctc-doux); }
	.ctc-fiche, .ctc-fiche.is-gauche { position: fixed; z-index: 9999; top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: min(78vh, 560px); border-radius: 20px 20px 0 0; transform: translateY(105%); }
	.ctc-fiche.is-ouverte { transform: none; }
	.ctc-visuel { height: 160px; }
	.ctc .ctc-nom { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
	.ctc *, .ctc-fiche { transition: none !important; animation: none !important; }
}
