/* -------------------------------------------------------------------------- */
/* Albums (liste)                                                             */
/* -------------------------------------------------------------------------- */

.ameptmg-wrap {
  display: grid;
  gap: 28px;
}

.ameptmg-wrap--albums {
  gap: 1.1rem;
}

/* Defaults proches du thème (override-friendly) */
:where(.ameptmg-wrap, .ameptmg-albums, .ameptmg-album-single) {
  --ameptmg-surface: rgba(255, 255, 255, 0.94);
  --ameptmg-surface-strong: rgba(255, 255, 255, 0.97);
  --ameptmg-border: rgba(226, 232, 240, 0.92);
  --ameptmg-text: rgba(15, 23, 42, 0.92);
  --ameptmg-muted: rgba(15, 23, 42, 0.68);
  --ameptmg-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  --ameptmg-shadow-hover: 0 18px 48px rgba(15, 23, 42, 0.16);
  --ameptmg-border-hover: rgba(148, 163, 184, 0.65);
  --ameptmg-focus: rgba(26, 136, 85, 0.38);
}

/* -------------------------------------------------------------------------- */
/* Galeries (liste) : style proche des cards d’articles                        */
/* -------------------------------------------------------------------------- */

.ameptmg-wrap--galleries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 992px) {
  .ameptmg-wrap--galleries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ameptmg-wrap--galleries {
    grid-template-columns: 1fr;
  }
}

.ameptmg-wrap--galleries .ameptmg-item {
  background: var(--ameptmg-surface-strong);
  border-radius: var(--radius-xl, 1.6rem);
  overflow: hidden;
  box-shadow: var(--ameptmg-shadow);
  border: 1px solid var(--ameptmg-border);
  transform: translateZ(0);
  transition: transform var(--transition-fast, 140ms), box-shadow var(--transition-fast, 140ms), border-color var(--transition-fast, 140ms);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ameptmg-wrap--galleries .ameptmg-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--ameptmg-shadow-hover);
  border-color: var(--ameptmg-border-hover);
}

.ameptmg-wrap--galleries .ameptmg-item:focus-within {
  outline: 3px solid var(--ameptmg-focus);
  outline-offset: 4px;
}

/* En liste, on affiche 1 “image de couverture” comme une card d’article */
.ameptmg-wrap--galleries .ameptmg-grid {
  order: -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.ameptmg-wrap--galleries .ameptmg-grid > a.ameptmg-card {
  display: none;
}

.ameptmg-wrap--galleries .ameptmg-grid > a.ameptmg-card:first-child {
  display: block;
}

.ameptmg-wrap--galleries .ameptmg-card {
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: linear-gradient(135deg, rgba(26, 136, 85, 0.20), rgba(246, 196, 83, 0.20));
}

.ameptmg-wrap--galleries .ameptmg-card::after {
  display: none;
}

.ameptmg-wrap--galleries .ameptmg-img {
  aspect-ratio: 16 / 10;
}

.ameptmg-wrap--galleries .ameptmg-title {
  margin: 0;
  padding: 1rem 1rem 1.1rem;
  font-size: 1.08rem;
  line-height: 1.3;
  font-weight: 900;
  color: var(--ameptmg-text);
}

/* Les embeds vidéo rendent la liste trop lourde : on garde la vidéo pour les pages détail */
.ameptmg-wrap--galleries .ameptmg-videos {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .ameptmg-wrap--galleries .ameptmg-item {
    transition: none;
  }

  .ameptmg-wrap--galleries .ameptmg-item:hover {
    transform: none;
  }
}

/* -------------------------------------------------------------------------- */
/* Bannière (hero)                                                           */
/* -------------------------------------------------------------------------- */

.ameptmg-hero {
  border-radius: var(--radius-xl, 1.6rem);
  overflow: hidden;
  border: 1px solid var(--ameptmg-border);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(240, 138, 36, 0.12));
  box-shadow: var(--ameptmg-shadow);
  position: relative;
}

.ameptmg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--ameptmg-hero-bg, none);
  background-size: cover;
  background-position: center;
  opacity: 0.52;
  filter: saturate(1.03) contrast(1.03);
}

.ameptmg-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 20% 10%, rgba(255, 255, 255, 0.90), rgba(255, 255, 255, 0.15) 55%),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.22));
}

.ameptmg-hero__inner {
  position: relative;
  z-index: 1;
  padding: clamp(1.1rem, 2.2vw, 1.6rem);
}

.ameptmg-hero__title {
  margin: 0;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: rgba(15, 23, 42, 0.92);
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
}

.ameptmg-hero__subtitle {
  margin: 0.5rem 0 0;
  color: rgba(15, 23, 42, 0.74);
  font-weight: 750;
  max-width: 70ch;
}

.ameptmg-albums {
  display: grid;
  grid-template-columns: repeat(var(--ameptmg-cols, 3), minmax(0, 1fr));
  gap: 1.15rem;
  align-items: stretch;
}

@media (max-width: 992px) {
  .ameptmg-albums {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ameptmg-albums {
    grid-template-columns: 1fr;
  }
}

.ameptmg-album {
  display: block;
  text-decoration: none;
  border-radius: var(--radius-xl, 1.6rem);
  overflow: hidden;
  background: var(--ameptmg-surface);
  border: 1px solid var(--ameptmg-border);
  box-shadow: var(--ameptmg-shadow);
  transform: translateZ(0);
  transition: transform var(--transition-fast, 140ms), box-shadow var(--transition-fast, 140ms), border-color var(--transition-fast, 140ms);
  position: relative;
  color: inherit;
}

.ameptmg-album:focus-visible {
  outline: 3px solid var(--ameptmg-focus);
  outline-offset: 4px;
}

.ameptmg-album:hover {
  border-color: var(--ameptmg-border-hover);
  box-shadow: var(--ameptmg-shadow-hover);
  transform: translateY(-3px);
}

.ameptmg-album-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(240, 138, 36, 0.10));
  position: relative;
}

.ameptmg-album-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);
  transition: transform var(--transition-fast, 140ms), filter var(--transition-fast, 140ms);
}

.ameptmg-album:hover .ameptmg-album-cover {
  transform: scale(1.04);
  filter: saturate(1.03) contrast(1.03);
}

.ameptmg-album-cover--empty {
  width: 100%;
  height: 100%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 7l1.5-2h3L15 7' stroke='%230f172a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.5 7h11A2.5 2.5 0 0 1 20 9.5v8A2.5 2.5 0 0 1 17.5 20h-11A2.5 2.5 0 0 1 4 17.5v-8A2.5 2.5 0 0 1 6.5 7Z' stroke='%230f172a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z' stroke='%230f172a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/54px 54px no-repeat,
    radial-gradient(650px 260px at 30% 10%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.35)),
    linear-gradient(135deg, rgba(26, 136, 85, 0.18), rgba(20, 184, 166, 0.16));
}

/* -------------------------------------------------------------------------- */
/* Album (détail) : galerie images + vidéos                                   */
/* -------------------------------------------------------------------------- */

.ameptmg-album-single {
  display: grid;
  gap: 0.9rem;
}

.ameptmg-album-meta {
  padding: 0.95rem 1rem 1.05rem;
}

.ameptmg-album-title {
  font-weight: 950;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ameptmg-text);
  font-size: 1.08rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.ameptmg-album-sub {
  margin-top: 0.35rem;
  color: var(--ameptmg-muted);
  font-weight: 750;
  font-size: 0.92rem;
}

.ameptmg-album-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  .ameptmg-album,
  .ameptmg-album-cover {
    transition: none;
  }

  .ameptmg-album:hover {
    transform: none;
  }

  .ameptmg-album:hover .ameptmg-album-cover {
    transform: none;
  }
}

.ameptmg-title {
  margin: 0 0 0.25rem;
  font-weight: 950;
  letter-spacing: -0.02em;
  color: var(--ameptmg-text);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}

.ameptmg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.ameptmg-card {
  display: block;
  border-radius: 1.05rem;
  overflow: hidden;
  background: var(--ameptmg-surface);
  border: 1px solid var(--ameptmg-border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  transform: translateZ(0);
  transition: transform var(--transition-fast, 140ms), box-shadow var(--transition-fast, 140ms), border-color var(--transition-fast, 140ms);
  position: relative;
}

.ameptmg-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(500px 240px at 70% 20%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.00) 60%);
  opacity: 0;
  transition: opacity var(--transition-fast, 140ms);
}

.ameptmg-card:hover {
  border-color: var(--ameptmg-border-hover);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.ameptmg-card:hover::after {
  opacity: 1;
}

.ameptmg-card:focus-visible {
  outline: 3px solid var(--ameptmg-focus);
  outline-offset: 4px;
}

.ameptmg-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.ameptmg-videos {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

@media (max-width: 640px) {
  .ameptmg-videos {
    grid-template-columns: 1fr;
  }
}

.ameptmg-video {
  border-radius: var(--radius-lg, 1.2rem);
  overflow: hidden;
  background: var(--ameptmg-surface);
  border: 1px solid var(--ameptmg-border);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.08));
}

/* WP video shortcode ajoute souvent un wrapper .wp-video */
.ameptmg-video :where(iframe, video, .wp-video, .mejs-container) {
  width: 100%;
  max-width: 100%;
  max-height: 360px;
}

.ameptmg-video iframe,
.ameptmg-video video {
  width: 100%;
  max-width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 360px;
  background: rgba(15, 23, 42, 0.04);
}

/* MediaElement.js wrapper: keep it visible and responsive */
.ameptmg-video .mejs-container,
.ameptmg-video .wp-video {
  width: 100% !important;
  max-width: 100% !important;
}

/* -------------------------------------------------------------------------- */
/* Lightbox / Slider                                                         */
/* -------------------------------------------------------------------------- */

body.ameptmg-lightbox-open {
  overflow: hidden;
}

.ameptmg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.ameptmg-lightbox[aria-hidden="true"] {
  display: none;
}

.ameptmg-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(2px);
}

.ameptmg-lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: min(86vh, 980px);
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-xl, 1.6rem);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.ameptmg-lightbox__figure {
  margin: 0;
  display: grid;
  gap: 0.6rem;
  justify-items: center;
}

.ameptmg-lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 1.05rem;
  background: rgba(15, 23, 42, 0.04);
}

.ameptmg-lightbox__caption {
  color: rgba(15, 23, 42, 0.78);
  font-weight: 750;
  text-align: center;
  max-width: 90ch;
}

.ameptmg-lightbox__close {
  position: absolute;
  right: 0.6rem;
  top: 0.55rem;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.86);
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--transition-fast, 140ms), box-shadow var(--transition-fast, 140ms);
}

.ameptmg-lightbox__close:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.ameptmg-lightbox__nav {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.86);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--transition-fast, 140ms), box-shadow var(--transition-fast, 140ms);
}

.ameptmg-lightbox__nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.ameptmg-lightbox :where(button):focus-visible {
  outline: 3px solid rgba(26, 136, 85, 0.38);
  outline-offset: 4px;
}

@media (max-width: 640px) {
  .ameptmg-lightbox {
    padding: 0.75rem;
  }

  .ameptmg-lightbox__panel {
    grid-template-columns: 44px 1fr 44px;
    padding: 0.65rem;
  }

  .ameptmg-lightbox__img {
    max-height: 68vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ameptmg-lightbox__close,
  .ameptmg-lightbox__nav {
    transition: none;
  }

  .ameptmg-lightbox__close:hover,
  .ameptmg-lightbox__nav:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .ameptmg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ameptmg-img {
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ameptmg-card,
  .ameptmg-card::after {
    transition: none;
  }

  .ameptmg-card:hover {
    transform: none;
  }
}