/* Welcome section improvements */
.section-welcome { padding: 60px 0; }
.section-welcome .subtitle { color: #9aa1b7; font-weight: 700; letter-spacing: .4px; margin-bottom: 8px; }
.section-welcome .title { margin-bottom: 14px; font-size: 2rem; color:#08103b; }
.section-welcome .welcome-text { color: #596274; margin-bottom: 18px; line-height:1.6; max-width: 520px; }
.section-welcome .btn-wrap { display:flex; gap:12px; margin-top:10px; flex-wrap:wrap; }

.welcome-cta { padding:12px 26px; }
.welcome-cta-outline { background: transparent; border: 1px solid rgba(255,255,255,0.08); color: inherit; }

/* Gallery layout */
.welcome-gallery { display:flex; gap:16px; align-items:stretch; }
.welcome-main-card {
    flex: 1.2;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(11,23,75,0.08);
    position: relative;
    min-height: 240px;
    display:flex;
    flex-direction:column;
}
.welcome-main-img { width:100%; height:100%; object-fit:cover; display:block; }
.welcome-main-caption {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: rgba(0,0,0,0.36);
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
}
.welcome-main-caption h4 { margin:0 0 6px; font-size:1rem; }
.welcome-main-caption p { margin:0; font-size:0.9rem; color:rgba(255,255,255,0.9); }

/* Side thumbnails */
.welcome-side-cards {
    display:flex;
    flex-direction:column;
    gap:12px;
    width: 38%;
    min-width: 140px;
}
.welcome-thumb {
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow: 0 10px 30px rgba(11,23,75,0.06);
    height: calc((240px - 12px) / 2);
}
.welcome-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

/* Responsive */
@media (max-width: 991px) {
    .welcome-gallery { flex-direction:row; gap:12px; }
    .welcome-side-cards { width: 36%; }
    .section-welcome .title { font-size:1.6rem; }
}
@media (max-width: 767px) {
    .section-welcome { padding:40px 0; }
    .welcome-gallery { flex-direction:column; }
    .welcome-side-cards { flex-direction:row; width:100%; }
    .welcome-thumb { height:120px; flex:1; }
    .welcome-main-card { min-height:200px; }
    .section-welcome .welcome-text { max-width:100%; }
}
/* Additions: animations & effects for welcome gallery and CTAs */

/* Keyframes */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { transform: translateX(-120%); opacity: 0; }
    50% { transform: translateX(20%); opacity: 0.6; }
    100% { transform: translateX(120%); opacity: 0; }
}

/* Entrance animations */
.section-welcome .subtitle,
.section-welcome .title,
.section-welcome .welcome-text,
.section-welcome .btn-wrap,
.welcome-main-card,
.welcome-side-cards .welcome-thumb {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.64s cubic-bezier(.2,.9,.3,1) both;
}

/* Stagger delays */
.section-welcome .subtitle { animation-delay: 0.06s; }
.section-welcome .title { animation-delay: 0.12s; }
.section-welcome .welcome-text { animation-delay: 0.20s; }
.section-welcome .btn-wrap { animation-delay: 0.28s; }
.welcome-main-card { animation-delay: 0.34s; }
.welcome-side-cards .welcome-thumb:nth-child(1) { animation-delay: 0.42s; }
.welcome-side-cards .welcome-thumb:nth-child(2) { animation-delay: 0.50s; }

/* Main card hover */
.welcome-main-card {
    transition: transform 0.6s cubic-bezier(.2,.9,.3,1), box-shadow 0.45s ease;
    will-change: transform;
}
.welcome-main-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 26px 60px rgba(11,23,75,0.12);
}

/* Main image subtle zoom */
.welcome-main-img {
    transition: transform 0.9s cubic-bezier(.2,.9,.3,1), filter 0.5s ease;
    will-change: transform;
    backface-visibility: hidden;
}
.welcome-main-card:hover .welcome-main-img {
    transform: scale(1.04);
    filter: contrast(1.04) saturate(1.03);
}

/* Caption lift */
.welcome-main-caption {
    transition: transform 0.36s ease, opacity 0.36s ease;
    transform: translateY(8px);
    opacity: 0.96;
}
.welcome-main-card:hover .welcome-main-caption {
    transform: translateY(0);
    opacity: 1;
}

/* Side thumbs hover */
.welcome-thumb {
    transition: transform 0.42s cubic-bezier(.2,.9,.3,1), box-shadow 0.42s ease;
    will-change: transform;
    cursor: pointer;
}
.welcome-thumb img {
    transition: transform 0.6s cubic-bezier(.2,.9,.3,1), filter 0.5s ease;
    display:block;
    backface-visibility: hidden;
}
.welcome-thumb:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(11,23,75,0.10);
}
.welcome-thumb:hover img {
    transform: scale(1.08) rotate(-1deg);
    filter: brightness(1.03) saturate(1.06);
}

/* Button micro-interaction + sheen */
.welcome-cta,
.welcome-cta-outline {
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.28s ease;
    z-index: 1;
}
.welcome-cta:active,
.welcome-cta-outline:active {
    transform: translateY(1px) scale(0.995);
}

/* sheen pseudo-element */
.welcome-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.12) 100%);
    transform: translateX(-110%);
    opacity: 0;
    mix-blend-mode: overlay;
    transition: transform 0.6s cubic-bezier(.2,.9,.3,1), opacity 0.28s ease;
}
.welcome-cta:hover::before {
    transform: translateX(30%);
    opacity: 1;
}

/* outline variant - subtle border glow */
.welcome-cta-outline {
    box-shadow: inset 0 0 0 1px rgba(8,16,59,0.05);
}
.welcome-cta-outline:hover {
    box-shadow: 0 14px 30px rgba(8,16,59,0.06), inset 0 0 0 1px rgba(8,16,59,0.08);
}

/* Accessibility: respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .section-welcome .subtitle,
    .section-welcome .title,
    .section-welcome .welcome-text,
    .section-welcome .btn-wrap,
    .welcome-main-card,
    .welcome-side-cards .welcome-thumb,
    .welcome-main-img,
    .welcome-thumb img,
    .welcome-cta::before {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Small polish: focus visible for keyboard users */
.welcome-cta:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(9,24,80,0.10), 0 8px 30px rgba(11,23,75,0.08);
}

/* Optional tiny shimmer on main caption for emphasis */
.welcome-main-caption::after {
    content: "";
    position: absolute;
    left: -40%;
    top: -20%;
    width: 140%;
    height: 140%;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.06) 100%);
    transform: rotate(10deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.8s cubic-bezier(.2,.9,.3,1);
}
.welcome-main-card:hover .welcome-main-caption::after {
    opacity: 1;
    transform: rotate(10deg) translateX(6%);
}
/* css */
/* Append to `site/css/welcome.css` */

/* Button: animated gradient + sheen + ripple */
.welcome-cta {
    position: relative;
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .4px;
    color: #08103b;
    background: linear-gradient(90deg, #ffffff 0%, #ffd37a 40%, #8B5E3C 70%, #ffffff 100%);
    background-size: 200% 100%;
    transition: transform .22s cubic-bezier(.2,.9,.3,1), box-shadow .28s ease;
    box-shadow: 0 8px 30px rgba(9,12,40,0.12);
    overflow: hidden;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    backface-visibility: hidden;
    will-change: transform;
    text-decoration: none;
}

/* moving gradient */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.welcome-cta.animate-gradient {
    animation: gradientShift 6s linear infinite;
}

/* sheen */
.welcome-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04) 50%, rgba(255,255,255,0.14));
    transform: translateX(-120%);
    opacity: 0;
    transition: transform .6s cubic-bezier(.2,.9,.3,1), opacity .28s ease;
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 1;
}
.welcome-cta:hover::before,
.welcome-cta:focus::before { transform: translateX(30%); opacity: 1; }

/* ripple (simple, centered) */
.welcome-cta::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.22);
    border-radius: 50%;
    transform: translate(-50%,-50%) scale(0);
    opacity: 0;
    transition: transform .45s cubic-bezier(.2,.9,.3,1), opacity .45s ease;
    z-index: 0;
    pointer-events: none;
}
.welcome-cta:active::after {
    transform: translate(-50%,-50%) scale(14);
    opacity: 0.14;
    transition: transform .35s cubic-bezier(.15,.9,.3,1), opacity .35s ease;
}

/* hover + active micro-interactions */
.welcome-cta:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 20px 40px rgba(11,23,75,0.12); }
.welcome-cta:active { transform: translateY(1px) scale(.997); box-shadow: 0 12px 28px rgba(11,23,75,0.08); }

/* focus ring for accessibility */
.welcome-cta:focus {
    outline: none;
    box-shadow: 0 0 0 6px rgba(9,24,80,0.08), 0 12px 30px rgba(11,23,75,0.08);
    z-index: 3;
}

/* Secondary outline variant adaptation */
.welcome-cta-outline {
    background: transparent;
    color: #08103b;
    border: 1px solid rgba(8,16,59,0.06);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
.welcome-cta-outline:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(8,16,59,0.06); }

/* Typography: gradient heading, animated subtitle and text */
.section-welcome .title {
    margin-bottom: 12px;
    font-size: 2.0rem;
    font-weight: 800;
    line-height: 1.05;
    background: linear-gradient(90deg,#08103b 0%, #3b2b7a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* fallback will still show if background-clip unsupported */
    letter-spacing: -0.2px;
    text-transform: none;
    display: inline-block;
    transform-origin: left center;
    animation: titleFloat .9s cubic-bezier(.2,.9,.3,1) both;
    z-index: 2;
}

@keyframes titleFloat {
    from { opacity: 0; transform: translateY(8px) scale(.995); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.section-welcome .subtitle {
    color: #6e778c;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    font-size: .85rem;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(6px);
    animation: fadeUp .6s cubic-bezier(.2,.9,.3,1) .06s both;
}

.section-welcome .welcome-text {
    color: #515a6b;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 560px;
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeUp .6s cubic-bezier(.2,.9,.3,1) .18s both;
    text-shadow: 0 1px 0 rgba(255,255,255,0.02);
}

/* small helper keyframe reused */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .welcome-cta.animate-gradient,
    .welcome-cta::before,
    .welcome-cta::after,
    .welcome-cta:hover,
    .section-welcome .title,
    .section-welcome .subtitle,
    .section-welcome .welcome-text {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
/* css - append to `site/css/welcome.css` */
/* Mobile tweaks: more spacing between button and images, larger nicer button, center alignment */
@media (max-width: 767px) {
    /* Ensure columns stack with comfortable spacing */
    .section-welcome .row.align-items-center {
        row-gap: 18px;
    }
    .section-welcome .col-md-6 {
        padding-bottom: 8px;
    }

    /* Add space between text area and gallery when stacked */
    .section-welcome .welcome-gallery {
        margin-top: 18px;
        padding-top: 6px;
        gap: 12px;
    }

    /* Make gallery cards slightly smaller and balanced on mobile */
    .welcome-main-card {
        min-height: 200px;
        border-radius: 12px;
    }
    .welcome-thumb {
        height: 120px;
        border-radius: 10px;
    }

    /* Button: bigger touch area, centered, nice shadow and full-bleed option */
    .section-welcome .btn-wrap {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: 18px; /* extra gap from text */
    }

    .welcome-cta,
    .welcome-cta-outline {
        padding: 14px 30px;
        font-size: 1rem;
        border-radius: 14px;
        box-shadow: 0 12px 34px rgba(9,12,40,0.10);
        min-width: 220px;
        max-width: 92%;
        width: auto;
    }

    /* Optional: make CTA full-width for very small screens */
    @media (max-width: 420px) {
        .welcome-cta,
        .welcome-cta-outline {
            display: inline-block;
            width: 100%;
            max-width: none;
            padding: 16px 20px;
            text-align: center;
        }
    }

    /* Keep button micro-interactions subtle on mobile */
    .welcome-cta:hover { transform: none; box-shadow: 0 10px 30px rgba(11,23,75,0.10); }
    .welcome-cta:active { transform: translateY(1px) scale(.997); }

    /* Prevent gallery from touching page edges */
    .section-welcome .container.wide {
        padding-left: 16px;
        padding-right: 16px;
    }
}
/* =========================================================
   IMAGE QUALITY FIX – chống vỡ & mượt render
   ========================================================= */

/* 1. Ảnh chính & thumbnail: render mượt, tránh blur khi scale */
.welcome-main-img,
.welcome-thumb img {
    image-rendering: auto;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
}

/* 2. Giảm zoom hover để tránh phóng to quá mức (NGUYÊN NHÂN CHÍNH gây vỡ) */
.welcome-main-card:hover .welcome-main-img {
    transform: scale(1.02); /* trước là 1.04 */
    filter: contrast(1.03) saturate(1.02);
}

/* 3. Thumbnail: bỏ rotate + giảm scale để không nát ảnh nhỏ */
.welcome-thumb:hover img {
    transform: scale(1.04); /* trước 1.08 + rotate */
    filter: brightness(1.02) saturate(1.04);
}

/* 4. Ngăn ảnh nhỏ bị kéo căng quá mức */
.welcome-main-img,
.welcome-thumb img {
    max-width: 100%;
    max-height: 100%;
}

/* 5. Mobile: TẮT zoom hover (mobile rất dễ vỡ ảnh) */
@media (max-width: 767px) {
    .welcome-main-card:hover .welcome-main-img,
    .welcome-thumb:hover img {
        transform: none;
        filter: none;
    }
}


