/* ============================================================
   CM PD WIDGETS
   ============================================================ */

/* Esconde elementos Alpine antes de inicializar */
[x-cloak] {
  display: none !important;
}

/* ============================================================
   ACCORDION — PÁGINA SOBRE
   ============================================================ */
.cm-pd-accordion-item {
  margin-bottom: 10px;
}

.cm-pd-accordion-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  gap: 3rem;
  padding: 2rem 1rem;
}

.cm-pd-description {
  margin-top: 1rem;
}

.cm-pd-main-image {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.35s ease,
    opacity 0.35s ease;
  opacity: 0;
  width: 100%;
  max-width: 360px !important;
}

.cm-pd-wrapper-number {
  width: 7%;
}

.cm-pd-wrapper-main-image {
  display: flex;
  justify-content: flex-end;
  width: 35%;
}

.cm-pd-wrapper-button {
  position: absolute;
  top: 1.8rem;
  right: 0;
  width: fit-content;
}

.cm-pd-content {
  width: 50%;
  margin-top: 1.5rem;
}

.cm-pd-partners {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.35s ease;
  pointer-events: none;
}

.cm-pd-partners p {
  margin: 0;
}

.cm-pd-logos {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.cm-pd-partners a img {
  width: 100%;
  min-width: 70px;
  max-width: 70px;
}

.cm-pd-toggle,
.cm-pd-toggle:hover,
.cm-pd-toggle:focus {
  all: unset;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media only screen and (max-width: 569px) {
  .cm-pd-accordion-header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
  }

  .cm-pd-wrapper-main-image {
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .cm-pd-wrapper-number,
  .cm-pd-wrapper-main-image,
  .cm-pd-content {
    width: 100%;
  }

  /* .cm-pd-wrapper-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: fit-content;
  } */
}

/* ============================================================
   ACCORDION — INICIATIVAS NACIONAIS
   ============================================================ */
.cm-pd-nacional-init-accordion-item {
  margin-bottom: 10px;
}

.cm-pd-nacional-init-accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  gap: 3rem;
  padding: 2rem 1rem;
  position: relative;
}

.cm-pd-nacional-init-wrapper-number {
  width: 40%;
}

.cm-pd-nacional-init-content {
  width: 60%;
}

.cm-pd-nacional-init-wrapper-button {
  position: absolute;
  top: 2rem;
  right: 0;
  width: fit-content;
}

.cm-pd-nacional-init-content h3 {
  margin-bottom: 1rem;
}

.cm-pd-nacional-init-description {
  max-height: 5em;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.cm-pd-nacional-init-description.is-open {
  max-height: 2000px;
  transition: max-height 0.7s ease;
}

.cm-pd-nacional-init-toggle,
.cm-pd-nacional-init-toggle:hover,
.cm-pd-nacional-init-toggle:focus {
  all: unset;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media only screen and (max-width: 769px) {
  .cm-pd-nacional-init-accordion-header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
  }

  .cm-pd-nacional-init-wrapper-number,
  .cm-pd-nacional-init-content {
    width: 100%;
  }

  /* .cm-pd-nacional-init-wrapper-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: fit-content;
  } */
}

/* ============================================================
   OVERLAY CARD
   ============================================================ */
.cm-pd-overlay-card {
  position: relative;
  width: 100%;
  min-height: 700px;
  overflow: hidden;
}

.cm-pd-overlay-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 1;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.cm-pd-overlay-card-bg.hidden {
  opacity: 0;
}

.cm-pd-overlay-card-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50%;
  height: 200px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition:
    width 0.5s ease-in-out,
    height 0.5s ease-in-out,
    background-color 0.3s ease;
  z-index: 2;
}

.cm-pd-overlay-card-overlay.expanded {
  width: 100%;
  height: 100%;
  min-height: 600px;
  justify-content: center;
  padding: 1.5rem;
}

.cm-pd-overlay-card-title {
  width: 100%;
  max-width: 85%;
  margin-bottom: 1rem;
}

.cm-pd-overlay-card-description {
  margin-top: 1rem;
  overflow: hidden;
}

.cm-pd-overlay-card-toggle,
.cm-pd-overlay-card-toggle:hover,
.cm-pd-overlay-card-toggle:focus {
  all: unset;
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  z-index: 3;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1024px) {
  .cm-pd-overlay-card-overlay {
    width: 100%;
  }
}

/* ============================================================
   CARD EXPANDÍVEL
   ============================================================ */
.elementor-widget-cm_pd_expandable_card {
  width: 100%;
}

.cm-pd-expandable-card {
  position: relative;
  width: 100%;
  min-width: 300px;
  min-height: 600px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.cm-pd-expandable-box {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60%;
  padding: 1.2rem;
  display: grid;
  grid-template-rows: auto 0fr auto;
  transition: grid-template-rows 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cm-pd-expandable-box.expanded {
  grid-template-rows: auto 1fr auto;
}

.cm-pd-expandable-description {
  overflow: hidden;
}

.cm-pd-expandable-header {
  display: flex;
  height: 100%;
  min-height: 100px;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.3rem 0;
}

.cm-pd-expandable-toggle,
.cm-pd-expandable-toggle:hover,
.cm-pd-expandable-toggle:focus {
  all: unset;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  padding: 0.3rem 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

/* ============================================================
  SLIDER SECTION
  ============================================================ */

.cm-pd-slider-wrapper {
  width: 100%;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cm-pd-slider-container {
  width: 100%;
  max-width: 1400px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  padding: 1rem;
}

/* LEFT */
.cm-pd-slider-left {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.cm-pd-slider-section-title {
  max-width: 70%;
}

/* RIGHT */
.cm-pd-slider-right {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* STAGE */
.cm-pd-slider-stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 600px;
  min-height: 300px;
  max-height: 460px;
  aspect-ratio: 5 / 4;
  overflow: hidden;
}

/* SLIDE */
.cm-pd-slider-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SLIDE IMAGE */
.cm-pd-slider-slide-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 440px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cm-pd-slider-slide-image a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cm-pd-slider-slide-title {
  text-align: center;
  z-index: 2;
}

/* DOTS */
.cm-pd-slider-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cm-pd-slider-dot {
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.cm-pd-slider-dot.active {
  opacity: 1;
}

/* ============================================================
  CLASSES DE TRANSIÇÃO (para Alpine x-transition)
  ============================================================ */

/* Classe base de transição */
.transition {
  transition-property: opacity, transform;
}

.ease-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.duration-500 {
  transition-duration: 500ms;
}

.duration-400 {
  transition-duration: 400ms;
}

/* Opacidade */
.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

/* Movimento horizontal */
.translate-x {
  will-change: transform;
}

.translate-x-10 {
  transform: translateX(10%);
}

.-translate-x-10 {
  transform: translateX(-10%);
}

.translate-x-0 {
  transform: translateX(0);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .cm-pd-slider-container {
    padding: 0.8rem;
  }
}

@media (max-width: 569px) {
  .cm-pd-slider-container {
    flex-direction: column;
    text-align: center;
  }

  .cm-pd-slider-left,
  .cm-pd-slider-right {
    width: 100%;
  }

  .cm-pd-slider-section-title {
    max-width: 100%;
    padding: 2rem;
  }

  .cm-pd-slider-dots {
    justify-content: center;
  }
}

/* ============================================================
  RECENTS POSTS
  ============================================================ */
/* =====================================
   RESET IMPORTANTE
===================================== */
.cm-pd-recent-posts-section *,
.cm-pd-recent-posts-section *::before,
.cm-pd-recent-posts-section *::after {
  box-sizing: border-box;
}

/* =====================================
   SECTION FULL WIDTH
===================================== */
.cm-pd-recent-posts-section {
  width: 100%;
}

/* =====================================
   WRAPPER CENTRAL
===================================== */
.cm-pd-recent-posts-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1rem;

  display: flex;
  flex-direction: row;
  align-items: stretch; /* MESMA ALTURA */
  gap: 2rem;
}

/* =====================================
   COLUNAS 50 / 50
===================================== */
.cm-pd-recent-posts-left,
.cm-pd-recent-posts-right {
  flex: 1 1 50%;
  min-width: 0; /* CRUCIAL para evitar overflow */
  display: flex;
  flex-direction: column;
}

/* =====================================
   POST DE DESTAQUE
===================================== */
.cm-pd-recent-posts-highlight {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem;
}

.cm-pd-recent-posts-highlight-image-link {
  display: block;
  width: 100%;
}

/* =====================================
   GRID DIREITA
===================================== */
.cm-pd-recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;

  flex-grow: 1;
}

/* =====================================
   ARTIGOS GRID
===================================== */
.cm-pd-recent-post-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-bottom: 1px solid #ababab;
}

/* =====================================
   IMAGENS RESPONSIVAS (ISTO RESOLVE O TEU PROBLEMA)
===================================== */
.cm-pd-recent-posts-section img {
  width: 100%;
  height: auto;
  display: block;
}

/* Wrapper de ratio */
.cm-pd-image-ratio-wrapper {
  width: 100%;
  overflow: hidden;
}

.cm-pd-image-ratio-highlight,
.cm-pd-image-ratio-list {
  aspect-ratio: 16 / 9;
}

.cm-pd-image-ratio-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =====================================
   TEXTO NÃO PODE QUEBRAR LAYOUT
===================================== */
.cm-pd-recent-post-item-title,
.cm-pd-recent-posts-highlight-title {
  word-break: break-word;
}

.cm-pd-recent-post-item-content {
  overflow: hidden;
}

.cm-pd-wrapper-recent-posts-title-paginate {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cm-pd-recent-posts-right-title {
  width: max-content;
}

.cm-pd-recent-post-item-title {
  width: 100%;
  max-width: 80%;
}

.cm-pd-page-btn {
  border-radius: 0;
}

.cm-pd-pagination-wrapper.cm-pd-hidden {
  visibility: hidden;
}
.cm-pd-pagination-wrapper.cm-pd-ready {
  visibility: visible;
}
/* =====================================
   BREAKPOINT <= 1025px
===================================== */
@media (max-width: 1025px) {
  .cm-pd-recent-posts-wrapper {
    flex-direction: column;
  }

  .cm-pd-recent-posts-left,
  .cm-pd-recent-posts-right {
    flex: 1 1 100%;
  }
}

/* =====================================
   MOBILE EXTRA
===================================== */
@media (max-width: 640px) {
  .cm-pd-recent-posts-grid {
    grid-template-columns: 1fr;
  }
}
