/**
 * Hero Search - Slim Variant Styles
 * Airbnb-lite compact hero (320px desktop, 340px mobile)
 *
 * This file only contains overrides for .pca-hero--slim
 * Base styles are in assets/css/hero-search.css
 *
 * @package Traveler_Child
 * @since 2.0.0
 */

/* ==========================================================================
   Slim Hero Container
   ========================================================================== */

.pca-hero--slim {
    height: 320px;
    min-height: 320px;
    max-height: 320px;
}

@media (max-width: 767px) {
    .pca-hero--slim {
        height: 340px;
        min-height: 340px;
        max-height: 340px;
    }
}

/* ==========================================================================
   Background Image (<picture> element)
   ========================================================================== */

.pca-hero--slim .pca-hero-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.pca-hero--slim .pca-hero-media picture {
    display: block;
    width: 100%;
    height: 100%;
}

.pca-hero--slim .pca-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 70%; /* Favor palms/horizon, not sky */
}

/* ==========================================================================
   Text Scrim (Localized Overlay - Behind Content Only)
   ========================================================================== */

.pca-hero--slim .pca-hero-scrim {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 55%; /* Only covers left side where content lives */
    z-index: 2;
    pointer-events: none; /* Must not block clicks */

    /* Gradient fades to transparent at the edge */
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.50) 0%,
        rgba(0, 0, 0, 0.35) 60%,
        rgba(0, 0, 0, 0) 100%
    );
}

@media (max-width: 767px) {
    .pca-hero--slim .pca-hero-scrim {
        /* Mobile: centered content needs vertical gradient */
        width: 100%;
        top: auto;
        bottom: 0;
        height: 85%; /* Increased coverage for taller hero */

        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.55) 0%,   /* Stronger at bottom for headline */
            rgba(0, 0, 0, 0.35) 50%,  /* Mid-point for subheadline */
            rgba(0, 0, 0, 0) 100%
        );
    }
}

/* ==========================================================================
   Content Layout
   ========================================================================== */

.pca-hero--slim .pca-hero-content {
    position: relative;
    z-index: 3;
    padding: 1.5rem 1rem;
}

.pca-hero--slim .pca-hero-inner {
    gap: 0.75rem;
    max-width: 600px;
}

/* Left alignment on desktop */
.pca-hero--slim .pca-hero-content[data-alignment="left"] .pca-hero-inner {
    margin: 0;
    text-align: left;
    align-items: flex-start;
}

@media (max-width: 767px) {
    .pca-hero--slim .pca-hero-content {
        padding: 1.25rem 1rem;
    }

    .pca-hero--slim .pca-hero-inner {
        gap: 0.625rem;  /* 10px - better vertical rhythm */
        max-width: 100%;
        text-align: center;
        align-items: center;
    }

    /* Mobile Typography - larger and bolder for readability */
    .pca-hero--slim .pca-hero-headline {
        font-size: 26px;
        font-weight: 700;
        line-height: 1.15;
        margin-bottom: 0.5rem;
        color: #ffffff !important;  /* Override global h1 orange */
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Standard subheadline only (fallback for non-responsive) */
    .pca-hero--slim .pca-hero-subheadline:not(.pca-hero-subheadline--responsive) {
        font-size: 15px;
        font-weight: 500;
        line-height: 1.35;
        letter-spacing: 0.01em;
        opacity: 0.95;
        max-width: 300px;
        margin: 0 auto;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    }
}

/* ==========================================================================
   Typography (Compact & Rhythmic for Slim)
   ========================================================================== */

.pca-hero--slim .pca-hero-headline {
    font-size: clamp(22px, 4.5vw, 30px);
    line-height: 1.2;
    margin-bottom: 0.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff !important;  /* Override global h1 orange from parent theme */
}

/* Standard subheadline only (not the responsive slim version) */
.pca-hero--slim .pca-hero-subheadline:not(.pca-hero-subheadline--responsive) {
    font-size: clamp(14px, 2.2vw, 16px);
    line-height: 1.45;
    opacity: 0.92;
    max-width: 420px;
    margin: 0;
}

/* ==========================================================================
   Responsive Subheadline (Slim Variant)
   Desktop: Trust-forward single block
   Mobile: Two-line structure with secondary styling on Line 2
   ========================================================================== */

.pca-hero--slim .pca-hero-subheadline--responsive {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Desktop Subheadline */
.pca-hero--slim .pca-hero-subheadline__desktop {
    display: block;
    font-size: 15px;
    line-height: 1.5;
    opacity: 0.94;
    max-width: 520px;
    margin: 0;
}

/* Mobile Subheadline Container - Hidden on Desktop */
.pca-hero--slim .pca-hero-subheadline__mobile {
    display: none;
}

/* Mobile Line 1 (Primary - booking terms) */
.pca-hero--slim .pca-hero-subheadline__mobile-line1 {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin: 0 0 0.375rem 0;  /* Breathing room between lines */
    opacity: 0.92;
}

/* Mobile Line 2 (Secondary - trust/local, slightly smaller) */
.pca-hero--slim .pca-hero-subheadline__mobile-line2 {
    font-size: 13px;  /* 0.9em relative to line 1 */
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    opacity: 0.85;
}

/* Mobile: Show mobile version, hide desktop */
@media (max-width: 767px) {
    .pca-hero--slim .pca-hero-subheadline__desktop {
        display: none;
    }

    .pca-hero--slim .pca-hero-subheadline--responsive {
        max-width: 280px;
        margin: 0 auto;
        text-align: center;
    }

    .pca-hero--slim .pca-hero-subheadline__mobile {
        display: block;
    }

    .pca-hero--slim .pca-hero-subheadline__mobile-line1 {
        margin: 0 0 0.25rem 0;
    }
}

/* Very small screens (320px) - proportionally smaller */
@media (max-width: 359px) {
    .pca-hero--slim .pca-hero-subheadline__mobile-line1 {
        font-size: 13px;
    }

    .pca-hero--slim .pca-hero-subheadline__mobile-line2 {
        font-size: 12px;
    }
}

@media (min-width: 992px) {
    .pca-hero--slim .pca-hero-headline {
        font-size: 30px;
    }

    .pca-hero--slim .pca-hero-subheadline {
        font-size: 16px;
        max-width: 450px;
    }
}

/* ==========================================================================
   Search Form - Adjacent Layout (Desktop)
   Two visually distinct siblings sharing an edge (Airbnb pattern)
   ========================================================================== */

.pca-hero--slim .pca-hero-search-form {
    max-width: 560px;
    margin-top: 0.75rem;
}

.pca-hero--slim .pca-search-input-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 0;
    /* No shared background - each element has its own */
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.pca-hero--slim .pca-search-input {
    flex: 1 1 70%;
    min-width: 0;
    padding: 14px 16px 14px 44px;
    border: none !important;
    /* Own background + left radius only */
    background: #ffffff;
    border-radius: 8px 0 0 8px !important;
    min-height: 52px;
    font-size: 15px;
    /* Individual shadow for depth */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.pca-hero--slim .pca-search-input:focus {
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 2px var(--color-primary, #FF6B00);
}

.pca-hero--slim .pca-search-button {
    position: static !important;
    transform: none !important;
    flex: 0 0 auto;
    min-width: 130px;
    height: auto;
    padding: 14px 24px;
    /* Own radius - right side only */
    border-radius: 0 8px 8px 0 !important;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    /* Distinct shadow */
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.25);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.pca-hero--slim .pca-search-button:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.35);
    transform: translateY(-1px);
}

.pca-hero--slim .pca-search-button:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.35),
        0 0 0 4px var(--color-primary, #FF6B00),
        0 4px 16px rgba(255, 107, 0, 0.25);
}

/* Search icon adjustment */
.pca-hero--slim .pca-search-icon {
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

/* ==========================================================================
   Search Form - Stacked Layout (Mobile)
   ========================================================================== */

@media (max-width: 767px) {
    .pca-hero--slim .pca-hero-search-form {
        max-width: 100%;
        margin-top: 0.875rem;  /* Better spacing after subheadline */
    }

    .pca-hero--slim .pca-search-input-wrapper {
        flex-direction: column !important;
        /* Restore shared container on mobile for stacked look */
        background: #ffffff;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        overflow: hidden;
    }

    .pca-hero--slim .pca-search-input {
        flex: none;
        width: 100%;
        background: transparent;
        border-radius: 0 !important;
        border-bottom: 1px solid #e5e7eb !important;
        padding: 14px 16px 14px 44px;
        min-height: 52px;           /* Taller for thumb comfort */
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        box-shadow: none;
    }

    .pca-hero--slim .pca-search-input:focus {
        box-shadow: inset 0 0 0 2px var(--color-primary, #FF6B00);
    }

    .pca-hero--slim .pca-search-button {
        width: 100%;
        min-height: 52px;  /* Taller for thumb comfort */
        border-radius: 0 !important;
        justify-content: center;
        box-shadow: none;
        font-size: 16px;
        font-weight: 600;
    }

    .pca-hero--slim .pca-search-button:hover {
        box-shadow: none;
        transform: none;
    }

    .pca-hero--slim .pca-search-icon {
        top: 26px; /* Center in taller input on mobile */
    }
}

/* ==========================================================================
   Mobile Helper Text (Airbnb/Villa Users)
   ========================================================================== */

.pca-hero--slim .pca-hero-helper-mobile {
    display: none; /* Hidden on desktop */
    margin: 0.5rem 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

@media (max-width: 767px) {
    .pca-hero--slim .pca-hero-helper-mobile {
        display: block;
        text-align: center;
    }
}

/* ==========================================================================
   Secondary Helper Pill (Translucent White - Secondary CTA)
   Frosted glass pill for "No hotel yet? Explore all tours"
   ========================================================================== */

.pca-hero--slim .pca-hero-browse-link {
    margin-top: 0.75rem;
}

/* Translucent white pill - clearly secondary to primary CTA */
.pca-hero--slim .pca-hero-browse-link .pca-browse-all-link,
.pca-hero--slim .pca-hero-browse-link .pca-browse-all-link:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;

    /* Frosted glass effect */
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);

    color: #ffffff !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;

    transition: background 0.2s ease, border-color 0.2s ease;
}

.pca-hero--slim .pca-hero-browse-link .pca-browse-all-link:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.4);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pca-hero--slim .pca-hero-browse-link .pca-browse-all-link:focus-visible {
    outline: 2px solid var(--color-primary, #FF6B00);
    outline-offset: 2px;
}

/* Arrow icon - small and aligned */
.pca-hero--slim .pca-hero-browse-link .pca-browse-arrow {
    font-size: 12px;
    opacity: 0.85;
}

/* ==========================================================================
   Secondary Helper Pill - Mobile
   Hidden on slim mobile for cleaner, single-CTA hero (CRO optimization)
   ========================================================================== */

@media (max-width: 767px) {
    .pca-hero--slim .pca-hero-browse-link {
        display: none; /* Remove redundant CTA - main button serves same purpose */
    }
}

/* ==========================================================================
   Trust Strip - Desktop (Frosted Glass Pills)
   ========================================================================== */

.pca-hero--slim .pca-trust-strip {
    margin-top: 1rem;
}

.pca-hero--slim .pca-trust-strip__desktop {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 12px;
    color: #ffffff;
}

.pca-hero--slim .pca-trust-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 6px 12px;
    /* Frosted glass effect */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px; /* Full pill shape */
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: background 0.2s ease;
}

.pca-hero--slim .pca-trust-pill:hover {
    background: rgba(255, 255, 255, 0.22);
}

.pca-hero--slim .pca-trust-icon {
    font-size: 13px;
}

/* Hide dividers - pills are self-contained now */
.pca-hero--slim .pca-trust-divider {
    display: none;
}

/* Hide mobile grid on desktop */
.pca-hero--slim .pca-trust-strip__mobile {
    display: none;
}

/* ==========================================================================
   Trust Strip - Mobile (2x2 Frosted Grid)
   ========================================================================== */

@media (max-width: 767px) {
    /* Hide desktop pills on mobile */
    .pca-hero--slim .pca-trust-strip__desktop {
        display: none;
    }

    /* Show mobile grid */
    .pca-hero--slim .pca-trust-strip__mobile {
        display: block;
    }

    .pca-hero--slim .pca-trust-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .pca-hero--slim .pca-trust-grid-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 10px 8px;
        /* Frosted glass effect */
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 10px;
    }

    .pca-hero--slim .pca-trust-grid-icon {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .pca-hero--slim .pca-trust-grid-text {
        font-size: 11px;
        color: #ffffff;
        font-weight: 500;
        line-height: 1.3;
    }
}

/* ==========================================================================
   Autocomplete Dropdown (Ensure it works in slim)
   ========================================================================== */

.pca-hero--slim .pca-search-results {
    z-index: 2147483647 !important;
    max-height: 300px;
}

/* ==========================================================================
   Hide Default Variant Elements in Slim
   ========================================================================== */

.pca-hero--slim .pca-hero-trust-badge {
    display: none;
}

.pca-hero--slim .pca-hero-categories {
    display: none;
}

/* ==========================================================================
   Backdrop-filter Fallback (older browsers)
   ========================================================================== */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .pca-hero--slim .pca-trust-pill,
    .pca-hero--slim .pca-trust-grid-item {
        background: rgba(0, 0, 0, 0.28);
        border-color: rgba(255, 255, 255, 0.30);
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .pca-hero--slim *,
    .pca-hero--slim *::before,
    .pca-hero--slim *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
