/*
 * MILOBRAS shared presentation.
 * One maintained stylesheet replaces the Customizer's accumulated overrides.
 * Component modules own the gallery engine, footer and form field sizes.
 * This file owns their shared layout and responsive compatibility states.
 */
:root {
  --mb-content-heading-size: 15px;
  --mb-project-section-gap: 13px;
  --mb-project-shell-gap: 17px;
}

/* Shared review layout; the mobile grid and slider remain component-owned. */
body .AreaSpot.AreaTestemunhos .SideTestemunhos {
  display: flow-root;
}
body .AreaSpot.AreaTestemunhos .strong-testimonials-view-widget {
  overflow: hidden !important;
}
body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-inner {
  text-align: left !important;
}
body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-field {
  text-align: right !important;
}
body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-image img {
  display: block !important;
  margin: 0 !important;
}

/* Content typography. The real project H1 belongs to .entry-header. */
html body.page .AreaPage .pagespan > :is(h2, h3),
html body.page .AreaPage .pagespan > .codex-mobile-readmore > :is(h2, h3) {
  font-size: var(--mb-content-heading-size) !important;
}
/* Old project-body headings are separate from the visible main H1. */
.post-portfolio :is(h1, h2, h3, h4, h5, h6) {
  position: absolute !important;
  left: -9999px !important;
  visibility: hidden !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
/* The modern footer supplies the quote action; suppress the old floating tab. */
.BTNorcamento {
  display: none !important;
}

@media (max-width: 768px) {
  body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-inner {
    padding: 16px 14px 0 !important;
  }
  body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-image img {
    height: auto !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  body .AreaSpot.AreaTestemunhos .TestemunhosLerTodos {
    position: static !important;
    bottom: auto !important;
    float: right !important;
    margin-right: 20px !important;
  }
}

@media (min-width: 769px) {
  /* Review slider desktop geometry. */
  body .AreaSpot.AreaTestemunhos .t-slide {
    margin-left: 0 !important;
    width: 100% !important;
  }
  body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-inner {
    padding: 20px 24px 0 !important;
  }
  body .AreaSpot.AreaTestemunhos .strong-view.wpmtst-default.slider-container .wpmtst-testimonial {
    border: 0 !important;
  }
  body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-image {
    float: left !important;
    display: block !important;
    width: auto !important;
    max-width: 30% !important;
    margin: 0 26px 0 0 !important;
    text-align: left !important;
  }
  body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-image img {
    background: #fff !important;
    border: 1px solid #efefef !important;
    box-sizing: content-box !important;
    padding: 6px !important;
  }
  body .AreaSpot.AreaTestemunhos .maybe-clear {
    display: none !important;
    clear: none !important;
  }
  body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-content,
  body .AreaSpot.AreaTestemunhos .wpmtst-testimonial-content p {
    max-width: 100% !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
    text-align: left !important;
  }
  body .AreaSpot.AreaTestemunhos .TestemunhosLerTodos {
    bottom: 0 !important;
  }

  /* Page roles are assigned in PHP for both the PT page and its EN pair. */
  body.mb-page-recruitment .container.sidebar > .row.base-desktop-2 > div {
    float: none !important;
  }
  body.mb-page-recruitment .container.sidebar > .row.base-desktop-2 .pagespan {
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 10px !important;
  }
  body.mb-page-recruitment .container.sidebar > .row.base-desktop-2 .SideGoals .widget {
    box-sizing: border-box !important;
    height: 100% !important;
    min-height: 0 !important;
    padding-bottom: 20px !important;
  }
  body.mb-page-testimonials .SideDeixaTestemunhos .strong-view {
    padding-top: 21px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  body.mb-page-testimonials .SideDeixaTestemunhos .form-field,
  body.mb-page-testimonials .SideDeixaTestemunhos .form-field label,
  body.mb-page-testimonials .SideDeixaTestemunhos .form-field input,
  body.mb-page-testimonials .SideDeixaTestemunhos .form-field textarea,
  body.mb-page-testimonials .SideDeixaTestemunhos .form-field .field-wrap {
    box-sizing: border-box !important;
    width: 100% !important;
  }
  body.mb-page-testimonials .SideDeixaTestemunhos .widget.page_in_widget {
    padding-bottom: 22px !important;
  }
  body.mb-page-services .pagespan {
    padding-bottom: 4px !important;
  }

  /* Project shell spacing; tablet and desktop use the same component markup. */
  body.single-otw-portfolio > .container {
    margin-top: var(--mb-project-section-gap) !important;
  }
  body.single-otw-portfolio .otw-eighteen.otw-columns {
    margin-top: var(--mb-project-shell-gap) !important;
  }
  body.single-otw-portfolio article.otw-single-portfolio-item .entry-title {
    max-width: 100% !important;
  }
  body.single-otw-portfolio article.otw-single-portfolio-item .entry-header {
    box-sizing: border-box !important;
    margin-left: 10% !important;
    margin-right: auto !important;
    margin-top: -13px !important;
    text-align: center !important;
    width: 79.5% !important;
  }
  body.single-otw-portfolio .portfolio-gallery-wrapper {
    margin-top: -42px !important;
  }
  body.single-otw-portfolio article.otw-single-portfolio-item > .categories,
  body.single-otw-portfolio article.otw-single-portfolio-item > .categories + br,
  body.single-otw-portfolio article.otw-single-portfolio-item > .entry-content {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.single-otw-portfolio article.otw-single-portfolio-item > .PortfolioBack2:not(.mobile-hide) {
    margin-top: 2px !important;
  }
}

/* The narrow tablet header is a distinct state from the >=993px header. */
@media (min-width: 769px) and (max-width: 992px) {
  body.single-otw-portfolio article.otw-single-portfolio-item .entry-title {
    display: inline-block !important;
    position: relative !important;
    top: -32px !important;
    font-size: 19px !important;
    line-height: 1.25 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    white-space: nowrap !important;
    width: auto !important;
  }
}

/* Shared homepage slider title: center its line in the existing header strip. */
html body.home.mb-responsive #text-9.widget_text h2 {
  padding-top: 5px !important;
  padding-bottom: 5px !important;
}
/* Phones keep the approved homepage without the guarantees slider. */
@media (max-width: 767px) {
  html body.home.mb-responsive .AreaSpot.AreaPortfolio:has(#text-9) {
    display: none !important;
  }
}

/* Tablet touch cards keep their captions still, including tap/focus states. */
@media (min-width:768px) and (any-pointer:coarse) {
  html body #milobras-home-projects .milobras-home-projects__card .milobras-home-projects__caption {
    transform: none !important;
    transition: none !important;
  }
  html body #milobras-home-projects .milobras-home-projects__card .milobras-home-projects__view {
    opacity: 0 !important;
    transition: none !important;
  }
  html body .otw-sc-portfolio .otw-portfolio-item-link > div.title {
    bottom: 0 !important;
    transform: none !important;
    transition: none !important;
  }
  html body .otw-sc-portfolio .otw-portfolio-item-link > div.text {
    visibility: hidden !important;
    transition: none !important;
  }
}

/* Testimonial submission overlay: widget forms can omit their template CSS.
 * Keep idle hidden; Strong Testimonials toggles inline display while sending. */
body.mb-page-testimonials .SideDeixaTestemunhos .strong-form {
  position: relative;
}
body.mb-page-testimonials .SideDeixaTestemunhos .strong-form-wait {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(255, 255, 255, .7);
}
body.mb-page-testimonials .SideDeixaTestemunhos .strong-form-wait .message {
  position: absolute;
  top: calc(50% - 25px);
  width: 100%;
  height: 50px;
  line-height: 50px;
  text-align: center;
}
body.mb-page-testimonials .SideDeixaTestemunhos .strong-form-wait .message img {
  display: block;
  width: 50px;
  height: 50px;
  max-width: 50px;
  margin: 0 auto;
  animation: mb-testimonial-submit-spin 2.5s linear infinite;
}
@keyframes mb-testimonial-submit-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  body.mb-page-testimonials .SideDeixaTestemunhos .strong-form-wait .message img {
    animation: none;
  }
}

/* Preserve square testimonial fields across native Safari/iPad rendering. */
body.mb-page-testimonials .SideDeixaTestemunhos .wpmtst-submission-form input:is([type="text"], [type="email"]),
body.mb-page-testimonials .SideDeixaTestemunhos .wpmtst-submission-form textarea {
  -webkit-appearance: none !important;
  appearance: none !important;
  border-radius: 0 !important;
}
/* Match the approved Passport review button's dark label and weight. */
html body.mb-page-testimonials .SideDeixaTestemunhos #page_in_widget-2 form.wpmtst-submission-form input.wpmtst_submit_testimonial.button {
  color: #283414 !important;
  -webkit-text-fill-color: #283414 !important;
  font-weight: 700 !important;
}

/* Phone archive excerpts only. Original images, paragraphs and authors stay put. */
@media (max-width: 767px) {
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-excerpt {
    display: flow-root;
    position: relative;
    max-height: calc(var(--mb-review-preview-height) + 36px);
    overflow: hidden;
  }
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-excerpt::after {
    content: "";
    position: absolute;
    right: 0;
    top: var(--mb-review-preview-height);
    left: 0;
    height: 36px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.7) 62%, #fff);
  }
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-open,
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-measuring {
    max-height: none;
    overflow: visible;
  }
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-open::after,
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-measuring::after {
    display: none;
  }
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 8px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #6cc400;
    font-family: "Roboto Condensed", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 24px;
    text-align: left;
    text-transform: none;
    cursor: pointer;
  }
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-toggle:focus-visible {
    outline: 2px solid #6cc400;
    outline-offset: 4px;
  }
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-chevron {
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
  }
  body.mb-page-testimonials .AreaPage .strong-view-id-1 .mb-review-toggle[aria-expanded="true"] .mb-review-chevron {
    transform: rotate(225deg);
  }
}
