/* Gumz and More - design changes requested after conversion (config.json: "custom_css").
   Loaded last on every page. Divi breakpoints: tablet <= 980, phone <= 767.
   Pages are scoped by the body class WordPress already emits:
     body.home            homepage
     body.page-id-205     About
     body.et-tb-has-body  pages built on the sidebar template (service pages, Patient Resources) */


/* ===== ALL SCREENS ===== */

/* Service pages: the article sat in an inner row that Divi squeezes to 80% of its column,
   leaving a gap beside the text. Let it fill the column. */
body.et-tb-has-body .et_pb_post_content .et_pb_row {
  width: 100% !important;
  max-width: none !important;
}


/* Footer: Divi nudges the footer section 13px down (transform: translateY(13px)), which opens a
   white strip above its pink border line. */
body .et_pb_section_0_tb_footer.et_pb_section {
  transform: none !important;
}


body .et_pb_blurb_1_tb_footer {
  margin-top: 5px !important;
}


/* ===== DESKTOP >= 1200 ===== */

/* Nav: room between a dropdown item's label and its arrow */
@media (min-width: 1200px) {
  body .et_pb_menu .et-menu-nav > ul > li.menu-item-has-children > a:first-child {
    padding-right: 10px !important;
  }
}


/* ===== TABLET (HORIZONTAL) 981-1199 ===== */
@media (min-width: 981px) and (max-width: 1199px) {

  body #page-container .et_pb_section .et_pb_button_0_tb_header {
    font-size: 16px !important;
  }

  /* Nav: room between a dropdown item's label and its arrow */
  body .et_pb_menu .et-menu-nav > ul > li.menu-item-has-children > a:first-child {
    padding-right: 5px !important;
  }

  /* Footer: the tagline is a fixed 310px wide, wider than its column here, so it ran over the
     Quick Links column. Keep it inside its column. */
  body .et_pb_text_0_tb_footer.et_pb_module {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Header row: just under full width */
  body .et_pb_row_0_tb_header {
    max-width: 99% !important;
  }

  /* Header: with "Reach Out" gone from it, the nav takes the whole row */
  body .et_pb_column_0_tb_header {
    width: 100% !important;
  }
  body .et_pb_column_1_tb_header {
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Fixed "Reach Out" button: tighter to the corner */
  body .et_pb_button_0_tb_header_wrapper {
    left: 5px !important;
    bottom: 5px !important;
  }

  /* HOME - hero button */
  body.home .et_pb_button_0_wrapper {
    right: 24% !important;
  }

  /* HOME - the (hidden-on-desktop) carousel-arrow row is offset 538px to the right, past the
     edge of a 1024 screen: the page scrolled sideways. Keep it inside. */
  body.home .et_pb_row_12.et_pb_row {
    left: 0 !important;
  }

  /* HOME - Our Dentist copy: 70% wide. (Applied to this column only: the same width on every
     half-width column pushes the photo columns past the viewport and the page scrolls sideways.) */
  body.home .et_pb_row_3 > .et_pb_column_5 {
    width: 70% !important;
  }

  /* SERVICES - sidebar form: name and phone number each get their own row */
  body.et-tb-has-body .form-block {
    float: none !important;
    width: 100% !important;
  }

  /* HOME - Our Dentist: copy sits higher and further left, clear of the doctor's face */
  body.home .et_pb_section_3.et_pb_section {
    padding-top: 110px;
  }
  body.home .et_pb_row_3.et_pb_row {
    margin-left: 32px !important;
    width: 700px !important;
    max-width: 700px !important;
  }

  /* HOME - Our Reviews: centre the carousel (it was pushed off to the right) */
  body.home .et_pb_row_13.et_pb_row {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 90% !important;
  }
  body.home .et_pb_row_13 .swiper-wrapper {
    align-items: stretch !important;
  }
  body.home .et_pb_row_13 .swiper-slide {
    height: auto !important;
  }

  /* ABOUT - text beside a tall photo left a big empty block under the photo. Let the photo sit
     beside the heading and the body copy run full width underneath. */
  body.page-id-205 .et_pb_row_1.et_pb_row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 340px;
    column-gap: 40px;
    align-items: start;
    padding-right: 32px !important;
  }
  body.page-id-205 .et_pb_row_1 .et_pb_column_2,
  body.page-id-205 .et_pb_row_1 .et_pb_column_3 {
    display: contents;
  }
  body.page-id-205 .et_pb_row_1 .et_pb_text_0,
  body.page-id-205 .et_pb_row_1 .et_pb_text_1,
  body.page-id-205 .et_pb_row_1 .et_pb_image_1 {
    grid-column: 1;
  }
  body.page-id-205 .et_pb_row_1 .et_pb_image_2 {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 0 !important;
    width: 100% !important;
  }
  body.page-id-205 .et_pb_row_1 .et_pb_text_2 {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100% !important;
  }
}


/* The single-row nav is 4px too wide for a screen exactly 981-1000px wide; tighten its gaps. */
@media (min-width: 981px) and (max-width: 1000px) {
  body .et_pb_menu_0_tb_header .et-menu-nav > ul > li {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }
}


/* ===== TABLET + PHONE (<= 980) ===== */
@media (max-width: 980px) {

  /* HOME - Our Patient Resources: full width */
  body.home .et_pb_row_1 .et_pb_column_2 {
    width: 100% !important;
  }

  /* HOME - hero: no photo (and none of the padding that made room for it) */
  body.home .et_pb_section_0.et_pb_section {
    background-image: none !important;
    padding-bottom: 0 !important;
  }
  body.home .et_pb_section_0::after {
    display: none;
  }

  /* HOME - Compassionate Dental Care photo: full width */
  body.home .et_pb_row_2 .et_pb_column_4 {
    width: 100% !important;
  }
  body.home .et_pb_row_2 .et_pb_column_4 .et_pb_image,
  body.home .et_pb_row_2 .et_pb_column_4 .et_pb_image_wrap,
  body.home .et_pb_row_2 .et_pb_column_4 img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* HOME - Compassionate Dental Care: photo above the heading */
  body.home .et_pb_row_2 {
    display: flex !important;
    flex-direction: column;
  }
  body.home .et_pb_row_2 .et_pb_column_4 {
    order: -1;
    margin-bottom: 30px;
  }

  /* HOME - Our Dentist: the pink doctor block comes first, then the copy.
     The block is the section's background image, so draw it as a ::before that can be ordered. */
  body.home .et_pb_section_3.et_pb_section {
    display: flex;
    flex-direction: column;
    background-image: none !important;
    min-height: 0 !important;
    padding: 0 !important;
  }
  body.home .et_pb_section_3::before {
    content: "";
    order: -1;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 0.554;
    background: url("../images/mallorie-bg-3.jpg") center bottom / 114% auto no-repeat;
  }
  body.home .et_pb_section_3 .et_pb_row_3.et_pb_row {
    padding-top: 30px !important;
    padding-bottom: 50px !important;
  }

  /* HOME - Explore Our Services: gap between the stacked cards */
  body.home .et_pb_row_6 .et_pb_column,
  body.home .et_pb_row_8 .et_pb_column,
  body.home .et_pb_row_10 .et_pb_column {
    margin-bottom: 40px !important;
  }

  /* HOME - Our Reviews: centred carousel, even cards, arrows in line above it */
  body.home .et_pb_row_13.et_pb_row {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 90% !important;
    max-width: none !important;
  }
  body.home .et_pb_row_13 .swiper-wrapper {
    align-items: stretch !important;
  }
  body.home .et_pb_row_13 .swiper-slide {
    height: auto !important;
  }
  body.home .et_pb_row_12.et_pb_row {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 90% !important;
    max-width: none !important;
    margin: 24px auto !important;
  }
  body.home .et_pb_row_12 .et_pb_column {
    width: auto !important;
    margin: 0 !important;
  }
  body.home .et_pb_row_12 .swiper-button-prev,
  body.home .et_pb_row_12 .swiper-button-next {
    position: static !important;
    margin: 0 !important;
  }

  /* ABOUT - photo edge to edge: no left padding, 100% wide */
  body.page-id-205 .et_pb_row_0.et_pb_row {
    padding-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body.page-id-205 .et_pb_row_0 .et_pb_column_0 {
    width: 100% !important;
    padding: 0 !important;
  }
  body.page-id-205 .et_pb_image_0 {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  body.page-id-205 .et_pb_image_0 .et_pb_image_wrap,
  body.page-id-205 .et_pb_image_0 img {
    display: block;
    width: 100%;
  }
}


/* ===== TABLET (VERTICAL) 768-980 ===== */
@media (min-width: 768px) and (max-width: 980px) {

  /* FOOTER - contact blurbs: 5px above */
  body .et_pb_blurb_1_tb_footer,
  body .et_pb_blurb_2_tb_footer,
  body .et_pb_blurb_4_tb_footer,
  body .et_pb_blurb_5_tb_footer {
    margin-top: 5px !important;
  }

  /* FOOTER - a rule above the two contact columns separates them from the logo / Quick Links row */
  body .et_pb_column_2_tb_footer.et_pb_column,
  body .et_pb_column_3_tb_footer.et_pb_column {
    padding: 50px 0;
    border-top: 1px solid #e5ebf1;
  }
  body .et_pb_column_2_tb_footer.et_pb_column {
    margin-top: 50px;
  }

  /* HOME - the page's buttons sit left */
  body.home .et_pb_button_0_wrapper,
  body.home .et_pb_button_1_wrapper,
  body.home .et_pb_button_2_wrapper,
  body.home .et_pb_button_3_wrapper {
    text-align: left !important;
  }

  /* HOME - Explore Our Services: heading and rule left-aligned */
  body.home .et_pb_row_4 .et_pb_text_8,
  body.home .et_pb_row_4 .et_pb_text_8 h2 {
    text-align: left !important;
  }
  body.home .et_pb_row_4 .et_pb_image_5 {
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left !important;
  }

  /* HOME - Our Dentist heading: same size as the other headings */
  body.home .et_pb_text_6 .et_pb_text_inner h2 {
    font-size: 56px !important;
    line-height: 75px !important;
  }

  /* HOME - Explore Our Services: cards in columns of two */
  body.home .et_pb_row_6.et_pb_row,
  body.home .et_pb_row_8.et_pb_row,
  body.home .et_pb_row_10.et_pb_row {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  body.home .et_pb_row_6 > .et_pb_column,
  body.home .et_pb_row_8 > .et_pb_column,
  body.home .et_pb_row_10 > .et_pb_column {
    width: 50% !important;
  }

  /* Footer: every column centred, horizontally and vertically */
  body .et_pb_row_0_tb_footer {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch;
  }
  body .et_pb_row_0_tb_footer > .et_pb_column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 50% !important;
    margin-right: 0 !important;
  }
  body .et_pb_row_0_tb_footer .et_pb_text_inner,
  body .et_pb_row_0_tb_footer .et_pb_blurb_container,
  body .et_pb_row_0_tb_footer .et_pb_module_header,
  body .et_pb_row_0_tb_footer .et_pb_button_module_wrapper {
    text-align: center !important;
  }
}


/* ===== PHONE (<= 767) ===== */
@media (max-width: 767px) {

  /* Image modules sit inline */
  .et_pb_image.et_block_module {
    display: inline-block;
  }

  /* Every h2 */
  body #page-container h2,
  body #page-container .et_pb_text .et_pb_text_inner h2 {
    font-size: 40px !important;
    line-height: 50px !important;
  }

  /* FOOTER */
  body .et_pb_section_0_tb_footer.et_pb_section {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  body .et_pb_column_0_tb_footer.et_pb_column,
  body .et_pb_column_1_tb_footer.et_pb_column {
    padding: 50px 0;
    border-bottom: 1px solid #e5ebf1;
  }
  body .et_pb_column_0_tb_footer .et_pb_text_0_tb_footer,
  body .et_pb_column_0_tb_footer .et_pb_text_0_tb_footer .et_pb_text_inner {
    text-align: left !important;
  }
  body .et_pb_text_0_tb_footer.et_pb_module {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* HOME - the page's buttons sit left, not centred */
  body.home .et_pb_button_0_wrapper,
  body.home .et_pb_button_1_wrapper,
  body.home .et_pb_button_2_wrapper,
  body.home .et_pb_button_3_wrapper {
    text-align: left !important;
  }

  /* HOME - reviews: each card is as tall as its own review (custom.js sizes the carousel to the
     active one) instead of every card stretching to the longest */
  body.home .et_pb_row_13 .swiper-wrapper {
    align-items: flex-start !important;
  }

  /* NAV - mobile menu dropdowns start closed (custom.js toggles .gm-open) */
  body .et_mobile_menu li.menu-item-has-children > ul.sub-menu {
    display: none !important;
  }
  body .et_mobile_menu li.menu-item-has-children.gm-open > ul.sub-menu {
    display: block !important;
  }
  body .et_mobile_menu li.menu-item-has-children > a {
    position: relative;
    padding-right: 48px !important;
  }
  body .et_mobile_menu li.menu-item-has-children > a::after {
    content: "3";
    font-family: "ETmodules";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s;
  }
  body .et_mobile_menu li.menu-item-has-children.gm-open > a::after {
    transform: translateY(-50%) rotate(180deg);
  }
}


/* ===== "Reach Out" in the header: a fixed button, bottom left (phone + tablet horizontal) ===== */
@media (max-width: 767px), (min-width: 981px) and (max-width: 1199px) {
  body .et_pb_button_0_tb_header_wrapper {
    position: fixed !important;
    left: 16px;
    bottom: 16px;
    right: auto;
    top: auto;
    margin: 0 !important;
    width: auto !important;
    z-index: 99999;
  }
}
@media (max-width: 767px) {
  body .et_pb_button_0_tb_header_wrapper {
    left: 5px !important;
    bottom: 5px !important;
  }
  body #page-container .et_pb_section .et_pb_button_0_tb_header {
    text-transform: uppercase;
    font-size: 16px !important;
    padding-top: 5px !important;
    padding-right: 30px !important;
    padding-bottom: 5px !important;
    padding-left: 15px !important;
  }
}

/* Footer social icons (Quick Links column) */
.gm-footer-social { display: flex; gap: 12px; margin-top: 16px; }
.gm-footer-social .gm-social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: #f590a8; color: #fff; text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}
.gm-footer-social .gm-social-icon svg { width: 20px; height: 20px; }
.gm-footer-social .gm-social-icon:hover,
.gm-footer-social .gm-social-icon:focus-visible { background: #d9708a; transform: translateY(-2px); }

/* Avily "designed by" credit (footer) */
.avily-credit .avily-link { text-decoration: none; }
.avily-credit .avily-link:hover { text-decoration: underline; }
.avily-credit img { height: 1em; width: auto; vertical-align: middle; margin: 0 4px; }

/* Keep the reCAPTCHA badge above page content */
.grecaptcha-badge { z-index: 2147483647 !important; }
