/* =============================================
   BASE
   ============================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =============================================
   FAQ HEADER
   Duplicate .faq-header h1 declarations merged —
   animation state kept, static state kept.
   ============================================= */

.faq-header {
    padding: 200px 0 40px;
    text-align: center;
    background: #F9F5EE;
    /* explicit bg so it matches rest of page */
}

.faq-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 64px;
    color: #003060;

    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1s ease;
}

.faq-header h1.show {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   FAQ SECTION
   ============================================= */

.faq-section {
    padding: 60px 0;
    /* reduced from 100px — less excessive on desktop */
    background: #F9F5EE;
}

/* =============================================
   FAQ LAYOUT GRID
   ============================================= */

.faq-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 80px;
    align-items: start;
    /* flex-start is invalid on grid — corrected to start */
}

/* =============================================
   LEFT TITLE
   ============================================= */

.faq-left h3 {
    font-family: 'Urbanist', sans-serif;
    font-weight: 500;
    font-size: 42px;
    color: #014694;
    line-height: 1.2;
    position: sticky;
    top: 100px;
}

/* =============================================
   RIGHT ACCORDION COLUMN
   ============================================= */

.faq-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    /* prevents flex/grid blowout */
}

/* =============================================
   FAQ BOX — CLOSED STATE
   ============================================= */

.faq-box {
    width: 100%;
    background: transparent;
    border: 1px solid #D9D9D9;
    border-radius: 20px;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* =============================================
   FAQ BOX — OPEN STATE
   ============================================= */

.faq-box.open {
    background: #FFFFFF;
}

/* =============================================
   QUESTION ROW
   ============================================= */

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    /* stops text and arrow from touching on narrow screens */
    cursor: pointer;
}

.faq-question span {
    font-family: 'Urbanist', sans-serif;
    font-size: 20px;
    color: #003060;
    transition: color 0.3s ease;
    flex: 1;
    min-width: 0;
}

.faq-box:hover .faq-question span {
    color: #ffc400;
}

/* =============================================
   ANSWER — hidden by default, revealed when open
   ============================================= */

.faq-answer {
    font-family: 'Urbanist', sans-serif;
    font-size: 16px;
    color: #555555;
    line-height: 1.6;

    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.faq-box.open .faq-answer {
    max-height: 500px;
    opacity: 1;
    margin-top: 15px;
    /* only adds spacing when visible */
}

/* =============================================
   ARROW
   ============================================= */

.arrow {
    width: 16px;
    height: 16px;
    border-right: 2px solid #003060;
    border-bottom: 2px solid #003060;
    transform: rotate(45deg);
    flex-shrink: 0;
    /* never let the arrow compress */
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-box.open .arrow {
    transform: rotate(-135deg);
}

/* =============================================
   FADE-UP UTILITY
   ============================================= */

.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    /* was `all` — avoids transitioning layout properties */
}

.fade-up.show {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   RESPONSIVE — TABLET (max-width: 1023px)
   ============================================= */

@media screen and (max-width: 1023px) {
    .faq-header {
        padding: 160px 20px 30px;
    }

    .faq-header h1 {
        font-size: 48px;
    }

    .faq-section {
        padding: 50px 0;
    }

    .faq-layout {
        grid-template-columns: 220px 1fr;
        gap: 50px;
    }

    .faq-left h3 {
        font-size: 25px;
        position: static;
        text-align: center;
    }

    .faq-question span {
        font-size: 16px;
    }

    .faq-answer {
        font-size: 14px;
    }
}

/* =============================================
   RESPONSIVE — MOBILE (max-width: 767px)
   ============================================= */

@media screen and (max-width: 767px) {
    .faq-header {
        padding: 120px 16px 24px;
    }

    .faq-header h1 {
        font-size: 36px;
    }

    .faq-section {
        padding: 40px 0;
    }

    .faq-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .faq-left h3 {
        font-size: 21px;
        position: static;
    }

    .faq-box {
        padding: 18px 20px;
        border-radius: 14px;
    }

    .faq-question span {
        font-size: 15px;
    }

    .faq-answer {
        font-size: 14px;
    }

    .arrow {
        width: 12px;
        height: 12px;
    }
}

/* =============================================
   RESPONSIVE — SMALL MOBILE (max-width: 479px)
   ============================================= */

@media screen and (max-width: 479px) {
    .faq-header h1 {
        font-size: 30px;
    }

    .faq-left h3 {
        font-size: 18px;
    }

    .faq-question span {
        font-size: 14px;
    }

    .faq-box {
        padding: 16px;
        border-radius: 12px;
    }
}