/* =================================================================
   BASE HERO STYLES (LOAD FAST) - ชิดขอบ Header
   ================================================================= */
.custom-hero-banner {
    /* **Absolute Position** เพื่อหลุดจากการควบคุมของ Theme Container */
    position: absolute !important; 
    
    /* **กำหนดตำแหน่งเริ่มต้นให้ชิดขอบด้านล่างของ Header หลัก** */
    /* 90px (Header) - 32px (Admin Bar) = 58px. ปรับค่านี้ให้พอดีที่สุด */
    top: 58px !important; 
    left: 0;
    
    overflow: hidden;
    width: 100vw !important; /* กว้างเต็ม Viewport */
    
    /* ยกเลิก Margin-top ทั้งหมด */
    margin-top: 0 !important; 
    
    z-index: 5; /* Z-index ทั่วไป (ต่ำกว่า Admin Bar แต่สูงกว่าเนื้อหา) */
    
    /* ใช้ Flexbox เพื่อจัดตำแหน่งเนื้อหาอย่างรวดเร็ว */
    display: flex; 
    color: #ffffff; /* สีข้อความหลัก */
}

/* ภาพพื้นหลัง/Slider */
.custom-hero-banner .hero-image,
.custom-hero-banner .hero-slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; 
}
.custom-hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Overlay (Filter สี) */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* ให้อยู่ระหว่างภาพและข้อความ */
}

/* Hero Content (ข้อความและปุ่ม) */
.hero-content {
    position: relative;
    z-index: 3; 
    text-align: center;
    padding: 20px;
    max-width: 900px;
}

/* Headline & Sub-headline */
.hero-title {
    font-size: 3em;
    margin-bottom: 0.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); 
}

/* Subtitle (ข้อความรอง) */
.hero-subtitle {
    font-size: 1.2em;
    margin-bottom: 1.5em;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* Hero Button */
.hero-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: #ff4500;
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.hero-button:hover {
    background-color: #cc3700;
}

/* =================================================================
   CONTENT POSITIONING (FLEXBOX - FAST)
   ================================================================= */

/* center (Default) */
.hero-content-center {
    justify-content: center;
    align-items: center;
}

/* top-left */
.hero-content-top-left {
    justify-content: flex-start;
    align-items: flex-start;
    padding: 50px;
}
.hero-content-top-left .hero-content { text-align: left; }

/* bottom-right */
.hero-content-bottom-right {
    justify-content: flex-end;
    align-items: flex-end;
    padding: 50px;
}
.hero-content-bottom-right .hero-content { text-align: right; }

/* =================================================================
   SLIDER STYLES (PURE CSS)
   ================================================================= */

.hero-slider-container {
    position: relative;
    overflow: hidden;
}

.hero-slide {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* ซ่อนทุก Slide ก่อน */
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1; /* แสดง Slide ที่ Active */
}

/* =================================================================
   FIX: OVERRIDE THEME PADDING/MARGIN & HIDE TITLE
   ================================================================= */

/* บังคับให้ Container, Row, และ Column ที่หุ้ม Hero กว้างเต็มจอและไม่มีช่องว่าง */
#primary .container,
#primary .row,
#primary .col-lg-12 {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important; 
    width: 100% !important;
}

/* **ซ่อน Header และ Title (หกหก) อย่างเด็ดขาด** */
#primary header.entry-header.page-header,
#primary h1.entry-title {
    display: none !important;
    height: 0 !important; 
    margin: 0 !important;
    padding: 0 !important;
}

/* =================================================================
   ADMIN BAR WARNING STYLES
   ================================================================= */
#wpadminbar .php-old-warning .ab-icon {
    top: 3px;
}
#wpadminbar .php-old-warning > .ab-item {
    background-color: #555 !important;
}
#wpadminbar .php-old-warning:hover > .ab-item {
    background-color: #e64a19 !important; /* เปลี่ยนสีเมื่อ Hover */
}