/* =============================================================================
   CLASSEMENTS DES VILLES PAR CRITÈRES (refonte v2)
   Page : classement_v2.php  (/villes-et-quartiers/classement/)

   Chargé APRÈS /css/v2/home-refonte.css, dont il réutilise les variables
   (--hv3-*) et les composants (.hv3-btn, .hv3-h2, .hv3-cta-band…).
   Les classes propres à cette page utilisent le préfixe .cls-.

   SOMMAIRE
   1. Réglages de page
   2. Hero : titre + formulaire (zone + critère)
   3. Classements nationaux (vignettes)
   4. Publicité
   5. Responsive
   ============================================================================= */


/* =============================================================================
   1. RÉGLAGES DE PAGE
   ============================================================================= */

.cls-page main.cls-main {
  background-size: 100% 900px;
}

/* Sans JS, les 2 listes (région et département) restent visibles ;
   avec JS, seule celle de la zone choisie est affichée. */
.hv3-js .cls-sub-select:not([data-cls-active]) { display: none; }


/* =============================================================================
   2. HERO
   ============================================================================= */

.cls-hero {
  position: relative;
  padding: 26px 0 64px;
}

.cls-hero-inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.cls-h1 {
  font-weight: 800;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -.6px;
  color: var(--hv3-navy);
  margin: 0 0 10px;
}

.cls-h1-accent {
  background-image: linear-gradient(100deg, #0FA99B 0%, #22DAD2 60%, #3BE8B0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--hv3-place);
}

.cls-sub {
  font-size: 16px;
  line-height: 1.55;
  color: var(--hv3-muted);
  margin: 0 0 26px;
}

/* ---- Carte du formulaire (halo turquoise, comme la recherche du comparateur) ---- */
.cls-card {
  position: relative;
  margin: 0 auto;
  padding: 28px 28px 26px;
  border-radius: var(--hv3-radius);
  background: #FFFFFF;
  border: 2px solid var(--hv3-place-bright);
  box-shadow: 0 0 0 6px rgba(34, 218, 210, .12), 0 26px 50px -26px rgba(15, 169, 155, .75);
  text-align: left;
}

.cls-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.cls-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cls-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--hv3-navy);
}

.cls-label-num {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-image: var(--hv3-place-grad);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(6, 110, 102, .35);
}

/* ---- Listes déroulantes ---- */
.cls-select-wrap {
  position: relative;
}

.cls-select-wrap + .cls-select-wrap { margin-top: 10px; }

.cls-sub-select[data-cls-active] { animation: cls-drop .25s ease-out; }

@keyframes cls-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Chevron */
.cls-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid var(--hv3-place);
  border-bottom: 2px solid var(--hv3-place);
  transform: rotate(45deg);
  pointer-events: none;
}

.hv3-page .cls-select {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 46px 0 18px;
  margin: 0;
  border-radius: var(--hv3-radius-sm);
  border: 1.5px solid #D6EEEA;
  background: var(--hv3-soft);
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: 16px;   /* 16px minimum : évite le zoom automatique sur iOS */
  font-weight: 600;
  color: var(--hv3-navy);
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color var(--hv3-ease), box-shadow var(--hv3-ease), background-color var(--hv3-ease);
}

.hv3-page .cls-select:hover { border-color: var(--hv3-place-bright); background-color: #FFFFFF; }

.hv3-page .cls-select:focus {
  outline: none;
  border-color: var(--hv3-place-bright);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(34, 218, 210, .2);
}

/* Valeur non choisie : texte grisé comme un placeholder */
.hv3-page .cls-select.cls-is-empty { color: #A3A5C2; font-weight: 500; }
.hv3-page .cls-select option,
.hv3-page .cls-select optgroup { color: var(--hv3-navy); }
.hv3-page .cls-select optgroup { font-weight: 700; }

/* Champ manquant à la soumission */
.hv3-page .cls-select.cls-is-invalid {
  border-color: var(--hv3-match);
  box-shadow: 0 0 0 4px rgba(255, 28, 96, .14);
  animation: cls-shake .35s ease;
}

@keyframes cls-shake {
  0%, 100% { transform: none; }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

/* ---- Message & bouton ---- */
.cls-msg {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  color: var(--hv3-match);
}

.cls-msg:empty { min-height: 0; margin-top: 6px; }

.cls-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.hv3-page .cls-submit {
  min-width: 300px;
  cursor: pointer;
  font-family: inherit;
}

.cls-submit-spin {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #FFFFFF;
  animation: hv3-spin .7s linear infinite;
}

.cls-submit.is-loading { pointer-events: none; }
.cls-submit.is-loading .cls-submit-spin { display: inline-block; }
.cls-submit.is-loading .hv3-btn-arrow { display: none; }


/* =============================================================================
   3. CLASSEMENTS NATIONAUX (vignettes)
   ============================================================================= */

.cls-section {
  padding: 24px 0 88px;
}

.cls-section-head { margin-bottom: 34px; }
.cls-section-head .hv3-h2 { font-size: 30px; }

.cls-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cls-tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 128px;
  padding: 14px 16px;
  border-radius: var(--hv3-radius-sm);
  overflow: hidden;
  isolation: isolate;
  background: var(--hv3-navy);
  box-shadow: var(--hv3-shadow-sm);
  text-decoration: none;
  transition: transform var(--hv3-ease), box-shadow var(--hv3-ease);
}

.cls-tile:hover,
.cls-tile:focus {
  transform: translateY(-3px);
  box-shadow: var(--hv3-shadow);
  text-decoration: none;
}

.cls-tile-img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}

.cls-tile:hover .cls-tile-img { transform: scale(1.07); }

/* Voile sombre pour la lisibilité du texte */
.cls-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(24, 20, 87, 0) 0%, rgba(24, 20, 87, .08) 40%, rgba(24, 20, 87, .78) 100%);
  transition: background var(--hv3-ease);
}

.cls-tile:hover::before {
  background: linear-gradient(180deg, rgba(15, 169, 155, .12) 0%, rgba(24, 20, 87, .12) 40%, rgba(24, 20, 87, .85) 100%);
}

.cls-tile-ico {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  font-size: 17px;
  line-height: 1;
}

.cls-tile-name {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}


/* =============================================================================
   4. PUBLICITÉ
   ============================================================================= */

.cls-ads {
  margin: 0 auto 56px;
  padding: 12px;
  max-width: 970px;
  border-radius: var(--hv3-radius-sm);
  background: var(--hv3-soft);
  border: 1px solid var(--hv3-border);
  text-align: center;
}

.cls-ads-title {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--hv3-muted);
}


/* =============================================================================
   5. RESPONSIVE
   ============================================================================= */

@media (max-width: 991px) {
  .cls-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .cls-page main.cls-main { background-size: 100% 700px; }

  .cls-hero { padding: 18px 0 44px; }
  .cls-h1 { font-size: 26px; letter-spacing: -.3px; }
  .cls-sub { font-size: 14.5px; margin-bottom: 18px; }

  .cls-card { padding: 20px 16px 18px; }
  .cls-fields { grid-template-columns: 1fr; gap: 18px; }
  .cls-label { margin-bottom: 10px; }
  .hv3-page .cls-select { height: 52px; }

  .cls-actions .cls-submit { width: 100%; min-width: 0; }

  .cls-section { padding: 10px 0 56px; }
  .cls-section-head { margin-bottom: 24px; }
  .cls-section-head .hv3-h2 { font-size: 23px; }

  .cls-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cls-tile { height: 104px; padding: 10px 11px; gap: 8px; }
  .cls-tile-ico { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }
  .cls-tile-name { font-size: 13.5px; }

  .cls-ads { margin-bottom: 40px; }
}
