/*!
 * Accès direct territoires — styles du composant intégrable.
 * Reprend les codes du Portail national des collectivités territoriales (variables --pn-*),
 * avec des valeurs de repli quand le composant est utilisé ailleurs.
 */
.pnct-territoires {
  --pnct-green: var(--pn-green, #17503d);
  --pnct-green-light: var(--pn-green-light, #1f7a58);
  --pnct-green-050: var(--pn-green-050, #eef4f0);
  --pnct-gold: var(--pn-gold, #8c7a1e);
  --pnct-ink: var(--pn-ink, #1c2b26);
  --pnct-muted: var(--pn-muted, #5f6b66);
  --pnct-line: var(--pn-line, #e4e9e5);
  color: var(--pnct-ink);
  font-size: 14px;
  line-height: 1.45;
  text-align: start;
}

/* ── Panneau déroulant du bandeau (même gabarit que « Ressources & données ») ── */
.hero-action .dropdown-menu.pnct-territoires {
  inset-inline: auto 0 !important;
  width: min(560px, calc(100vw - 48px));
  padding: 18px 18px 16px;
  border: 0;
  border-radius: 12px;
  margin-top: 8px;
  box-shadow: 0 12px 34px rgba(16, 40, 30, .2);
}
.hero-action .dropdown-menu.pnct-territoires::before { content: ""; position: absolute; inset: -10px 0 auto; height: 10px; }
.hero-action .dropdown-menu.pnct-territoires::after {
  content: "";
  position: absolute;
  top: -7px;
  inset-inline-end: 127px;
  width: 16px;
  height: 16px;
  background: #fff;
  transform: rotate(45deg);
  border-radius: 3px;
}
/* Le bouton ouvre désormais un panneau : chevron qui pivote, plus de glissement de flèche */
.hero-action--territoires.dropdown .hero-action__btn:hover .hero-action__caret { transform: none; }
.hero-action--territoires.dropdown.show .hero-action__caret { transform: rotate(180deg); }

/* ── Contenu ── */
.pnct-territoires__head { margin-bottom: 14px; }
.pnct-territoires__title { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--pnct-ink); }
.pnct-territoires__intro { margin: 2px 0 0; font-size: 12.5px; color: var(--pnct-muted); }

.pnct-territoires__fields { display: grid; gap: 12px; }
.pnct-territoires__field { display: grid; gap: 5px; }
.pnct-territoires__label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; font-weight: 700; color: var(--pnct-ink); }
.pnct-territoires__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  color: var(--pnct-gold);
  background: rgba(140, 122, 30, .12);
}
.pnct-territoires__select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid #ccd5d0;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  color: var(--pnct-ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235f6b66' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center / 16px 16px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.pnct-territoires[dir="rtl"] .pnct-territoires__select { padding: 0 12px 0 36px; background-position: left 12px center; }
.pnct-territoires__select:hover:not(:disabled) { border-color: var(--pnct-green-light); }
.pnct-territoires__select:focus { outline: 0; border-color: var(--pnct-green-light); box-shadow: 0 0 0 .2rem rgba(31, 122, 88, .18); }
.pnct-territoires__select:disabled { color: var(--pnct-muted); background-color: #f4f6f4; cursor: not-allowed; }

.pnct-territoires__status { margin: 10px 0 0; font-size: 12.5px; color: var(--pnct-muted); }
.pnct-territoires__status:empty { display: none; }
.pnct-territoires__status.is-error { color: #a23b2a; }

.pnct-territoires__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--pnct-line);
}
.pnct-territoires__destination { display: grid; margin: 0; min-width: 0; font-size: 12.5px; line-height: 1.4; color: var(--pnct-muted); }
.pnct-territoires__destination strong { font-size: 14px; color: var(--pnct-ink); overflow-wrap: anywhere; }
.pnct-territoires__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--pn-radius, 6px);
  font-size: 14px;
  font-weight: 500;
  color: #fff !important;
  text-decoration: none !important;
  background: var(--pnct-green);
  transition: background .15s;
}
.pnct-territoires__go:hover { background: var(--pnct-green-light); }
.pnct-territoires__go:focus-visible { outline: 2px solid var(--pnct-gold); outline-offset: 2px; }
.pnct-territoires__go svg { width: 16px; height: 16px; transition: transform .2s; }
.pnct-territoires__go:hover svg { transform: translateX(3px); }
.pnct-territoires[dir="rtl"] .pnct-territoires__go svg { transform: scaleX(-1); }
.pnct-territoires[dir="rtl"] .pnct-territoires__go:hover svg { transform: scaleX(-1) translateX(3px); }
.pnct-territoires__go[aria-disabled="true"] { background: #b9c4be; cursor: not-allowed; pointer-events: auto; }

@media (min-width: 576px) {
  .pnct-territoires__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pnct-territoires__field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 1199.98px) {
  .hero-action .dropdown-menu.pnct-territoires::after { inset-inline-end: 40px; }
}
@media (max-width: 767.98px) {
  .hero-action .dropdown-menu.pnct-territoires { width: 100%; padding: 14px; margin-top: 4px; }
  .hero-action .dropdown-menu.pnct-territoires::after { content: none; }
}
