.maivelo-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--maivelo-white);
  background: var(--maivelo-bg);
  flex-direction: column;
}

.site-main--front,
.maivelo-homepage-main {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.maivelo-homepage-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.maivelo-homepage-content > .alignfull {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.maivelo-hero__video,
.maivelo-hero > .wp-block-cover__video-background {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.maivelo-hero > .wp-block-cover__background {
  display: none;
}

.maivelo-hero > .wp-block-cover__inner-container {
  display: flex;
  flex: 1;
  width: 100%;
}

.maivelo-hero--arabic {
  direction: rtl;
  text-align: start;
  font-family: var(--maivelo-font-arabic);
}

body.home .maivelo-header-part,
.maivelo-header-part--homepage {
  position: absolute;
  z-index: 30;
  width: 100%;
  inset-block-start: 0;
  inset-inline-start: 0;
}

body.home .site-header--block,
.maivelo-header-part--homepage .site-header--block {
  padding: 24px 24px 0;
  background: transparent;
  border: 0;
}

body.home .site-header--block .site-header__inner,
.maivelo-header-part--homepage .site-header__inner {
  padding: 8px 12px;
  border-radius: 12px;
}

body.home .site-header--block .site-branding-block .wp-block-site-logo img,
body.home .site-header--block .site-branding-block .custom-logo,
.maivelo-header-part--homepage .site-branding-block .wp-block-site-logo img,
.maivelo-header-part--homepage .site-branding-block .custom-logo {
  max-width: 8rem;
  max-height: 3rem;
}

.site-header--hero {
  position: relative;
  z-index: 3;
  padding: 24px 24px 0;
  color: var(--maivelo-white);
  background: transparent;
  border: 0;
}

.site-header--hero .site-header__inner {
  display: grid;
  grid-template-areas:
    "brand action toggle"
    "nav nav nav";
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
}

.site-header--hero .site-branding {
  grid-area: brand;
  align-self: center;
  min-width: 0;
}

.site-header--hero .site-branding__logo {
  max-width: 8rem;
  max-height: 3rem;
}

.site-header--hero .site-title {
  overflow: hidden;
  color: var(--maivelo-gold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header--hero .site-header__action {
  grid-area: action;
  align-self: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--maivelo-bg);
  background: var(--maivelo-gold);
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.site-header--hero .menu-toggle {
  grid-area: toggle;
  align-self: center;
  min-height: 40px;
  padding: 8px 12px;
  color: var(--maivelo-white);
  border-color: var(--maivelo-gold);
}

.site-header--hero .primary-navigation {
  grid-area: nav;
  width: 100%;
}

.site-header--hero .primary-navigation > .primary-menu,
.site-header--hero .primary-navigation > div > .primary-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 8px 0 0;
  list-style: none;
}

.site-header--hero .primary-navigation a {
  display: block;
  padding: 8px;
  color: var(--maivelo-white);
  border-radius: 4px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.site-header--hero .primary-navigation a:hover,
.site-header--hero .primary-navigation a:focus-visible {
  color: var(--maivelo-bg);
  background: var(--maivelo-gold);
}

.site-header--hero .primary-navigation .sub-menu {
  position: static;
  display: none;
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 0 4px 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.site-header--hero .primary-navigation:not(.has-submenu-controls) .menu-item-has-children:focus-within > .sub-menu,
.site-header--hero .primary-navigation .menu-item-has-children.is-submenu-open > .sub-menu {
  display: flex;
}

@media (hover: hover) and (pointer: fine) {
  .site-header--hero .primary-navigation .menu-item-has-children:hover > .sub-menu {
    display: flex;
  }
}

.site-header--hero .submenu-toggle {
  color: var(--maivelo-white);
}

.site-header--hero .primary-navigation.is-collapsible {
  display: none;
}

.site-header--hero .primary-navigation.is-collapsible.is-open {
  display: block;
}

.site-header--hero .menu-toggle.is-ready {
  display: inline-flex;
}

.maivelo-hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  align-items: flex-end;
  width: 100%;
  padding: 32px 24px 48px;
}

.maivelo-hero__content-inner {
  display: grid;
  gap: 32px;
  width: 100%;
}

.maivelo-hero__copy {
  max-width: 52rem;
}

.maivelo-hero__title {
  margin: 0;
  color: var(--maivelo-white);
  font-family: var(--maivelo-font-latin);
  font-size: clamp(2.25rem, 9vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: .98;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}

.maivelo-hero[dir="rtl"] .maivelo-hero__title,
.maivelo-hero--arabic .maivelo-hero__title {
  font-family: var(--maivelo-font-arabic);
  letter-spacing: normal;
  line-height: 1.15;
}

.maivelo-hero__title-line {
  display: block;
}

.maivelo-hero__word {
  display: inline-block;
  white-space: nowrap;
}

.maivelo-hero__character,
.maivelo-hero__word--arabic {
  display: inline-block;
  opacity: 1;
  transform: translateX(0);
}

.maivelo-hero--animated .maivelo-hero__character,
.maivelo-hero--animated .maivelo-hero__word--arabic {
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity 500ms ease, transform 500ms ease;
  transition-delay: var(--maivelo-character-delay, 200ms);
}

.maivelo-hero--animated[dir="rtl"] .maivelo-hero__word--arabic {
  transform: translateX(18px);
}

.maivelo-hero--animated.is-ready .maivelo-hero__character,
.maivelo-hero--animated.is-ready .maivelo-hero__word--arabic {
  opacity: 1;
  transform: translateX(0);
}

.maivelo-hero__subheading {
  max-width: 44rem;
  margin: 24px 0 0;
  color: var(--maivelo-cream-light);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.maivelo-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 28px;
}

a.maivelo-hero__cta,
.maivelo-hero__cta > .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--maivelo-gold);
  border-radius: 8px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

a.maivelo-hero__cta--primary,
.maivelo-hero__cta--primary > .wp-block-button__link {
  color: var(--maivelo-bg);
  background: var(--maivelo-gold);
}

a.maivelo-hero__cta--secondary,
.maivelo-hero__cta--secondary > .wp-block-button__link {
  color: var(--maivelo-white);
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.maivelo-hero__tag {
  justify-self: start;
  max-width: 24rem;
  margin: 0;
  padding: 12px 16px;
  color: var(--maivelo-cream-light);
  border-radius: 12px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.maivelo-hero--animated .maivelo-hero__subheading,
.maivelo-hero--animated .maivelo-hero__actions,
.maivelo-hero--animated .maivelo-hero__tag {
  opacity: 0;
  transition-property: opacity;
  transition-duration: 1000ms;
  transition-timing-function: ease;
}

.maivelo-hero--animated .maivelo-hero__subheading {
  transition-delay: 800ms;
}

.maivelo-hero--animated .maivelo-hero__actions {
  transition-delay: 1200ms;
}

.maivelo-hero--animated .maivelo-hero__tag {
  transition-delay: 1400ms;
}

.maivelo-hero--animated.is-ready .maivelo-hero__subheading,
.maivelo-hero--animated.is-ready .maivelo-hero__actions,
.maivelo-hero--animated.is-ready .maivelo-hero__tag {
  opacity: 1;
}

.front-page-content {
  padding-block: clamp(2rem, 6vw, 6rem);
}

@media (max-width: 25rem) {
  body.home .site-header--block .site-header__inner,
  .maivelo-header-part--homepage .site-header__inner {
    grid-template-areas: "brand action nav";
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 8px 10px;
  }

  body.home .site-header--block .site-branding-block .wp-block-site-logo img,
  body.home .site-header--block .site-branding-block .custom-logo,
  .maivelo-header-part--homepage .site-branding-block .wp-block-site-logo img,
  .maivelo-header-part--homepage .site-branding-block .custom-logo {
    max-width: 7rem;
    max-height: 2.625rem;
  }

  body.home .site-header--block .site-header__action-wrap .wp-block-button,
  body.home .site-header--block .site-header__action-wrap .wp-block-button__link,
  .maivelo-header-part--homepage .site-header__action-wrap .wp-block-button,
  .maivelo-header-part--homepage .site-header__action-wrap .wp-block-button__link {
    width: auto;
    padding-inline: 10px;
    font-size: .75rem;
  }

  body.home .site-header--block .site-header__action-wrap,
  .maivelo-header-part--homepage .site-header__action-wrap {
    min-width: 0;
    justify-self: end;
  }

  .maivelo-hero__content {
    min-width: 0;
    padding: 9rem 24px max(40px, calc(24px + env(safe-area-inset-bottom)));
  }

  .maivelo-hero__content-inner,
  .maivelo-hero__copy {
    min-width: 0;
  }

  .maivelo-hero__content-inner {
    gap: 24px;
  }

  .maivelo-hero__title {
    max-width: 100%;
    font-size: clamp(2rem, calc(1.25rem + 4vw), 2.25rem);
    line-height: 1.02;
  }

  .maivelo-hero[dir="rtl"] .maivelo-hero__title,
  .maivelo-hero--arabic .maivelo-hero__title {
    line-height: 1.15;
  }

  .maivelo-hero__subheading {
    margin-block-start: 18px;
    font-size: 1rem;
    line-height: 1.45;
  }

  .maivelo-hero__actions {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    max-width: 24rem;
    margin-block-start: 20px;
  }

  .maivelo-hero__actions .wp-block-button,
  a.maivelo-hero__cta,
  .maivelo-hero__cta > .wp-block-button__link {
    width: 100%;
    min-width: 0;
  }

  .maivelo-hero__tag {
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    overflow-wrap: break-word;
    word-break: normal;
  }
}

/* Preserve main.css's existing narrow block-header layout: the homepage's
   25rem single-row override otherwise lets the cart overlap the logo. */
@media (max-width: 24rem) {
  body.home .site-header--block .site-header__inner,
  .maivelo-header-part--homepage .site-header__inner {
    grid-template-areas: "brand nav" "action action";
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 22.5rem) {
  body.home .site-header--block .site-branding-block .wp-block-site-logo img,
  body.home .site-header--block .site-branding-block .custom-logo,
  .maivelo-header-part--homepage .site-branding-block .wp-block-site-logo img,
  .maivelo-header-part--homepage .site-branding-block .custom-logo {
    max-width: 6rem;
  }

  body.home .site-header--block .site-header__action-wrap .wp-block-button__link,
  .maivelo-header-part--homepage .site-header__action-wrap .wp-block-button__link {
    padding-inline: 8px;
    font-size: .6875rem;
  }
}

@media (min-width: 48rem) {
  .site-header--hero {
    padding-inline: 48px;
  }

  .maivelo-hero__content {
    padding-inline: 48px;
  }

  body.home .site-header--block,
  .maivelo-header-part--homepage .site-header--block {
    padding-inline: 48px;
  }

  .maivelo-hero__title {
    font-size: 3rem;
  }
}

@media (min-width: 64.01rem) {
  .site-header--hero .site-header__inner {
    grid-template-areas: "brand nav action";
    grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr);
    gap: 16px;
    padding: 10px 16px;
  }

  body.home .site-header--block .site-header__inner,
  .maivelo-header-part--homepage .site-header__inner {
    grid-template-areas: "brand nav action";
    grid-template-columns: minmax(8rem, 1fr) auto minmax(8rem, 1fr);
    gap: 16px;
    padding: 10px 16px;
  }

  body.home .site-header--block .primary-navigation,
  .maivelo-header-part--homepage .primary-navigation {
    justify-self: center;
    width: auto;
  }

  body.home .site-header--block .site-header__action-wrap,
  .maivelo-header-part--homepage .site-header__action-wrap {
    justify-self: end;
  }

  .site-header--hero .site-header__action {
    justify-self: end;
    font-size: .875rem;
  }

  .site-header--hero .menu-toggle,
  .site-header--hero .menu-toggle.is-ready {
    display: none;
  }

  .site-header--hero .primary-navigation,
  .site-header--hero .primary-navigation.is-collapsible {
    display: block;
    justify-self: center;
    width: auto;
  }

  .site-header--hero .primary-navigation > .primary-menu,
  .site-header--hero .primary-navigation > div > .primary-menu {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
  }

  .site-header--hero .primary-navigation .menu-item-has-children {
    position: relative;
    display: flex;
    align-items: center;
  }

  .site-header--hero .primary-navigation .sub-menu {
    position: absolute;
    grid-column: auto;
    display: none;
    padding: 8px;
    background: rgba(36, 26, 22, 0.98);
    border: 1px solid var(--maivelo-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  }

  .site-header--hero .primary-navigation:not(.has-submenu-controls) .menu-item-has-children:focus-within > .sub-menu,
  .site-header--hero .primary-navigation .menu-item-has-children.is-submenu-open > .sub-menu {
    display: flex;
  }

  .site-header--hero .primary-navigation a {
    white-space: nowrap;
  }

  .maivelo-hero__content-inner {
    grid-template-columns: minmax(0, 1.6fr) minmax(16rem, .8fr);
    align-items: end;
  }

  .maivelo-hero__tag {
    justify-self: end;
  }

  .maivelo-hero[dir="rtl"] .maivelo-hero__tag,
  .maivelo-hero--arabic .maivelo-hero__tag {
    justify-self: start;
  }
}

@media (max-width: 24rem) {
  .site-header--hero .site-header__inner {
    grid-template-areas:
      "brand toggle"
      "action action"
      "nav nav";
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-header--hero .site-header__action {
    justify-self: stretch;
    text-align: center;
  }
}

@media (min-width: 75rem) {
  .site-header--hero {
    padding-inline: 64px;
  }

  body.home .site-header--block,
  .maivelo-header-part--homepage .site-header--block {
    padding-inline: 64px;
  }

  .maivelo-hero__content {
    padding: 32px 64px 64px;
  }

  .maivelo-hero__title {
    font-size: 3.75rem;
  }
}

@media (min-width: 90rem) {
  .maivelo-hero__title {
    font-size: 4.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maivelo-hero--animated .maivelo-hero__character,
  .maivelo-hero--animated .maivelo-hero__word--arabic,
  .maivelo-hero--animated .maivelo-hero__subheading,
  .maivelo-hero--animated .maivelo-hero__actions,
  .maivelo-hero--animated .maivelo-hero__tag {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
