/**
 * Hero Premium Enhancement Styles
 * Scroll-reveal animations, grain overlay, animated stats, scroll indicator
 *
 * UI/UX Pro Max compliant:
 * - Focus visible styles for keyboard navigation
 * - Minimum 44px touch targets
 * - Logical properties for RTL
 * - Reduced motion support
 * - WCAG contrast ratios
 *
 * @package yRealestate
 * @since 1.0.0
 */

/* ── Grain overlay ── */
.re-hero__grain {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* ── Stats bar ── */
.re-hero__stats-bar {
    display: flex;
    gap: 2.5rem;
    margin-block-start: 3rem;
    padding-block-start: 2rem;
    border-block-start: 1px solid rgba(255, 255, 255, 0.12);
    direction: rtl;
}

.re-hero__stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    min-width: 80px;
}

.re-hero__stat-number {
    font-family: var(--re-font-primary, 'Cairo', sans-serif);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--re-color-primary, #2E8B57);
    line-height: 1;
    direction: ltr;
}

.re-hero__stat-suffix {
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 700;
    color: var(--re-color-primary, #2E8B57);
}

.re-hero__stat-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ── Scroll indicator ── */
.re-hero__scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.re-hero__scroll-indicator:hover {
    opacity: 1;
}

.re-hero__scroll-text {
    font-size: 0.6875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    writing-mode: horizontal-tb;
}

.re-hero__scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    position: relative;
    overflow: hidden;
}

.re-hero__scroll-dot {
    width: 3px;
    height: 12px;
    background: var(--re-color-primary, #2E8B57);
    border-radius: 2px;
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    animation: reScrollDot 2.5s ease-in-out infinite;
}

@keyframes reScrollDot {
    0% { top: -12px; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 60px; opacity: 0; }
}

/* ── Badge ── */
.re-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    margin-block-end: 1.5rem;
    animation: reBadgeGlow 3s ease-in-out infinite;
}

@keyframes reBadgeGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 139, 87, 0); }
    50% { box-shadow: 0 0 20px 0 rgba(46, 139, 87, 0.15); }
}

.re-hero__badge-dot {
    width: 8px;
    height: 8px;
    background: var(--re-color-secondary, #D2691E);
    border-radius: 50%;
    animation: reBadgeDot 2s ease-in-out infinite;
}

@keyframes reBadgeDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

.re-hero__badge-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.02em;
}

/* ── Hero button shimmer ── */
.re-btn--hero {
    position: relative;
    overflow: hidden;
    min-height: 48px;
    min-width: 48px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.re-btn--hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.re-btn--hero:hover::before {
    left: 100%;
}

/* Focus visible for keyboard navigation */
.re-btn--hero:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* ── Data reveal animations ── */
[data-reveal] {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .re-hero__stats-bar {
        gap: 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .re-hero__stat-item {
        min-width: 65px;
    }

    .re-hero__scroll-indicator {
        bottom: 1.5rem;
    }

    .re-hero__scroll-line {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .re-hero__stats-bar {
        gap: 1rem;
    }

    .re-hero__stat-number {
        font-size: 1.5rem;
    }

    .re-hero__stat-label {
        font-size: 0.6875rem;
    }
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .re-hero__scroll-dot,
    .re-hero__badge-dot,
    .re-hero__badge {
        animation: none;
    }

    .re-btn--hero::before {
        display: none;
    }
}

/* Homepage template 1 (hp1): scroll hint + stats alignment */
.hp1-hero .hp1-scroll.re-hero__scroll-indicator {
    position: absolute;
    inset-inline-start: 50%;
    bottom: 2.5rem;
    transform: translateX(-50%);
    z-index: 10;
    padding-block: 0;
}

.hp1-hero .hp1-content {
    z-index: 3;
}
