/**
 * Page communes — recherche AJAX (complément au thème GDON).
 * Le thème masque .town-item { display: none } pour l’ancien filtre #select_towns_trigger.
 */

/* Éléments déjà sélectionnés : hors liste déroulante (lisibilité). */
.commune-search-dropdown .select2-results__option[aria-selected="true"],
.commune-search-dropdown .select2-results__option[aria-selected=true] {
	display: none;
}

#commune-search-results .town-item,
.commune-results .town-item,
.town-item.town-item--visible {
	display: block;
}

#commune-search-results > .commune-legend,
.commune-results > .commune-legend {
	max-width: 100%;
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid #d8d8d8;
}

.commune-legend {
	max-width: 100%;
}

.commune-legend img {
	display: block;
	max-width: min(100%, 720px);
	width: auto;
	height: auto;
	max-height: 280px;
	margin-left: auto;
	margin-right: auto;
	object-fit: contain;
}

.commune-legend__caption {
	max-width: min(100%, 720px);
	margin: 0.75rem auto 0;
	text-align: center;
}

.town-item .town-sections {
	margin-top: 0.35rem;
	color: #2b6cb0;
	font-size: 14px;
	font-weight: 600;
}

.town-item .town-sections--hors-gdon {
	color: #777;
	font-style: italic;
	font-weight: 500;
}

.town-item .item-image {
	margin-top: 1.25rem;
}

.town-item .item-image img {
	display: block;
	max-width: min(100%, 400px);
	width: auto;
	height: auto;
	max-height: 220px;
	object-fit: contain;
}

.town-item a.item-image--zoom {
	display: inline-block;
	cursor: zoom-in;
	text-decoration: none;
	color: inherit;
}

.town-item a.item-image--zoom:hover img,
.town-item a.item-image--zoom:focus img {
	opacity: 0.92;
}

.town-item a.item-image--zoom:focus {
	outline: 2px solid #2b6cb0;
	outline-offset: 4px;
}

/* Titre + icône : toujours côte à côte (le h3 wrappe à droite, pas sous l’icône). */
.town-item .item-name > .ctn-flex {
	flex-wrap: nowrap;
	align-items: flex-start;
}

.town-item .item-name .name-ico {
	flex-shrink: 0;
}

.town-item .item-name > .ctn-flex > div:last-child {
	flex: 1 1 0;
	min-width: 0;
}

.town-item .item-name h3 {
	overflow-wrap: break-word;
	word-wrap: break-word;
}
