/* style.css */

/* ฟอนต์โลคัล */
@font-face {
  font-family: 'Marcellus';
  src: url('Fonts/Marcellus-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Arimo';
  src: url('Fonts/Arimo-VariableFont_wght.ttf') format('truetype');
}

.mitr-light { font-family: "Mitr", sans-serif !important; font-weight: 300; font-style: normal; }
.mitr-regular { font-family: "Mitr", sans-serif !important; font-weight: 400; font-style: normal; }

:root { 
  --vh-hero: 100vh;
  --brand: #6f7b5a; /* โทนเขียวเดียวกับโลโก้ */
}

html, body{
  margin:0; padding:0;
  font-family: 'Marcellus','Arimo', 'Mitr', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:#fff; color:#111;
}

/* ===== HERO (วิดีโอพื้นหลัง) ===== */
.video-section{ position:relative; width:100%; height:var(--vh-hero); overflow:hidden; }
.video-section video{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; pointer-events:none; }
.overlay{ position:absolute; inset:0; color:#fff; z-index:2;  }

.logo{ text-align:center; padding-top:2rem; z-index: 9; }
.logo img{ max-width:120px; height:auto; pointer-events:auto; position:relative; z-index:10;}

.big-heading{
  position:absolute; top:40%; left:2rem; transform:translateY(-40%);
  font-family:'Marcellus', 'Mitr',serif; font-size:6vw; font-weight:normal; line-height:1;
  text-shadow:0 2px 10px rgba(0,0,0,.35);
}
.description{ margin-top:30px; font-size: 1.2rem; max-width:600px; text-shadow:0 2px 8px rgba(0,0,0,.45); line-height: 1.2;}

/* ===== NAV (ลอยมุมขวา – โปร่งสนิท) ===== */
.navbar.hero-nav{
  position:absolute;
  top:20px;
  right:20px;
  left:auto;
  z-index:1050;
  padding:0;
  background:transparent !important;
  box-shadow:none !important;
  border:0 !important;
  pointer-events:auto;
}

/* ล้างพื้นหลังทุกชั้นของเมนูให้โปร่งจริง ๆ */
.navbar.hero-nav,
.navbar.hero-nav *{
  background:transparent !important;
  box-shadow:none !important;
  border:0 !important;
}

/* ลิงก์เมนู: ฟอนต์เดียวกับหัวเรื่อง + สีโลโก้ */
.navbar.hero-nav .nav-link{
  font-family:'Marcellus', 'Mitr', serif;
  color:var(--brand) !important;
  font-size:1.05rem;
  letter-spacing:.02em;
  text-transform:none;
  opacity:1;
  padding:.25rem .75rem;
  transition:opacity .2s ease;
}
.navbar.hero-nav .nav-link:hover,
.navbar.hero-nav .nav-link:focus{ opacity:.75; }

/* เผื่อมีคลาส menu-accent จากไฟล์เดิมให้เป็นสีแบรนด์ด้วย */
.menu-accent{ color:var(--brand) !important; }

/* ===== BURGER ICON (ใหม่ทั้งหมด - 3 ขีด) ===== */
.navbar.hero-nav .navbar-toggler {
  border: 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
  position: relative;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar.hero-nav .navbar-toggler:hover {
  background: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18) !important;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.navbar.hero-nav .navbar-toggler:focus {
  outline: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

/* รองรับทั้ง .burger-icon และ .burger-line */
.navbar.hero-nav .burger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1070;
}

.navbar.hero-nav .burger-icon span,
.navbar.hero-nav .burger-line {
  display: block;
  width: 28px;
  height: 3px;
  background: #2b2119 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
}

/* เมื่อเปิดเมนู - แปลงเป็น X */
.navbar-toggler[aria-expanded="true"] .burger-icon span:nth-child(1),
.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .burger-icon span:nth-child(2),
.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.navbar-toggler[aria-expanded="true"] .burger-icon span:nth-child(3),
.navbar-toggler[aria-expanded="true"] .burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Container collapse ของเมนูให้โปร่ง */
#heroMenu { 
  background:transparent !important;
}

#heroMenu .navbar-nav { 
  background:transparent !important; 
}

/* ===== Desktop (จอใหญ่): แสดงเมนูปกติ ===== */
@media (min-width: 992px) {
  /* ซ่อน burger บนจอใหญ่ */
  .navbar.hero-nav .navbar-toggler {
    display: none !important;
  }
  
  /* แสดงเมนูเสมอ */
  #heroMenu {
    display: flex !important;
    position: static;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  #heroMenu .navbar-nav {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
  }
  
  #heroMenu .nav-link {
    font-size: 1.05rem;
    padding: 0.25rem 0.75rem;
  }
}

/* ===== Mobile (จอเล็ก): ซ่อนเมนู แสดง burger ===== */
@media (max-width: 991.98px) {
  .navbar.hero-nav{ right:8px; }
  
  /* ซ่อนเมนูจนกว่าจะคลิก burger */
  #heroMenu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 80px 2rem 2rem;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  #heroMenu.show {
    opacity: 1;
    visibility: visible;
    display: block;
  }

  #heroMenu .navbar-nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
  }

  #heroMenu .nav-link {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
  }
}

/* ===== CONTENT SECTION ===== */
.content-section{ background:#f6f1e8; padding:5rem 2rem; color:#2b2119; }
.content-section h2{ font-family:'Marcellus', 'Mitr',serif; font-size:2.8rem; line-height:1.2; margin-bottom:1.5rem; }
.content-section p{ font-size:1rem; margin-bottom:1rem; color:#3b3028; }
.cta-link{ font-weight:700; text-decoration:none; border-bottom:1px solid currentColor; color:#2b2119; }

/* ===== COUNTERS ===== */
.counter-row{ border-top:1px solid rgba(0,0,0,.08); margin-top:1.5rem; }
.counter-item{ text-align:left; }
.counter-value{
  font-family:'Marcellus', 'Mitr',serif;
  font-size:3.4rem; line-height:1; color:#48553c;
}
.counter-label{
  font-family:'Marcellus', 'Mitr',serif;
  font-size:1.8rem; color:#48553c; margin-top:.25rem;
}
.counter-sub{ color:#6b7368; margin-top:.25rem; }

/* ===== GALLERY ===== */
.gallery-section{ padding:4rem 1rem; }
.gallery-title{ font-family:'Marcellus', 'Mitr',serif; font-size:2rem; margin-bottom:1.5rem; }
.gallery-grid .card{ border:0; overflow:hidden; background:transparent; transition:transform .2s ease, box-shadow .2s ease; }
.gallery-grid .card img{ width:100%; height:220px; object-fit:cover; display:block; transition:transform .3s ease; }
.gallery-grid .card:hover img{ transform:scale(1.05); }
.gallery-grid .card:hover{ transform:translateY(-2px); box-shadow:0 10px 24px rgba(0,0,0,.12); }

/* ===== Floating Play Button ===== */
.fab-play{
  position:fixed; bottom:2rem; right:2rem; width:60px; height:60px; border-radius:50%;
  background-color:#2b1a15; display:flex; align-items:center; justify-content:center;
  box-shadow:0 4px 12px rgba(0,0,0,.3); border:none; cursor:pointer; z-index:1056;
  transition:transform .2s ease, background .3s;
}
.fab-play:hover{ transform:scale(1.1); background-color:#8b3f2f; }
.fab-play i{ font-size:2.2rem; color:#fff; line-height:1; }

/* ===== Modal Zoom ===== */
.modal.modal-zoom .modal-dialog{ transform:scale(.88); transition:transform .66s ease, opacity .66s ease; }
.modal.modal-zoom.show .modal-dialog{ transform:scale(1); }
.ratio>iframe{ border:0; }

/* Gallery Modal Image Height Control */
#galleryModal .carousel-inner img { max-height: 90vh; width: auto !important; object-fit: contain; }

/* ===== FOOTER ===== */
.site-footer{ font-family:'Arimo'; background:#fff; color:#0c0f0d; border-top:1px solid #e9ecef; }
.footer-top{ padding:4rem 2rem 2rem; }
.footer-title{
  font-family:'Arimo', 'Mitr',sans-serif; font-weight:800; font-size:clamp(2.8rem, 6vw, 6rem); line-height:1;
  letter-spacing:-.02em; margin:0;
}
.footer-colhead{ font-family:'Arimo'; font-size:.8rem; letter-spacing:.08em; font-weight:700; opacity:.7; margin-bottom:.4rem; }
.footer-link{ color:#0c0f0d; text-decoration:underline; text-underline-offset:2px; }
.footer-link:hover{ opacity:.8; }
.footer-link.strong{ font-weight:800; font-size:1.6rem; display:inline-block; }
.footer-address{ margin-top:.5rem; line-height:1.5; }

.footer-list{ list-style:none; padding-left:0; margin:0; }
.footer-list li{ margin:.15rem 0; }

.footer-bottom{ padding:1rem 2rem 2rem; border-top:1px solid #e9ecef; }
.bottom-nav{ list-style:none; padding:0; margin:0; display:flex; gap:2rem; flex-wrap:wrap; }
.bottom-nav a{ color:#0c0f0d; text-decoration:none; }
.bottom-nav a:hover{ text-decoration:underline; }
.copy{ font-weight:700; }

/* ===== วิดีโอบาเนอร์: ไล่สีบน-ล่าง 80px ===== */
.video-section::before,
.video-section::after{
  content:"";
  position:absolute; left:0; right:0;
  pointer-events:none;
  z-index:1;
}
/* ด้านบน: ขาว → โปร่ง 80px */
.video-section::before{
  top:0; height:120px;
  background:linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.60) 50%, rgba(255,255,255,0) 100%);
}
/* ด้านล่าง: ดำ → โปร่ง 80px */
.video-section::after{
  bottom:0; height:80px;
  background:linear-gradient(0deg, rgba(0,0,0,.65) 0%, rgba(0,0,0,0) 100%);
}

/* ===== Responsive ===== */
@media (max-width:992px){
  .big-heading{ font-size:8vw; }
}

@media (max-width:576px){
  .video-section{ height:70vh; }
  .big-heading{ font-size:9vw; left:1rem; line-height:1.1; }
  .description{ font-size: 1.2rem; left:1rem; max-width:90%;line-height:1.1; }
  .logo img{ max-width:80px; }
  .footer-link.strong{ font-size:1.3rem; }
  .gallery-grid .card img{ height:160px; }
}

/* Offcanvas improvements */
.offcanvas { will-change: transform; }

.agri-hero-banner-sect {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 400px;
  background-image: url('img/bglowindex.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  padding: 60px 20px 60px;
}

.agri-hero-banner-sect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.agri-hero-content-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
}

.agri-hero-main-heading {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
  color: white;
  line-height: 1.2;
  margin-bottom: 30px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.agri-hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  background: #c4e538;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.agri-hero-cta-btn:hover {
  background: #b5d630;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(196, 229, 56, 0.4);
}

.agri-hero-cta-btn::after {
  content: '→';
  font-size: 24px;
  transition: transform 0.3s ease;
}

.agri-hero-cta-btn:hover::after {
  transform: translateX(5px);
}

@media (max-width: 768px) {
  .agri-hero-main-heading {
      font-size: 1.5rem;
      margin-bottom: 20px;
  }

  .agri-hero-cta-btn {
      padding: 10px 24px;
      font-size: 14px;
  }
}

/* เพิ่มท้าย style.css */

/* ===== HERO VIDEO (Original) ===== */
.video-section .hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* ===== HERO IMAGE (เมื่อใช้รูปภาพแทนวิดีโอ) ===== */
.video-section .hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Overlay สำหรับรูปภาพ (ให้อ่านข้อความได้ชัดเจน) */
.video-section .hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

/* ===== HERO GRADIENT (Fallback ถ้าไม่มีรูป/วิดีโอ) ===== */
.video-section .hero-gradient {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6f7b5a 0%, #4a5a3a 100%);
  z-index: 0;
}

.video-section .hero-gradient::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* ===== ปรับ z-index ให้ overlay อยู่เหนือ background ===== */
.video-section .overlay {
  position: absolute;
  inset: 0;
  color: #fff;
  z-index: 3; /* เพิ่มจาก 2 เป็น 3 */
  pointer-events: none;
}

/* ปรับ navigation ให้อยู่เหนือ overlay */
.navbar.hero-nav {
  z-index: 1050; /* เดิมอยู่แล้ว */
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .video-section .hero-image {
    background-position: center center;
  }
  
  .video-section .hero-video {
    object-position: center center;
  }
}

/* ===== Loading State (Optional) ===== */
.video-section.loading {
  background: #2b2119;
}

.video-section.loading::before {
  content: 'Loading...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 1.2rem;
  z-index: 10;
}

.mixed-fontface {
  font-family: "Marcellus", "Mitr", sans-serif;
  font-weight: 300;
  font-style: normal;
}