
/* =========================================
   dir assets\css\front-page.css
   Hardcode Front Page (Hybrid Switcher)
   ========================================= */
.hc-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.hc-img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.text-center { text-align: center; }
.text-white { color: #fff !important; }

/* 1. Hero Section */
.hc-hero-section { padding: 80px 0; background: #fff; overflow: hidden; }
.hc-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.hc-title { font-size: 3.5em; font-weight: 800; color: #1a1a1a; margin-bottom: 20px; line-height: 1.2; }
.hc-desc { font-size: 1.1em; color: #555; line-height: 1.6; margin-bottom: 30px; max-width: 500px; }
.hc-hero-actions { display: flex; gap: 15px; }
.hc-btn { padding: 12px 25px; border-radius: 50px; font-weight: bold; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: all 0.3s ease; }
.hc-btn-primary { background: #125732; color: #fff; } /* สีเขียวบริษัท */
.hc-btn-primary:hover { background: #0e4528; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(18,87,50,0.3); }
.hc-btn-secondary { background: #6b8c78; color: #fff; }
.hc-btn-secondary:hover { background: #557260; transform: translateY(-3px); }

/* Hexagon Image Placeholder */
.hc-hexagon-img-wrap {
    width: 100%; max-width: 500px; aspect-ratio: 1/1; margin: 0 auto;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #e2e8f0;
}

/* 2. Factory Section */
.hc-factories-section { padding: 80px 0; background: #f8fafc; }
.hc-section-title { font-size: 2.5em; font-weight: bold; color: #1a1a1a; margin-bottom: 15px; }
.hc-section-subtitle { font-size: 1.1em; color: #666; margin-bottom: 50px; max-width: 700px; margin-left: auto; margin-right: auto; }
.hc-factory-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: 0.3s; }
.hc-factory-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.hc-card-img { display: block; aspect-ratio: 4/3; background: #eee; }
.hc-card-body { padding: 20px; text-align: left; }
.hc-card-title { font-size: 1.1em; font-weight: bold; margin: 0; }
.hc-card-title a { color: #1a1a1a; text-decoration: none; }
.hc-card-placeholder { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:#ccc; font-size:3em; }

/* 3. News Section */
.hc-news-section { padding: 80px 0; background: #3b8255; } /* พื้นหลังสีเขียวตามรูป */
.hc-news-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 15px; }
.hc-view-all { text-decoration: none; font-weight: bold; display: flex; align-items: center; gap: 5px; }
.hc-view-all:hover { opacity: 0.8; }
.hc-news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.hc-news-card { background: #fff; border-radius: 12px; overflow: hidden; display: flex; padding: 15px; gap: 15px; align-items: center; box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
.hc-news-img { width: 100px; height: 100px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #eee; }
.hc-news-body { flex-grow: 1; }
.hc-news-title { font-size: 1.1em; font-weight: bold; margin: 0 0 5px 0; }
.hc-news-title a {color: #1a1a1a; text-decoration: none; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; line-height: 1.2; min-height: calc(1.2em * 2); }
.hc-news-title a:hover {color: #10b981;}

.hc-news-excerpt {
    font-size: 0.9em; 
    color: #666;
    margin-top: 8px; /* เพิ่มระยะห่างจาก Title นิดนึง */
    
    /* ใช้เวทมนตร์เดียวกันกับเนื้อหาย่อ ให้ตัดที่ 2 บรรทัดเช่นกัน */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2; 
    line-clamp: 2;
    line-height: 1.5;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .hc-hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hc-desc { margin: 0 auto 30px; }
    .hc-hero-actions { justify-content: center; }
    .hc-factory-grid { grid-template-columns: repeat(2, 1fr); }
    .hc-news-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .hc-title { font-size: 2.5em; }
    .hc-factory-grid { grid-template-columns: 1fr; }
}

/* Video Section Grid */
.hc-video-section { padding: 80px 0; background: #fff; }
.hc-video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 40px; }

.hc-video-facade {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.hc-svg-facade { width: 100%; height: 100%; }

.hc-play-button {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 5;
}

.hc-video-facade:hover .hc-play-button {
    transform: translate(-50%, -50%) scale(1.1);
    color: #10b981; /* เปลี่ยนเป็นสีเขียวสว่างเมื่อ hover */
}

.hc-video-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    z-index: 4;
}

.hc-video-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive */
@media (max-width: 767px) {
    .hc-video-grid { grid-template-columns: 1fr; }
    .hc-play-button { font-size: 60px; }
}


/* =========================================
   Native CSS Slider (ไม่ง้อ Swiper.js)
   ========================================= */
.hc-native-slider-wrap {
    position: relative;
    padding: 10px 0 20px;
}

.hc-native-slider {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* ซ่อน Scrollbar IE */
    scrollbar-width: none; /* ซ่อน Scrollbar Firefox */
}
.hc-native-slider::-webkit-scrollbar { 
    display: none; /* ซ่อน Scrollbar Chrome/Safari */
}

/* ขนาดของการ์ดแต่ละใบ */
.hc-slide-item {
    flex: 0 0 calc(33.333% - 20px) !important; /* แก้ตรงนี้! เป็น 3 ใบพอดี (100%/3) */
    width: calc(33.333% - 20px) !important; /* เพิ่ม width เข้าไปกันเหนียว */
    scroll-snap-align: start;
    display: flex;
}
.hc-slide-item > article { width: 100%; }

/* =========================================
   ปุ่มลูกศร Slider (อัปเดตแก้บั๊กสีชมพู)
   ========================================= */
.hc-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #125732 !important; /* บังคับเขียวเสมอ */
    color: #fff !important;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none !important;
    box-shadow: 0 5px 15px rgba(18,87,50,0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none !important; /* เอาเส้นขอบ Focus ออก */
}
.hc-slider-btn i { 
    font-size: 24px; 
}
/* ดักทุกสถานะ ทั้งตอนชี้ ตอนกด และตอนเอาเมาส์ค้างไว้ */
.hc-slider-btn:hover,
.hc-slider-btn:focus,
.hc-slider-btn:active { 
    background-color: #0e4528 !important; /* บังคับเขียวเข้ม ห้ามเป็นสีชมพู */
    transform: translateY(-50%) scale(1.1); 
    outline: none !important;
}
.hc-slider-btn.prev { left: -20px; }
.hc-slider-btn.next { right: -20px; }

/* Responsive Adjustments สำหรับปุ่ม */
@media (max-width: 1024px) {
    .hc-slider-btn.prev { left: -10px; }
    .hc-slider-btn.next { right: -10px; }
}
@media (max-width: 767px) {
    .hc-slider-btn { display: none !important; } /* มือถือซ่อนปุ่ม ใช้ปัดเอา */
}


/* =========================================
   Section: Certification (ใบรับรอง)
   ========================================= */
.hc-cert-section {
    padding: 80px 0;
    background-color: #f8fafc; /* พื้นหลังเทาอมฟ้าอ่อนๆ ดันให้กรอบลอยเด่น */
}
.hc-accent-line {
    width: 60px;
    height: 4px;
    background-color: #125732;
    margin: 15px auto 40px;
    border-radius: 2px;
}
.hc-cert-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}
.hc-cert-item {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
    border: 1px solid #edf2f7;
}
.hc-cert-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: #125732;
}
.hc-cert-img-wrap {
    width: 100%;
    aspect-ratio: 3/4; /* สัดส่วนกระดาษ A4 แนวตั้ง (ใบเซอร์) */
    background: #f1f5f9;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
}
.hc-img-contain {
    width: 100%;
    height: 100%;
    object-fit: contain; /* สำคัญ! ให้ใบเซอร์โชว์เต็มใบ ไม่ถูกตัดแหว่ง */
}
.hc-cert-placeholder {
    font-size: 4rem;
    color: #cbd5e1;
}
.hc-cert-title {
    font-size: 1rem;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
}

/* --- Native Lightbox Style (<dialog>) --- */
.hc-lightbox {
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    max-width: 90vw;
    max-height: 90vh;
    overflow: visible;
    margin: auto;
}
.hc-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.85); /* พื้นหลังดำโปร่งแสง */
    backdrop-filter: blur(5px); /* เอฟเฟกต์เบลอแบบ iOS */
}
.hc-lightbox-content {
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hc-lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}
.hc-lightbox-caption {
    margin: 15px 0 0;
    font-size: 1.2rem;
    font-weight: bold;
    color: #125732;
}
.hc-lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: none;
    color: #1a1a1a;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: 0.2s;
    z-index: 10;
    outline: none !important;
}
.hc-lightbox-close:hover {
    background: #ef4444; /* สีแดงตอนชี้ */
    color: #fff;
    transform: scale(1.1);
}

/* --- Responsive Layout --- */
@media (max-width: 1024px) {
    .hc-cert-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 767px) {
    /* มือถือบังคับเป็น 2x2 จะได้เห็นครบๆ */
    .hc-cert-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; } 
    .hc-cert-item { padding: 10px; }
    .hc-cert-title { font-size: 0.85rem; }
    .hc-lightbox-caption { font-size: 1rem; }
}

/* =========================================
   Section: Services (บริการของเรา)
   ========================================= */
.hc-services-section {
    padding: 60px 0;
    background-color: #fff;
}

.hc-service-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 40px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
}
.hc-service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    border-color: #10b981; /* ขอบเขียวอ่อนตอน hover */
}
.hc-service-icon {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* สั่งให้ Lordicon ขยับเองเบาๆ ตอนโหลดเสร็จ (ถ้าไม่อยากให้ขยับตอนแรก ลบบรรทัดนี้ได้ครับ) */
.hc-service-card lord-icon {
    transition: transform 0.3s ease;
}
.hc-service-card:hover lord-icon {
    transform: scale(1.1);
}
.hc-service-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
}
.hc-service-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1; /* ดันปุ่มอ่านต่อลงไปชิดขอบล่างเสมอ */
}
.hc-service-link {
    color: #125732;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.hc-service-link:hover {
    color: #0e4528;
    text-decoration: underline;
}

/* =========================================
   📱 Responsive สำหรับ Slider (คุมทั้ง โรงงาน และ บริการ)
   ========================================= */
@media (max-width: 1024px) {
    /* แท็บเล็ต: บังคับให้การ์ดทุกแบบ (โรงงาน+บริการ) โชว์ 2 ใบ */
    .hc-slide-item { flex: 0 0 calc(50% - 15px) !important; } 
    .hc-slider-btn.prev { left: -10px; }
    .hc-slider-btn.next { right: -10px; }
}

@media (max-width: 767px) {
    /* มือถือ: บังคับให้การ์ดทุกแบบ โชว์ 1 ใบ + โผล่ขอบใบที่สองมา 15% ให้รู้ว่าปัดได้ */
    .hc-slide-item { flex: 0 0 85% !important; } 
    .hc-native-slider { padding-right: 20px; gap: 15px; }
    .hc-service-card { padding: 30px 15px; }
    /* ซ่อนปุ่มลูกศรบนมือถือ ให้ใช้นิ้วปัดเอา */
    .hc-slider-btn { display: none !important; } 
}


/* =========================================
   Section: Partner Logos (Infinite Marquee)
   ========================================= */
.hc-partner-section {
    padding: 50px 0;
    background-color: #f8fafc00; /* พื้นหลังเทาอ่อนๆ ตัดกับคอนเทนต์ก่อนหน้า */
    border-top: 1px solid #edf2f7;
}

.hc-marquee-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    /* ลูกเล่นเพิ่มความแพง: ไล่สีจางๆ ขอบซ้าย-ขวา ให้โลโก้ค่อยๆ โผล่และหายไป */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.hc-marquee-track {
    display: flex;
    align-items: center;
    gap: 60px; /* ระยะห่างระหว่างโลโก้ */
    width: max-content;
    /* สั่งให้เลื่อนตลอดเวลา 25 วินาทีต่อ 1 รอบ แบบเส้นตรง */
    animation: scrollMarquee 25s linear infinite;
}

/* หยุดเลื่อนเมื่อลูกค้าเอาเมาส์ชี้โลโก้ */
.hc-marquee-wrapper:hover .hc-marquee-track {
    animation-play-state: paused;
}

.hc-partner-logo {
    flex-shrink: 0;
    width: 160px; /* ขนาดกล่องโลโก้ */
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hc-partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* ทำให้โลโก้เป็นสีเทาๆ กลืนกับพื้นหลัง ดูโปร่งๆ ไม่แย่งซีน */
    filter: grayscale(100%) opacity(0.5);
    transition: all 0.3s ease;
}

/* พอเอาเมาส์ชี้ โลโก้จะกลับมามีสี ขยายร่างนิดๆ */
.hc-partner-logo:hover img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* คำนวณเลื่อนเฟรมไปครึ่งนึง (เพราะเราก๊อปรูปลูปไว้ 2 ชุด) */
@keyframes scrollMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 30px)); } /* 30px คือ ครึ่งนึงของ gap: 60px */
}

/* Responsive สำหรับมือถือ */
@media (max-width: 767px) {
    .hc-partner-logo { width: 120px; height: 60px; }
    .hc-marquee-track { gap: 30px; animation-duration: 15s; } /* มือถือเลื่อนไวขึ้นนิดนึง */
    @keyframes scrollMarquee {
        from { transform: translateX(0); }
        to { transform: translateX(calc(-50% - 15px)); }
    }
}