/* New homepage (templates/new-homepage.php). Scoped under .nh. Animation lives in assets/js/new-homepage.js. */

.nh {
    --nh-primary: #f36e51;
    --nh-primary-dark: #e2573a;
    --nh-light: #f6f6f6;
    --nh-charcoal: #3c3c3b;
    --nh-dark: #1a1818;
    --nh-text: #1a1818;
    --nh-space: clamp(56px, 7vw, 104px);
    --nh-radius: 4px;
    --nh-ease: cubic-bezier(.22, .61, .36, 1);
    color: var(--nh-text);
    font-size: 16px;
    line-height: 1.55;
    overflow-x: clip;
}

/* The design replaces the sitewide orange header bar with the USP bar under the hero. */
.page-template-new-homepage .atlantis-header-usps { display: none; }

.nh ul { list-style: none; margin: 0; padding: 0; }
.nh img { display: block; max-width: 100%; height: auto; }

/* ---------- Shared pieces ---------- */

.nh-section { padding: var(--nh-space) 0; position: relative; }
/* Anchor links and keyboard focus land below the sticky header, not behind it. */
.nh > section, .nh a, .nh button { scroll-margin-top: 130px; }
.nh-bg-white { background: #fff; }
.nh-bg-light { background: var(--nh-light); }
.nh-bg-charcoal { background: var(--nh-charcoal); }
.nh-bg-dark { background: var(--nh-dark); }
.nh-bg-primary { background: var(--nh-primary); }
.nh-inverse, .nh-inverse .nh-title, .nh-inverse .nh-content, .nh-inverse .nh-lead { color: #fff; }

/* Two sections with the same background read as one block (Imperium + its cards). */
.nh-bg-white + .nh-bg-white,
.nh-bg-light + .nh-bg-light,
.nh-bg-charcoal + .nh-bg-charcoal,
.nh-bg-dark + .nh-bg-dark { margin-top: -1px; padding-top: 0; }

.nh-eyebrow {
    color: var(--nh-primary);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: .02em;
    line-height: 1.4;
    margin: 0 0 12px;
    text-transform: uppercase;
}

.nh-title {
    color: inherit;
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 300;
    letter-spacing: -.01em;
    line-height: 1.16;
    margin: 0;
}
.nh-title strong { font-weight: 700; }

.nh-rule {
    background: var(--nh-primary);
    display: block;
    height: 3px;
    margin: 26px 0 30px;
    transform-origin: left center;
    width: 92px;
}

.nh-lead { font-size: 16px; font-weight: 600; line-height: 1.55; margin: 0 0 28px; max-width: 30em; }

.nh-content { font-size: 16px; font-weight: 300; }
.nh-content p { margin: 0 0 24px; }
.nh-content strong, .nh-content b { font-weight: 600; }
.nh-content > :last-child { margin-bottom: 32px; }

.nh-btn {
    background: var(--nh-primary);
    border: 1px solid var(--nh-primary);
    border-radius: var(--nh-radius);
    color: #fff;
    display: inline-block;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    min-width: 220px;
    padding: 14px 34px;
    text-align: center;
    text-decoration: none;
    transition: background-color .25s var(--nh-ease), border-color .25s var(--nh-ease), color .25s var(--nh-ease), transform .25s var(--nh-ease), box-shadow .25s var(--nh-ease);
}
.nh-btn:hover, .nh-btn:focus-visible {
    background: var(--nh-primary-dark);
    border-color: var(--nh-primary-dark);
    box-shadow: 0 10px 24px -12px rgba(243, 110, 81, .9);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}
.nh-btn--white { background: #fff; border-color: #fff; color: var(--nh-text); }
.nh-btn--white:hover, .nh-btn--white:focus-visible { background: var(--nh-dark); border-color: var(--nh-dark); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7); color: #fff; }
.nh-btn--outline { background: transparent; color: var(--nh-primary); }
.nh-btn--outline:hover, .nh-btn--outline:focus-visible { color: #fff; }

.nh-arrows { display: flex; gap: 5px; margin-top: 30px; }
.nh-arrow {
    align-items: center;
    background: var(--nh-light);
    border: 0;
    border-radius: var(--nh-radius);
    color: var(--nh-primary);
    cursor: pointer;
    display: inline-flex;
    height: 44px;
    justify-content: center;
    padding: 0;
    transition: background-color .25s var(--nh-ease), color .25s var(--nh-ease), opacity .25s;
    width: 44px;
}
.nh-arrow--next svg { transform: scaleX(-1); }
.nh-arrow:hover, .nh-arrow:focus-visible { background: var(--nh-primary); color: #fff; }
.nh-arrow:disabled { cursor: default; opacity: .35; pointer-events: none; }
.nh-bg-light .nh-arrow, .nh-inverse .nh-arrow, .nh-hero .nh-arrow { background: #fff; }
.nh-bg-light .nh-arrow:hover, .nh-inverse .nh-arrow:hover, .nh-hero .nh-arrow:hover { background: var(--nh-primary); }

/* ---------- Hero slider ---------- */

.nh-hero {
    background: var(--nh-dark);
    color: #fff;
    min-height: clamp(520px, 43vw, 760px);
    overflow: hidden;
    position: relative;
}
.nh-hero__slide { inset: 0; opacity: 0; position: absolute; visibility: hidden; }
.nh-hero__slide.is-active { opacity: 1; visibility: visible; z-index: 1; }

.nh-hero__media { inset: 0; overflow: hidden; position: absolute; }
.nh-hero__media img { height: 100%; object-fit: cover; object-position: center; width: 100%; }
/* First load: the photo and text wait hidden, at the zoom's starting point, until the script fades them in. */
.nh-js .nh-hero__slide.is-active .nh-hero__media img { transform: scale(1.08); }
.nh-js .nh-hero__slide:first-child .nh-hero__media img { opacity: 0; }
/* Own GPU layer from the first paint: the slow zoom glides instead of snapping a pixel at a time. */
.nh-hero__media img { will-change: transform; }
.nh-js .nh-hero__slide.is-active [data-nh-hero-item] { opacity: 0; }
/* Left to right shade keeps the white text readable over any photo or video. */
.nh-hero__media::after {
    background: linear-gradient(90deg, rgba(10, 10, 10, .78) 0%, rgba(10, 10, 10, .55) 34%, rgba(10, 10, 10, .12) 62%, rgba(10, 10, 10, 0) 80%);
    content: '';
    inset: 0;
    position: absolute;
}
.nh-hero__video { inset: 0; opacity: 0; position: absolute; transition: opacity 1s ease; }
.nh-hero__video.is-ready { opacity: 1; }
.nh-hero__video iframe {
    border: 0;
    height: 56.25vw;
    left: 50%;
    min-height: 100%;
    min-width: 177.78vh;
    pointer-events: none;
    position: absolute;
    top: 50%;
    /* Oversized so the YouTube title bar and logo fall outside the hero. */
    transform: translate(-50%, -50%) scale(1.25);
    width: 100vw;
}

.nh-hero__inner { align-items: center; display: flex; height: 100%; min-height: inherit; position: relative; z-index: 2; }
.nh-hero__content { max-width: 620px; padding: 70px 0 90px; }
.nh-hero__title { color: #fff; font-size: clamp(28px, 2.75vw, 42px); font-weight: 700; line-height: 1.15; margin: 0 0 26px; text-wrap: balance; }
.nh-hero__text { font-size: clamp(16px, 1.25vw, 18px); font-weight: 300; line-height: 1.5; margin: 0 0 36px; }
.nh-hero__buttons { display: flex; flex-wrap: wrap; gap: 18px; }

.nh-hero__controls { align-items: center; bottom: 28px; display: flex; justify-content: space-between; left: 0; position: absolute; right: 0; z-index: 3; }
.nh-hero__controls .nh-arrows { margin: 0; }
.nh-hero__dots { align-items: center; display: flex; gap: 8px; }
.nh-hero__pause { align-items: center; background: none; border: 0; color: #fff; cursor: pointer; display: inline-flex; height: 32px; justify-content: center; margin-left: 6px; opacity: .8; padding: 0; transition: opacity .2s; width: 32px; }
.nh-hero__pause:hover { opacity: 1; }
.nh-hero__pause svg { fill: currentColor; }
.nh-hero__pause .nh-icon-play, .nh-hero__pause.is-paused .nh-icon-pause { display: none; }
.nh-hero__pause.is-paused .nh-icon-play { display: inline; }
.nh-hero__dot { background: rgba(255, 255, 255, .35); border: 0; border-radius: 2px; cursor: pointer; height: 3px; overflow: hidden; padding: 0; position: relative; width: 44px; }
.nh-hero__dot::before { content: ''; inset: -12px 0; position: absolute; }
.nh-hero__dot span { background: #fff; display: block; height: 100%; transform: scaleX(0); transform-origin: left center; }
.nh-hero__dot.is-active span { background: var(--nh-primary); }

/* ---------- USP bar ---------- */

.nh-usp { background: var(--nh-primary); color: #fff; padding: 17px 0; }
.nh-usp__list { align-items: center; display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; }
.nh-usp__item { align-items: center; color: #fff; display: inline-flex; font-size: clamp(15px, 1.25vw, 18px); font-weight: 300; gap: 10px; text-decoration: none; }
a.nh-usp__item:hover { color: #fff; text-decoration: underline; }
.nh .nh-usp__icon { height: 20px; object-fit: contain; width: 20px; }

/* ---------- Image strip ---------- */

.nh-strip { display: flex; }
.nh-strip__item { flex: 1 1 0; height: clamp(150px, 12.3vw, 240px); overflow: hidden; }
.nh-strip__item img { height: 100%; object-fit: cover; width: 100%; }

/* ---------- Accordion ---------- */

.nh-accordion__item { background: #fff; border-radius: 6px; margin-bottom: 10px; }
.nh-bg-white .nh-accordion__item { background: var(--nh-light); }
.nh-inverse .nh-accordion__item { color: var(--nh-text); }
.nh-accordion__heading { font-size: inherit; margin: 0; }
.nh-accordion__toggle {
    align-items: center;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    font-size: clamp(18px, 1.5vw, 22px);
    font-weight: 600;
    justify-content: space-between;
    padding: 17px 30px 17px 20px;
    text-align: left;
    width: 100%;
}
.nh-accordion__state { font-weight: 700; text-transform: uppercase; transition: color .25s; }
.nh-accordion__toggle:hover .nh-accordion__state { color: var(--nh-primary); }
.nh-accordion__toggle .hide-label, .nh-accordion__toggle.collapsed .show-label { display: inline; }
.nh-accordion__toggle .show-label, .nh-accordion__toggle.collapsed .hide-label { display: none; }
.nh-accordion__body { padding: 12px 20px 30px; }
.nh-accordion__body.nh-content > :last-child { margin-bottom: 0; }
.nh-accordion__body .nh-btn { margin-top: 8px; }

/* ---------- Text and image ---------- */

.nh-text-image__media { border-radius: var(--nh-radius); overflow: hidden; }
.nh-text-image__media img { width: 100%; }

/* ---------- Card carousel ---------- */

.nh-cards { overflow: hidden; }
.nh-cards__head { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; margin-bottom: 40px; }
.nh-cards__head .nh-rule { margin-bottom: 0; }
.nh-cards__head .nh-lead { margin: 16px 0 0; }

/* The track runs past the container to the edge of the screen, as in the design. */
/* Cut at the container's left edge, so the first card always lines up with the heading. The few px of slack keep focus outlines whole. */
.nh-cards__viewport { --nh-gap: 28px; --nh-per: 3.45; clip-path: inset(-10px -100vw -10px -6px); touch-action: pan-y; }
.nh-cards__track { cursor: grab; display: flex; gap: var(--nh-gap); user-select: none; will-change: transform; }
.nh-cards__track.is-dragging { cursor: grabbing; }
.nh-cards__track.is-dragging a { pointer-events: none; }
.nh-card { flex: 0 0 calc((100% - var(--nh-gap) * (var(--nh-per) - 1)) / var(--nh-per)); }
.nh-card__link { aspect-ratio: 1; background: #d9d9d9; border-radius: var(--nh-radius); color: #fff; display: block; overflow: hidden; position: relative; }
.nh-card__link img { height: 100%; object-fit: cover; transition: transform .7s var(--nh-ease); width: 100%; }
.nh-card__link::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .78) 100%); content: ''; inset: 0; position: absolute; }
a.nh-card__link:hover img { transform: scale(1.06); }
.nh-card__caption { bottom: 0; font-size: clamp(15px, 1.2vw, 17px); left: 0; line-height: 1.45; padding: 0 30px 24px; position: absolute; right: 0; z-index: 1; }
.nh-card__caption strong { display: block; font-weight: 600; }
.nh-card__caption span { display: block; font-weight: 300; }

/* ---------- Icon grid ---------- */

.nh-icons__grid { display: grid; gap: 54px 20px; grid-template-columns: repeat(3, 1fr); }
.nh-icons__item { align-items: center; color: inherit; display: flex; flex-direction: column; font-size: clamp(16px, 1.3vw, 19px); font-weight: 600; gap: 26px; line-height: 1.25; text-align: center; text-decoration: none; }
.nh-icons__item span { max-width: 9em; }
.nh .nh-icons__item img { height: 78px; object-fit: contain; transition: transform .4s var(--nh-ease); width: 78px; }
a.nh-icons__item:hover { color: var(--nh-primary); text-decoration: none; }
a.nh-icons__item:hover img { transform: translateY(-6px); }

/* ---------- Text slider and image ---------- */

.nh-text-slider { overflow: hidden; }
.nh-text-slider__body { max-width: 580px; }
.nh-text-slider__slides { display: grid; }
.nh-text-slider__slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; }
.nh-text-slider__slide.is-active { opacity: 1; visibility: visible; }
.nh-text-slider__slide .nh-title { font-weight: 300; }
.nh-text-slider__media { bottom: 0; overflow: hidden; position: absolute; right: 0; top: 0; width: 36vw; }
/* One photo per slide, stacked; the active one fades in over the others. */
.nh-text-slider__media img { height: 100%; inset: 0; object-fit: cover; opacity: 0; position: absolute; transition: opacity .7s var(--nh-ease); width: 100%; }
.nh-text-slider__media img.is-active { opacity: 1; }
.nh-text-slider__media img.nh-focus-top { object-position: center top; }
.nh-text-slider__media img.nh-focus-bottom { object-position: center bottom; }

/* ---------- CTA card ---------- */

.nh-cta { overflow: hidden; padding: clamp(40px, 5.2vw, 76px) 0 clamp(50px, 6vw, 90px); position: relative; }
.nh-cta__media { inset: -12% 0; position: absolute; }
.nh-cta__media img { height: 100%; object-fit: cover; width: 100%; }
.nh-cta__card { background: var(--nh-primary); border-radius: var(--nh-radius); max-width: 640px; padding: clamp(36px, 4.8vw, 70px) clamp(28px, 6.5vw, 95px); position: relative; }
.nh-cta__card .nh-eyebrow { color: #fff; }
.nh-cta__card .nh-rule { background: #fff; }
.nh-cta__card .nh-lead { margin-bottom: 34px; }
.nh-cta__actions { align-items: center; display: flex; flex-wrap: wrap; gap: 20px 40px; }
.nh-cta__actions .nh-btn { color: var(--nh-primary); font-weight: 600; }
.nh-cta__actions .nh-btn:hover { color: #fff; }
.nh-cta__phone { color: #fff; font-size: 19px; font-weight: 300; line-height: 1.3; margin: 0; }
.nh-cta__phone a { color: var(--nh-text); display: block; font-size: 24px; font-weight: 700; text-decoration: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1199.98px) {
    .nh-cards__viewport { --nh-per: 2.6; }
}

@media (max-width: 991.98px) {
    .nh-cards__viewport { --nh-per: 2.2; --nh-gap: 20px; }
    /* Photo above the text. */
    .nh-text-slider { display: flex; flex-direction: column; padding-top: 0; }
    .nh-text-slider__body { max-width: none; }
    .nh-text-slider__media { height: 62vw; margin-bottom: 48px; max-height: 480px; order: -1; position: relative; width: 100%; }
    .nh-usp__list { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767.98px) {
    .nh-hero { min-height: 560px; }
    .nh-hero__media::after { background: linear-gradient(180deg, rgba(10, 10, 10, .45) 0%, rgba(10, 10, 10, .72) 100%); }
    .nh-hero__content { padding: 56px 0 96px; }
    .nh-hero__buttons .nh-btn { flex: 1 1 100%; }
    .nh-strip { flex-wrap: wrap; }
    .nh-strip__item { flex: 1 1 50%; height: 38vw; }
    .nh-rule { margin: 20px 0 24px; }
    .nh-cards__viewport { --nh-per: 1.25; --nh-gap: 16px; }
    .nh-card__caption { padding: 0 20px 18px; }
    .nh-icons__grid { gap: 36px 12px; grid-template-columns: repeat(2, 1fr); }
    .nh .nh-icons__item img { height: 60px; width: 60px; }
    .nh-btn { min-width: 0; }
}

@media (max-width: 479.98px) {
    .nh-usp__list { grid-template-columns: 1fr; }
    .nh-cta__actions .nh-btn { width: 100%; }
}

/* Keyboard focus is always visible, on any background. */
.nh a:focus-visible, .nh button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.nh-btn:focus-visible { outline-color: var(--nh-text); }
.nh-inverse .nh-btn:focus-visible, .nh-hero .nh-btn:focus-visible { outline-color: #fff; }

/* Elements start hidden only when the script is going to animate them in. */
.nh-js [data-nh-reveal] { opacity: 0; }
.nh-js [data-nh-lines] { visibility: hidden; }
/* Room for descenders inside the line masks, so letters like g and y are not cut. */
.nh-title [class*="line-mask"] { margin-bottom: -.22em; padding-bottom: .22em; }
/* An inline raised mark reads as a new line to SplitText and the title breaks after it. */
[data-nh-lines] sup { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
    .nh-js [data-nh-reveal] { opacity: 1; }
    .nh-js [data-nh-lines] { visibility: visible; }
    .nh-js .nh-hero__slide.is-active .nh-hero__media img { transform: none; }
    .nh-js .nh-hero__slide:first-child .nh-hero__media img { opacity: 1; }
    .nh-js .nh-hero__slide.is-active [data-nh-hero-item] { opacity: 1; }
    .nh-btn, .nh-card__link img, .nh .nh-icons__item img, .nh-text-slider__media img { transition: none; }
}
