/* Hero Section Styles based on Figma Design (node-id: 2:134) */

.hero-section {
    position: relative;
    width: 100%;
    min-height: 1074px; /* Height of the parent frame from Figma */
    background-color: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 180px 0 80px; /* Space on top to offset the fixed floating navbar and top legal bar */
}

/* Background image on the left - Gemini Generated Image (2:231) relative coordinates */
.hero-section::before {
    content: "";
    position: absolute;
    left: -10%;
    top: -5%;
    width: 35%;
    height: 724px;
    background-image: url('../images/hero_background_image.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.2; /* Faded background fill opacity from Figma (0.2) */
    pointer-events: none;
    z-index: 1;
}

/* Background SVG geometric graphic centered - Frame 185 (2:135) */
.hero-graphic-desktop {
    position: absolute;
    left: 50%;
    top: calc(50vh - 260px); /* Centered in top screen relative to hero-section */
    width: 480px;
    height: 480px;
    margin-left: -240px;
    background-image: url('../images/hero_graphic.svg?v=1.0.2');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
    display: block;
}

.hero-graphic-mobile {
    display: none;
}

/* Main Content Container - Frame 231 (1447px width) */
.hero-content {
    position: relative;
    max-width: 1447px;
    width: 90%;
    margin: 0 auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-sizing: border-box;
}

/* Top Row Layout - Frame 230 */
.hero-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    min-height: calc(100vh - 245px); /* Positions 'Resolvemos desafios complexos de' ~45px from screen base */
    min-height: calc(100dvh - 245px);
    box-sizing: border-box;
}

.hero-top-row .wp-block-column {
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Left Title and CTA Container - Frame 226 */
.hero-title-container {
    display: flex;
    flex-direction: column;
    gap: 22px; /* Autolayout gap: 22px from Figma */
    max-width: 650px;
    width: 100%;
}

/* Title Styling - Frame 225 */
.hero-title {
    font-family: 'Helvetica Neue', Arial, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 66px; /* Reduced from 72.7px to prevent wrapping on desktop */
    font-weight: 700; /* Bold (700) */
    line-height: 1.1;
    letter-spacing: -3.96px; /* letterSpacing adjusted to match new font-size */
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Title first segment: NIT. */
.title-nit {
    color: #119091;
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

.title-nit-svg,
.title-nit svg {
    height: 0.82em;
    width: auto;
    display: block;
    fill: #119091;
    color: #119091;
}

.hero-sliding-wrapper {
    position: relative;
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
}

.hero-sliding-text {
    position: absolute;
    left: 0;
    bottom: -100%; /* Start off-screen below */
    width: auto;
    height: 100%;
    white-space: nowrap;
    background: linear-gradient(135deg, #15B4B6 0%, #094F50 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center; /* Center text vertically inside dynamic wrapper height */
    opacity: 0;
    padding-right: 25px; /* Prevent clipping of wide or slanted characters like 'y' at the end */
    transition: bottom 0.8s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}

.hero-sliding-text.active {
    bottom: 0;
    opacity: 1;
}

.hero-sliding-text.exit {
    bottom: 100%; /* Move off-screen above */
    opacity: 0;
}

/* CTA Pill Button container - Button (2:182) */
.hero-cta-btn {
    margin-top: 8px;
}

.hero-cta-btn .wp-block-button__link {
    background-color: transparent !important;
    border: 1px solid #3ba1bf !important; /* Stroke weight 1px, color rgb(59, 161, 191) */
    color: #3ba1bf !important;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px; /* FontSize: 16px */
    font-weight: 700; /* Bold */
    padding: 18px 24px !important; /* Padding: Top/Bottom 18px, Left/Right 20px+ */
    border-radius: 65px !important; /* Corner radius: 65px */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    box-shadow: none !important;
    line-height: 1;
}

.hero-cta-btn .wp-block-button__link:hover {
    background-color: rgba(59, 161, 191, 0.08) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 161, 191, 0.15) !important;
}

/* Right Description Container - Frame 227 */
.hero-desc-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 317px;
    width: 100%;
    padding-top: 0; /* Centered with left column */
    margin-left: auto;
    align-items: flex-end;
    text-align: right;
}

/* large description text */
.hero-desc-large {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 2.2rem;
    font-weight: 400; /* Regular */
    color: #3ba1bf; /* Color: rgb(59, 161, 191) */
    line-height: 1.1;
    margin: 0;
}

/* small claim / link text */
.hero-desc-small {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 19px;
    font-weight: 400;
    margin: 14px 0 0 0;
    letter-spacing: 0;
    text-transform: lowercase;
}

.hero-link-saiba-mais {
    color: #1e7088;
    text-decoration: underline !important;
    text-underline-offset: 4px;
    text-decoration-thickness: 1.5px;
    transition: color 0.25s ease, opacity 0.25s ease;
    display: inline-block;
}

.hero-link-saiba-mais:hover {
    color: #15b4b6;
    opacity: 0.85;
}

/* Bottom Row Layout - Frame 229 */
.hero-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
    scroll-margin-top: 140px;
}

.hero-bottom-heading {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 28px;
    font-weight: 500;
    color: #004152;
    margin: 0 0 10px 0;
}

/* Divider with Split/Fading Linear Gradient - Vector 9 */
.hero-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, #59bcb1 0%, rgba(65, 137, 129, 0) 54%, #15b4b6 100%);
    margin: 0 0 45px 0; /* Leaves space for cards in the next scroll phase */
    border: none;
    transform-origin: left;
    animation: draw-stroke-left-to-right 1s ease-in-out 0.8s both;
}

@keyframes draw-stroke-left-to-right {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Grid Cards Container - CARDS 2x2 */
.hero-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch; /* Keeps cards in each row equal height and perfectly aligned */
    gap: 16px;
    margin-top: 0;
    width: 100%;
}

/* Base Card Styles */
.hero-card {
    border-radius: 8px;
    padding: 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.3s ease;
}

.hero-card-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.hero-card-title {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 38px;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.1;
    color: #0c4b4d;
    letter-spacing: -0.6px;
}

/* Card Body - Dynamic Height Expansion via CSS Grid Rows (0fr <-> 1fr) */
.hero-card-body {
    position: relative;
    flex: 1;
    margin-bottom: 20px;
    width: 100%;
}

/* Default View (Summary) - takes full height in default state, 0 height when expanded */
.hero-card-default-view {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease;
}

.hero-card-default-inner {
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hero-card-subtitle {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0c4b4d;
    margin: 0 0 14px 0;
    letter-spacing: -0.2px;
}

.hero-card-desc {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.5;
    color: #0c4b4d;
    margin: 0;
}

/* Bullets View (Variant with pills) - takes 0 height in default state, expands to full height when expanded */
.hero-card-bullets-view {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    pointer-events: none;
    transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.35s ease;
}

.hero-card-bullets-inner {
    overflow: hidden;
    min-height: 0;
}

.hero-card-pills-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    align-items: flex-start;
}

.hero-card-pill {
    display: inline-block;
    max-width: 100%;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(0.75rem, 0.68rem + 0.22vw, 0.875rem); /* Min 12px (0.75rem) to Max 14px (0.875rem) */
    font-weight: 400;
    line-height: 1.38;
    padding: 8px 20px;
    border-radius: 999px;
    box-sizing: border-box;
    transform: translateY(12px);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Expanded State for Smooth View Transition */
.hero-card.is-expanded .hero-card-default-view {
    grid-template-rows: 0fr;
    opacity: 0;
    pointer-events: none;
}

.hero-card.is-expanded .hero-card-bullets-view {
    grid-template-rows: 1fr;
    opacity: 1;
    pointer-events: auto;
}

.hero-card.is-expanded .hero-card-pill {
    opacity: 1;
    transform: translateY(0);
}

.hero-card.is-expanded .hero-card-pill:nth-child(1) { transition-delay: 0.04s; }
.hero-card.is-expanded .hero-card-pill:nth-child(2) { transition-delay: 0.09s; }
.hero-card.is-expanded .hero-card-pill:nth-child(3) { transition-delay: 0.14s; }
.hero-card.is-expanded .hero-card-pill:nth-child(4) { transition-delay: 0.19s; }

/* Card 1 & Card 4: Solid Teal base */
.hero-card.card-filled {
    background-color: #59bcb1;
    border: 1.5px solid transparent;
}

.hero-card.card-filled .hero-card-pill {
    background-color: #0e4848;
    color: #ffffff;
    border: 1px solid #0e4848;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hero-card.card-filled:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(89, 188, 177, 0.28);
}

.hero-card.card-filled .hero-card-toggle-btn {
    background-color: #ffffff;
    color: #59bcb1;
}

.hero-card.card-filled .hero-card-toggle-btn:hover {
    background-color: #f4fbfb;
    color: #0c4b4d;
}

/* Cards 2 & 3: Outlined Teal (White background) */
.hero-card.card-outlined {
    background-color: #ffffff;
    border: 1.5px solid #59bcb1;
}

.hero-card.card-outlined .hero-card-title,
.hero-card.card-outlined .hero-card-subtitle {
    color: #0c4b4d;
}

.hero-card.card-outlined .hero-card-pill {
    background-color: transparent;
    border: 1px solid #59bcb1;
    color: #247970;
    box-shadow: none;
}

.hero-card.card-outlined:hover {
    transform: translateY(-4px);
    background-color: rgba(89, 188, 177, 0.03);
    box-shadow: 0 12px 28px rgba(12, 75, 77, 0.08);
}

.hero-card.card-outlined .hero-card-toggle-btn {
    background-color: #59bcb1;
    color: #ffffff;
}

.hero-card.card-outlined .hero-card-toggle-btn:hover {
    background-color: #4aa79d;
    color: #ffffff;
}

/* Toggle Button & Icon Animations */
.hero-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
}

.hero-card-toggle-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                background-color 0.3s ease, 
                box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hero-card-toggle-btn:hover {
    transform: scale(1.1);
}

.hero-card.is-expanded .hero-card-toggle-btn {
    transform: rotate(180deg);
}

.hero-card.is-expanded .hero-card-toggle-btn:hover {
    transform: rotate(180deg) scale(1.1);
}

.toggle-icon {
    position: relative;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-icon svg {
    position: absolute;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.35s ease;
}

.toggle-icon .icon-plus {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.toggle-icon .icon-minus {
    opacity: 0;
    transform: rotate(-90deg) scale(0.4);
}

.hero-card.is-expanded .toggle-icon .icon-plus {
    opacity: 0;
    transform: rotate(90deg) scale(0.4);
}

.hero-card.is-expanded .toggle-icon .icon-minus {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* --- Responsive & Mobile Adaptability --- */

@media (max-width: 1200px) {
    .hero-section {
        min-height: auto;
        padding-top: 155px;
    }

    .hero-top-row {
        min-height: auto;
    }

    .hero-bottom-row {
        margin-top: 20px;
    }

    .hero-title {
        font-size: 56px;
        letter-spacing: -3px;
    }

    .hero-desc-large {
        font-size: 34px;
    }

    .hero-card-title {
        font-size: 34px;
    }

    .hero-card-subtitle {
        font-size: 1.25rem;
    }

    .hero-card-desc {
        font-size: 1rem;
    }
}

@media (max-width: 992px) {
    .hero-top-row {
        flex-direction: column;
        gap: 0;
        min-height: auto;
    }

    .hero-top-row .wp-block-column {
        width: 100% !important;
        flex-basis: auto !important;
        max-width: 100%;
    }

    .hero-graphic-desktop {
        display: none !important;
    }

    .hero-graphic-mobile {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        margin: 36px auto 44px auto !important;
        width: min(340px, 80vw) !important;
        height: auto !important;
        aspect-ratio: 513 / 509;
        min-height: 280px;
        display: block !important;
        background-image: url('../images/hero_graphic.svg?v=1.0.2');
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        pointer-events: none;
        z-index: 1;
    }

    .hero-title-container,
    .hero-desc-container {
        max-width: 100%;
    }

    .hero-desc-container {
        padding-top: 0;
        margin-left: 0;
        align-items: flex-start;
        text-align: left;
    }

    .hero-bottom-row {
        margin-top: 40px;
    }

    /* Cascade 1-column stack on tablets & mobile */
    .hero-cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-card {
        padding: 28px;
        min-height: auto;
    }

    .hero-card-title {
        font-size: 32px;
        margin-bottom: 14px;
    }

    .hero-card-subtitle {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .hero-card-desc {
        font-size: 0.975rem;
    }

    .hero-card-body {
        min-height: auto;
        margin-bottom: 18px;
    }

    .hero-card-pill {
        padding: 9px 18px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 100px 0 50px;
    }

    .hero-section::before {
        display: block;
        left: -15%;
        top: -15px;
        width: 75%;
        max-width: 320px;
        height: 420px;
        opacity: 0.22;
        background-size: contain;
        background-repeat: no-repeat;
    }

    .hero-title {
        font-size: 42px;
        letter-spacing: -2px;
    }

    .hero-desc-large {
        font-size: 28px;
    }

    .hero-bottom-heading {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .hero-divider {
        margin-bottom: 30px;
    }

    .hero-card {
        padding: 24px;
    }

    .hero-card-title {
        font-size: 28px;
    }

    .hero-card-subtitle {
        font-size: 1.125rem;
        margin-bottom: 10px;
    }

    .hero-card-desc {
        font-size: 0.95rem;
    }

    .hero-card-pill {
        padding: 8px 16px;
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 38px;
        letter-spacing: -1.5px;
    }

    .hero-graphic-mobile {
        margin: 28px auto 38px auto !important;
        width: min(300px, 84vw) !important;
        min-height: 250px;
    }

    .hero-desc-large {
        font-size: 26px;
    }

    .hero-bottom-heading {
        font-size: 22px;
    }

    .hero-card {
        padding: 20px;
    }

    .hero-card-title {
        font-size: 25px;
    }

    .hero-card-subtitle {
        font-size: 1.05rem;
        margin-bottom: 8px;
    }

    .hero-card-desc {
        font-size: 0.925rem;
    }

    .hero-card-pill {
        padding: 7px 14px;
        border-radius: 16px;
    }
}

/* ==========================================================================
   Height-Based Responsiveness for Desktop/Laptop Viewports
   Ensures the 'Áreas' section (title + 2x2 cards) fits completely within a
   single screen on laptops (e.g. MacBook 13", Windows 1080p @ 125%/150%).
   ========================================================================== */

/* Tier 1: Laptops and standard desktop screens with moderate height (<= 900px) */
@media (min-width: 993px) and (max-height: 900px) {
    .hero-section {
        min-height: auto;
        padding: 135px 0 35px;
    }

    .hero-top-row {
        min-height: calc(100vh - 200px);
        min-height: calc(100dvh - 200px);
        gap: 30px;
    }

    .hero-title {
        font-size: 56px;
        letter-spacing: -3px;
    }

    .hero-desc-large {
        font-size: 1.95rem;
    }

    .hero-bottom-row {
        scroll-margin-top: 110px;
    }

    .hero-bottom-heading {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .hero-divider {
        margin-bottom: 22px;
    }

    .hero-cards-grid {
        gap: 14px;
    }

    .hero-card {
        padding: 20px 24px;
    }

    .hero-card-title {
        font-size: 30px;
        margin-bottom: 10px;
    }

    .hero-card-subtitle {
        font-size: 1.15rem;
        line-height: 1.25;
        margin-bottom: 10px;
    }

    .hero-card-desc {
        font-size: 0.92rem;
        line-height: 1.42;
    }

    .hero-card-body {
        margin-bottom: 14px;
    }

    .hero-card-toggle-btn {
        width: 36px;
        height: 36px;
    }

    .toggle-icon {
        width: 15px;
        height: 15px;
    }

    .hero-card-pill {
        padding: 6px 16px;
        font-size: 0.8rem;
    }

    .hero-card-pills-list {
        gap: 7px;
    }
}

/* Tier 2: Compact Laptops (MacBook Air 13", Windows 1366x768 / 1080p @ 150%, height <= 780px) */
@media (min-width: 993px) and (max-height: 780px) {
    .hero-section {
        padding: 110px 0 20px;
    }

    .hero-top-row {
        min-height: calc(100vh - 160px);
        min-height: calc(100dvh - 160px);
        gap: 20px;
    }

    .hero-title {
        font-size: 48px;
        letter-spacing: -2.5px;
    }

    .hero-desc-large {
        font-size: 1.7rem;
    }

    .hero-bottom-row {
        scroll-margin-top: 98px;
    }

    .hero-bottom-heading {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .hero-divider {
        margin-bottom: 14px;
    }

    .hero-cards-grid {
        gap: 10px;
    }

    .hero-card {
        padding: 14px 18px;
    }

    .hero-card-title {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .hero-card-subtitle {
        font-size: 1.02rem;
        line-height: 1.2;
        margin-bottom: 6px;
    }

    .hero-card-desc {
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .hero-card-body {
        margin-bottom: 10px;
    }

    .hero-card-toggle-btn {
        width: 32px;
        height: 32px;
    }

    .toggle-icon {
        width: 14px;
        height: 14px;
    }

    .toggle-icon svg {
        width: 14px;
        height: 14px;
    }

    .hero-card-pill {
        padding: 5px 12px;
        font-size: 0.74rem;
    }

    .hero-card-pills-list {
        gap: 5px;
    }
}

/* Tier 3: Ultra-compact height (height <= 680px, e.g. laptop with browser bookmarks bar & dev tools or split screen) */
@media (min-width: 993px) and (max-height: 680px) {
    .hero-section {
        padding: 95px 0 15px;
    }

    .hero-top-row {
        min-height: calc(100vh - 130px);
        min-height: calc(100dvh - 130px);
        gap: 15px;
    }

    .hero-title {
        font-size: 42px;
        letter-spacing: -2px;
    }

    .hero-desc-large {
        font-size: 1.45rem;
    }

    .hero-desc-small {
        margin-top: 6px;
        font-size: 16px;
    }

    .hero-bottom-row {
        scroll-margin-top: 85px;
    }

    .hero-bottom-heading {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .hero-divider {
        margin-bottom: 10px;
    }

    .hero-cards-grid {
        gap: 8px;
    }

    .hero-card {
        padding: 11px 15px;
    }

    .hero-card-title {
        font-size: 21px;
        margin-bottom: 4px;
    }

    .hero-card-subtitle {
        font-size: 0.92rem;
        line-height: 1.15;
        margin-bottom: 4px;
    }

    .hero-card-desc {
        font-size: 0.78rem;
        line-height: 1.3;
    }

    .hero-card-body {
        margin-bottom: 8px;
    }

    .hero-card-toggle-btn {
        width: 28px;
        height: 28px;
    }

    .toggle-icon {
        width: 12px;
        height: 12px;
    }

    .toggle-icon svg {
        width: 12px;
        height: 12px;
    }

    .hero-card-pill {
        padding: 4px 10px;
        font-size: 0.70rem;
    }

    .hero-card-pills-list {
        gap: 4px;
    }
}
