/**
 * Hero Section Block Styles
 * Single Source of Truth for Design System
 */

/* ============================================
   FORCE FULL-WIDTH DISPLAY
   ============================================ */

/* Remove all WordPress wrapper constraints */
.wp-block-mawconsultant-hero-section {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

/* Override any parent container styles */
.site-main .wp-block-mawconsultant-hero-section,
.entry-content .wp-block-mawconsultant-hero-section,
article .wp-block-mawconsultant-hero-section {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   HERO SECTION BASE STYLES
   ============================================ */

.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================
   BACKGROUND & OVERLAY
   ============================================ */

.hero-section__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-section__background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-section__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

/* ============================================
   CONTENT CONTAINER - FIGMA SPECS
   ============================================ */

.hero-section__container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-inline: var(--container-padding-x);
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.hero-section__content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 900px;
}

/* ============================================
   TYPOGRAPHY - FIGMA SPECS
   ============================================ */

.hero-section__heading {
    font-family: var(--font-serif);
    font-size: 72px;
    font-weight: 500;
    line-height: 1.15em;
    letter-spacing: -0.02em;
    color: var(--color-primary-foreground);
    margin: 0 !important;
    padding: 0 !important;
    white-space: pre-wrap;
    text-align: left;
}

.hero-section__description {
    font-family: var(--font-sans);
    font-size: 20px;
    font-weight: 300;
    line-height: 32px;
    letter-spacing: 0;
    color: var(--color-primary-foreground);
    margin: 0 !important;
    padding: 0 !important;
    white-space: pre-wrap;
    text-align: left;
    max-width: 800px;
}

/* ============================================
   BUTTONS - FIGMA SPECS
   ============================================ */

.hero-section__buttons {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hero-section__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 32px;
    text-decoration: none;
    font-family: 'DM Sans', 'Arial', sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
}

.hero-section__button--primary {
    background-color: var(--color-primary-foreground);
    color: var(--color-foreground);
    font-weight: 700;
}

.hero-section__button--primary:hover {
    background-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-section__button--secondary {
    background-color: transparent;
    color: var(--color-primary-foreground);
    font-weight: 400;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.hero-section__button--secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}

.hero-section__button-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

/* Padding is now controlled by --container-padding-x variable in style.css */

@media (max-width: 1200px) {
    .hero-section__heading {
        font-size: 72px;
        line-height: 86px;
    }

    .hero-section__description {
        font-size: 20px;
        line-height: 28px;
    }
}

@media (max-width: 1024px) {
    .hero-section {
        min-height: 100vh;
        height: 100vh;
    }

    .hero-section__container {
        gap: 40px;
    }

    .hero-section__content {
        gap: 24px;
    }

    .hero-section__heading {
        font-size: 80px;
        line-height: 94px;
    }

    .hero-section__description {
        font-size: 24px;
        line-height: 32px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: 640px;
    }

    .hero-section__container {
        gap: 32px;
    }

    .hero-section__content {
        gap: 24px;
        max-width: 600px;
    }

    .hero-section__heading {
        font-size: 64px;
        line-height: 1.25em;
        letter-spacing: -0.02em;
    }

    .hero-section__description {
        font-size: 16px;
        line-height: 24px;
        max-width: 100%;
    }

    .hero-section__buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .hero-section__button {
        width: 100%;
        padding: 20px 28px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 100vh;
        height: 100vh;
    }

    .hero-section__container {
        gap: 24px;
    }

    .hero-section__content {
        gap: 20px;
    }

    .hero-section__heading {
        font-size: 40px;
        line-height: 1.25em;
        letter-spacing: -0.02em;
    }

    .hero-section__button {
        padding: 18px 24px;
        font-size: 13px;
        line-height: 18px;
    }
}

/* ============================================
   GUTENBERG EDITOR PREVIEW STYLES
   ============================================ */

.hero-section-editor {
    margin: 20px 0;
}

.hero-section-preview {
    position: relative;
    width: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background-color: #333;
}

.hero-section-preview__background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    background-size: cover;
    background-position: center;
}

.hero-section-preview__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.hero-section-preview__container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hero-section-preview__content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-section-preview__heading {
    font-family: var(--font-serif);
    font-size: 48px;
    font-weight: 500;
    line-height: 1.2;
    color: #ffffff;
    margin: 0;
}

.hero-section-preview__description {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: #ffffff;
    margin: 0;
}

.hero-section-preview__buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-section-preview__button {
    display: inline-flex;
    align-items: center;
    padding: 16px 24px;
    font-size: 14px;
    cursor: text;
}

.hero-section-preview__button--primary {
    background-color: #ffffff;
    color: #000000;
    font-weight: 700;
}

.hero-section-preview__button--secondary {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.hero-section-preview__button span {
    color: inherit !important;
}

/* ============================================
   WORDPRESS EDITOR OVERRIDES
   ============================================ */

.editor-styles-wrapper .hero-section-preview__heading,
.editor-styles-wrapper .hero-section-preview__description {
    color: #ffffff !important;
}

/* Remove WordPress default margins/paddings */
.wp-block-mawconsultant-hero-section p {
    margin: 0 !important;
}

.wp-block-mawconsultant-hero-section h1,
.wp-block-mawconsultant-hero-section h2,
.wp-block-mawconsultant-hero-section h3 {
    margin: 0 !important;
}

/* ============================================
   ENTRANCE ANIMATIONS
   Triggered by JS adding .is-animated to .hero-section
   ============================================ */

/* --- Keyframes --- */
@keyframes hero-fade-up {
    from {
        opacity: 0;
        transform: translateY(36px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes hero-ken-burns {
    from {
        transform: scale(1.08);
    }

    to {
        transform: scale(1);
    }
}

/* --- Initial hidden states (before JS class fires) --- */
.hero-section .hero-section__background-image {
    transform-origin: center center;
}

.hero-section .hero-section__heading,
.hero-section .hero-section__description,
.hero-section .hero-section__buttons {
    opacity: 0;
    transform: translateY(36px);
}

.hero-section .hero-section__overlay {
    opacity: 0;
}

/* --- Animated states once .is-animated is applied --- */
.hero-section.is-animated .hero-section__background-image {
    animation: hero-ken-burns 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.hero-section.is-animated .hero-section__overlay {
    animation: hero-fade-in 0.8s ease both;
    /* Preserve inline opacity style after animation ends */
    animation-fill-mode: forwards;
}

.hero-section.is-animated .hero-section__heading {
    animation: hero-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.hero-section.is-animated .hero-section__description {
    animation: hero-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

.hero-section.is-animated .hero-section__buttons {
    animation: hero-fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.75s both;
}

/* --- Respect user's reduced-motion preference --- */
@media (prefers-reduced-motion: reduce) {

    .hero-section .hero-section__heading,
    .hero-section .hero-section__description,
    .hero-section .hero-section__buttons {
        opacity: 1;
        transform: none;
    }

    .hero-section .hero-section__overlay {
        opacity: var(--hero-overlay-opacity, 0.7);
    }

    .hero-section.is-animated .hero-section__background-image,
    .hero-section.is-animated .hero-section__overlay,
    .hero-section.is-animated .hero-section__heading,
    .hero-section.is-animated .hero-section__description,
    .hero-section.is-animated .hero-section__buttons {
        animation: none;
    }
}