/* ============================================================
   CareWheel Hub — visuels décoratifs climate_type
   ============================================================ */

/* Dégradés de fond (fallback si image locale absente) */
.enclosure-thumb--climate.desert-gradient,
.climate-preview.desert-gradient {
  background: linear-gradient(145deg, #8a5a28 0%, #dfa24a 45%, #f0d090 100%);
}

.enclosure-thumb--climate.semi-arid-gradient,
.climate-preview.semi-arid-gradient {
  background: linear-gradient(145deg, #7a4a20 0%, #c98a3a 50%, #e8c070 100%);
}

.enclosure-thumb--climate.savanna-gradient,
.climate-preview.savanna-gradient {
  background: linear-gradient(145deg, #8a7030 0%, #d6b85a 55%, #efe0a0 100%);
}

.enclosure-thumb--climate.temperate-gradient,
.climate-preview.temperate-gradient {
  background: linear-gradient(145deg, #3d6b45 0%, #6fae75 50%, #a8d8b0 100%);
}

.enclosure-thumb--climate.subtropical-gradient,
.climate-preview.subtropical-gradient {
  background: linear-gradient(145deg, #2a8a55 0%, #4fc987 55%, #90e8b8 100%);
}

.enclosure-thumb--climate.tropical-gradient,
.climate-preview.tropical-gradient {
  background: linear-gradient(145deg, #1a7a48 0%, #37c978 55%, #70e8a8 100%);
}

.enclosure-thumb--climate.rainforest-gradient,
.climate-preview.rainforest-gradient {
  background: linear-gradient(145deg, #157a60 0%, #2ed3a3 50%, #70f0d0 100%);
}

.enclosure-thumb--climate.montane-gradient,
.climate-preview.montane-gradient {
  background: linear-gradient(145deg, #4a6a9a 0%, #8ab4f8 55%, #c8e0ff 100%);
}

.enclosure-thumb--climate.paludarium-gradient,
.climate-preview.paludarium-gradient {
  background: linear-gradient(145deg, #1a7a80 0%, #35c5c9 50%, #80e8ec 100%);
}

.enclosure-thumb--climate.aquaterrarium-gradient,
.climate-preview.aquaterrarium-gradient {
  background: linear-gradient(145deg, #2060a8 0%, #4fa3ff 55%, #90c8ff 100%);
}

.enclosure-thumb--climate.default-gradient,
.climate-preview.default-gradient {
  background: linear-gradient(145deg, #3a5080 0%, #6ea8ff 55%, #a8c8f0 100%);
}

/* Surface commune : vignette carte + aperçu paramètres */
.climate-preview,
.enclosure-thumb.enclosure-thumb--climate {
  position: relative;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: stretch;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--climate-accent, var(--accent)) 35%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  align-items: unset;
  justify-content: unset;
  font-size: unset;
  font-weight: unset;
  color: unset;
}

.enclosure-thumb.enclosure-thumb--climate {
  container-type: size;
  /* Mobile : taille carrée fixe (évite le rétrécissement au stretch sur la hauteur du texte). */
  align-self: flex-start;
  width: var(--enc-climate-thumb-size);
  height: var(--enc-climate-thumb-size);
  min-width: 5.5rem;
  min-height: 5.5rem;
  flex-shrink: 0;
}

.climate-preview .enc-thumb-img,
.enclosure-thumb.enclosure-thumb--climate .enc-thumb-img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
}

.climate-preview .enc-thumb-icon,
.enclosure-thumb.enclosure-thumb--climate .enc-thumb-icon {
  grid-area: 1 / 1;
  display: none;
  align-self: center;
  justify-self: center;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.climate-preview.enc-thumb-fallback .enc-thumb-img,
.enclosure-thumb.enclosure-thumb--climate.enc-thumb-fallback .enc-thumb-img {
  display: none;
}

.climate-preview.enc-thumb-fallback .enc-thumb-icon,
.enclosure-thumb.enclosure-thumb--climate.enc-thumb-fallback .enc-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Badge type de milieu */
.climate-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  border: 1px solid color-mix(in srgb, var(--climate-accent, #6ea8ff) 50%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.climate-type-badge.desert-gradient,
.climate-type-badge.semi-arid-gradient,
.climate-type-badge.savanna-gradient,
.climate-type-badge.temperate-gradient,
.climate-type-badge.subtropical-gradient,
.climate-type-badge.tropical-gradient,
.climate-type-badge.rainforest-gradient,
.climate-type-badge.montane-gradient,
.climate-type-badge.paludarium-gradient,
.climate-type-badge.aquaterrarium-gradient,
.climate-type-badge.default-gradient {
  background: linear-gradient(135deg, color-mix(in srgb, var(--climate-accent) 85%, #000), var(--climate-accent));
}

/* Aperçu sheet paramètres (carré aligné sur .enclosure-thumb carte) */
.climate-preview-host {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-start;
}

.climate-preview {
  width: 130px;
  max-width: 130px;
  max-height: 130px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
}

.climate-settings-block {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(120, 180, 200, 0.12);
}

.climate-settings-block h3 {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.climate-settings-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.climate-settings-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.climate-settings-desc {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.climate-settings-controls {
  margin-bottom: 0;
  flex-wrap: nowrap;
}

.climate-settings-controls select {
  width: auto;
}

@media (max-width: 420px) {
  .climate-settings-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .climate-preview-host {
    justify-content: center;
  }

  .climate-settings-controls {
    flex-wrap: wrap;
  }

  .climate-settings-controls select {
    width: 100%;
    flex: 1 1 100%;
  }

  .climate-settings-controls button {
    width: 100%;
  }
}

.climate-preview-label {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: start;
  z-index: 2;
  font-weight: 600;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.enclosure-thumb.enclosure-thumb--climate .climate-preview-label {
  margin: clamp(0.3rem, 10cqmin, 0.65rem) clamp(0.35rem, 12cqmin, 0.75rem);
  font-size: clamp(0.58rem, 18cqmin, 0.82rem);
}

.climate-preview .climate-preview-label {
  margin: 0.65rem 0.75rem;
  font-size: 0.82rem;
}

.climate-regulation-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
