/* WKAD — Carte agrandie, v0.1.2.
   La barre de fermeture reste hors de la zone interactive de la carte. */
html.wkad-map-dialog-open { overflow: hidden; }

.wkad-map-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: calc(100vw - 2rem);
  max-width: 100rem;
  height: calc(100vh - 2rem);
  max-height: 64rem;
  height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 1px solid #738d95;
  border-radius: .75rem;
  overflow: hidden;
  background: #fff;
  color: #163844;
  font: inherit;
  line-height: 1.5;
  box-shadow: 0 1rem 4rem rgba(0, 0, 0, .24);
}
.wkad-map-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.wkad-map-dialog::backdrop { background: rgba(8, 25, 33, .72); }
.wkad-map-dialog *,
.wkad-map-dialog *::before,
.wkad-map-dialog *::after { box-sizing: border-box; }

.wkad-map-dialog__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #c1cfd3;
  background: #fff;
}
.wkad-map-dialog__header h2 {
  flex: 1 1 16rem;
  margin: 0;
  color: #163844;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
}
.wkad-map-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-height: 2.75rem;
  max-width: 100%;
  padding: .6rem 1rem;
  border: 2px solid #5a267e;
  border-radius: .5rem;
  background: #5a267e;
  color: #fff;
  font: inherit;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
}
.wkad-map-dialog__close:hover { border-color: #3d1658; background: #3d1658; }
.wkad-map-dialog__body { min-width: 0; min-height: 0; background: #edf3f2; }
.wkad-map-dialog__body iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
}
.wkad-map-dialog__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  padding: .75rem 1.25rem;
  border-top: 1px solid #c1cfd3;
  background: #fff;
  color: #405d66;
  font-size: .875rem;
}
.wkad-map-dialog__footer p { flex: 1 1 22rem; margin: 0; }
.wkad-map-dialog__footer a {
  color: #5a267e;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.wkad-map-dialog__close--bottom {
  margin-inline-start: auto;
  border-width: 1px;
  background: #fff;
  color: #5a267e;
}
.wkad-map-dialog__close--bottom:hover { background: #eee7f3; color: #3d1658; }
.wkad-map-dialog :is(a, button):focus-visible {
  outline: 3px solid #286b73;
  outline-offset: 3px;
}
.wkad-map-dialog iframe:focus-visible {
  outline: 3px solid #286b73;
  outline-offset: -3px;
}

@media (max-width: 40rem) {
  .wkad-map-dialog {
    width: calc(100vw - .75rem);
    height: calc(100vh - .75rem);
    height: calc(100dvh - .75rem);
    max-height: none;
    border-radius: .5rem;
  }
  .wkad-map-dialog__header { padding: .75rem; gap: .5rem; }
  .wkad-map-dialog__header h2 { flex-basis: 100%; }
  .wkad-map-dialog__header .wkad-map-dialog__close { width: 100%; }
  .wkad-map-dialog__footer { padding: .5rem .75rem; }
  .wkad-map-dialog__footer p { display: none; }
}

@media (max-height: 32rem) {
  .wkad-map-dialog__header { padding: .5rem .75rem; gap: .25rem .75rem; }
  .wkad-map-dialog__header h2 { flex: 1 1 10rem; font-size: 1rem; }
  .wkad-map-dialog__header .wkad-map-dialog__close { width: auto; }
  .wkad-map-dialog__footer { max-height: 25vh; overflow-y: auto; padding: .25rem .75rem; }
  .wkad-map-dialog__footer p { display: none; }
}

@media (forced-colors: active) {
  .wkad-map-dialog { border-color: CanvasText; box-shadow: none; }
  .wkad-map-dialog__close { border-color: ButtonText; }
  .wkad-map-dialog :is(a, button, iframe):focus-visible { outline-color: Highlight; }
}

@media print { .wkad-map-dialog { display: none !important; } }
