/*
Theme Name: Thomas2025
Theme URI: https://thomasthailand.co/
Author: RyuuU
Author URI: https://thomasthailand.co/
Description: Thomas2025
Version: 1.0.1
License: GNU General Public License v2 or later
Text Domain: mytheme
*/

/* ---------- RESET พื้นฐาน ---------- */


@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Mitr', sans-serif;
    background: #ffffff;
    color: #111111;
}

/* container กลางหน้า */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0px;
}

/* ====================================
   HEADER แบบ 2 โหมด (บนสุดของเว็บ)
==================================== */

.site-header {
    position: fixed;   /* เปลี่ยนจาก sticky เป็น fixed */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #000;
	height:75px;
}

/* โครงใน header */
.header-inner {
    display: flex;
    justify-content: center; /* จัดแนวนอน */
    align-items: center;     /* จัดแนวตั้ง */
    padding: 12px 0;
    max-width: 1200px;
    margin: 0 auto;
    height: 100%; /* ถ้าจัดแนวตั้งไม่ขยับ ให้ตั้งความสูง */
}


/* โลโก้ */
.header-logo img {
  width: auto;
  height: 25px; /* ปรับได้ตามต้องการ */
  object-fit: contain;
  display: block;
}


/* เมนู & search: ซ่อนตอนอยู่บนสุด */
.header-nav,
.header-search {
    display: none;
}

/* เมนู */
.header-menu {
    list-style: none;
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0;

	margin-right: 80px;
}

.header-menu a {
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.15em;
}

.header-menu a:hover {
    text-decoration: underline;
}

/* ช่องค้นหา */
.header-search .search-form {
    position: relative;
}

.header-search .search-field {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 6px 32px 6px 10px;
    min-width: 220px;
}

.header-search .search-field::placeholder {
    color: #ccc;
}

.header-search .search-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

/* โหมดตอนเลื่อนลง (body มีคลาส is-scrolled) — ใช้เฉพาะจอใหญ่ */
@media (min-width: 961px) {
    body.is-scrolled .header-inner {
        justify-content: space-between; /* ซ้าย โลโก้ | กลาง เมนู | ขวา search */
        padding: 10px 40px;
    }

    body.is-scrolled .header-logo {
        font-size: 20px;
        letter-spacing: 0.15em;
    }

    body.is-scrolled .header-nav,
    body.is-scrolled .header-search {
        display: block;
    }
	
}

/* =========================
   HERO SLIDER ด้านบนสุด
========================= */

.hero-slider {
	margin-top:70px;
    width: 100%;
    aspect-ratio: 16 / 9; /* สัดส่วนชัดเจน 16:9 */
    max-height: 800px;
    position: relative;
    margin-bottom: 0px;
    overflow: hidden; /* กันรูปเกินกรอบ */
}

.hero-slide {
    position: relative;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    padding: 40px 20px;
}

.hero-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.25)
    );
}

.hero-slide-overlay {
    position: relative;
    max-width: 1500px;
    text-align: center;
}

.hero-title {
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 600;
    margin-bottom: 12px;
}

.hero-excerpt {
    font-size: clamp(14px, 1.6vw, 18px);
}

/* จุด ๆ pagination ใต้ Hero */
.hero-pagination {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    text-align: center;
}

.hero-pagination .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.hero-pagination .swiper-pagination-bullet-active {
    background: #ffffff;
}


/* =============================
   HAMBURGER MENU (Mobile)
============================ */

.header-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.header-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: 0.3s ease;
}

/* ===== ปรับเฉพาะมือถือ: ให้ Hero สูงขึ้น ===== */
/* Hero Mobile Layout */
@media (max-width: 768px) {

  .hero-slider {
      aspect-ratio: 9 / 16 !important;   /* เปลี่ยนกลับเป็นแนวนอน */
      min-height: 500px !important;      /* ลดสูงลงจาก 420 → 240px */
      margin-top: 75px;                  /* เผื่อชน header */
  }

  .hero-slide {
      padding: 20px 16px;                /* ขยับข้อความภายในให้อยู่ตรงกลาง */
  }

  .hero-slide::before {
      background: linear-gradient(
          to top,
          rgba(0, 0, 0, 0.75),
          rgba(0, 0, 0, 0.1)
      );  /* ทำให้อ่านข้อความได้ง่ายขึ้นบนรูปเล็ก */
  }
}



/* Mobile Layout */
@media (max-width: 960px) {

    .header-inner {
        padding: 10px 16px;
        justify-content: space-between;
    }

    /* แสดงปุ่ม */
    .header-toggle {
        display: block;
        z-index: 999;
    }

    /* ซ่อนเมนู + search ก่อน */
    .header-nav,
    .header-search {
        display: none;
    }

    /* กล่องเมนู */
    .header-nav {
        position: absolute;
        top: 75px;
        left: 0;
        right: 0;
        background: #000;
        padding: 24px 20px;
        border-top: 1px solid #333;
    }

    .header-menu {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    .header-menu a {
        font-size: 16px;
        letter-spacing: 0.1em;
    }

    /* เมื่อเมนูเปิด (คลาสถูกเพิ่มที่ body) */
    body.is-menu-open .header-nav {
        display: block;
    }

    body.is-menu-open .header-search {
        display: block;
        margin-top: 10px;
    }

    /* Hamburger = X */
    body.is-menu-open .header-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    body.is-menu-open .header-toggle span:nth-child(2) {
        opacity: 0;
    }
    body.is-menu-open .header-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}



/* ===============================
   CONTENT DEFAULT (บทความทั่วไป)
=============================== */

article {
    margin-bottom: 32px;
}

article h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

article h2 a {
    color: #111;
    text-decoration: none;
}

article h2 a:hover {
    text-decoration: underline;
}

.entry {
    font-size: 15px;
    line-height: 1.7;
}

/* ===============================
   POPULAR CONTENT (GRID + PAGING)
=============================== */

.popular-section {
    padding: 40px 0 60px;
    background: #ffffff;
}

.popular-heading {
	font-weight:500;
    text-align: center;
    font-size: 40px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 35px;
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
}

/* การ์ดแต่ละใบ */
.popular-card {
    font-size: 14px;
    line-height: 1.6;
}

.popular-thumb img {
    width: 100%;
	height:250px;
    display: block;
}

/* meta: category + date */
.popular-meta {
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.popular-cat {
    color: #0072ff;
    font-weight: 600;
}

.popular-date {
    color: #555;
    margin-left: 8px;
}

/* title */
.popular-title {
    font-size: 25px;
    margin-bottom: 10px;
    line-height: 1.4;
    font-weight: 500;
    color: #000;
 	text-decoration: underline;
	
	

    /* 🔥 บังคับสูงเท่ากับ 2 บรรทัดเสมอ */
    min-height: calc(1.4em * 2); /* 2 บรรทัด */
    
    /* ✂ ตัดข้อความเกิน */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* จำกัด 2 บรรทัด */
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.popular-title a {
    color: #000; /* สีดำที่ต้องการ */
    text-decoration: none; /* เอาเส้นใต้ลิงก์ออก */
}

.popular-title a:hover {
    color: #222; /* สีตอน hover */
    text-decoration: underline; /* หรือจะเปลี่ยนเป็น none ก็ได้ */
}

/* excerpt */
.popular-excerpt {
	font-family: "Sarabun", sans-serif;
  	font-weight: 400;
  	font-style: normal;
    font-size: 16px;
    color: #000;
    line-height: 1.6;

    /* บังคับสูงเท่ากันทุกใบด้วย (3 บรรทัด) */
    min-height: calc(1.6em * 3);
    
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}



/* pagination */
.popular-pagination {
    margin-top: 32px;
    text-align: center;
    font-size: 14px;
}

.popular-pagination .page-link {
    display: inline-block;
    margin: 0 4px;
}

.popular-pagination .page-link a,
.popular-pagination .page-link span {
    padding: 4px 8px;
    text-decoration: none;
    color: #000;
}

.popular-pagination .page-link .current {
    font-weight: 600;
    border-bottom: 1px solid #000;
}


/* ===== เพิ่ม padding ใน mobile ===== */
@media (max-width: 768px) {

  /* ทำ container ให้มี padding ข้างซ้าย-ขวา */
  .popular-section .container {
      padding-left: 16px;
      padding-right: 16px;
  }

  /* ถ้าชิดเกินไปตรงรูป ให้ลดความกว้างลงนิด */
  .popular-thumb img {
      border-radius: 10px;
      width: 100%;
  }

  /* การ์ดแต่ละอันมีระยะห่างด้านล่าง */
  .popular-card {
      padding-bottom: 20px;
  }
}



/* responsive: tablet/mobile */
@media (max-width: 960px) {
    .popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .popular-grid {
        grid-template-columns: 1fr;
    }

    .popular-heading {
        font-size: 20px;
        letter-spacing: 0.12em;
    }
}


/* ====================================
   ADVERTORIAL CONTENT SECTION (ดำ)
==================================== */

.advertorial-section {
    background: #000;
    color: #fff;
    padding: 20px 0;
}

.margin-top{
	margin-top:50px;
}

/* layout 2 คอลัมน์: ซ้ายเนื้อหา, ขวาแบนเนอร์ */
.advertorial-inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

/* หัวข้อใหญ่ด้านบน */
.advertorial-heading {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* ฝั่งซ้าย: list โฆษณา 2 แถว */
.advertorial-main {
    width: 100%;
}

/* การ์ดแต่ละแถว (รูปซ้าย, ข้อความขวา) */
.ad-item {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

/* รูปซ้าย */
.ad-thumb img {
    width: 290px;
    height: auto;
    object-fit: cover;
    display: block;
}

/* ข้อความขวา */
.ad-body {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
}

.ad-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.ad-excerpt {
    font-size: 13px;
    color: #ddd;
	font-family: "Sarabun", sans-serif;
  	font-weight: 400;
  	font-style: normal;
}

/* เส้นคั่นระหว่างแถว */
.ad-divider {
    border: 0;
    border-top: 1px solid #444;
    margin: 16px 0 24px;
}

/* ฝั่งขวา: แบนเนอร์ */
.advertorial-banner .banner-link img {
	margin-top:53px;
    width: 80%;
	height: 354px;
    display: block;
    border-radius: 4px;
}

/* ---------- Responsive ---------- */
/* === MOBILE LAYOUT สำหรับ ADVERTORIAL === */
@media (max-width: 768px) {

  /* ให้ทั้งกล่องเรียงเป็นคอลัมน์ลงมา */
  .advertorial-inner {
      display: flex;
      flex-direction: column;
      gap: 24px;
  }

  /* 1) รูปโฆษณา (banner) ขึ้นก่อน */
  .advertorial-banner {
      order: 1;          /* ขึ้นเป็นบล็อกแรก */
      width: 100%;
  }

  .advertorial-banner .banner-link img {
      width: 100%;
      height: auto;
      margin-top: 0;     /* เอา margin-top เดิมออก */
      border-radius: 16px;
      display: block;
      object-fit: cover;
  }

  /* 2) กล่อง content ทั้งสองอันตามมา */
  .advertorial-main {
      order: 2;          /* ตามหลัง banner */
      width: 100%;
      margin-top: 0;     /* ยกเลิก .margin-top สูงเกินไปบนมือถือ */
  }

  /* ให้ content 1 และ 2 เรียงลงมา */
  .ad-item {
      display: flex;
      flex-direction: column;  /* รูปบน ข้อความล่าง */
      gap: 10px;
      margin-bottom: 24px;
  }

  .ad-thumb img {
      width: 100%;
      height: auto;
      border-radius: 12px;
      object-fit: cover;
      display: block;
  }

  .ad-title {
      font-size: 18px;
      line-height: 1.35;
  }

  .ad-excerpt {
      font-size: 14px;
  }

  /* container มีขอบซ้ายขวาพอดีเหมือน popular */
  .advertorial-section .container {
      padding: 0 16px;
  }

  /* ไม่ต้องใช้เส้นคั่นใน mobile ถ้าอยากเอาออก */
  .ad-divider {
      display: none;
  }
}




/* ======================================
   CONTENT / LATEST SECTION — New Style
====================================== */

.video-section {
    background: #000;
    color: #fff;
    padding: 80px 0;
}

.video-inner {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 48px;
    align-items: flex-start;
}

/* ---------- Heading ---------- */
.video-heading,
.video-sidebar-heading {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 36px;
}

/* =======================================
   LEFT: MAIN ARTICLE (BIG POST)
======================================= */

.video-main-post {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.video-main-thumb img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.video-main-thumb:hover img {
    opacity: 0.9;
}

.video-main-date {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #aaa;
}

.video-main-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
}

.video-main-title a {
    color: #fff;
    text-decoration: none;
}

.video-main-title a:hover {
    text-decoration: underline;
}

/* จำกัดข้อความใน CONTENT (ฝั่งซ้าย) ให้เหลือ 3 บรรทัด */
.video-main-excerpt {
    font-family: "Sarabun", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #ddd;

    /* 🔥 บังคับแค่ 3 บรรทัด */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;  
    text-overflow: ellipsis;
}


/* =======================================
   RIGHT: LATEST LIST (3 POSTS)
======================================= */

.video-sidebar {
	margin-top: 85px;
    border-left: 2px solid #333;
    padding-left: 32px;
}

.video-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    margin-bottom: 32px;
    align-items: start;
}

.video-thumb img {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.video-thumb:hover img {
    opacity: 0.85;
}

.video-item-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 6px;
}

.video-item-title a {
    color: #fff;
    text-decoration: none;
}

.video-item-title a:hover {
    text-decoration: underline;
}

.video-item-date {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ========== Responsive ========== */

@media (max-width: 960px) {
    .video-inner {
        grid-template-columns: 1fr;
    }

    .video-sidebar {
        border-left: none;
        padding-left: 0;
    }

    .video-sidebar-heading {
        text-align: center;
    }
}

@media (max-width: 720px) {
    .video-item {
        grid-template-columns: 1fr;
    }

    .video-thumb img {
        height: auto;
    }
}

/* 📱 ปรับเลย์เอาต์ CONTENT / LATEST บนมือถือ ให้เนี๊ยบขึ้น */
@media (max-width: 768px) {

  /* ให้ section นี้ไม่สูงเกินไป และมีขอบซ้ายขวา */
  .video-section {
      padding: 32px 0 40px;        /* จาก 80px 0 → เตี้ยลง */
  }

  .video-section .container {
      padding: 0 16px;             /* เหมือน popular / advertorial */
  }

  /* ภายในบล็อกซ้าย–ขวาห่างกันพอดี */
  .video-inner {
      gap: 24px;
  }

  /* รูปหลักขนาดเท่ากัน */
  .video-main-thumb img {
      width: 100%;
      height: 220px;               /* ปรับได้ 210–240 ตามที่เต้ชอบ */
      object-fit: cover;
      border-radius: 12px;
  }

  /* วันที่ */
  .video-main-date {
      margin-top: 8px;
      margin-bottom: 4px;
      font-size: 11px;
      letter-spacing: 0.12em;
  }

  /* หัวข้อ: ไม่ใหญ่เกิน + จำกัด 2 บรรทัด */
  .video-main-title {
      font-size: 20px;
      line-height: 1.3;
      margin-bottom: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
  }

  /* เนื้อหาย่อ: 3 บรรทัดพอดี ไม่ยาวกินพื้นที่ */
  .video-main-excerpt {
      font-size: 15px;
      line-height: 1.6;
      color: #ddd;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 0;
  }

  /* ระยะห่างในบล็อกหลัก */
  .video-main-post {
      gap: 10px;
      margin-bottom: 0;
  }

  /* LATEST: ไม่ให้ห่างจาก CONTENT เกินไป */
  .video-sidebar {
      margin-top: 20px;        /* จาก 85px → 20px */
      border-left: none;       /* มือถือไม่ต้องมีเส้นซ้าย */
      padding-left: 0;
      padding-top: 16px;
      border-top: 1px solid #333;  /* แทนเส้นคั่นด้านบนเล็กน้อย */
  }

  .video-sidebar-heading {
      font-size: 22px;
      margin-bottom: 20px;
      letter-spacing: 0.16em;
      text-align: center;
  }
}



/* ======================
   FOOTER ด้านล่างสุด
====================== */

.site-footer {
    background: #ffffff;
    padding: 20px 0;
    font-size: 14px;
    color: #777;
    border-top: 1px solid #e5e5e5;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ไอคอนโซเชียล */
.footer-social a {
    margin-right: 16px;
    font-size: 22px;
    color: #777;
    transition: 0.2s;
}

.footer-social a:hover {
    color: #000;
}

.footer-copy {
    color: #777;
}

/* responsive footer */
@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
