/* cms2 hero module */
.cms2-hero { position: relative; overflow: hidden; background: #0b0d10; color: #fff; }
.cms2-hero-full   { height: 100vh; }
.cms2-hero-large  { height: clamp(520px, 78vh, 760px); }
.cms2-hero-medium { height: clamp(380px, 56vh, 560px); }
.cms2-hero-small  { height: clamp(260px, 38vh, 400px); }

.cms2-hero .cms2-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.cms2-hero .cms2-slide.active { opacity: 1; pointer-events: auto; }

.cms2-hero-media { position: absolute; inset: 0; background-position: center; background-size: cover; }
/* The iframe form: YouTube always fills its frame 16:9, so covering the slide
   means sizing the frame to 16:9 of the larger axis and centring the overflow. */
.cms2-video-bg {
    position: absolute; top: 50%; left: 50%;
    width: 177.78vh; min-width: 100%; height: 56.25vw; min-height: 100%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
/* A <video> needs none of that -- object-fit crops it for us, whatever its
   aspect. Element + class outranks the rule above, so this wins without
   !important and the iframe branch is untouched. */
video.cms2-video-bg {
    top: 0; left: 0;
    width: 100%; height: 100%;
    min-width: 0; min-height: 0;
    transform: none;
    object-fit: cover;
}
.cms2-hero-shade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.8) 100%),
                linear-gradient(90deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 60%);
}
.cms2-hero-inner {
    position: absolute;
    left: 0; right: 0;
    bottom: clamp(44px, 8vh, 90px);
    padding: 0 clamp(22px, 4vw, 48px);
    max-width: var(--cms2-max-width, none);
    margin: 0 auto;
}
.cms2-hero-heading {
    margin: 0;
    font-size: clamp(38px, 6.5vw, 92px);
    line-height: .95;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -.015em;
    max-width: 14ch;
}
.cms2-hero-sub { font-size: 17px; line-height: 1.5; max-width: 520px; margin: 16px 0 24px; color: rgba(255,255,255,.85); }
.cms2-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* buttons (shared) */
.cms2-btn {
    display: inline-block;
    padding: 13px 28px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    transition: opacity .15s, background .15s;
    border: 0;
    cursor: pointer;
}
.cms2-btn-primary { background: #111; color: #fff; }
.cms2-hero .cms2-btn-primary { background: #fff; color: #111; }
.cms2-btn-primary:hover { opacity: .85; }
.cms2-btn-ghost { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(8px); }
.cms2-btn-ghost:hover { background: rgba(255,255,255,.28); }
.cms2-btn-ghost-dark { background: transparent; color: #111; box-shadow: inset 0 0 0 2px #111; }

/* slider chrome (shared with textslider) */
.cms2-slider-arrows { position: absolute; bottom: 30px; right: clamp(22px, 4vw, 48px); display: flex; gap: 8px; z-index: 4; }
.cms2-slider-prev, .cms2-slider-next {
    width: 52px; height: 52px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(10px);
    border: 0; color: #fff;
    font-size: 26px; line-height: 1;
    cursor: pointer;
}
.cms2-slider-prev:hover, .cms2-slider-next:hover { background: rgba(255,255,255,.32); }
.cms2-slider-dots { position: absolute; bottom: 34px; left: clamp(22px, 4vw, 48px); display: flex; gap: 8px; z-index: 4; }
.cms2-slider-dot { width: 32px; height: 3px; background: rgba(255,255,255,.3); border: 0; padding: 0; cursor: pointer; }
.cms2-slider-dot.active { background: #fff; }
.cms2-slider-dots-dark .cms2-slider-dot { background: rgba(0,0,0,.2); }
.cms2-slider-dots-dark .cms2-slider-dot.active { background: #111; }

/* layout B: split */
.cms2-hero-b { background: #f5f5f4; color: #111; }
.cms2-hero-b .cms2-slide { display: flex; }
.cms2-hero-b-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 5vw, 72px);
}
.cms2-hero-b .cms2-hero-sub { color: #444; }
.cms2-hero-b-media { flex: 1.15; position: relative; overflow: hidden; }
.cms2-hero-b-media img { width: 100%; height: 100%; object-fit: cover; }
.cms2-hero-b .cms2-slider-dots { left: clamp(24px, 5vw, 72px); }
@media (max-width: 760px) {
    .cms2-hero-b .cms2-slide { flex-direction: column-reverse; }
    .cms2-hero-b-text { padding-bottom: 60px; }
}

/* Photo for this section, and the mobile one when it has been supplied.
 *
 * cms2_bg_style() emits --cms2-bg (always) and --cms2-bg-m (only when the
 * "Image (mobile)" slot is filled), and nothing else — no inline
 * `background-image`, because an inline style would outrank the media query
 * below and the swap would silently never happen.
 *
 * The swap is CSS rather than PHP because one cached HTML file serves every
 * visitor: the server must not pick a photo per device. The fallback chain means
 * a section with no mobile image keeps the desktop one.
 */
.cms2-hero-media { background-image: var(--cms2-bg); }
@media (max-width: 760px) {
    .cms2-hero-media { background-image: var(--cms2-bg-m, var(--cms2-bg)); }
}
