html.tet-lightbox-open,
body.tet-lightbox-open {
  overflow: hidden;
}

/* =========================================
   Grille des vignettes
========================================= */

.tet-lightbox-item {
  display: block;
}

.tet-lightbox-thumb-wrap {
  position: relative;
}

.tet-lightbox-thumb-actions {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tet-lightbox-trigger {
  display: block;
  text-decoration: none;
  line-height: 0;
}

.tet-lightbox-trigger img {
  display: block;
  width: 100%;
  height: auto;
}

.tet-lightbox-thumb-title {
  margin-top: 6px;
  min-height: 2.4em;
  font-family: 'EB Garamond', serif;
  font-size: 0.92rem;
  line-height: 1.15;
  font-weight: 400;
  color: #2b2b2b;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.tet-lightbox-comment-source {
  display: none;
}

/* bouton modifier sur la vignette */
.tet-lightbox-edit-link {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.2s ease;
}

.tet-lightbox-edit-link:hover {
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
}

/* =========================================
   Overlay lightbox
========================================= */

.tet-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.tet-lightbox.is-open {
  display: block;
}

.tet-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.tet-lightbox__dialog {
  position: relative;
  z-index: 2;
  width: min(1200px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  display: flex;
  flex-direction: column;
}

.tet-lightbox__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: transparent;
}

.tet-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  width: auto;
  height: auto;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* =========================================
   Métadonnées
========================================= */

.tet-lightbox__meta {
  margin-top: 14px;
  padding: 0 8px;
  color: #ffffff;
  text-align: left;
}

.tet-lightbox__counter {
  margin-bottom: 8px;
  font-size: 0.9rem;
  line-height: 1.2;
  opacity: 0.8;
  color: #ffffff;
}

.tet-lightbox__title {
  font-family: 'Libre Bodoni', serif;
  font-size: 1.35rem;
  line-height: 1.15;
  font-weight: 400;
  margin-bottom: 8px;
  color: #ffffff;
}

/* =========================================
   Boutons
========================================= */

.tet-lightbox__close {
  position: absolute;
  top: -8px;
  right: -4px;
  z-index: 100003;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.tet-lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 100002;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.tet-lightbox__prev {
  left: 12px;
}

.tet-lightbox__next {
  right: 12px;
}

.tet-lightbox__close:hover,
.tet-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.tet-lightbox__nav.is-hidden {
  display: none !important;
}

/* =========================================
   Responsive
========================================= */

@media (max-width: 900px) {
  .tet-lightbox__dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    margin: 10px auto;
  }

  .tet-lightbox__image {
    max-height: calc(100vh - 260px);
  }

  .tet-lightbox__title {
    font-size: 1.15rem;
  }

  .tet-lightbox__comment {
    font-size: 0.95rem;
    line-height: 1.32;
  }

  .tet-lightbox__comment img,
  .tet-lightbox__comment figure img {
    max-width: min(300px, 100%) !important;
  }

  .tet-lightbox__prev {
    left: 8px;
  }

  .tet-lightbox__next {
    right: 8px;
  }

  .tet-lightbox__nav {
    width: 56px;
    height: 56px;
    font-size: 2.1rem;
  }

  .tet-lightbox__close {
    top: 4px;
    right: 4px;
  }

  .tet-lightbox-thumb-title {
    font-size: 0.88rem;
    line-height: 1.12;
  }
}

/* =========================================
   Actions GPS / informations sur les vignettes
========================================= */

.tet-lightbox-map-link,
.tet-lightbox-comment-link {
  position: static;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.tet-lightbox-map-link svg,
.tet-lightbox-comment-link svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.tet-lightbox-map-link:hover,
.tet-lightbox-map-link:focus-visible,
.tet-lightbox-comment-link:hover,
.tet-lightbox-comment-link:focus-visible {
  background: rgba(0, 0, 0, 0.82);
  color: #ffffff;
  transform: translateY(-1px);
}

.tet-lightbox-map-link:focus-visible,
.tet-lightbox-comment-link:focus-visible,
.tet-lightbox__map-button:focus-visible,
.tet-lightbox__comment-button:focus-visible,
.tet-map-modal__close:focus-visible,
.tet-map-modal__external-link:focus-visible,
.tet-comment-modal__close:focus-visible,
.tet-comment-modal__content a:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

/* Boutons carte / informations dans la grande lightbox */
.tet-lightbox__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 2px 0 4px;
}

.tet-lightbox__map-button,
.tet-lightbox__comment-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tet-lightbox__map-button[hidden],
.tet-lightbox__comment-button[hidden] {
  display: none !important;
}

.tet-lightbox__map-button svg,
.tet-lightbox__comment-button svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex: 0 0 auto;
}

.tet-lightbox__map-button:hover,
.tet-lightbox__comment-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.75);
}

/* =========================================
   Modale cartographique OpenStreetMap
========================================= */

.tet-map-modal {
  position: fixed;
  inset: 0;
  z-index: 100100;
  display: none;
  padding: 24px;
  overflow-y: auto;
}

.tet-map-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tet-map-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.tet-map-modal__dialog {
  position: relative;
  z-index: 2;
  width: min(1000px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  color: #202020;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.tet-map-modal__header {
  padding: 20px 64px 16px 22px;
  border-bottom: 1px solid #e6e6e6;
}

.tet-map-modal__eyebrow {
  margin-bottom: 3px;
  font-size: 0.78rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a6a6a;
}

.tet-map-modal__title {
  margin: 0;
  font-family: 'Libre Bodoni', serif;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.15;
  font-weight: 400;
  color: #171717;
}

.tet-map-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: #222222;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.tet-map-modal__close:hover {
  background: rgba(0, 0, 0, 0.16);
}

.tet-map-modal__map-wrap {
  position: relative;
  width: 100%;
  height: min(62vh, 620px);
  min-height: 380px;
  background: #e9e9e9;
}

.tet-map-modal__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #e9e9e9;
}

.tet-map-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px 16px;
  border-top: 1px solid #e6e6e6;
}

.tet-map-modal__coordinates {
  font-size: 0.9rem;
  line-height: 1.3;
  color: #555555;
}

.tet-map-modal__external-link,
.tet-map-modal__external-link:visited {
  flex: 0 0 auto;
  color: #1d4f78;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 700px) {
  .tet-map-modal {
    padding: 10px;
  }

  .tet-map-modal__dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .tet-map-modal__header {
    padding: 16px 56px 13px 16px;
  }

  .tet-map-modal__map-wrap {
    height: 58vh;
    min-height: 300px;
  }

  .tet-map-modal__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 14px;
  }

  .tet-map-modal__external-link {
    flex: none;
  }
}


/* =========================================
   Modale d’informations / commentaires
========================================= */

.tet-comment-modal {
  position: fixed;
  inset: 0;
  z-index: 100200;
  display: none;
  padding: 24px;
  overflow-y: auto;
}

.tet-comment-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tet-comment-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.tet-comment-modal__dialog {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  color: #242424;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.tet-comment-modal__header {
  flex: 0 0 auto;
  padding: 20px 64px 16px 22px;
  border-bottom: 1px solid #e6e6e6;
}

.tet-comment-modal__eyebrow {
  margin-bottom: 3px;
  font-size: 0.78rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a6a6a;
}

.tet-comment-modal__title {
  margin: 0;
  font-family: 'Libre Bodoni', serif;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.15;
  font-weight: 400;
  color: #171717;
}

.tet-comment-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: #222222;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.tet-comment-modal__close:hover {
  background: rgba(0, 0, 0, 0.16);
}

.tet-comment-modal__body {
  min-height: 0;
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tet-comment-modal__content {
  font-family: 'EB Garamond', serif;
  font-size: 1.08rem;
  line-height: 1.5;
  color: #2b2b2b;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal !important;
}

.tet-comment-modal__content,
.tet-comment-modal__content * {
  box-sizing: border-box;
  max-width: 100% !important;
}

.tet-comment-modal__content p,
.tet-comment-modal__content span,
.tet-comment-modal__content strong,
.tet-comment-modal__content em,
.tet-comment-modal__content li,
.tet-comment-modal__content ul,
.tet-comment-modal__content ol,
.tet-comment-modal__content div,
.tet-comment-modal__content blockquote,
.tet-comment-modal__content figcaption,
.tet-comment-modal__content h1,
.tet-comment-modal__content h2,
.tet-comment-modal__content h3,
.tet-comment-modal__content h4,
.tet-comment-modal__content h5,
.tet-comment-modal__content h6,
.tet-comment-modal__content font {
  color: #2b2b2b !important;
  background: transparent !important;
  background-color: transparent !important;
  white-space: normal !important;
  text-indent: 0 !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tet-comment-modal__content p,
.tet-comment-modal__content div,
.tet-comment-modal__content blockquote,
.tet-comment-modal__content li {
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
  width: auto !important;
}

.tet-comment-modal__content p:last-child,
.tet-comment-modal__content div:last-child,
.tet-comment-modal__content blockquote:last-child {
  margin-bottom: 0 !important;
}

.tet-comment-modal__content ul,
.tet-comment-modal__content ol {
  margin: 0 0 12px 24px !important;
  padding: 0 !important;
}

.tet-comment-modal__content a,
.tet-comment-modal__content a:visited {
  color: #1d4f78 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.tet-comment-modal__content [style] {
  color: #2b2b2b !important;
  background: transparent !important;
  background-color: transparent !important;
  white-space: normal !important;
  max-width: 100% !important;
}

.tet-comment-modal__content img {
  display: block;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  margin: 16px 0;
  border-radius: 4px;
}

.tet-comment-modal__content figure {
  display: block;
  max-width: 100% !important;
  margin: 16px 0 !important;
}

.tet-comment-modal__content figcaption {
  margin-top: 7px;
  font-size: 0.94em;
  line-height: 1.35;
  color: #5a5a5a !important;
}

.tet-comment-modal__content table {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  overflow-x: auto;
}

.tet-comment-modal__content td,
.tet-comment-modal__content th {
  padding: 7px 9px;
  color: #2b2b2b !important;
  background: transparent !important;
  border: 1px solid #d5d5d5 !important;
  white-space: normal !important;
}

.tet-comment-modal__content .align-left {
  float: left;
  margin: 8px 18px 10px 0;
}

.tet-comment-modal__content .align-right {
  float: right;
  margin: 8px 0 10px 18px;
}

.tet-comment-modal__content::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 700px) {
  .tet-comment-modal {
    padding: 10px;
  }

  .tet-comment-modal__dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .tet-comment-modal__header {
    padding: 16px 56px 13px 16px;
  }

  .tet-comment-modal__body {
    padding: 16px;
  }

  .tet-comment-modal__content {
    font-size: 1rem;
    line-height: 1.45;
  }

  .tet-comment-modal__content .align-left,
  .tet-comment-modal__content .align-right {
    float: none;
    margin: 14px 0;
  }
}


.tet-comment-modal__close:focus-visible,
.tet-comment-modal__content a:focus-visible {
  outline-color: #1d4f78;
}
