/*
 * Homepage hero. Phones/tablets (below 1000px) are first; desktop fixes are at the end
 * (the base desktop hero rules stay in style.css).
 *
 * The photo's face sits in the upper-middle of the frame, so on every phone/tablet the
 * headline and buttons are stacked at the bottom of the hero, on a dark fade, and never
 * cross the face. Portrait screens get the portrait photo (ID 1696) via a <picture>
 * source added in inc/a11y-perf.php; landscape screens keep the wide photo with the
 * text on the left. "html body.home" outranks leftover rules in Additional CSS.
 *
 * EasyWP's CDN caches theme files and ignores ?ver=, so a changed file keeps serving
 * the old copy until the CDN is purged. Rename this file (and its enqueue) to ship
 * changes without a purge.
 */
@media (max-width: 999px) {
  html body.home .nectar_section.top-level {
    box-sizing: border-box !important;
    min-height: 100svh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    padding-top: 0 !important;
  }
  html body.home .nectar_section.top-level > .row_col_wrap_12 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 0 0 auto !important;
  }
  html body.home .nectar_section.top-level .wpb_row {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  html body.home .nectar_section.top-level .row-bg-img {
    object-fit: cover !important;
  }
  html body.home .nectar_section.top-level .row-bg-overlay {
    opacity: 1 !important;
  }
  /* The empty right-hand columns only take up space on small screens */
  html body.home .nectar_section.top-level .vc_col-sm-7 {
    display: none !important;
  }
  html body.home .nectar_section.top-level .vc_col-sm-5,
  html body.home .nectar_section.top-level .vc_col-sm-5 > .vc_column-inner {
    width: 100% !important;
    padding: 0 !important;
    border-bottom: 0 !important;
  }
  html body.home .nectar_section.top-level h1 {
    line-height: 1.12 !important;
    white-space: normal !important;
    word-break: normal !important;
    margin-bottom: 10px !important;
  }
  html body.home .nectar_section.top-level .nectar-split-heading span {
    white-space: normal !important;
  }
  html body.home .nectar_section.top-level .hero-subline-1 {
    white-space: normal !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    line-height: 1.35 !important;
  }
  html body.home .nectar_section.top-level .hero-subline-2 {
    line-height: 1.35 !important;
    margin-bottom: 0 !important;
  }
  html body.home .nectar_section.top-level .wpb_column:has(.nectar-cta) .wpb_wrapper {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  html body.home .nectar_section.top-level .nectar-cta {
    display: inline-block !important;
    margin: 0 !important;
  }
  html body.home .nectar_section.top-level .nectar-cta .link_text {
    white-space: nowrap !important;
  }
  html body.home .nectar_section.top-level h1,
  html body.home .nectar_section.top-level p {
    text-shadow: 0 1px 12px rgba(0,0,0,.45) !important;
  }
}

/* Phones and tablets held upright: face in the clear upper-middle, text at the bottom */
@media (max-width: 999px) and (orientation: portrait) {
  html body.home .nectar_section.top-level {
    padding-bottom: max(32px, env(safe-area-inset-bottom)) !important;
  }
  html body.home .nectar_section.top-level .row-bg-img {
    object-position: 62% 30% !important;
  }
  html body.home .nectar_section.top-level .row-bg-overlay {
    background: linear-gradient(180deg, rgba(4,8,32,.5) 0%, rgba(4,8,32,0) 18%, rgba(4,8,32,0) 50%, rgba(4,8,32,.78) 66%, rgba(4,8,32,.94) 100%) !important;
  }
  /* The inner rows are full-width (they cancel outer padding), so pad them directly */
  html body.home .nectar_section.top-level .wpb_row > .row_col_wrap_12 {
    padding: 0 24px !important;
  }
  html body.home .nectar_section.top-level .wpb_row + .wpb_row {
    margin-top: 20px !important;
  }
  html body.home .nectar_section.top-level .wpb_column:has(.nectar-cta) .wpb_wrapper {
    flex-direction: column !important;
  }
  html body.home .nectar_section.top-level h1 {
    font-size: clamp(26px, 7.4vw, 34px) !important;
  }
  html body.home .nectar_section.top-level .hero-subline-1 {
    font-size: 15px !important;
  }
  html body.home .nectar_section.top-level .hero-subline-2 {
    font-size: 14px !important;
  }
  html body.home .nectar_section.top-level .nectar-cta .link_text {
    font-size: 14px !important;
  }
}

/* Short phones (iPhone SE and similar): tighter type so the face stays clear */
@media (max-width: 999px) and (orientation: portrait) and (max-height: 740px) {
  html body.home .nectar_section.top-level {
    padding-bottom: 22px !important;
  }
  html body.home .nectar_section.top-level h1 {
    font-size: 24px !important;
    margin-bottom: 6px !important;
  }
  html body.home .nectar_section.top-level .hero-subline-1 {
    font-size: 13.5px !important;
  }
  html body.home .nectar_section.top-level .hero-subline-2 {
    font-size: 13px !important;
  }
  html body.home .nectar_section.top-level .wpb_row + .wpb_row {
    margin-top: 14px !important;
  }
  html body.home .nectar_section.top-level .wpb_column:has(.nectar-cta) .wpb_wrapper {
    gap: 8px !important;
  }
}

/* Upright tablets: larger type, buttons side by side */
@media (min-width: 691px) and (max-width: 999px) and (orientation: portrait) {
  html body.home .nectar_section.top-level {
    padding-bottom: 56px !important;
  }
  html body.home .nectar_section.top-level .wpb_row > .row_col_wrap_12 {
    padding: 0 48px !important;
  }
  html body.home .nectar_section.top-level .vc_col-sm-5 {
    max-width: 640px !important;
  }
  html body.home .nectar_section.top-level h1 {
    font-size: 48px !important;
  }
  html body.home .nectar_section.top-level .hero-subline-1 {
    font-size: 20px !important;
  }
  html body.home .nectar_section.top-level .hero-subline-2 {
    font-size: 18px !important;
  }
  html body.home .nectar_section.top-level .wpb_row + .wpb_row {
    margin-top: 28px !important;
  }
  html body.home .nectar_section.top-level .wpb_column:has(.nectar-cta) .wpb_wrapper {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
  }
  html body.home .nectar_section.top-level .nectar-cta .link_text {
    font-size: 16px !important;
  }
}

/* Phones turned sideways: wide photo, face on the right, text on the left */
@media (max-width: 999px) and (orientation: landscape) {
  /* The fixed header (ticker + name) is ~115px tall here; keep the text below it */
  html body.home .nectar_section.top-level {
    padding-top: 128px !important;
    padding-bottom: 20px !important;
  }
  html body.home .nectar_section.top-level .row-bg-img {
    object-position: 85% 15% !important;
  }
  html body.home .nectar_section.top-level .row-bg-overlay {
    background: linear-gradient(90deg, rgba(4,8,32,.85) 0%, rgba(4,8,32,.6) 42%, rgba(4,8,32,0) 66%) !important;
  }
  html body.home .nectar_section.top-level .wpb_row > .row_col_wrap_12 {
    padding: 0 28px !important;
  }
  html body.home .nectar_section.top-level .vc_col-sm-5 {
    width: 52% !important;
    max-width: 440px !important;
  }
  html body.home .nectar_section.top-level .wpb_row + .wpb_row {
    margin-top: 14px !important;
  }
  html body.home .nectar_section.top-level h1 {
    font-size: 26px !important;
  }
  html body.home .nectar_section.top-level .hero-subline-1 {
    font-size: 14px !important;
  }
  html body.home .nectar_section.top-level .hero-subline-2 {
    font-size: 13px !important;
  }
  html body.home .nectar_section.top-level .wpb_column:has(.nectar-cta) .wpb_wrapper {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  html body.home .nectar_section.top-level .nectar-cta .link_text {
    font-size: 13px !important;
  }
}

/* Desktop */
@media (min-width: 1000px) {
  /* Salient's parallax starts the photo 70px above the page, which put Saby's head behind
     the menu. Start it ~80px down and fade its (already dark) top edge into the stage colour. */
  html body.home .nectar_section.top-level > .row-bg-wrap .row-bg {
    background-color: #020a24 !important;
  }
  html body.home .nectar_section.top-level .row-bg-img {
    top: 150px !important;
    height: calc(100% - 150px) !important;
    object-position: 85% 0 !important;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 120px);
    mask-image: linear-gradient(to bottom, transparent 0, #000 120px);
  }
  /* Keep both buttons on one row with one-line labels; the row may run past the text
     column (Salient clips columns for its entrance animation) into the empty space beside it */
  html body.home .nectar_section.top-level .wpb_column:has(.nectar-cta) {
    overflow: visible !important;
  }
  html body.home .nectar_section.top-level .wpb_column:has(.nectar-cta) .wpb_wrapper {
    flex-wrap: nowrap !important;
    gap: 16px !important;
    width: max-content !important;
  }
  html body.home .nectar_section.top-level .nectar-cta {
    flex: 0 0 auto !important;
  }
  html body.home .nectar_section.top-level .nectar-cta .text {
    white-space: nowrap !important;
  }
}
