/* ══════════════════════════════════════
       HERO
       ══════════════════════════════════════ */
    .hero-wrap {
        position: relative; width: 100%; overflow: hidden; height: 340px;
        /* ใส่รูปจริง: background-image: url("{{ asset('front/image/hero-bg.jpg') }}"); */
        background: linear-gradient(160deg, #87CEEB 0%, #5BA8D9 20%, #2E86C1 35%, #1A6B3C 60%, #2D8B55 80%, #45A66D 100%);
        background-size: cover; background-position: center top;
    }
    .hero-overlay {
        position: absolute; inset: 0;
        background: linear-gradient(90deg, rgba(0,14,100,.55) 0%, rgba(0,14,100,.25) 50%, transparent 80%);
        display: flex; align-items: center;
    }
    .hero-text    { padding-left: 64px; }
    .hero-welcome { font-size: 17px; font-weight: 400; color: #fff; font-style: italic; margin: 0 0 6px; opacity: .95; }
    .hero-brand   { font-size: 54px; font-weight: 900; color: #fff; line-height: 1; margin: 0; letter-spacing: -1px; }
    .hero-brand span { color: var(--bs-secondary-300); }


/* ══════════════════════════════════════
       BANNER CAROUSEL
       ══════════════════════════════════════ */
/* ── ความสูงมาจากสัดส่วน ไม่ใช่ตัวเลขตายตัว ──
   ของเดิมตรึง height: 431px ซึ่งเป็นความสูงที่บังเอิญพอดีกับภาพ 1920x544 บนจอกว้าง ๆ
   เท่านั้น จอที่กว้างกว่าหรือแคบกว่านั้นภาพจะสูงไม่เท่า 431 เลยเกิดขอบว่างหรือโดนตัด
   (เคยแก้ด้วยการใส่ height:auto เฉพาะจอเล็ก ซึ่งกลบอาการได้แค่ครึ่งเดียว)

   ความสูงเท่า hero หน้าแรกของ mrta-news (.nw-hero): 450px ที่จอ 1920 ตาม mockup ย่อตามความกว้างจอ ต่ำสุด 220px
   ภาพที่สัดส่วนไม่ตรงถูกครอบตัดตรงกลาง (object-fit: cover ด้านล่าง) */
#banner-section {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: clamp(220px, 23.4vw, 450px);
    overflow: hidden;
}

/* ฟิล์มขาวไล่สีจากซ้าย: ตัวหนังสือกรมท่าอ่านออกทุกรูปแบนเนอร์ (ตามแบบที่ฝั่งซ้ายสว่าง) */
#banner-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .8) 34%, rgba(255, 255, 255, 0) 62%);
}

/* ข้อความบนแบนเนอร์ - ไม่รับคลิก แบนเนอร์ที่มีลิงก์ยังกดได้ทั้งใบ */
.banner-hero {
    width: 100%; /* เป็น flex item ของ #banner-section - ไม่ให้หดตามข้อความ */
    position: relative;
    z-index: 2;
    padding-top: clamp(24px, 3vw, 48px);
    padding-bottom: clamp(40px, 4vw, 64px);
    pointer-events: none;
}

.banner-hero-title {
    margin: 0 0 clamp(8px, 1vw, 18px);
    font-size: clamp(36px, 3.7vw, 72px);
    font-weight: 700;
    line-height: 1.15;
    color: #1a3f99; /* บนฟิล์มขาว 8.4:1 */
}

.banner-hero-title .accent {
    color: #d71920; /* ตัวอักษรใหญ่ 5.0:1 */
}

.banner-hero-desc {
    max-width: 34em;
    margin: 0;
    font-size: clamp(15px, 1.15vw, 22px);
    font-weight: 500;
    line-height: 1.95;
    color: #1a3f99;
}

#banner-carousel,
#banner-carousel .owl-stage-outer,
#banner-carousel .owl-stage,
#banner-carousel .owl-item,
#banner-carousel .item {
    height: 100%;
}

/* carousel เป็นพื้นหลังเต็มกล่อง - ข้อความ (.banner-hero) อยู่ใน flow ปกติด้านบน */
#banner-carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
}

#banner-carousel .item {
    position: relative;
}

/* object-fit: cover เผื่อไฟล์เก่าที่อัปไว้ก่อนกำหนดสัดส่วนมาตรฐาน
   ภาพสัดส่วนไม่ตรงจะถูกครอบตัดที่กึ่งกลางแทนที่จะยืดจนเพี้ยน
   (ของใหม่ผ่านกล่องตัดรูปในหน้าแอดมินมาแล้ว สัดส่วนตรงเป๊ะ ไม่โดนตัดอะไรเลย) */
#banner-carousel .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── มีแบนเนอร์ใบเดียว = ไม่ต้องมีปุ่มให้กดเปลี่ยน ──
   owl ใส่คลาส .disabled ให้ .owl-nav / .owl-dots เองอยู่แล้วเมื่อไม่มีอะไรให้เลื่อน
   แต่กฎด้านล่างสั่ง display:flex (บางอันมี !important) ทับไปหมด ปุ่มเลยยังโผล่
   ต้องเคารพ .disabled ก่อน ไม่งั้นผู้ใช้กดลูกศรแล้วภาพไม่เปลี่ยน งงว่าเสียหรือเปล่า */
#banner-carousel .owl-nav.disabled,
#banner-carousel .owl-dots.disabled {
    display: none !important;
}

/* Navigation Arrows */
#banner-carousel .owl-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

#banner-carousel .owl-nav button {
    pointer-events: all;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin: 0 20px;
    font-size: 24px;
}

#banner-carousel .owl-nav button:hover {
    background: rgba(0, 0, 0, 0.8) !important;
    transform: scale(1.1);
}

#banner-carousel .owl-nav button i {
    font-size: 24px;
    line-height: 1;
}

/* Dots */
#banner-carousel .owl-dots {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#banner-carousel .owl-dot {
    width: 12px !important;
    height: 12px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
}

#banner-carousel .owl-dot span {
    display: none !important;
}

#banner-carousel .owl-dot.active {
    background: #fff !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
    width: 14px !important;
    height: 14px !important;
}

#banner-carousel .owl-dot:hover {
    background: rgba(255, 255, 255, 0.8) !important;
}

/* ── Responsive ── */
@media (max-width: 767.98px) {
    /* Hero */
    .hero-wrap {
        height: 220px;
    }
    .hero-text {
        padding-left: 24px;
    }
    .hero-welcome {
        font-size: 13px;
    }
    .hero-brand {
        font-size: 34px;
    }

    /* Banner nav */
    #banner-carousel .owl-nav button {
        width: 36px;
        height: 36px;
        margin: 0 8px;
        font-size: 16px !important;
    }
    #banner-carousel .owl-dots {
        bottom: 10px !important;
        gap: 7px !important;
    }
    #banner-carousel .owl-dot {
        width: 9px !important;
        height: 9px !important;
    }
    #banner-carousel .owl-dot.active {
        width: 11px !important;
        height: 11px !important;
    }
    #banner-section {
        margin-top: 0 !important;
    }
}

@media (max-width: 575.98px) {
    /* Hero */
    .hero-wrap {
        height: 180px;
    }
    .hero-text {
        padding-left: 16px;
    }
    .hero-welcome {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .hero-brand {
        font-size: 26px;
        letter-spacing: 0;
    }

    /* Banner: hide nav arrows on very small screens */
    #banner-carousel .owl-nav {
        display: none;
    }
}