/*
 * Shared styles for Lotus sections.
 * Section stylesheets use these classes and variables. They do not redeclare them.
 * Container widths match the Ratio theme grid.
 */

@font-face {
  font-family: "Fairplex Wide";
  src: url("/wp-content/themes/ratio/assets/fonts/fairplex-book.woff2") format("woff2"),
    url("/wp-content/themes/ratio/assets/fonts/fairplex-book.woff") format("woff"),
    url("/wp-content/themes/ratio/assets/fonts/fairplex-book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fairplex Wide OT";
  src: url("/wp-content/themes/ratio/assets/fonts/fairplex-book.woff2") format("woff2"),
    url("/wp-content/themes/ratio/assets/fonts/fairplex-book.woff") format("woff"),
    url("/wp-content/themes/ratio/assets/fonts/fairplex-book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geogrotesque";
  src: url("/wp-content/themes/ratio/assets/fonts/Geogrotesque.woff2") format("woff2"),
    url("/wp-content/themes/ratio/assets/fonts/Geogrotesque.woff") format("woff"),
    url("/wp-content/themes/ratio/assets/fonts/Geogrotesque.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geogrotesque";
  src: url("/wp-content/themes/ratio/assets/fonts/Geogrotesque.woff2") format("woff2"),
    url("/wp-content/themes/ratio/assets/fonts/Geogrotesque.woff") format("woff"),
    url("/wp-content/themes/ratio/assets/fonts/Geogrotesque.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

.fx-section {
  --fx-color-text: #757575;
  --fx-color-heading: #313131;
  --fx-color-accent: #d6ab60;
  --fx-color-bg: #ffffff;
  --fx-color-olive: #5a5c4c;
  --fx-color-olive-dark: #424434;
  --fx-font-body: "Open Sans", sans-serif;
  --fx-font-heading: "Open Sans", sans-serif;
  --fx-font-display: "Fairplex Wide", "Fairplex Wide OT", "Times New Roman", serif;
  --fx-font-eyebrow: "Geogrotesque", "Open Sans", sans-serif;
  --fx-font-intro: "Maven Pro", "Open Sans", sans-serif;
  /* Mobile-first defaults; larger viewports upscale via min-width queries. */
  --fx-container: 300px;
  --fx-section-pad: 3.5rem;
  --fx-content-pad-x: 1.5rem;
  --fx-heading-size: 1.5rem;
  --fx-btn-font-size: 1rem;
  --fx-btn-pad-y: 0.875rem;
  --fx-btn-pad-x: 1.25rem;
  --fx-btn-radius: 1.75rem;
  --fx-btn-tracking: 0.15em;
  --fx-btn-line-height: 1.15;
  box-sizing: border-box;
  margin: 0;
  padding-top: var(--fx-section-pad);
  padding-bottom: var(--fx-section-pad);
  background-color: var(--fx-color-bg);
  color: var(--fx-color-text);
  font-family: var(--fx-font-body);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.857;
}

.fx-section *,
.fx-section *::before,
.fx-section *::after {
  box-sizing: border-box;
}

/* Darker olive: remap the olive token so section backgrounds and on-dark accents follow */
.fx-section--bg-dark {
  --fx-color-olive: var(--fx-color-olive-dark);
}

/*
 * Same-tone stacked sections: collapse the following section's top pad.
 * Skip when the previous section is a hero (always keep breathing room after heroes).
 * Opt in with: padding-top: var(--fx-pad-top-collapsed, <your-pad>);
 * Bakery/wpautop often inserts a <br> between rows; include that in the sibling chain.
 */
.vc_row:has(.fx-section:not(.fx-section--bg-dark):not(.fx-section--hero)) + .vc_row .fx-section:not(.fx-section--bg-dark),
.vc_row:has(.fx-section:not(.fx-section--bg-dark):not(.fx-section--hero)) + br + .vc_row .fx-section:not(.fx-section--bg-dark),
.vc_row:has(.fx-section.fx-section--bg-dark:not(.fx-section--hero)) + .vc_row .fx-section.fx-section--bg-dark,
.vc_row:has(.fx-section.fx-section--bg-dark:not(.fx-section--hero)) + br + .vc_row .fx-section.fx-section--bg-dark {
  --fx-pad-top-collapsed: 0px;
}

.fx-section__inner {
  width: var(--fx-container);
  max-width: calc(100% - (2 * var(--fx-content-pad-x)));
  margin-right: auto;
  margin-left: auto;
}

.fx-section__heading {
  margin: 0 0 1.25rem;
  color: var(--fx-color-heading);
  font-family: var(--fx-font-heading);
  font-size: var(--fx-heading-size);
  font-weight: 300;
  line-height: 1.21;
  letter-spacing: 0.0625rem;
  text-transform: uppercase;
}

.fx-section__text {
  margin: 0 0 1.5rem;
}

.fx-section__text > :last-child {
  margin-bottom: 0;
}

/*
 * Lotus button - Figma CTA type (Geogrotesque SemiBold 24 / tracking 0.3em / pill ~82).
 * !important beats Ratio a/p a and theme .edgtf-btn-sized defaults.
 * Base tokens are mobile; min-width queries below scale up.
 */
.fx-section a.fx-section__button,
.fx-section p a.fx-section__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  padding: var(--fx-btn-pad-y) var(--fx-btn-pad-x);
  border: 1px solid var(--fx-color-accent);
  border-radius: var(--fx-btn-radius);
  background-color: transparent;
  color: var(--fx-color-heading) !important;
  font-family: var(--fx-font-eyebrow) !important;
  font-size: var(--fx-btn-font-size) !important;
  font-style: normal !important;
  font-weight: 600 !important;
  line-height: var(--fx-btn-line-height) !important;
  letter-spacing: var(--fx-btn-tracking) !important;
  text-align: center;
  text-decoration: none !important;
  text-transform: uppercase !important;
  white-space: normal;
  overflow-wrap: break-word;
  transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}

.fx-section a.fx-section__button:hover,
.fx-section a.fx-section__button:focus,
.fx-section p a.fx-section__button:hover,
.fx-section p a.fx-section__button:focus {
  border-color: var(--fx-color-accent);
  background-color: var(--fx-color-accent);
  color: var(--fx-color-heading) !important;
  text-decoration: none !important;
}

.fx-section a.fx-section__button--on-dark,
.fx-section p a.fx-section__button--on-dark {
  border-color: #ffffff;
  color: #ffffff !important;
}

.fx-section a.fx-section__button--on-dark:hover,
.fx-section a.fx-section__button--on-dark:focus,
.fx-section p a.fx-section__button--on-dark:hover,
.fx-section p a.fx-section__button--on-dark:focus {
  border-color: #ffffff;
  background-color: #ffffff;
  color: var(--fx-color-olive) !important;
}

.fx-section a.fx-section__button--on-dark:focus-visible {
  outline-color: #ffffff;
}

.fx-section__link {
  color: var(--fx-color-accent);
  text-decoration: none;
  transition: color 0.15s ease-out;
}

.fx-section__link:hover,
.fx-section__link:focus {
  color: var(--fx-color-heading);
}

.fx-section a.fx-section__button:focus-visible,
.fx-section__link:focus-visible {
  outline: 2px solid var(--fx-color-accent);
  outline-offset: 3px;
}

.fx-section img {
  max-width: 100%;
  height: auto;
}

/*
 * Circle number used by Numbered Media / List / Grid.
 * Figma: 76px ring, Fairplex digit, stroke #F5F5F4 on olive.
 */
.fx-section__number {
  --fx-number-size: 3rem;
  --fx-number-digit-size: 2rem;
  box-sizing: border-box;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--fx-number-size);
  height: var(--fx-number-size);
  border: 2px solid #f5f5f4;
  border-radius: 50%;
  color: #ffffff;
  font-family: var(--fx-font-display);
  font-size: var(--fx-number-digit-size);
  font-style: normal;
  font-weight: 400;
  line-height: 0.89;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: none;
}

@media (min-width: 768px) {
  .fx-section__number {
    --fx-number-size: 4rem;
    --fx-number-digit-size: 2.75rem;
  }
}

@media (min-width: 1024px) {
  .fx-section__number {
    --fx-number-size: 4.75rem;
    --fx-number-digit-size: 3.4375rem;
  }
}

/*
 * Ratio always injects a fixed full-viewport .edgtf-cover (background #000,
 * opacity 0, z-index 0) for the slide-from-right side menu. That layer sits
 * above .edgtf-content (z-index auto) inside .edgtf-wrapper (z-index 1000) and
 * can paint the whole page solid black when opacity fails to composite at 0
 * (seen when resizing DevTools across the 768px tablet breakpoint). Keep the
 * cover inert until the menu opens, and raise page content above it.
 */
body.edgtf-side-menu-slide-from-right:not(.edgtf-right-side-menu-opened) .edgtf-wrapper > .edgtf-cover {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

.edgtf-content {
  position: relative;
  z-index: 1;
}

/*
 * Stacked Lotus sections: kill the white hairline between olive bands.
 *
 * Do NOT disable clearfix ::before/::after on .edgtf-full-section-inner -
 * that class is a real clearfix wrapper and blanking its pseudos collapses
 * Bakery row layout (and can leave a solid black viewport at tablet widths).
 *
 * Safe approach: zero the theme's 25px column gap, paint the row olive so any
 * remaining subpixel gap matches the band, hide wpautop <br> between rows,
 * and overlap consecutive Lotus rows/sections by 1px so a white parent seam
 * cannot show through (seen again above Contact Us on olive stacks).
 */
.edgtf-full-section-inner .vc_column_container:has(.fx-section),
.edgtf-full-section-inner .vc_column_container:first-child:has(.fx-section) {
  margin-bottom: 0 !important;
}

.vc_row:has(.fx-section),
.vc_row:has(.fx-section) > .edgtf-full-section-inner,
.vc_row:has(.fx-section) .wpb_column,
.vc_row:has(.fx-section) .vc_column_container,
.vc_row:has(.fx-section) .vc_column-inner,
.vc_row:has(.fx-section) .wpb_wrapper {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Keep hex in sync with --fx-color-olive / --fx-color-olive-dark */
.vc_row:has(.fx-section:not(.fx-section--bg-dark)) {
  background-color: #5a5c4c;
}

.vc_row:has(.fx-section.fx-section--bg-dark) {
  background-color: #424434;
}

.vc_row:has(.fx-section) > .edgtf-full-section-inner > br,
.vc_row:has(.fx-section) .wpb_wrapper > br {
  display: none;
}

.vc_row:has(.fx-section) + br {
  display: none;
}

/*
 * 1px overlap closes subpixel gaps between stacked Lotus bands (Bakery rows
 * and direct sibling sections such as portfolio-single + contact form).
 */
.vc_row:has(.fx-section) + .vc_row:has(.fx-section),
.vc_row:has(.fx-section) + br + .vc_row:has(.fx-section) {
  margin-top: -1px !important;
}

.fx-section + .fx-section {
  margin-top: -1px;
}

/*
 * Seam paint on the FOLLOWING section only: 1px of its own olive covers the
 * join so a white parent cannot peek through (olive -> dark included).
 * Do not paint the first section under the header.
 */
.vc_row:has(.fx-section) + .vc_row:has(.fx-section) .fx-section,
.vc_row:has(.fx-section) + br + .vc_row:has(.fx-section) .fx-section,
.fx-section + .fx-section {
  box-shadow: 0 -1px 0 0 var(--fx-color-olive);
}

@media (min-width: 481px) {
  .fx-section {
    --fx-container: 420px;
    --fx-heading-size: 1.75rem;
    --fx-btn-font-size: 1.125rem;
    --fx-btn-pad-y: 1.125rem;
    --fx-btn-pad-x: 1.75rem;
    --fx-btn-radius: 2rem;
    --fx-btn-tracking: 0.2em;
  }
}

@media (min-width: 601px) {
  .fx-section {
    --fx-container: 600px;
  }
}

@media (min-width: 768px) {
  .fx-section {
    --fx-container: 768px;
    --fx-section-pad: 5.5rem;
    /* Tablet: keep a moderate inset. Desktop 5.75rem waits until 1024. */
    --fx-content-pad-x: 2.5rem;
    --fx-heading-size: 2.0625rem;
    --fx-btn-font-size: 1.25rem;
    --fx-btn-pad-y: 1.25rem;
    --fx-btn-pad-x: 2rem;
    --fx-btn-radius: 2.25rem;
    --fx-btn-tracking: 0.2em;
  }
}

@media (min-width: 1024px) {
  .fx-section {
    --fx-container: 950px;
    --fx-content-pad-x: 5.75rem;
    --fx-btn-font-size: 1.5rem;
    --fx-btn-pad-y: 1.8125rem;
    --fx-btn-pad-x: 3.125rem;
    --fx-btn-radius: 2.625rem;
    --fx-btn-tracking: 0.3em;
  }
}

@media (min-width: 1201px) {
  .fx-section {
    --fx-container: 1100px;
  }
}

@media (min-width: 1401px) {
  .fx-section {
    --fx-container: 1300px;
  }
}
