/* ============================================================
   IN AN HOANG NAM
   HOME HERO
   FILE: hero-home.css

   STRUCTURE
   ------------------------------------------------------------
   #content.site-content
        |
        |-- .inh-home-hero
        |
        |-- #primary

   HERO
        |
        |-- LEFT  : MAIN SLIDER
        |
        |-- RIGHT : 4 BANNERS — 2 x 2

   DESIGN
   ------------------------------------------------------------
   - FULL WIDTH
   - 15px side spacing
   - NO fixed 1410px
   - NO fixed 720px
   - Slider + banners tự co theo viewport
============================================================ */


/* ============================================================
   01. GENERATEPRESS CONTENT LAYOUT FIX
   ============================================================ */

/*
 * GeneratePress có thể đặt #content thành display:flex.
 *
 * Nếu flex-direction mặc định là row:
 *
 * HERO              MAIN
 * ┌─────────────┐   ┌─────────────┐
 * │             │   │ Website     │
 * │    HERO     │   │ đang xây    │
 * │             │   │ dựng        │
 * └─────────────┘   └─────────────┘
 *
 * Ép thành column để Hero nằm trên Main.
 */

#content.site-content {
    display: flex !important;

    flex-direction: column !important;

    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    box-sizing: border-box;
}


/* ============================================================
   02. HERO BREAKOUT KHỎI GENERATEPRESS CONTAINER
   ============================================================ */

/*
 * Hero thoát khỏi .grid-container / .container
 * của GeneratePress.
 *
 * 100vw = toàn bộ chiều rộng viewport.
 */

#content.site-content > .inh-home-hero {

    position: relative;

    width: 100vw !important;
    max-width: 100vw !important;

    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;

    box-sizing: border-box;
}


/* ============================================================
   03. MAIN NẰM BÊN DƯỚI HERO
   ============================================================ */

#content.site-content > #primary {

    width: 100% !important;
    max-width: 100% !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    box-sizing: border-box;
}


/* ============================================================
   04. HERO WRAPPER
============================================================ */

.inh-home-hero {

    position: relative;

    width: 100vw;
    max-width: 100vw;

    margin: 0;

    padding: 10px 0 0;

    box-sizing: border-box;
}


/* ============================================================
   05. HERO CONTAINER
   FULL WIDTH
   15PX HAI BÊN
============================================================ */

.inh-home-hero .inh-container {

    width: calc(100vw - 30px) !important;

    max-width: none !important;

    margin-left: 15px !important;
    margin-right: 15px !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    box-sizing: border-box;
}


/* ============================================================
   06. HERO INNER
   ------------------------------------------------------------
   LEFT  = 54.2%
   RIGHT = 45.8%

   Không dùng:
   - 720px
   - 1410px
============================================================ */

.inh-home-hero-inner {

    display: grid;

    grid-template-columns:
        minmax(0, 54.2fr)
        minmax(0, 45.8fr);

    column-gap: 6px;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;

    align-items: stretch;

    box-sizing: border-box;
}


/* ============================================================
   07. LEFT — SLIDER
============================================================ */

.inh-home-hero-slider {

    position: relative;

    width: 100%;
    min-width: 0;

    overflow: hidden;

    border-radius: 6px;

    box-sizing: border-box;
}


/* ============================================================
   08. SLIDER FRAME
   ------------------------------------------------------------
   TỶ LỆ GỐC:
   720 × 441

   Khi màn hình thay đổi:
   width thay đổi
   height tự động thay đổi theo aspect-ratio
============================================================ */

.inh-home-hero-slides {

    position: relative;

    width: 100%;
    min-width: 0;

    aspect-ratio: 720 / 441;

    overflow: hidden;

    border-radius: 6px;

    box-sizing: border-box;
}


/* ============================================================
   09. SLIDE
============================================================ */

.inh-home-hero-slide {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    opacity: 0;
    visibility: hidden;

    z-index: 0;

    transition:
        opacity 0.5s ease,
        visibility 0.5s ease;

    box-sizing: border-box;
}


/* ============================================================
   10. ACTIVE SLIDE
============================================================ */

.inh-home-hero-slide.is-active {

    opacity: 1;

    visibility: visible;

    z-index: 1;
}


/* ============================================================
   11. SLIDE LINK
============================================================ */

.inh-home-hero-slide-link {

    display: block;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}


/* ============================================================
   12. SLIDE IMAGE
============================================================ */

.inh-home-hero-slide-image {

    display: block;

    width: 100%;
    height: 100%;

    max-width: none;

    margin: 0;
    padding: 0;

    border: 0;

    object-fit: cover;

    object-position: center;

    box-sizing: border-box;
}


/* ============================================================
   13. HERO ARROWS
   ------------------------------------------------------------
   MŨI TÊN NẰM TRỰC TIẾP TRÊN ẢNH
============================================================ */

.inh-home-hero-arrows {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    z-index: 20;

    pointer-events: none;
}


/* ============================================================
   14. ARROW
============================================================ */

.inh-home-hero-arrow {

    position: absolute;

    top: 50%;

    width: 42px;
    height: 64px;

    margin: 0;
    padding: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    border: 0;

    border-radius: 4px;

    background: rgba(0, 0, 0, 0.25);

    color: #ffffff;

    cursor: pointer;

    opacity: 0;

    pointer-events: auto;

    appearance: none;
    -webkit-appearance: none;

    transition:
        opacity 0.25s ease,
        background 0.25s ease,
        transform 0.25s ease;

    box-sizing: border-box;
}


/* ============================================================
   15. PREVIOUS ARROW
============================================================ */

.inh-home-hero-arrow-prev {

    left: 12px;
}


/* ============================================================
   16. NEXT ARROW
============================================================ */

.inh-home-hero-arrow-next {

    right: 12px;
}


/* ============================================================
   17. ARROW ICON
============================================================ */

.inh-home-hero-arrow span {

    display: block;

    font-size: 42px;

    font-weight: 300;

    line-height: 1;

    margin-top: -5px;

    pointer-events: none;
}


/* ============================================================
   18. HIỆN ARROW KHI HOVER ẢNH
============================================================ */

.inh-home-hero-slides:hover
.inh-home-hero-arrow {

    opacity: 1;
}


/* ============================================================
   19. ARROW HOVER
============================================================ */

.inh-home-hero-arrow:hover {

    background: rgba(0, 0, 0, 0.55);
}


/* ============================================================
   20. ARROW MOVE
============================================================ */

.inh-home-hero-arrow-prev:hover {

    transform:
        translateY(-50%)
        translateX(-2px);
}


.inh-home-hero-arrow-next:hover {

    transform:
        translateY(-50%)
        translateX(2px);
}


/* ============================================================
   21. RIGHT — 4 BANNERS
   ------------------------------------------------------------
   2 CỘT
   2 HÀNG
============================================================ */

.inh-home-hero-banners {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    grid-template-rows:
        repeat(2, minmax(0, 1fr));

    column-gap: 6px;
    row-gap: 6px;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    align-content: stretch;

    box-sizing: border-box;
}


/* ============================================================
   22. BANNER
============================================================ */

.inh-home-hero-banner {

    position: relative;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    border-radius: 6px;

    background: #eeeeee;

    box-sizing: border-box;
}


/* ============================================================
   23. BANNER LINK
============================================================ */

.inh-home-hero-banner > a {

    position: relative;

    display: block;

    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    overflow: hidden;

    box-sizing: border-box;
}


/* ============================================================
   24. BANNER IMAGE
============================================================ */

.inh-home-hero-banner > img,
.inh-home-hero-banner > a > img {

    display: block;

    width: 100%;
    height: 100%;

    max-width: none;

    margin: 0;
    padding: 0;

    border: 0;

    object-fit: cover;

    object-position: center;

    transition:
        transform 0.35s ease;

    box-sizing: border-box;
}


/* ============================================================
   25. BANNER IMAGE HOVER
============================================================ */

.inh-home-hero-banner:hover > img,
.inh-home-hero-banner:hover > a > img {

    transform: scale(1.025);
}


/* ============================================================
   26. HOVER FRAME
============================================================ */

.inh-banner-frame {

    position: absolute;

    inset: 0;

    z-index: 5;

    pointer-events: none;
}


/* ============================================================
   27. FRAME COMMON
============================================================ */

.inh-banner-frame span {

    position: absolute;

    display: block;

    background: #ffffff;

    opacity: 0;
}


/* ============================================================
   28. FRAME TOP
============================================================ */

.inh-banner-frame .frame-top {

    top: 8px;
    left: 8px;

    width: 0;
    height: 2px;
}


/* ============================================================
   29. FRAME RIGHT
============================================================ */

.inh-banner-frame .frame-right {

    top: 8px;
    right: 8px;

    width: 2px;
    height: 0;
}


/* ============================================================
   30. FRAME BOTTOM
============================================================ */

.inh-banner-frame .frame-bottom {

    right: 8px;
    bottom: 8px;

    width: 0;
    height: 2px;
}


/* ============================================================
   31. FRAME LEFT
============================================================ */

.inh-banner-frame .frame-left {

    left: 8px;
    bottom: 8px;

    width: 2px;
    height: 0;
}


/* ============================================================
   32. FRAME SHOW
============================================================ */

.inh-home-hero-banner:hover
.inh-banner-frame span {

    opacity: 1;
}


/* ============================================================
   33. FRAME TOP ANIMATION
============================================================ */

.inh-home-hero-banner:hover
.inh-banner-frame .frame-top {

    animation:
        inh-frame-top
        0.45s
        linear
        forwards;
}


/* ============================================================
   34. FRAME RIGHT ANIMATION
============================================================ */

.inh-home-hero-banner:hover
.inh-banner-frame .frame-right {

    animation:
        inh-frame-right
        0.45s
        0.45s
        linear
        forwards;
}


/* ============================================================
   35. FRAME BOTTOM ANIMATION
============================================================ */

.inh-home-hero-banner:hover
.inh-banner-frame .frame-bottom {

    animation:
        inh-frame-bottom
        0.45s
        0.9s
        linear
        forwards;
}


/* ============================================================
   36. FRAME LEFT ANIMATION
============================================================ */

.inh-home-hero-banner:hover
.inh-banner-frame .frame-left {

    animation:
        inh-frame-left
        0.45s
        1.35s
        linear
        forwards;
}


/* ============================================================
   37. FRAME KEYFRAME — TOP
============================================================ */

@keyframes inh-frame-top {

    from {
        width: 0;
    }

    to {
        width: calc(100% - 16px);
    }
}


/* ============================================================
   38. FRAME KEYFRAME — RIGHT
============================================================ */

@keyframes inh-frame-right {

    from {
        height: 0;
    }

    to {
        height: calc(100% - 16px);
    }
}


/* ============================================================
   39. FRAME KEYFRAME — BOTTOM
============================================================ */

@keyframes inh-frame-bottom {

    from {
        width: 0;
    }

    to {
        width: calc(100% - 16px);
    }
}


/* ============================================================
   40. FRAME KEYFRAME — LEFT
============================================================ */

@keyframes inh-frame-left {

    from {
        height: 0;
    }

    to {
        height: calc(100% - 16px);
    }
}


/* ============================================================
   ============================================================
   41. TABLET
   <= 991px
   ============================================================
   ============================================================ */

@media (max-width: 991px) {


    /* --------------------------------------------------------
       HERO
    -------------------------------------------------------- */

    .inh-home-hero {

        padding-top: 8px;
    }


    /* --------------------------------------------------------
       CONTAINER
    -------------------------------------------------------- */

    .inh-home-hero .inh-container {

        width: calc(100vw - 30px) !important;

        max-width: none !important;

        margin-left: 15px !important;
        margin-right: 15px !important;

        padding-left: 0 !important;
        padding-right: 0 !important;
    }


    /* --------------------------------------------------------
       HERO INNER
       Chuyển thành 1 cột
    -------------------------------------------------------- */

    .inh-home-hero-inner {

        display: grid;

        grid-template-columns: 1fr;

        grid-template-rows: auto auto;

        row-gap: 6px;

        column-gap: 0;

        width: 100%;
    }


    /* --------------------------------------------------------
       SLIDER
    -------------------------------------------------------- */

    .inh-home-hero-slides {

        width: 100%;

        aspect-ratio: 720 / 441;
    }


    /* --------------------------------------------------------
       BANNERS
    -------------------------------------------------------- */

    .inh-home-hero-banners {

        width: 100%;

        height: auto;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        grid-template-rows:
            repeat(2, minmax(0, 1fr));

        column-gap: 6px;

        row-gap: 6px;
    }


    /* --------------------------------------------------------
       BANNER
    -------------------------------------------------------- */

    .inh-home-hero-banner {

        width: 100%;

        height: auto;

        aspect-ratio: 250 / 167;
    }
}


/* ============================================================
   ============================================================
   42. MOBILE
   <= 767px
   ============================================================
   ============================================================ */

@media (max-width: 767px) {


    /* --------------------------------------------------------
       HERO
    -------------------------------------------------------- */

    .inh-home-hero {

        padding-top: 6px;
    }


    /* --------------------------------------------------------
       CONTAINER
       FULL WIDTH
    -------------------------------------------------------- */

    .inh-home-hero .inh-container {

        width: 100vw !important;

        max-width: none !important;

        margin-left: 0 !important;
        margin-right: 0 !important;

        padding-left: 0 !important;
        padding-right: 0 !important;
    }


    /* --------------------------------------------------------
       INNER
    -------------------------------------------------------- */

    .inh-home-hero-inner {

        width: 100%;

        row-gap: 4px;
    }


    /* --------------------------------------------------------
       SLIDER
    -------------------------------------------------------- */

    .inh-home-hero-slider {

        border-radius: 4px;
    }


    .inh-home-hero-slides {

        border-radius: 4px;
    }


    /* --------------------------------------------------------
       BANNERS
    -------------------------------------------------------- */

    .inh-home-hero-banners {

        column-gap: 4px;

        row-gap: 4px;
    }


    .inh-home-hero-banner {

        border-radius: 4px;
    }


    /* --------------------------------------------------------
       ARROWS
    -------------------------------------------------------- */

    .inh-home-hero-arrow {

        width: 34px;
        height: 52px;

        opacity: 1;

        border-radius: 3px;
    }


    .inh-home-hero-arrow-prev {

        left: 6px;
    }


    .inh-home-hero-arrow-next {

        right: 6px;
    }


    .inh-home-hero-arrow span {

        font-size: 34px;
    }
}


/* ============================================================
   ============================================================
   43. MOBILE NHỎ
   <= 480px
   ============================================================
   ============================================================ */

@media (max-width: 480px) {


    /* --------------------------------------------------------
       HERO
    -------------------------------------------------------- */

    .inh-home-hero {

        padding-top: 4px;
    }


    /* --------------------------------------------------------
       BANNERS
    -------------------------------------------------------- */

    .inh-home-hero-banners {

        column-gap: 3px;

        row-gap: 3px;
    }


    /* --------------------------------------------------------
       ARROWS
    -------------------------------------------------------- */

    .inh-home-hero-arrow {

        width: 30px;
        height: 46px;
    }


    .inh-home-hero-arrow-prev {

        left: 4px;
    }


    .inh-home-hero-arrow-next {

        right: 4px;
    }


    .inh-home-hero-arrow span {

        font-size: 30px;
    }
}


/* ============================================================
   44. SAFETY
   ------------------------------------------------------------
   Ngăn GeneratePress ép lại width của Hero.
============================================================ */

#content.site-content
> .inh-home-hero
> .inh-container {

    flex: 0 0 auto !important;

    box-sizing: border-box;
}


/* ============================================================
   45. SAFETY — KHÔNG CHO MAIN LÊN CẠNH HERO
============================================================ */

#content.site-content > #primary {

    flex: 0 0 auto !important;
}

/* =========================================================
   HERO - CÙNG CHIỀU RỘNG 1445px + CHIỀU CAO KHÔNG CẮT ẢNH
   (chỉ áp dụng từ 992px; tablet và mobile giữ nguyên)
========================================================= */

@media (min-width: 992px) {

    /* Hero rộng bằng các khối bên dưới */
    #content.site-content > .inh-home-hero .inh-container {
        width: min(1445px, calc(100vw - 30px)) !important;
        max-width: 1445px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .inh-home-hero {
        /* Chiều cao hero: tối đa 460px, màn nhỏ hơn thì tự co theo tỉ lệ.
           Muốn thấp hơn thì giảm 460px, muốn ảnh hiện đủ hơn thì tăng. */
        --inh-hero-h: clamp(280px, 31.8vw, 460px);
    }

    .inh-home-hero-slides {
        aspect-ratio: auto;
        height: var(--inh-hero-h);
    }

    .inh-home-hero-banners {
        height: var(--inh-hero-h);
    }
}

/* =========================================================
   HERO - DẤU TRÒN CHỈ BÁO SLIDE
========================================================= */

.inh-home-hero-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    z-index: 20;

    display: flex;
    align-items: center;
    gap: 7px;

    padding: 5px 9px;

    background: rgba(0, 0, 0, 0.28);
    border-radius: 999px;
}

.inh-home-hero-dots .inh-home-hero-dot {
    width: 8px;
    height: 8px;
    min-width: 0;
    padding: 0;
    margin: 0;

    background: rgba(255, 255, 255, 0.6) !important;
    border: 0;
    border-radius: 999px;
    box-shadow: none;

    cursor: pointer;

    transition: width 0.25s ease, background-color 0.25s ease;
}

.inh-home-hero-dots .inh-home-hero-dot:hover {
    background: #ffffff !important;
}

/* Dấu tròn của ảnh đang hiện: dài ra và đổi sang vàng */
.inh-home-hero-dots .inh-home-hero-dot.is-active {
    width: 22px;
    background: #EF9B2D !important;
}

.inh-home-hero-dots .inh-home-hero-dot:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .inh-home-hero-dots {
        bottom: 8px;
        gap: 6px;
        padding: 4px 8px;
    }

    .inh-home-hero-dots .inh-home-hero-dot {
        width: 7px;
        height: 7px;
    }

    .inh-home-hero-dots .inh-home-hero-dot.is-active {
        width: 18px;
    }
}