/* =========================
   1) ลิงก์ทั่วไปในเนื้อหา
========================= */
.entry-content a,
.nv-content-wrap a {
  color: #0073e6;
  text-decoration: none;
}

.entry-content a:hover,
.nv-content-wrap a:hover {
  color: #005bb5;
  text-decoration: underline;
}


/* =========================
   2) เมนู Header
========================= */
header .menu a,
header a {
  color: inherit;
  text-decoration: none !important;
}

header .menu a:hover,
header a:hover {
  color: #0ec963 !important;
  text-decoration: none !important;
}


/* =========================
   3) เมนู Footer
========================= */
footer a {
  color: inherit;
  text-decoration: none !important;
}

footer a:hover {
  color: #0ec963 !important;
  text-decoration: none !important;
}


/* =========================
   GRID
========================= */

.tt-grid{
  display:grid;
  grid-template-columns:repeat(3,2fr);
  gap:8px;
}

.tt-card{
  position:relative;
  aspect-ratio:9/16;
  overflow:hidden;
  border-radius:12px;
  cursor:pointer;
}

.tt-card img{
  width:100%;
  height:100%;
  object-fit:cover;
}


/* =========================
   OVERLAY
========================= */

.tt-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.2);
}

.tt-play{
  width:50px;
  height:50px;
  background:#fff;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
}


/* =========================
   POPUP
========================= */

#tt-popup{
  position:fixed;
  inset:0;
  display:none;
  z-index:99999;
}

.tt-popup-bg{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.9);
}


/* =========================
   FEED (TikTok style)
========================= */

.tt-feed{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  width:min(92vw,380px);
  height:90vh;
  overflow-y:scroll;
  scroll-snap-type:y mandatory;
  border-radius:18px;
  background:#000;
}


/* =========================
   VIDEO
========================= */

.tt-video{
  width:100%;
  height:90vh;
  scroll-snap-align:start;
}

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


/* =========================
   ซ่อนคลิปตั้งแต่ตัวที่ 7 เป็นต้นไป
========================= */

.tt-grid.show-less .tt-card:nth-child(n+7){
  display:none;
}


/* =========================
   ปุ่ม Load More
========================= */

.tt-loadmore-wrap{
  text-align:center;
  margin-top:20px;
}

#tt-loadmore-btn{
  background:#0ec963;
  color:#fff;
  border:none;
  padding:12px 28px;
  border-radius:999px;
  cursor:pointer;
  font-size:16px;
  font-weight:600;
}

#tt-loadmore-btn:hover{
  opacity:.9;
}


/* =========================
   POST GRID
   2 COLUMNS ON MOBILE
========================= */

@media (max-width: 767px){

    /* ตัว Grid หลัก */
    .vc_basic_grid{
        width:100% !important;
        margin:0 !important;
        padding:0 !important;
    }

    .vc_basic_grid .vc_grid-container{
        width:100% !important;
        margin:0 auto !important;
        padding:0 !important;
    }

    /* สำคัญ:
       บังคับ wrapper ของ WPBakery
       ให้รายการเรียงซ้าย-ขวา */
    .vc_basic_grid .vc_grid.vc_row .vc_pageable-slide-wrapper{
        display:flex !important;
        display:-webkit-flex !important;
        flex-direction:row !important;
        -webkit-flex-direction:row !important;
        flex-wrap:wrap !important;
        -webkit-flex-wrap:wrap !important;
        justify-content:center !important;
        -webkit-justify-content:center !important;
        align-items:flex-start !important;
        width:100% !important;
        margin:0 !important;
        padding:0 !important;
    }

    /* Blog แต่ละรายการ */
    .vc_basic_grid .vc_grid.vc_row .vc_grid-item,
    .vc_basic_grid .vc_grid.vc_row .vc_grid-item.vc_visible-item{
        display:inline-block !important;
        width:50% !important;
        max-width:50% !important;
        min-width:50% !important;
        flex:0 0 50% !important;
        -webkit-flex:0 0 50% !important;
        float:none !important;
        clear:none !important;
        margin:0 !important;
        padding:2px !important;
        box-sizing:border-box !important;
    }

    /* ป้องกัน element ด้านในดันความกว้าง */
    .vc_basic_grid .vc_grid-item .vc_grid-item-mini{
        width:100% !important;
        max-width:100% !important;
        box-sizing:border-box !important;
    }

    .vc_basic_grid .vc_grid-item .vc_gitem-zone{
        width:100% !important;
        max-width:100% !important;
        box-sizing:border-box !important;
    }

}


/* =========================
   SINGLE POST
   Mobile
========================= */

@media (max-width: 767px){

    .single-post .entry-header{
        margin-bottom:10px !important;
        padding-bottom:0 !important;
    }

}