/* ===================== Galeria Parque da Cidade (pdc_galeria) ===================== */
/* linha WPBakery que contém o elemento */
.pdcGaleriaSection { padding: 100px 0 110px; background: #fcfbf7; }
@media (max-width: 767px) { .pdcGaleriaSection { padding: 56px 0 64px; } }

/* o carrossel dos edifícios (.slide-center) saiu da homepage porque repetia a galeria:
   sem ele, a margem de 335px reservada por baixo do botão fica a mais.
   Se o carrossel voltar a ser posto, a margem original volta sozinha. */
body:not(:has(.slide-center)) .pdc-section .grid-imgs { margin-top: 100px; }
@media (max-width: 767px) { body:not(:has(.slide-center)) .pdc-section .grid-imgs { margin-top: 56px; } }

.pdc-gal {
  --gal-ink: #2f4a52;
  --gal-muted: #8b897f;
  --gal-line: #d9d5ca;
  --gal-accent: #396472;
  --gal-gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  color: var(--gal-ink);
}

/* ---------- cabeçalho ---------- */
.pdc-gal__head { text-align: center; margin-bottom: 34px; }

.pdc-gal__eyebrow {
  display: block;
  font-family: "Avenir", sans-serif;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gal-muted);
}

.pdc-gal__title {
  margin: 10px 0 26px;
  font-family: "BigCaslon", serif;
  font-weight: 400;
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1.05;
  color: var(--gal-ink);
}

.pdc-gal__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 34px;
}

.pdc-gal__tab {
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--gal-muted);
  font-family: "Avenir", sans-serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.pdc-gal__tab:hover,
.pdc-gal__tab:focus-visible { color: var(--gal-ink); outline: none; }
.pdc-gal__tab.is-on { color: var(--gal-ink); border-bottom-color: var(--gal-ink); }

/* ---------- mosaico (desktop): 1 grande + 4 pequenas ---------- */
.pdc-gal__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(170px, 19vw, 250px);
  gap: var(--gal-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdc-gal__item { position: relative; margin: 0; overflow: hidden; background: #ece9e1; }
.pdc-gal__item.is-big { grid-column: span 2; grid-row: span 2; }
.pdc-gal__item.is-off,
.pdc-gal__item.is-extra { display: none; }

.pdc-gal__link {
  position: absolute;
  inset: 0;
  display: block;
  color: #fff !important;
  text-decoration: none !important;
  cursor: zoom-in;
}

.pdc-gal__img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pdc-gal__link:hover .pdc-gal__img,
.pdc-gal__link:focus-visible .pdc-gal__img { transform: scale(1.04); }
.pdc-gal__link:focus-visible { outline: 2px solid var(--gal-accent); outline-offset: 3px; }

/* legenda: aparece ao passar o rato */
.pdc-gal__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 18px 14px;
  background: linear-gradient(to top, rgba(20, 30, 32, 0.55), rgba(20, 30, 32, 0));
  font-family: "Avenir", sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.pdc-gal__link:hover .pdc-gal__cap,
.pdc-gal__link:focus-visible .pdc-gal__cap { opacity: 1; transform: none; }

/* última peça do mosaico: "+12 fotografias" */
.pdc-gal__more { display: none; }
.pdc-gal__item.is-last .pdc-gal__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(32, 52, 58, 0.5);
  font-family: "BigCaslon", serif;
  font-size: clamp(22px, 2vw, 30px);
  transition: background-color 0.3s ease;
}
.pdc-gal__item.is-last .pdc-gal__more::before { content: attr(data-txt); }
.pdc-gal__item.is-last .pdc-gal__link:hover .pdc-gal__more { background: rgba(32, 52, 58, 0.62); }
.pdc-gal__item.is-last .pdc-gal__cap { display: none; }

/* ---------- rodapé ---------- */
.pdc-gal__foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin-top: 26px;
}

.pdc-gal__count {
  display: none;
  font-family: "Avenir", sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gal-muted);
}

.pdc-gal__btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 30px;
  background: var(--gal-accent);
  color: #fff !important;
  font-family: "Avenir", sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: filter 0.25s ease, transform 0.25s ease;
}
.pdc-gal__btn:hover { filter: brightness(0.9); transform: translateY(-1px); }

/* ---------- ecrã inteiro ---------- */
.pdc-gal__lb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 26, 28, 0.96);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.pdc-gal__lb[hidden] { display: none; }
.pdc-gal__lb.is-open { opacity: 1; }
html.pdc-gal-lock, html.pdc-gal-lock body { overflow: hidden; }

.pdc-gal__lb-fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  max-width: calc(100vw - 180px);
}

.pdc-gal__lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  transition: opacity 0.25s ease;
}
.pdc-gal__lb-img.is-loading { opacity: 0; }

.pdc-gal__lb-cap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding-top: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-family: "Avenir", sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.pdc-gal__lb-num { color: rgba(255, 255, 255, 0.55); white-space: nowrap; letter-spacing: 0.14em; }

.pdc-gal__lb-nav,
.pdc-gal__lb-close {
  position: absolute;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.pdc-gal__lb-nav:hover,
.pdc-gal__lb-close:hover,
.pdc-gal__lb-nav:focus-visible,
.pdc-gal__lb-close:focus-visible { border-color: #fff; background: rgba(255, 255, 255, 0.08); outline: none; }

.pdc-gal__lb-prev { left: 34px; top: 50%; margin-top: -26px; }
.pdc-gal__lb-next { right: 34px; top: 50%; margin-top: -26px; }
.pdc-gal__lb-nav::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  border-top: 1.5px solid #fff;
  border-left: 1.5px solid #fff;
}
.pdc-gal__lb-prev::before { transform: translate(-30%, -50%) rotate(-45deg); }
.pdc-gal__lb-next::before { transform: translate(-70%, -50%) rotate(135deg); }

.pdc-gal__lb-close { top: 24px; right: 34px; width: 46px; height: 46px; }
.pdc-gal__lb-close span,
.pdc-gal__lb-close span::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 1.5px;
  margin: -0.75px 0 0 -9px;
  background: #fff;
  transform: rotate(45deg);
}
.pdc-gal__lb-close span::after { content: ""; margin: 0; left: 0; transform: rotate(90deg); }

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .pdc-gal__lb-fig { max-width: calc(100vw - 40px); }
  .pdc-gal__lb-nav { top: auto; bottom: 22px; margin-top: 0; }
  .pdc-gal__lb-prev { left: calc(50% - 64px); }
  .pdc-gal__lb-next { right: calc(50% - 64px); }
  .pdc-gal__lb-img { max-height: calc(100vh - 200px); }
}

/* ---------- telemóvel: carrossel deslizante ---------- */
@media (max-width: 767px) {
  .pdc-gal { padding: 0; }
  .pdc-gal__head { padding: 0 20px; margin-bottom: 24px; }
  .pdc-gal__title { margin-bottom: 18px; }
  .pdc-gal__tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 24px;
    margin: 0 -20px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .pdc-gal__tabs::-webkit-scrollbar { display: none; }
  .pdc-gal__tab { flex: 0 0 auto; font-size: 12px; }

  .pdc-gal__grid {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .pdc-gal__grid::-webkit-scrollbar { display: none; }
  .pdc-gal__item,
  .pdc-gal__item.is-big { flex: 0 0 84%; aspect-ratio: 4 / 3; scroll-snap-align: start; }
  .pdc-gal__item.is-extra { display: block; }
  .pdc-gal__item.is-last .pdc-gal__more { display: none; }
  .pdc-gal__item.is-last .pdc-gal__cap { display: block; }
  .pdc-gal__cap { opacity: 1; transform: none; font-size: 12px; }
  .pdc-gal__count { display: block; }
  .pdc-gal__foot { margin-top: 18px; padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .pdc-gal *, .pdc-gal__lb { transition-duration: 0.01ms !important; }
}
