/* =============================================================
   HERO SLIDESHOW
   Four HD slides fade under a dark brown scrim. The brand plaque sits
   top-left, the "From Homes To Hubs" headline and the Login button
   (id=openLogin) on the left, the nav pill is centred in the top header
   strip (navbar.css), and the dots mirror the active slide at the
   bottom-right.

   The headline used to be baked into assets/hero/Main Frame.png; it is
   live text now, so it stays sharp at every size and is readable by
   screen readers.

   NOTE: nothing between <html> and .hero-nav may get a transform, filter
   or backdrop-filter — the pill is position:fixed (navbar.css) and would
   stop being pinned to the viewport. The scrim below is a plain
   background gradient for that reason.
============================================================= */

.hero{
    --hero-ink:var(--sg-ink);

    /* The hero is exactly as tall as the 1918x728 slides are at the
       screen's width, so on desktop the whole photo is always visible.
       Capped at the slide's own size on very wide screens. */
    --hero-h:min(728px, 37.956vw);

    min-height:0;
    position:relative;
    display:block;
    height:var(--hero-h);
    padding:0;
    overflow:hidden;
    background:#2a1a10;
    color:#fbf6ec;

    /* Swiping sideways changes the slide (hero.js); vertical drags still
       scroll the page. */
    touch-action:pan-y;
}

/* The base stylesheet's white scrim must not fog the slides */
.hero::before{
    content:none;
}

/* The old floating nav button is unused on this page */
.home-btn{
    display:none;
}

/* ── Slideshow layer ──────────────────────────────────────── */
.hero-slides,
.hero-slide,
.hero-slide img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
}

.hero-slides{
    z-index:0;
}

.hero-slide{
    opacity:0;
    transition:opacity .8s ease;
}

.hero-slide.active{
    opacity:1;
}

.hero-slide img{
    object-fit:cover;
    object-position:center;
}

/* ── Foreground: scrim + content ──────────────────────────── */
/* A left-to-right dark brown wash that gives the headline a calm field
   to sit on and fades out over the photo. A second, short gradient along
   the top keeps the nav pill and plaque separated from bright skies. */
.hero-frame{
    position:absolute;
    inset:0;
    z-index:2;
    pointer-events:none;

    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    padding:56px 0 0 clamp(24px,7vw,128px);

    background:
        linear-gradient(180deg, rgba(31,19,11,.46) 0, rgba(31,19,11,0) 26%),
        linear-gradient(90deg, rgba(31,19,11,.90) 0%, rgba(31,19,11,.72) 30%, rgba(31,19,11,.28) 56%, rgba(31,19,11,0) 76%);
}

/* Brand plaque — ivory, so the dark-on-gold logo keeps its contrast.
   Same top line as the nav pill. */
.hero-brand{
    position:absolute;
    top:var(--nav-top, 22px);
    left:clamp(16px,3.2vw,52px);
    z-index:1;

    display:flex;
    align-items:center;
    height:68px;
    padding:0 18px;

    background:rgba(251,248,242,.94);
    border:1px solid rgba(217,184,114,.55);
    border-radius:14px;
    box-shadow:0 10px 28px rgba(20,12,6,.28);

    pointer-events:auto;
}

.hero-brand img{
    display:block;
    width:auto;
    height:58px;
}

.hero-title{
    margin:0;
    font-family:'Fraunces',Georgia,serif;
    font-size:clamp(1.9rem,4.9vw,4.6rem);
    font-weight:600;
    line-height:1.04;
    letter-spacing:-.022em;
    color:#fbf6ec;
    text-shadow:0 2px 24px rgba(20,12,6,.35);
}

.hero-title span{
    color:var(--sg-gold-bright);
}

/* Short gold rule under the headline */
.hero-title::after{
    content:'';
    display:block;
    width:clamp(40px,5vw,72px);
    height:2px;
    margin-top:clamp(12px,1.7vw,22px);
    background:var(--sg-gold-grad);
}

/* Login — the primary action on a dark field, so it takes the gold. */
.hero-book{
    position:relative;
    z-index:2;
    display:inline-flex;
    align-items:center;
    gap:clamp(8px,1vw,12px);
    margin-top:clamp(16px,2.4vw,32px);
    padding:clamp(9px,1.25vw,14px) clamp(20px,2.4vw,32px);

    border:0;
    border-radius:10px;
    background:var(--sg-gold-grad);
    color:var(--sg-espresso);

    cursor:pointer;
    font-family:inherit;
    font-size:clamp(12px,1.15vw,15px);
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;

    pointer-events:auto;
    box-shadow:0 10px 24px rgba(20,12,6,.32), inset 0 1px 0 rgba(255,255,255,.35);
    transition:filter .2s ease, box-shadow .2s ease, transform .2s ease;
}

.hero-book:hover{
    filter:brightness(1.07);
    box-shadow:0 14px 30px rgba(20,12,6,.4), inset 0 1px 0 rgba(255,255,255,.4);
}

.hero-book:active{
    transform:translateY(1px);
}

.hero-book:focus-visible{
    outline:3px solid rgba(217,184,114,.6);
    outline-offset:3px;
}

/* Finger-sized tap area on a button that scales with the viewport. */
.hero-book::after{
    content:'';
    position:absolute;
    inset:-8px;
}

.hero-book span{
    font-size:1.25em;
    line-height:1;
    letter-spacing:0;
    transition:transform .2s ease;
}

.hero-book:hover span{
    transform:translateX(3px);
}

/* ── Nav header: pill nav centered in the top strip ──────────── */
.hero-header{
    position:absolute;
    inset:0 0 auto;
    z-index:1;
    display:flex;
    align-items:flex-end;
    justify-content:center;
    height:112px;
    padding:18px clamp(24px,3.2vw,52px) 12px;
    pointer-events:auto;
}

/* ── Carousel dots — bottom-right of the hero ───────────────── */
.hero-dots{
    position:absolute;
    right:clamp(20px,4.2vw,72px);
    bottom:clamp(16px,2.8vw,40px);
    z-index:4;
    display:flex;
    align-items:center;
    gap:8px;
}

.hero-dot{
    position:relative;
    width:8px;
    height:8px;
    padding:0;
    border:0;
    border-radius:999px;
    background:rgba(255,255,255,.5);
    cursor:pointer;
    transition:width .25s ease, background .2s ease;
}

/* The dot stays small; its tap area does not. */
.hero-dot::after{
    content:'';
    position:absolute;
    inset:-9px -4px;
}

.hero-dot:hover,
.hero-dot:focus-visible{
    background:rgba(255,255,255,.9);
}

.hero-dot.active{
    width:26px;
    background:var(--sg-gold-bright);
}

.hero-dot:focus-visible{
    outline:2px solid #fff;
    outline-offset:3px;
}

/* Fingers: a 8px dot with 8px gaps cannot be tapped reliably, so on touch
   screens the dots sit further apart and each gets a ~28px target. */
@media (pointer:coarse){
    .hero-dots{
        gap:18px;
    }

    .hero-dot::after{
        inset:-14px -8px;
    }
}

/* ── Login modal subtitle ─────────────────────────────────── */
.login-header .login-subtitle{
    margin:10px 0 0;
    font-size:.86rem;
    font-weight:600;
    letter-spacing:.02em;
    color:var(--sg-muted);
}

/* ── Hero responsive ───────────────────────────────────────── */
@media screen and (max-width:768px){
    /* On a phone the 1918:728 proportion would leave the headline
       cramped in a ~140px strip, so the hero gets real height and the
       photo is cropped to the centre instead. The headline moves to the
       bottom-left over a bottom-up scrim. */
    .hero{
        --hero-h:clamp(300px,78vw,460px);
    }

    .hero-header{
        height:82px;
        padding:18px 24px 10px;
    }

    .hero-frame{
        justify-content:flex-end;
        padding:0 20px 44px;
        background:
            linear-gradient(180deg, rgba(31,19,11,.5) 0, rgba(31,19,11,0) 28%),
            linear-gradient(0deg, rgba(31,19,11,.92) 0%, rgba(31,19,11,.66) 42%, rgba(31,19,11,.12) 78%, rgba(31,19,11,0) 100%);
    }

    .hero-brand{
        top:8px;
        left:12px;
        height:60px;
        padding:0 12px;
        border-radius:14px;
    }

    .hero-brand img{
        height:50px;
    }

    .hero-title{
        font-size:clamp(2rem,9vw,3rem);
    }

    .hero-book{
        font-size:13px;
        padding:12px 24px;
    }

    /* Bottom-right corner, level with the Login button. */
    .hero-dots{
        right:20px;
        bottom:max(18px, 3vw);
    }
}

@media (prefers-reduced-motion:reduce){
    .hero-slide,
    .hero-nav a::after,
    .hero-dot,
    .hero-book,
    .hero-book span{
        transition:none;
    }
}
