/* ============================================================
   animations.css — Initial states, hover effects, Lenis, a11y
   ============================================================ */

/* --- Cross-document page transitions (eliminates flash between pages) --- */
@view-transition {
  navigation: auto;
}

/* Sequential fade prevents layout shift when navigated from a scrolled position */
::view-transition-old(root) {
  animation: 150ms ease-out both vt-fade-out;
}
::view-transition-new(root) {
  animation: 200ms ease-in 150ms both vt-fade-in;
}
@keyframes vt-fade-out {
  to { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
}

/* --- Scroll progress bar --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary, #2694c1), var(--accent, #f58220));
  z-index: 9999;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
  width: 100%;
  will-change: transform;
}

/* --- Custom mobile nav overlay --- */

/* iOS Safari: ensure burger fires tap events correctly */
.header__burger.brxe-xburgertrigger {
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.nav-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 99999;
  visibility: hidden;
  pointer-events: none;
}

.nav-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
.nav-overlay__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 16, 50, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
}

/* Panel — light branded design */
.nav-overlay__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  background: #fff;
  color: #1e1c3a;
  border-radius: 18px;
  border: 1px solid rgba(80, 79, 126, 0.14);
  box-shadow:
    0 24px 60px rgba(20, 16, 50, 0.18),
    0 4px 16px rgba(20, 16, 50, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
}

/* Panel header: site-bg tint + logo + close */
.nav-overlay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #efeffb;
  border-bottom: 1px solid rgba(80, 79, 126, 0.1);
  flex-shrink: 0;
}

.nav-overlay__logo {
  height: 48px;
  width: auto;
}

/* Close button */
.nav-overlay__close {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(80, 79, 126, 0.08);
  border: 1px solid rgba(80, 79, 126, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #6665a0;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: background 180ms ease, color 180ms ease;
}

.nav-overlay__close:hover {
  background: rgba(80, 79, 126, 0.16);
  color: #1e1c3a;
}

/* Scrollable body */
.nav-overlay__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 20px;
}

.nav-overlay__nav {
  width: 100%;
}

.nav-overlay__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.nav-overlay__menu > li {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  width: 100%;
  border-bottom: 1px solid rgba(80, 79, 126, 0.08);
}

.nav-overlay__menu > li:last-child {
  border-bottom: none;
}

/* Menu items + CTA start hidden; JS animates them in */
.nav-overlay__menu > li,
.nav-overlay__cta {
  opacity: 0;
}

.nav-overlay__menu a {
  color: #2d2b52;
  display: flex;
  align-items: center;
  padding: 14px 12px;
  text-decoration: none;
  font-weight: 400;
  font-size: var(--text-m, 1rem);
  letter-spacing: 0.01em;
  border-radius: 10px;
  transition: background 180ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-overlay__menu a:hover,
.nav-overlay__menu a:focus-visible {
  background: rgba(80, 79, 126, 0.07);
  color: #16143a;
}

/* Row with link + toggle side by side */
.nav-overlay__menu-row {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.nav-overlay__menu-row > a {
  flex: 1;
  padding: 14px 12px;
}

/* About Us parent — slightly bolder */
.has-submenu > .nav-overlay__menu-row > a {
  font-weight: 500;
}

/* Toggle chevron */
.nav-overlay__toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  flex-shrink: 0;
  font-size: 13px;
  color: #9897c0;
  border-radius: 0 10px 10px 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 180ms ease, transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-overlay__toggle:hover {
  color: #2d2b52;
  background: rgba(80, 79, 126, 0.06);
}

/* FIX: was rotateX (wrong axis). Use rotate for correct 2D chevron flip. */
.nav-overlay__toggle[aria-expanded="true"] {
  transform: rotate(180deg);
  color: #2694c1;
}

/* Sub-menu — JS handles expand/collapse animation */
.nav-overlay__submenu {
  list-style: none;
  padding: 0 0 0 22px;
  margin: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

.nav-overlay__submenu.is-open {
  max-height: none;
  opacity: 1;
  margin: 0 0 8px;
}

.nav-overlay__submenu li {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

/* Left accent border on sub-items */
.nav-overlay__submenu li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: #2694c1;
  opacity: 0.5;
  border-radius: 1px;
}

.nav-overlay__submenu a {
  padding: 12px 12px 12px 16px;
  font-size: var(--text-s, 0.875rem);
  color: #6665a0;
  font-weight: 400;
}

.nav-overlay__submenu a:hover,
.nav-overlay__submenu a:focus-visible {
  color: #2694c1;
  background: rgba(38, 148, 193, 0.07);
}

/* CTA */
.nav-overlay__cta {
  padding-top: 14px;
  margin-top: 6px;
  border-top: 1px solid rgba(80, 79, 126, 0.1);
}

.nav-overlay__cta .bricks-button {
  width: 100%;
  justify-content: center;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Scroll lock when nav is open */
html.nav-locked {
  overflow: hidden;
}

html.nav-locked body {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Reduced motion: collapse all nav-overlay animation to simple fades */
@media (prefers-reduced-motion: reduce) {
  .nav-overlay__panel,
  .nav-overlay__backdrop {
    transition: opacity 150ms ease !important;
  }

  .nav-overlay__submenu {
    transition: none !important;
  }

  .nav-overlay__toggle {
    transition: none !important;
  }
}

/* --- Scroll restoration fix ---
   automatic.css sets html { scroll-behavior: smooth } which causes the
   browser to smooth-animate from the top on every page refresh instead
   of instantly restoring scroll position. Override globally; keep smooth
   only for keyboard/anchor navigation via :focus-within. */
html {
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: no-preference) {
  html:focus-within {
    scroll-behavior: smooth;
  }
}

/* --- Lenis smooth scroll --- */
html.lenis {
  height: auto;
}

html.lenis body {
  height: auto;
}

html.lenis [data-lenis-prevent] {
  overscroll-behavior: contain;
}

html.lenis-stopped {
  overflow: hidden;
}

/* --- Initial states: CSS hides, GSAP reveals (prevents FOUC) --- */

/* Hero (animations-home.js) */
.hero-section .hero-background__image {
  opacity: 0;
  transform: scale(1.05);
  will-change: transform, opacity;
}

.hero-section #brxe-dvonot {
  opacity: 0;
  transform: translateX(-20px);
}

.hero-section .hero-heading {
  opacity: 0;
  transform: translateY(30px);
}

.hero-section .hero-button__container {
  opacity: 0;
  transform: translateY(30px);
}

.hero-section .hero__social-proof {
  opacity: 0;
  transform: translateX(30px);
}


/* Homepage sections (animations-home.js) */
.solutions-section .section__heading--solutions,
.solutions-section .fr-tabs,
.solutions-section #brxe-ddjlic,
.solutions-section .solutions-tab,
.solutions-section .solutions__card,
#brxe-fupigs .fr-cta-card-alpha,
#brxe-fupigs .fr-cta-card-alpha__text li,
#brxe-dchfdg .section-heading--FAQs,
#brxe-dchfdg .info-lede,
#brxe-dchfdg .fr-faq-accordion-alpha__item {
  opacity: 0;
}

/* Recent projects cards — both homepage and standalone page */
#recent-projects .case-card {
  opacity: 0;
}

/* Template shop — both homepage section and standalone page */
#template-shop .section-eyebrow-heading--template,
#template-shop .section-heading--template,
#template-shop .template {
  opacity: 0;
}

/* Solutions page (animations-pages.js) */
.solution-section .solution-eyebrow-heading,
.solution-section .solution-section__left-div,
.solution-section .solution-card-bravo,
.solution-section .solutions-divider {
  opacity: 0;
}

/* Pricing page (animations-pages.js) */
.fr-process-section-foxtrot .fr-process-grid-foxtrot__sticky-content,
.fr-process-section-foxtrot .fr-process-section-foxtrot__card,
.fr-process-section-foxtrot .fr-process-section-foxtrot__card-step,
.fr-process-section-foxtrot .fr-process-section-foxtrot__cards-intro,
.fr-process-section-foxtrot .fr-process-card-foxtrot__price,
#brxe-hakify {
  opacity: 0;
}

/* Blog hero + body (animations-pages.js) */
.fr-blog-hero-alpha,
.fr-blog-hero-alpha .fr-blog-hero-alpha__heading,
.fr-blog-hero-alpha .fr-blog-meta-alpha,
.fr-blog-post-body-alpha {
  opacity: 0;
}

/* Blog article cards — index + homepage + post related */
.fr-article-section-hotel .fr-intro-alpha,
.fr-article-section-hotel .fr-article-card-hotel {
  opacity: 0;
}
/* Safety net: reveal intro heading after 1s if GSAP never touched it (no inline style) */
.fr-article-section-hotel .fr-intro-alpha:not([style]) {
  animation: fr-intro-fallback 0.5s 1s ease-out forwards;
}
@keyframes fr-intro-fallback {
  to { opacity: 1; }
}

/* Shared: CTA + footer (animations-core.js, every page) */
.cta-section .cta-section__left-div,
.cta-section .cta-section__icon-box,
.footer {
  opacity: 0;
}

/* Shared: Sticky CTA bar */
.sticky__cta {
  opacity: 0;
}

/* --- Hover effects — buttons --- */
.btn--action {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}

.btn--action::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.btn--action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn--action:hover::before {
  left: 100%;
}

/* --- Hover effects — solution cards --- */
.solution-card,
.solution-card-bravo {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.solution-card:hover,
.solution-card-bravo:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* --- Hover effects — process cards (pricing) --- */
.fr-process-section-foxtrot__card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fr-process-section-foxtrot__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* --- Hover effects — CTA icon boxes --- */
.cta-section__icon-box {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-section__icon-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* --- Hover effects — case cards --- */
.case-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.case-card .case-card__image {
  transition: transform 0.4s ease;
}

.case-card:hover .case-card__image {
  transform: scale(1.03);
}

/* --- Hover effects — template cards --- */
.template {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.template:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.template .template__header {
  overflow: hidden;
}

.template .template-header__image {
  transition: transform 0.4s ease;
}

.template:hover .template-header__image {
  transform: scale(1.04);
}

/* --- Blog article cards — base + mobile --- */
.fr-article-card-hotel {
  border-radius: var(--radius-m);
  padding: var(--space-xs) var(--space-s);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.fr-article-card-hotel:hover .fr-article-card-hotel__header,
.fr-article-card-hotel:hover .fr-article-card-hotel__footer {
  margin-left: 0 !important;
}

@media (hover: hover) {
  .fr-article-card-hotel:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.02);
  }
}

@media (max-width: 767px) {
  .fr-article-grid-hotel { --article-card-hotel-spacing: 1.5em; }
  .fr-article-card-hotel__read-more { padding: 0.5em 0; }
  .fr-article-card-hotel:hover .fr-article-card-hotel__footer {
    transform: none !important;
  }
}

/* --- Hero underline grow animation --- */
.hero-heading .underline-reveal {
  text-decoration: none !important;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  transition: background-size 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding-bottom: 2px;
}

.hero-heading .underline-reveal.is-revealed {
  background-size: 100% 2px;
}

/* --- Footer Mon-Fri icon --- */
#brxe-mryipc,
#brxe-mryipc * {
  stroke: white !important;
  fill: white !important;
}

/* --- Footer email wrap --- */
.footer-email {
  overflow-wrap: break-word;
  word-break: break-all;
  min-width: 0;
  max-width: 100%;
}

/* --- Footer newsletter subscribe button --- */
#brxe-srqgin .ff-btn-submit,
#brxe-srqgin .ff-btn-submit:not(.ff_btn_no_style) {
  background-color: var(--primary, #2694c1) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius-m, 6px) !important;
  padding: 0.6em 1.4em !important;
  font-weight: 600 !important;
  font-size: var(--text-m, 1rem) !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
  box-shadow: 0 2px 8px rgba(38, 148, 193, 0.35) !important;
  text-shadow: none !important;
  width: 100% !important;
  margin-top: 0.75em !important;
}

#brxe-srqgin .ff-btn-submit:hover {
  background-color: var(--primary-dark, #1d7aa3) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 14px rgba(38, 148, 193, 0.45) !important;
}

/* --- Fallback: if GSAP fails to load, reveal all pre-hidden elements --- */
html.no-gsap .hero-section .hero-background__image,
html.no-gsap .hero-section #brxe-dvonot,
html.no-gsap .hero-section .hero-heading,
html.no-gsap .hero-section .hero-button__container,
html.no-gsap .hero-section .hero__social-proof,
html.no-gsap .solutions-section .section__heading--solutions,
html.no-gsap .solutions-section .fr-tabs,
html.no-gsap .solutions-section #brxe-ddjlic,
html.no-gsap .solutions-section .solutions-tab,
html.no-gsap .solutions-section .solutions__card,
html.no-gsap #recent-projects .case-card,
html.no-gsap #brxe-fupigs .fr-cta-card-alpha,
html.no-gsap #brxe-fupigs .fr-cta-card-alpha__text li,
html.no-gsap #template-shop .section-eyebrow-heading--template,
html.no-gsap #template-shop .section-heading--template,
html.no-gsap #template-shop .template,
html.no-gsap #brxe-dchfdg .section-heading--FAQs,
html.no-gsap #brxe-dchfdg .info-lede,
html.no-gsap #brxe-dchfdg .fr-faq-accordion-alpha__item,
html.no-gsap .fr-article-section-hotel .fr-intro-alpha,
html.no-gsap .fr-article-section-hotel .fr-article-card-hotel,
html.no-gsap .solution-section .solution-eyebrow-heading,
html.no-gsap .solution-section .solution-section__left-div,
html.no-gsap .solution-section .solution-card-bravo,
html.no-gsap .solution-section .solutions-divider,
html.no-gsap .fr-process-section-foxtrot .fr-process-grid-foxtrot__sticky-content,
html.no-gsap .fr-process-section-foxtrot .fr-process-section-foxtrot__card,
html.no-gsap .fr-process-section-foxtrot .fr-process-section-foxtrot__card-step,
html.no-gsap .fr-process-section-foxtrot .fr-process-section-foxtrot__cards-intro,
html.no-gsap .fr-process-section-foxtrot .fr-process-card-foxtrot__price,
html.no-gsap #brxe-hakify,
html.no-gsap .fr-blog-hero-alpha,
html.no-gsap .fr-blog-hero-alpha .fr-blog-hero-alpha__heading,
html.no-gsap .fr-blog-hero-alpha .fr-blog-meta-alpha,
html.no-gsap .fr-blog-post-body-alpha,
html.no-gsap .cta-section .cta-section__left-div,
html.no-gsap .cta-section .cta-section__icon-box,
html.no-gsap .footer,
html.no-gsap .sticky__cta {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  clip-path: none !important;
}

/* --- Accessibility: reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .hero-section .hero-background__image,
  .hero-section #brxe-dvonot,
  .hero-section .hero-heading,
  .hero-section .hero-button__container,
  .hero-section .hero__social-proof,
  .solutions-section .section__heading--solutions,
  .solutions-section .fr-tabs,
  .solutions-section #brxe-ddjlic,
  .solutions-section .solutions-tab,
  .solutions-section .solutions__card,
  #recent-projects .case-card,
  #brxe-fupigs .fr-cta-card-alpha,
  #brxe-fupigs .fr-cta-card-alpha__text li,
  #template-shop .section-eyebrow-heading--template,
  #template-shop .section-heading--template,
  #template-shop .template,
  #brxe-dchfdg .section-heading--FAQs,
  #brxe-dchfdg .info-lede,
  #brxe-dchfdg .fr-faq-accordion-alpha__item,
  .fr-article-section-hotel .fr-intro-alpha,
  .fr-article-section-hotel .fr-article-card-hotel,
  .solution-section .solution-eyebrow-heading,
  .solution-section .solution-section__left-div,
  .solution-section .solution-card-bravo,
  .solution-section .solutions-divider,
  .fr-process-section-foxtrot .fr-process-grid-foxtrot__sticky-content,
  .fr-process-section-foxtrot .fr-process-section-foxtrot__card,
  .fr-process-section-foxtrot .fr-process-section-foxtrot__card-step,
  .fr-process-section-foxtrot .fr-process-section-foxtrot__cards-intro,
  .fr-process-section-foxtrot .fr-process-card-foxtrot__price,
  #brxe-hakify,
  .fr-blog-hero-alpha,
  .fr-blog-hero-alpha .fr-blog-hero-alpha__heading,
  .fr-blog-hero-alpha .fr-blog-meta-alpha,
  .fr-blog-post-body-alpha,
  .cta-section .cta-section__left-div,
  .cta-section .cta-section__icon-box,
  .footer,
  .sticky__cta {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }

  .scroll-progress {
    display: none;
  }

  .btn--action,
  .solution-card,
  .solution-card-bravo,
  .case-card,
  .template,
  .fr-article-card-hotel,
  .fr-process-section-foxtrot__card,
  .cta-section__icon-box {
    transition: none !important;
  }

  .btn--action::before {
    display: none;
  }

  .nav-overlay__panel,
  .nav-overlay__backdrop,
  .nav-overlay__menu > li,
  .nav-overlay__cta {
    opacity: 1 !important;
  }
}
