/*
 * Erick Beaulieu
 * Gutenberg Home migration | ID 1998
 * Desktop / Mobile baseline
 */

/* =========================================
   ASTRA LAYOUT
   ========================================= */

body:is(.page-id-1998,.page-id-6).ast-plain-container.ast-no-sidebar #primary {
  width: 100%;
  max-width: none;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

body:is(.page-id-1998,.page-id-6) .site-content > .ast-container {
  width: 100%;
  max-width: none;
  padding: 0;
}

body:is(.page-id-1998,.page-id-6) .entry-header {
  display: none;
}

body:is(.page-id-1998,.page-id-6) .entry-content {
  margin: 0;
}

body:is(.page-id-1998,.page-id-6) #content.site-content {
  flex: 0 0 auto !important;
}

/* Full-width sections, not Gutenberg constrained groups */
body:is(.page-id-1998,.page-id-6) .entry-content > .wp-block-group {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
  margin: 0 !important;
}

/* =========================================
   ANIMATED TITLES
   ========================================= */

body:is(.page-id-1998,.page-id-6) .eb-home-animated {
  background: #fff;
  padding: 20px 15px 25px;
  text-align: center;
}

body:is(.page-id-1998,.page-id-6) .eb-home-animated > div {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Preserve the original fadeIn animations */
body:is(.page-id-1998,.page-id-6) .eb-home-animated .heading-lg {
  font-family: "Open Sans", sans-serif;
  line-height: 1.2;
}

/* =========================================
   VIDEO + PRESENTATION + TESTIMONIAL
   ========================================= */

body:is(.page-id-1998,.page-id-6) .eb-home-presentation {
  background: #fff;
  padding: 0 20px 35px;
  color: #333;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns {
  display: flex;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
> .wp-block-column:first-child,
body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
> .wp-block-column:last-child {
  flex: 0 0 16.6667%;
  min-width: 0;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
> .wp-block-column:nth-child(2) {
  flex: 0 0 66.6666%;
  min-width: 0;
  text-align: center;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation p {
  font-family: "Open Sans", sans-serif;
  font-size: 15px;
  line-height: 24px;
  margin-top: 0;
  margin-bottom: 24px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.tekuno-vimeo-facade {
  width: 100%;
  max-width: 640px;
  margin: 0 auto 25px !important;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.tekuno-vimeo-facade img {
  display: block;
  max-width: 100%;
  height: auto;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
img.wp-image-630 {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px auto 25px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.wp-block-separator {
  margin-top: 25px;
  margin-bottom: 25px;
}

/* =========================================
   ABOUT SECTION
   Original WPBakery: 25% / 75%
   ========================================= */

body:is(.page-id-1998,.page-id-6) .eb-home-about {
  background: #f4f4f4;
  padding: 30px;
  color: #007a7a;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about-columns {
  display: flex;
  gap: 25px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about-columns
> .wp-block-column:first-child {
  flex: 0 0 calc(25% - 19px);
  min-width: 0;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about-columns
> .wp-block-column:last-child {
  flex: 1 1 0;
  min-width: 0;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about h2 {
  font-family: "Open Sans", sans-serif;
  font-size: 19px;
  line-height: 26px;
  font-weight: 700;
  color: #007a7a;
  margin: 0 0 18px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about p {
  font-family: "Open Sans", sans-serif;
  font-size: 15px;
  line-height: 24px;
  color: #007a7a;
  margin: 0 0 24px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about a {
  color: #007a7a;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about
.eb-home-media {
  margin: 0 0 20px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about
.eb-home-media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

body:is(.page-id-1998,.page-id-6) .eb-home-about
.wp-block-separator {
  margin: 15px 0 25px;
}

/* =========================================
   FAQ
   Preserve EBSC component appearance
   ========================================= */

body:is(.page-id-1998,.page-id-6) .eb-home-faq {
  background: #fff;
  padding: 30px 20px 45px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-faq > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 767px) {

  body:is(.page-id-1998,.page-id-6) .eb-home-animated {
    padding: 20px 10px;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-animated .heading-lg {
    font-size: 28px !important;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-presentation {
    padding: 0 10px 30px;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns {
    display: block;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
  > .wp-block-column:first-child,
  body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
  > .wp-block-column:last-child {
    display: none;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
  > .wp-block-column:nth-child(2) {
    width: 100%;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-about {
    padding: 25px 10px;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-about-columns {
    display: block;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-about-columns
  > .wp-block-column:first-child {
    margin-bottom: 25px;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-about
  .eb-home-media img {
    margin-left: auto;
    margin-right: auto;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-faq {
    padding: 25px 10px 35px;
  }
}

/* ==================================================
   EB HOME ANIMATION FIX V1
   Restore TheFox fadeIn behavior for animated labels.
   ================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body:is(.page-id-1998,.page-id-6) .eb-home-animated {
  min-height: 332px;
  padding: 20px 15px 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body:is(.page-id-1998,.page-id-6) .eb-home-animated > .wp-block-html,
body:is(.page-id-1998,.page-id-6) .eb-home-animated > div {
  width: 100%;
}

body:is(.page-id-1998,.page-id-6) .eb-home-animated [style*="animation: fadeIn"] {
  animation-fill-mode: forwards;
}

@media (max-width: 767px) {
  body:is(.page-id-1998,.page-id-6) .eb-home-animated {
    min-height: 0;
    padding: 20px 10px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:is(.page-id-1998,.page-id-6) .eb-home-animated [style*="animation: fadeIn"] {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* ==================================================
   EB HOME FAQ MATCH V1
   Reuse validated English FAQ styles, scoped to Home.
   ================================================== */

/* Full-width FAQ section */
body:is(.page-id-1998,.page-id-6) .eb-home-faq {
  width: 100% !important;
  max-width: none !important;
  background: #f4f4f4 !important;
  padding: 0 !important;
  margin: 0 !important;
}

body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq {
  background: #f4f4f4 !important;
  padding: 70px 0 !important;
}

body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__inner {
  background: #f4f4f4 !important;
}

/* Heading */
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq h2,
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__title {
  color: #008996 !important;
}

/* Separators */
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__item {
  border-top: 1px solid #c9d0d5 !important;
}

body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__item:last-child {
  border-bottom: 1px solid #c9d0d5 !important;
}

/* Questions */
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__toggle,
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__question {
  background: transparent !important;
  color: #56616d !important;
  transition: color .2s ease, background-color .2s ease;
}

body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__toggle:hover,
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__toggle:focus-visible,
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__toggle[aria-expanded="true"] {
  color: #008996 !important;
  background: transparent !important;
}

/* Icons */
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__icon {
  fill: #008996 !important;
  color: #008996 !important;
}

/* Open answers */
body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq__answer {
  color: #56616d !important;
  background: transparent !important;
}

/* Mobile */
@media (max-width: 767px) {
  body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq {
    padding-top: 50px !important;
    padding-bottom: 50px !important;
  }
}

/* EB HOME DESKTOP SPACING V1 */
@media (min-width: 768px) {

  /* Start animated text closer to the navigation */
  body:is(.page-id-1998,.page-id-6) .eb-home-animated {
    align-items: flex-start !important;
    padding-top: 8px !important;
  }

  /* Slightly more breathing room between animated rows */
  body:is(.page-id-1998,.page-id-6) .eb-home-animated
  .wp-block-html > div {
    row-gap: 13px !important;
  }

  /* Keep the FAQ connected to the previous section */
  body:is(.page-id-1998,.page-id-6) .entry-content
  > .eb-home-about + .eb-home-faq {
    margin-top: 0 !important;
  }
}

/* ==================================================
   EB HOME TYPOGRAPHY GAP V1
   Restore handwritten introduction and remove
   Gutenberg spacing immediately before FAQ.
   ================================================== */

/* First two text paragraphs directly below Alike video */
body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
> .wp-block-column:nth-child(2)
> p.wp-block-paragraph:nth-of-type(-n+2) {
  font-family: 'Caveat', cursive !important;
  color: #007c88 !important;
  font-size: 28px !important;
  line-height: 28px !important;
}

/* 26px gap observed between About and FAQ */
@media (min-width: 768px) {
  body:is(.page-id-1998,.page-id-6) .entry-content
  > .eb-home-about + .eb-home-faq {
    margin-top: -26px !important;
  }
}

/* ==================================================
   EB HOME VIMEO FIX V1
   ================================================== */

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.tekuno-vimeo-facade {
  position: relative;
  display: block;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body:is(.page-id-1998,.page-id-6) .eb-home-vimeo-play {
  position: absolute !important;
  inset: 0;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  cursor: pointer;
  overflow: hidden;
}

body:is(.page-id-1998,.page-id-6) .eb-home-vimeo-play img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

body:is(.page-id-1998,.page-id-6) .eb-home-vimeo-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 52px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color .2s ease;
  pointer-events: none;
}

body:is(.page-id-1998,.page-id-6) .eb-home-vimeo-play-icon::after {
  content: "";
  display: block;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid #fff;
  margin-left: 5px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-vimeo-play:hover
.eb-home-vimeo-play-icon {
  background: #008996;
}

body:is(.page-id-1998,.page-id-6) .eb-home-vimeo-play:focus-visible {
  outline: 3px solid #008996 !important;
  outline-offset: -3px;
}

body:is(.page-id-1998,.page-id-6) .eb-home-vimeo-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==================================================
   EB HOME HANDWRITTEN TEXT V1
   Original production typography below OCCOQ image.
   ================================================== */

body:is(.page-id-1998,.page-id-6) .eb-home-presentation-columns
> .wp-block-column:nth-child(2)
> p.wp-block-paragraph:nth-of-type(n+3) {
  font-family: 'Caveat', cursive !important;
  color: #007c88 !important;
  font-size: 28px !important;
  font-weight: 400 !important;
  font-style: normal !important;
  line-height: 28px !important;
  text-align: center !important;
  margin-top: 0 !important;
  margin-bottom: 24px !important;
}

/* ==================================================
   EB HOME VIMEO VISUAL FIX V2
   Remove inherited Astra button styling and
   background bleeding around thumbnail.
   ================================================== */

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.tekuno-vimeo-facade {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.eb-home-vimeo-play {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.eb-home-vimeo-play img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  box-shadow: none !important;
  border: 0 !important;
}

body:is(.page-id-1998,.page-id-6) .eb-home-presentation
.eb-home-vimeo-play:focus-visible {
  outline: 3px solid #008996 !important;
  outline-offset: -3px;
}

/* ==================================================
   EB HOME MOBILE LAYOUT V2
   About horizontal spacing and FAQ continuity.
   ================================================== */

@media (max-width: 767px) {

  /* Match the original horizontal breathing room */
  body:is(.page-id-1998,.page-id-6) .eb-home-about {
    padding: 25px 20px !important;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-about-columns {
    width: 100%;
    max-width: none;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-about
  .eb-home-media img {
    max-width: 100%;
    height: auto;
  }

  /* Remove EBSC's inherited 24px margin */
  body:is(.page-id-1998,.page-id-6) .eb-home-faq .ebsc-faq {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  body:is(.page-id-1998,.page-id-6) .entry-content
  > .eb-home-about + .eb-home-faq {
    margin-top: 0 !important;
  }
}

/* ==================================================
   EB HOME MOBILE FAQ COLLAPSE FIX V1
   Prevent internal FAQ margins from collapsing
   outside the Gutenberg group.
   ================================================== */

@media (max-width: 767px) {

  body:is(.page-id-1998,.page-id-6) .eb-home-faq {
    display: flow-root !important;
    margin: 0 !important;
  }

  body:is(.page-id-1998,.page-id-6) .eb-home-faq > .ebsc-faq {
    margin-block-start: 0 !important;
    margin-top: 0 !important;
  }

}
