/**
 * Homepage Styles
 * Hero section and front-page specific layout.
 * dandysite-jane theme
 *
 * Brand values come from ds-theme-customizations plugin via CSS variables.
 * Edit .less files in that plugin for color/font overrides.
 */


/* =====================================================================
   HOME HERO
   ===================================================================== */

.home-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Height set via inline style from meta field */
}

/* Background image layer */
.home-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 0;
    /* Slight scale so Ken Burns / parallax never shows edges */
    transform: scale(1.02);
}

/* Dark overlay — improves text legibility over any image */
.home-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.45) 60%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 1;
}

/* Content container */
.home-hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-2xl, 4rem) var(--spacing-lg, 2rem);
    max-width: 820px;
    width: 100%;
    gap: var(--spacing-md, 1rem);
}

/* Logo */
.home-hero__logo {
    width: auto;
    max-width: 220px;
    max-height: 160px;
    object-fit: contain;
    margin-bottom: var(--spacing-sm, 0.5rem);
}

/* Headline */
.home-hero__headline {
    font-family: var(--font-heading, 'EB Garamond', Georgia, serif);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.25;
    color: #fff;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    max-width: 680px;
}

/* Tagline */
.home-hero__tagline {
    font-family: var(--font-body, 'Lato', sans-serif);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    max-width: 560px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* CTA Button — white outline, glass background */
.home-hero__cta {
    display: inline-block;
    margin-top: var(--spacing-sm, 0.5rem);
    padding: 0.7em 2em;
    font-family: var(--font-body, 'Lato', sans-serif);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: var(--border-radius, 4px);
    transition: background 0.25s ease, border-color 0.25s ease;
    white-space: nowrap;
}

.home-hero__cta:hover,
.home-hero__cta:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 1);
    color: #fff;
    text-decoration: none;
    outline: none;
}

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

/* Scroll indicator (optional — shown if .home-hero--show-scroll class present) */
.home-hero__scroll {
    position: absolute;
    bottom: var(--spacing-lg, 2rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-hero__scroll::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.4);
    animation: hero-scroll-pulse 2s ease-in-out infinite;
}

@keyframes hero-scroll-pulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
    50%       { opacity: 0.8; transform: scaleY(1); }
}


/* =====================================================================
   FALLBACK — no featured image set
   ===================================================================== */

.home-hero--no-image {
    background-color: var(--color-wine-red, #7A1F2B);
    min-height: 60vh;
}

.home-hero--no-image .home-hero__bg {
    display: none;
}

.home-hero--no-image .home-hero__overlay {
    background: linear-gradient(
        135deg,
        rgba(122, 31, 43, 0.9) 0%,
        rgba(63, 107, 58, 0.7) 100%
    );
}


/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
    .home-hero__content {
        padding: var(--spacing-xl, 3rem) var(--spacing-md, 1rem);
    }

    .home-hero__logo {
        max-width: 160px;
    }

    .home-hero__headline {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    .home-hero__tagline {
        font-size: 0.95rem;
    }

    .home-hero__cta {
        font-size: 0.8rem;
        padding: 0.65em 1.6em;
    }
}

@media (max-width: 480px) {
    .home-hero__logo {
        max-width: 130px;
    }
}


/* =====================================================================
   FRONT PAGE BLOCK CONTENT AREA
   Ensures the_content() blocks below the hero get reasonable spacing
   ===================================================================== */

.front-page-content {
    /* Blocks manage their own internal spacing.
       This wrapper just ensures we're clear of the hero. */
}

.front-page-content .wp-block-group:first-child,
.front-page-content > *:first-child {
    /* No extra top margin needed — hero provides visual break */
}


/* =====================================================================
   CLASS RENAME — old .home-hero-* → new .hero-* aliases
   Keeps backward compat if any markup referenced the old names.
   ===================================================================== */

.home-hero { /* alias — front-page.php now uses .hero--fullbleed */ }


/* =====================================================================
   HERO + HEADER INTERACTION
   header-spacer handles the push-down on solid pages automatically.
   On overlay pages we hide it so the hero fills from the very top.
   We also zero site-main padding on hero pages so nothing adds
   unexpected space above the hero.
   ===================================================================== */

/* Overlay: hide the spacer, hero starts at top: 0 behind fixed header */
.header-style-overlay .header-spacer {
    display: none;
}

/* Hero pages: zero any default site-main padding/margin */
.hero--fullbleed,
.hero--split {
    /* Reset site-main top spacing — hero owns its own top edge */
}

.site-main:has(.hero--fullbleed),
.site-main:has(.hero--split) {
    padding-top: 0;
    margin-top: 0;
}


/* =====================================================================
   BASE HERO — shared across all layouts
   ===================================================================== */

.hero {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero__logo-link {
    display: inline-block;
    line-height: 0;
}

.hero__logo {
    width: auto;
    max-width: 220px;
    max-height: 160px;
    object-fit: contain;
}

.hero__headline {
    font-family: var(--font-heading, 'EB Garamond', Georgia, serif);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.25;
    margin: 0;
    max-width: 680px;
}

.hero__tagline {
    font-family: var(--font-body, 'Lato', sans-serif);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    margin: 0;
    max-width: 560px;
}

.hero__cta {
    display: inline-block;
    padding: 0.7em 2em;
    font-family: var(--font-body, 'Lato', sans-serif);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--border-radius, 4px);
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    white-space: nowrap;
}

.hero__cta:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}


/* =====================================================================
   FULL BLEED LAYOUT
   ===================================================================== */

.hero--fullbleed {
    display: flex;
    align-items: center;
    justify-content: center;
    /* height set via inline style from meta field */
    max-height: 100vh;   /* Fallback */
    max-height: 100svh;  /* Small viewport height — excludes browser chrome. Fixes Edge/Windows
                            where 100vh is calculated to include tab/address bar height. */
}

.hero--fullbleed .hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 0;
    transform: scale(1.02); /* prevent edge flicker on parallax/animation */
}

.hero--fullbleed .hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.45) 60%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 1;
}

.hero--fullbleed .hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-2xl, 4rem) var(--spacing-lg, 2rem);
    max-width: 820px;
    width: 100%;
    gap: var(--spacing-md, 1rem);
}

/* Full bleed text colors — always on dark bg */
.hero--fullbleed .hero__logo {
    margin-bottom: var(--spacing-sm, 0.5rem);
}

.hero--fullbleed .hero__headline {
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero--fullbleed .hero__tagline {
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Full bleed CTA — white outline, glass bg */
.hero--fullbleed .hero__cta {
    margin-top: var(--spacing-sm, 0.5rem);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hero--fullbleed .hero__cta:hover,
.hero--fullbleed .hero__cta:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
    text-decoration: none;
}

/* Full bleed fallback — no featured image */
.hero--fullbleed.hero--no-image {
    background-color: var(--color-wine-red, #7A1F2B);
    min-height: 60vh;
}
.hero--fullbleed.hero--no-image .hero__bg { display: none; }
.hero--fullbleed.hero--no-image .hero__overlay {
    background: linear-gradient(135deg, rgba(122, 31, 43, 0.9) 0%, rgba(63, 107, 58, 0.7) 100%);
}


/* =====================================================================
   SPLIT LAYOUTS — shared structure
   ===================================================================== */

.hero--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* min-height set via inline style from meta field */
}

/* Image left → image col first, panel col second (default DOM order) */
.hero--split-left .hero__image-col { order: 1; }
.hero--split-left .hero__panel     { order: 2; }

/* Image right → swap column order visually via order property */
.hero--split-right .hero__image-col { order: 2; }
.hero--split-right .hero__panel     { order: 1; }

/* Image column */
.hero__image-col {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero__image-placeholder {
    position: absolute;
    inset: 0;
    background: var(--color-border, #D4C8B5);
}

/* Content panel column */
.hero__panel {
    display: flex;
    align-items: center;
    background: var(--color-background, #F3E9D7);
    padding: var(--spacing-2xl, 4rem) var(--spacing-xl, 3rem);
}

.hero--split .hero__content {
    /* Explicitly reset any positioning from fullbleed context */
    position: static;
    z-index: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: var(--spacing-md, 1rem);
    max-width: 480px;
    width: 100%;
}

/* Split text colors — on light parchment panel */
.hero--split .hero__logo {
    max-width: 180px;
    max-height: 120px;
    margin-bottom: var(--spacing-xs, 0.25rem);
    filter: none; /* override plugin rule that inverts all .hero__logo to white */
}

.hero--split .hero__headline {
    color: var(--color-text, #2A2420);
    text-align: left;
}

.hero--split .hero__tagline {
    color: var(--color-text-light, #5A524D);
    text-align: left;
}

/* Split CTA — wine red, solid */
.hero--split .hero__cta {
    margin-top: var(--spacing-sm, 0.5rem);
    color: #fff;
    background: var(--color-wine-red, #7A1F2B);
    border: 1px solid var(--color-wine-red, #7A1F2B);
}

.hero--split .hero__cta:hover,
.hero--split .hero__cta:focus {
    background: var(--color-wine-highlight, #9B2C3A);
    border-color: var(--color-wine-highlight, #9B2C3A);
    color: #fff;
    text-decoration: none;
}

/* Split fallback — no image */
.hero--split.hero--no-image .hero__image-col {
    background: var(--color-border, #D4C8B5);
}


/* =====================================================================
   RESPONSIVE — split layouts collapse to stacked
   ===================================================================== */

@media (max-width: 900px) {
    .hero--split {
        grid-template-columns: 1fr;
    }

    /* On mobile, image always comes first regardless of left/right variant */
    .hero--split-right .hero__image-col { order: 1; }
    .hero--split-right .hero__panel     { order: 2; }

    .hero__image-col {
        min-height: 55vw;
        max-height: 400px;
        position: relative;
    }

    .hero__panel {
        padding: var(--spacing-xl, 3rem) var(--spacing-lg, 2rem);
    }

    .hero--split .hero__content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Full bleed */
    .hero--fullbleed .hero__content {
        padding: var(--spacing-xl, 3rem) var(--spacing-md, 1rem);
    }

    .hero__logo {
        max-width: 160px;
    }

    .hero--split .hero__logo {
        max-width: 140px;
    }

    .hero__headline {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    .hero__tagline {
        font-size: 0.95rem;
    }

    .hero__cta {
        font-size: 0.8rem;
        padding: 0.65em 1.6em;
    }

    .hero__panel {
        padding: var(--spacing-lg, 2rem) var(--spacing-md, 1rem);
    }
}


/* =====================================================================
   FRONT PAGE / PAGE HERO BLOCK CONTENT AREA
   ===================================================================== */

.front-page-content,
.page-hero-content {
    /* Blocks manage their own spacing.
       These wrappers just separate the hero from block content below. */
}
