/* ==========================================================
   PN — Archive Sites & Lieux
   Scope uniquement : /lieux/
   ========================================================== */

.post-type-archive-lieux .pn-hero-agenda {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: linear-gradient(
    to top,
    rgba(17,17,17,0.90) 0%,
    rgba(17,17,17,0.60) 35%,
    rgba(17,17,17,0.25) 65%,
    rgba(17,17,17,0.00) 100%
  );
}

.post-type-archive-lieux .pn-hero-agenda .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .7;
  z-index: 0;
}

.post-type-archive-lieux .pn-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  max-width: 1000px;
}

.post-type-archive-lieux .pn-hero-box {
  background: rgba(0,0,0,.7);
  padding: 2rem;
}

.post-type-archive-lieux .pn-hero-title {
  margin: 0 0 1rem;
  line-height: 1.2;
  font-weight: 800;
  font-size: 2.8rem;
}

.post-type-archive-lieux .pn-hero-title .y {
  color: #f8d94a;
}

.post-type-archive-lieux .pn-hero-title .w {
  color: #fff;
}

.post-type-archive-lieux .pn-hero-sub {
  font-size: 1.1rem;
  color: #f5f5f5;
  margin: 0;
}

/* Layout */
.post-type-archive-lieux .pn-agenda-layout {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 28px;
  align-items: start;
  padding: 18px 16px;
}

.post-type-archive-lieux .pn-agenda-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
}

/* Filtres */
.post-type-archive-lieux .pn-agenda-filters {
  display: grid;
  grid-template-columns: 1fr;
  border-left: 4px solid #759739;
  background: rgba(249,249,249,.8);
  padding: 12px;
  border-radius: 0 20px 0 0;
}

.post-type-archive-lieux .pn-agenda-filters > div {
  position: relative;
  padding-bottom: 0;
  margin-bottom: 0;
}

.post-type-archive-lieux .pn-agenda-filters > div > label {
  display: block;
  margin: 0 0 10px;
  line-height: 1.2;
  font-weight: 600;
  color: #759739;
}

.post-type-archive-lieux .pn-agenda-filters input[type="search"],
.post-type-archive-lieux .pn-agenda-filters input[type="number"],
.post-type-archive-lieux .pn-agenda-filters select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
}

.post-type-archive-lieux .pn-checklist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid rgba(117,153,57,.3);
  margin-top: 8px;
  padding-top: 8px;
}

.post-type-archive-lieux .pn-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}

.post-type-archive-lieux .pn-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #374151;
}

.post-type-archive-lieux .pn-badge {
  margin-left: auto;
  background: #e5f0d4;
  color: #46621e;
  font-weight: 700;
  font-size: .75rem;
  line-height: 1;
  border-radius: 999px;
  padding: 3px 8px;
  min-width: 22px;
  text-align: center;
}

/* Header liste / carte */
.post-type-archive-lieux .pn-agenda-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.post-type-archive-lieux .pn-btn-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  text-align: center;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 12px 18px;
  color: #fff !important;
  background: #759739 !important;
}

.post-type-archive-lieux .pn-btn-toggle.active {
  background: #1f2937 !important;
}

.post-type-archive-lieux .pn-result-count {
  margin: 0 0 12px;
  font-weight: 700;
  color: #374151;
  font-size: 1rem;
}

.post-type-archive-lieux .pn-result-count em {
  font-style: normal;
  color: #759739;
}

/* Cards */
.post-type-archive-lieux .pn-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.post-type-archive-lieux .pn-card {
  border: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.post-type-archive-lieux .pn-card figure {
  margin: 0;
  line-height: 0;
}

.post-type-archive-lieux .pn-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  height: auto;
}

.post-type-archive-lieux .pn-card .pn-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.post-type-archive-lieux .pn-card h3 {
  margin: 0 0 8px;
}

.post-type-archive-lieux .pn-card h3 a {
  color: #000;
  text-decoration: none;
  font-weight: 700;
}

.post-type-archive-lieux .excerpt-text {
  margin: .35rem 0 0;
  font-size: .9rem;
  line-height: 1.5;
  color: #374151;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-type-archive-lieux .readmore {
  align-self: flex-start;
  margin-top: 8px;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  color: #759739;
}

.post-type-archive-lieux .meta {
  margin-top: auto;
  font-size: .75rem;
  color: #777;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 6px 10px;
  background: #f8f8f7;
}

/* Carte */
.post-type-archive-lieux #pn-map {
  width: 100%;
  height: 1000px;
  border-radius: 10px;
  overflow: hidden;
}

.post-type-archive-lieux .pn-hidden {
  display: none !important;
}

/* Plein écran carte */
.post-type-archive-lieux #pn-map:fullscreen,
.post-type-archive-lieux #pn-map:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Mobile */
@media (max-width: 1024px) {
  .post-type-archive-lieux .pn-agenda-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .post-type-archive-lieux .pn-agenda-sidebar,
  .post-type-archive-lieux .pn-agenda-header {
    display: none !important;
  }

  .post-type-archive-lieux .pn-mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    z-index: 1000;
  }

  .post-type-archive-lieux .pn-mobile-bar button {
    flex: 1;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    color: #fff;
    background: #759739;
  }

  .post-type-archive-lieux .pn-mobile-bar button.secondary {
    background: #1f2937;
  }

  .post-type-archive-lieux #pn-map {
    height: 500px;
  }
}

@media (max-width: 640px) {
  .post-type-archive-lieux .pn-hero-agenda {
    min-height: 260px;
    padding: 1.5rem 1rem;
  }

  .post-type-archive-lieux .pn-hero-box {
    padding: 1rem;
  }

  .post-type-archive-lieux .pn-hero-title {
    font-size: 1.6rem;
  }

  .post-type-archive-lieux .pn-hero-sub {
    font-size: .95rem;
  }

  .post-type-archive-lieux #pn-map {
    height: 420px;
  }
}

@media (min-width: 1024px) {
  .post-type-archive-lieux .pn-hero-agenda + .ast-container {
    margin-top: -200px !important;
    position: relative;
    z-index: 20;
  }

  .post-type-archive-lieux .pn-agenda-layout > main {
    padding-top: 0 !important;
    margin-top: 0px !important;
    position: relative;
    z-index: 30;
  }
}

/* Correction largeur contenu archive lieux */
.post-type-archive-lieux .pn-agenda-layout > main {
  width: 100%;
  min-width: 0;
}

/* Neutraliser les styles Astra sur les cards lieux */
.post-type-archive-lieux .pn-card.ast-grid-common-col,
.post-type-archive-lieux .pn-card.ast-full-width,
.post-type-archive-lieux .pn-card.ast-article-post {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  display: flex !important;
}

/* Forcer une vraie grille de fiches */
.post-type-archive-lieux .pn-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  width: 100%;
}

/* Corriger image carte */
.post-type-archive-lieux .pn-card figure {
  width: 100%;
  margin: 0;
}

.post-type-archive-lieux .pn-card figure a {
  display: block;
  width: 100%;
}

.post-type-archive-lieux .pn-card img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* Corriger contenu carte */
.post-type-archive-lieux .pn-card .pn-body {
  width: 100%;
  padding: 14px;
}

@media (max-width: 1024px) {
  .post-type-archive-lieux .pn-filter-panel {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    background: #fff !important;
    overflow-y: auto !important;
    padding: 0 !important;
  }

  .post-type-archive-lieux .pn-filter-panel.pn-hidden {
    display: none !important;
  }

  .post-type-archive-lieux .pn-filter-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #759739;
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .post-type-archive-lieux .pn-filter-header h3 {
    margin: 0;
    color: #fff;
  }

  .post-type-archive-lieux #pn-filter-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    padding: 0;
  }

  .post-type-archive-lieux .pn-filter-panel .pn-agenda-filters {
    margin: 0;
    border-left: 0;
    border-radius: 0;
    padding: 16px;
  }

  body.pn-no-scroll {
    overflow: hidden !important;
  }
}

/* ==================================================
   SINGLE LIEU — BLOCS RELATIONNELS
   Articles liés / Lieux proches / Agenda / Produits
   ================================================== */

.single-lieux .pn-lieu-related {
  margin: 50px 0;
}

.single-lieux .pn-lieu-related h2 {
  font-size: 1.55rem;
  margin-bottom: 22px;
  font-weight: 700;
  line-height: 1.3;
  border-bottom: 3px solid #759739;
  padding-bottom: 8px;
}

.single-lieux .pn-lieu-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.single-lieux .pn-lieu-related-card {
  background: #ffffff;
  border: 1px solid #ececec;
  transition: transform 0.25s ease;
}

.single-lieux .pn-lieu-related-card:hover {
  transform: translateY(-3px);
}

.single-lieux .pn-lieu-related-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.single-lieux .pn-lieu-related-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}

.single-lieux .pn-lieu-related-card h3 {
  font-size: 1rem;
  line-height: 1.4;
  padding: 14px;
  margin: 0;
  font-weight: 600;
}

@media (max-width: 900px) {
  .single-lieux .pn-lieu-related-grid {
    display: flex;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
  }

  .single-lieux .pn-lieu-related-card {
    min-width: 260px;
    flex-shrink: 0;
    scroll-snap-align: start;
  }

  .single-lieux .pn-lieu-related-grid::-webkit-scrollbar {
    height: 6px;
  }
}
