/**
 * Clinica Dental Centro - V5 editorial structure.
 *
 * This final layer removes repeated visual sections, gives treatment pages a
 * recognisable photographic composition and keeps every real treatment route
 * available from the hub.
 */

/* Put a human, local-looking scene first in the three-image Home slideshow;
 * the third frame remains a real photograph of the clinic. */
body.cdc-v5.cdc-v4-home #page-container
  .cdc-home-hero-slideshow__image[data-slide="1"] {
  background-image: url("../images/odontologia-familiar-la-roda-v5.webp") !important;
  background-position: center 46% !important;
}

body.cdc-v5.cdc-v4-home #page-container
  .cdc-home-hero-slideshow__image[data-slide="3"] {
  background-image: url("https://clinicacentrolaroda.com/wp-content/uploads/2021/04/73T6837.avif") !important;
  background-position: center 52% !important;
}

/* Editorial pruning: these sections repeat promises, contact details or
 * process content that is already present in the retained sequence/footer. */
body.cdc-v5.cdc-v4-home #page-container :is(.et_pb_section_2, .et_pb_section_5, .et_pb_section_9),
body.cdc-v5.cdc-v4-clinic #page-container .et_pb_section_7,
body.cdc-v5.cdc-v4-contact #page-container .et_pb_section_4 {
  display: none !important;
}

/* The four auxiliary Home cards are not treatment destinations and repeated
 * information already explained in the retained diagnostic/first-visit area. */
body.cdc-v5.cdc-v4-home #page-container .et_pb_section_4
  :is(.et_pb_text_20, .et_pb_text_21, .et_pb_text_22, .et_pb_text_23) {
  display: none !important;
}

/* Treatments hub: keep the twelve real landing pages and remove four helper
 * cards whose links only returned to the same page. */
body.cdc-v5.cdc-v4-treatments #page-container .et_pb_section_2 .et_pb_row_2
  :is(.et_pb_text_19, .et_pb_text_20, .et_pb_text_21, .et_pb_text_22) {
  display: none !important;
}

body.cdc-v5.cdc-v4-treatments #page-container .et_pb_section_2 .et_pb_row_2
  .et_pb_text[data-cdc-category] h3[data-cdc-category]::before {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(103, 192, 193, .16);
  color: var(--cdc-v4-deep);
  content: attr(data-cdc-category);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .075em;
  line-height: 1.1;
  text-transform: uppercase;
}

body.cdc-v5.cdc-v4-treatments #page-container .et_pb_section_2 .et_pb_row_2
  .et_pb_text[data-cdc-category] {
  min-height: 216px;
}

/* Individual treatment hero: one calm information card plus one strong,
 * treatment-relevant photograph. The section no longer repeats the same photo
 * behind and inside a nearly full-width white panel. */
body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child {
  min-height: 0 !important;
  padding: clamp(50px, 5vw, 74px) 0 !important;
  background:
    radial-gradient(circle at 88% 18%, rgba(103, 192, 193, .28), transparent 28%),
    linear-gradient(135deg, var(--cdc-v4-ink) 0%, #164e5b 52%, var(--cdc-v4-deep) 100%) !important;
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr);
  gap: 24px;
  width: min(calc(100% - var(--cdc-v4-layout-gutter) - var(--cdc-v4-layout-gutter)), 1180px) !important;
  max-width: 1180px !important;
  min-height: 570px;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row::before,
body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row::after {
  display: none !important;
  content: none !important;
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column {
  width: 100% !important;
  min-width: 0 !important;
  height: 100%;
  margin: 0 !important;
  float: none !important;
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:first-child {
  display: flex !important;
  padding: clamp(38px, 4.5vw, 58px) !important;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 32px;
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: 0 28px 70px rgba(4, 28, 35, .26);
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:last-child {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 32px;
  background: var(--cdc-v4-mist);
  box-shadow: 0 28px 70px rgba(4, 28, 35, .24);
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:last-child
  :is(.et_pb_image, .et_pb_image_wrap, img) {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 570px;
  margin: 0 !important;
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:last-child
  :is(.et_pb_image, .et_pb_image_wrap) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:last-child img {
  object-fit: cover !important;
  object-position: center !important;
}

body.cdc-v5.cdc-v4-treatment #page-container
  .et_builder_inner_content > .et_pb_section:first-child .et_pb_text:has(h1) h1 {
  max-width: 13ch !important;
  font-size: clamp(2.55rem, 3.65vw, 3.8rem) !important;
  line-height: 1.02 !important;
}

body.cdc-v5.cdc-v4-treatment #page-container .et_pb_section_1 > .et_pb_row_1 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
  max-width: 1060px !important;
}

body.cdc-v5.cdc-v4-treatment #page-container .et_pb_section_1
  :is(.et_pb_text_1, .et_pb_text_2, .et_pb_text_3, .et_pb_text_4,
      .et_pb_text_5, .et_pb_text_10, .et_pb_text_11) {
  grid-column: auto !important;
}

body.cdc-v5.cdc-v4-treatment #page-container .et_pb_section_1 .et_pb_text_12 {
  grid-column: 1 / -1 !important;
}

/* Divi's per-page presets mark this module as both light and dark. Keep the
 * text explicitly legible on the retained corporate panel. */
html body.cdc-v5.cdc-v4.cdc-v4-treatment #page-container .et_builder_inner_content
  > .et_pb_section.et_pb_section_2 > .et_pb_row.et_pb_row_2
  .et_pb_text.et_pb_text_13 h2 {
  color: #ffffff !important;
}

html body.cdc-v5.cdc-v4.cdc-v4-treatment #page-container .et_builder_inner_content
  > .et_pb_section.et_pb_section_2 > .et_pb_row.et_pb_row_2
  .et_pb_text.et_pb_text_13 p {
  color: rgba(255, 255, 255, .86) !important;
}

body.cdc-v5.cdc-v4-treatment #page-container .et_pb_section_3 .et_pb_toggle_open {
  border-color: var(--cdc-v4-deep) !important;
  background: linear-gradient(145deg, var(--cdc-v4-deep), var(--cdc-v4-ink)) !important;
}

html body.cdc-v5.cdc-v4-treatment #page-container .et_pb_section_3
  .et_pb_toggle_open :is(.et_pb_toggle_title, .et_pb_toggle_content, p) {
  color: #ffffff !important;
}

@media (min-width: 981px) {
  body.cdc-v5.cdc-v4-treatments #page-container .et_pb_section_2 .et_pb_row_2 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
}

@media (max-width: 980px) {
  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:last-child
    :is(.et_pb_image, .et_pb_image_wrap, img) {
    min-height: 340px;
    height: 340px !important;
  }
}

@media (max-width: 767px) {
  body.cdc-v5.cdc-v4-home #page-container
    .cdc-home-hero-slideshow__image[data-slide="1"] {
    background-position: 64% center !important;
  }

  body.cdc-v5.cdc-v4-treatments #page-container .et_pb_section_2 .et_pb_row_2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body.cdc-v5.cdc-v4-treatments #page-container .et_pb_section_2 .et_pb_row_2
    .et_pb_text[data-cdc-category] {
    min-height: 0 !important;
    padding: 18px 20px 58px !important;
  }

  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child {
    padding: 30px 0 38px !important;
  }

  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row {
    width: calc(100% - 36px) !important;
    gap: 14px;
  }

  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:first-child {
    padding: 30px 24px !important;
    border-radius: 24px;
  }

  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:last-child {
    border-radius: 24px;
  }

  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child > .et_pb_row > .et_pb_column:last-child
    :is(.et_pb_image, .et_pb_image_wrap, img) {
    min-height: 240px;
    height: 240px !important;
  }

  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child .et_pb_text:has(h1) h1 {
    max-width: none !important;
    font-size: clamp(2rem, 9vw, 2.45rem) !important;
    line-height: 1.05 !important;
  }

  body.cdc-v5.cdc-v4-treatment #page-container .et_pb_section_1 > .et_pb_row_1 {
    grid-template-columns: 1fr !important;
  }

  body.cdc-v5.cdc-v4-treatment #page-container .et_pb_section_1 .et_pb_text_12 {
    grid-column: auto !important;
  }
}

@media (max-width: 390px) {
  body.cdc-v5.cdc-v4-treatment #page-container
    .et_builder_inner_content > .et_pb_section:first-child .et_pb_text:has(h1) h1 {
    font-size: clamp(1.82rem, 8.4vw, 2.15rem) !important;
    overflow-wrap: anywhere;
  }
}
