.query-title-wrapper {
    text-align: center;
    padding-top: 80px;
    padding-bottom: 50px
}

.query-title-wrapper h2 {
    margin-bottom: 0!important
}

.query-title-wrapper .white-text {
    color: #fff
}

@media (max-width: 767px) {
    .query-title-wrapper {
        text-align:center;
        padding-top: 80px;
        padding-bottom: 60px
    }
}

@media (min-width: 1450px) {
    .custom-column-baner {
        max-width:400px
    }

    body .is-layout-flex {
        justify-content: center
    }

    .custom-flex-group {
        justify-content: start!important
    }
}

@media (min-width: 501px) and (max-width:1000px) {
    .featured-image-responsive {
        margin:0 auto!important;
        padding: 20px 40px 0 40px;
        text-align: center;
        display: block;
        max-width: 50%!important
    }

    .my-section-class {
        padding-left: 50px;
        padding-right: 50px
    }
}

.movie-grid {
    padding-right: 20px;
    padding-left: 20px
}

@media (max-width: 767px) {
    .movie-grid {
        padding-right:0;
        padding-left: 0
    }

    .my-custom-columns .movie-card {
        height: 330px!important
    }

    .my-custom-columns .movie-card-image-wrapper {
        height: 270px!important
    }
}

.movie-card-link {
    text-decoration: none;
    color: inherit
}

.wp-block-post {
    margin-bottom: 0!important
}

.movie-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    transition: box-shadow .3s ease , transform .3s ease;
    cursor: pointer;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    height: 360px
}

.movie-card:hover {
    box-shadow: 0 16px 40px rgba(0,0,0,.25);
    transform: translateY(-8px)
}

.movie-card-image-wrapper {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    height: 290px
}

.movie-card-image {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px 12px 0 0;
    transition: transform .3s ease
}

.movie-card:hover .movie-card-image {
    transform: scale(1.05)
}

.my-custom-columns .movie-card {
    height: 420px
}

.my-custom-columns .movie-card-image-wrapper {
    height: 360px
}

.movie-meta-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5
}

.watch-link-badge,.director-badge,.year-badge {
    color: #000;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    position: absolute;
    z-index: 1
}

.watch-link-badge {
    top: 5px;
    left: 10px
}

.director-badge {
    top: 5px;
    right: 10px
}

.imdb-score-wrapper {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px
}

.imdb-score-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 4
}

.imdb-score-fg {
    fill: none;
    stroke-width: 4;
    transition: stroke-dashoffset .35s ease
}

.imdb-score-number-bg {
    fill: #fff;
    stroke: none
}

.imdb-score-text {
    fill: #000;
    font-size: 12px;
    font-weight: bold;
    font-family: Arial,sans-serif
}

.movie-card-title {
    margin: 8px 10px 12px;
    font-size: 14px;
    font-weight: 100;
    color: #000;
    text-align: center;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden
}

@media screen and (max-width: 768px) {
    .watch-link-badge {
        font-size:9px
    }

    .director-badge {
        font-size: 9px
    }

    .year-badge {
        font-size: 9px
    }

    .movie-card-title {
        font-size: 13px
    }

    .movie-card {
        margin-bottom: 20px;
        height: 320px
    }

    .owl-carousel .watch-link-badge {
        font-size: 7px;
        top: 33px;
        left: 1px
    }

    .owl-carousel .director-badge {
        font-size: 7px;
        top: 33px;
        right: 1px
    }

    .owl-carousel .imdb-score-wrapper {
        font-size: 7px;
        bottom: 3px;
        right: 1px
    }

    .owl-carousel .movie-card {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 8px 20px rgba(0,0,0,.12);
        transition: box-shadow .3s ease , transform .3s ease;
        cursor: pointer;
        margin-bottom: 10px;
        display: flex;
        flex-direction: column;
        height: 280px
    }

    .movie-card-image-wrapper {
        width: 100%;
        height: auto;
        position: relative;
        background: #000
    }

    .owl-carousel .movie-card-image {
        width: 100%;
        height: 190px;
        object-fit: cover;
        display: block;
        border-radius: 12px 12px 0 0;
        transition: transform .3s ease;
        margin-top: 20px
    }

    .owl-carousel .movie-card-title {
        font-size: 10px;
        text-align: center;
        line-height: 1.2em;
        flex-shrink: 0
    }

    .owl-carousel .owl-item img {
        display: block;
        width: 100%;
        padding-top: 0
    }

    .movie-card:hover {
        box-shadow: 0 16px 40px rgba(0,0,0,.25);
        transform: translateY(0)
    }
}

.featured-image-responsive {
    margin: 0 auto!important;
    padding: 20px 40px 40px 40px;
    text-align: center;
    display: block;
    max-width: 100%
}

@media (max-width: 767px) {
    .my-section-class {
        padding-right:20px;
        padding-left: 20px
    }

    .featured-image-responsive {
        margin: 0 auto!important;
        padding: 20px 40px 0 40px;
        text-align: center;
        display: block;
        max-width: 100%
    }

    .featured-image-responsive img {
        max-width: 100%;
        height: auto
    }
}

@media (max-width: 1024px) {
    .movie-grid {
        grid-template-columns:repeat(3,1fr)!important
    }
}

@media (max-width: 768px) {
    .movie-card {
        margin-top:-30px!important
    }

    .hero-section {
        margin-left: -20px!important;
        margin-right: -20px!important
    }

    .movie-grid {
        grid-template-columns: repeat(2,1fr)!important
    }

    .my-custom-columns {
        margin-left: 5px!important;
        margin-right: 5px!important
    }
}

.wp-site-blocks main {
    padding-bottom: 0!important;
    padding-top: 0!important;
    
}

.header {
    padding-left: 30px;
    padding-right: 30px;
    background: rgba(0,0,0,.3);
    box-shadow: 0 4px 6px rgba(0,0,0,.1)
}

.category-list a {
    display: inline-flex;
    text-decoration: none;
    font-weight: 600
}

.category-list a:hover {
    color: #ee055b
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns:repeat(2,1fr);
        padding-right: 0;
        padding-bottom: 10px
    }
}

.custom-related-wrapper {
    padding: 1px!important
}

.my-shortcode-wrapper {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;

}

.related-posts-flex {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* มือถือเริ่มต้น 2 คอลัมน์ */
  gap: 20px; /* เว้นระยะระหว่างการ์ดเท่ากัน */
  justify-content: center; /* บังคับให้อยู่ตรงกลาง */
}

.related-post-card {
  display: flex;
  flex-direction: column;
  height: 100%; /* ให้สูงเท่ากัน */
}

.image-wrapper img {
  width: 100%;
  height: auto; /* ปรับให้เต็มความกว้าง */
  display: block;
  object-fit: cover; /* กันภาพเบี้ยว */
}

/* PC ≥ 1024px → 4 คอลัมน์ */
@media (min-width: 1230px) {
  .related-posts-flex {
    grid-template-columns: repeat(4, 1fr);
  }
}

.movie-shortcode-group {
    margin: 20px auto;
    max-width: 1400px;
    height: auto
}

@media (max-width: 768px) {
    .movie-shortcode-group {
        margin:5px 10px
    }
}

.wp-block-post-content a {
    color: #b38f00;
    text-decoration: none
}

body .is-layout-flex {
    column-gap: 1rem;
    row-gap: 0
}

.button-shortcode-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap
}

.button-shortcode-row .wp-block-buttons {
    margin: 0
}

.button-shortcode-row .wp-block-button__link {
    font-size: 16px
}



#recent-post {
    color: #fff
}

.custom-catego {
    max-width: 1400px;
    margin: 0 auto;
    height: auto
}

.pagination-button .dots, .pagination-button span.ellipsis, .pagination-button span:not(.current):not(a) {
    color: #fff;
    background: transparent;
    padding: 1px 10px;
    display: inline-block;
    font-weight: bold
}

.pagination-button a,.pagination-button .current {
    margin-bottom: 15px;
    background-color: #ffd700;
    color: #000;
    padding: 1px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: background-color .3s ease , outline .3s ease
}

.pagination-button a:hover {
    background-color: #ffc107!important
}

.pagination-button a:focus {
    background-color: #ffa500!important;
    color: #fff;
    outline: none
}

.pagination-button .current {
    background-color: #de6f00!important;
    color: #fff
}

.pagination-button.prev {
    margin-bottom: 15px;
    color: #000;
    margin-right: 10px;
    background: #ffc107!important;
    padding: 5px 10px;
    border-radius: 5px
}

.pagination-button.next {
    margin-bottom: 15px;
    color: #000;
    margin-left: 10px;
    background: #ffc107!important;
    padding: 5px 10px;
    border-radius: 5px
}

.my-custom-search {
    background: #000
}

.quality-hd {
    color: green;
    font-weight: bold
}

.quality-zoom {
    color: red;
    font-weight: bold
}

.quality-clear {
    color: #1e90ff;
    font-weight: bold
}

.custom-blog {
    margin-bottom: 20px;
    padding-top: 150px;
    background: linear-gradient(145deg,#2c2c2c,#1a1a1a);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,.6) , inset 0 1px 0 rgba(255,255,255,.1);
    transition: all .3s ease-in-out;
    min-height: 900px;
    max-height: 400px;
    overflow: hidden
}

.full-width-column {
    padding-left: 10px;
    padding-right: 50px
}

@media (max-width: 767px) {
    .custom-blog {
        min-height:auto;
        max-height: none;
        overflow: visible;
        padding-top: 50px;
        margin-left: 0;
        margin-right: 0
    }

    .full-width-column {
        padding-left: 10px;
        padding-right: 10px
    }
}


/* CSS Player*/

.video-wrapper,
.video-wrapper * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.video-wrapper:fullscreen,
.video-wrapper:-webkit-full-screen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.video-wrapper video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}




video {
    width: 100%;
    height: 100%;
    display: block;
    background: black;
}

    .video-wrapper {
        position: relative;
        width: 100%;
        max-width: 100%;
        background: black;
        user-select: none;

    }

    .video-wrapper video {
        width: 100%;
        height: auto;
        background: black;
        display: block;
          cursor: pointer;
    }

  /* ปุ่มเล่นกลางจอ */
.custom-column-video {
  max-width: 1000px;
  margin: 0 auto !important;           /* จัดกึ่งกลาง */
  padding: 10px 10px 0px 10px;         /* padding: บน ขวา ล่าง ซ้าย */
}



.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 15;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    transition: transform 0.2s ease, opacity 0.3s ease;
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.center-play-btn.hide {
    opacity: 0;
    pointer-events: none;
}

.play-icon {
    width: 100%;
    height: 100%;
}
.center-play-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%) scale(1.1);
    }

 .playpause-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playpause-icon {
    width: 100%;
    height: 100%;
}
   

/* controls container */
  .custom-controls {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 55px;
        background: rgba(0,0,0,0.6);
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10 10px;
        color: white;
        font-family: sans-serif;
        user-select: none;
        z-index: 20;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
         cursor: pointer;
    }

    .video-wrapper.show-controls .custom-controls {
        opacity: 0.9;
        pointer-events: auto;
    }

    .custom-button {
        background: transparent;
        border: none;
        color: white;
        font-size: 20px;
        cursor: pointer;
        padding: 4px 8px;
        transition: transform 0.2s ease;
    }
    .custom-button:hover {
        transform: scale(1.2);
    }

    .time-display {
        flex-grow: 1;
        font-size: 14px;
        user-select: none;
    }

    .progress-container {
        position: absolute;
        bottom: 55px;
        left: 0;
        right: 0;
        height: 6px;
        background: rgba(255, 255, 255, 0.3);
        cursor: pointer;
        z-index: 30;
    }

    .progress-filled {
        width: 0%;
        height: 100%;
        background: #ff6600;
        transition: width 0.1s linear;
    }

    .quality-options {
        position: absolute;
        bottom: 35px;
        background: rgba(0,0,0,0.85);
        border-radius: 5px;
        padding: 0px 0px;
        display: none;
        right: 50px;
        min-width: 80px;
        z-index: 30;
        list-style: none;
    }
    .quality-options li {
        color: white;
        padding: 6px 12px;
        cursor: pointer;
        font-size: 14px;
    }
    .quality-options li:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .volume-menu {
        position: absolute;
        bottom: 55px;
        right: 0;
        background: rgba(0,0,0,0.85);
        border-radius: 5px;
        padding: 8px;
        display: none;
        z-index: 30;
        width: 30px;
        height: 100px;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

.volume-slider {
    writing-mode: bt-lr;
    width: 6px;
    height: 80px;
    background: #fff;
    cursor: pointer; /* ใช้มือชี้แบบปกติ */
}

/* เมื่อกดและลากจะใช้มือจับ */
.volume-slider:active {
    cursor: pointer; /* ใช้มือชี้เหมือนเดิมเมื่อกด */
}
    .controls-group {
        display: flex;
        align-items: center;
        gap: 10px;
        
    }

    /* แถบแสดงสถานะคุณภาพในที่เดียวกัน */
    .quality-status-bar {
        position: absolute;
        bottom: 8px;
        left: 100px;
        color: white;
        padding: 5px 15px;
        border-radius: 5px;
        font-size: 14px;
        z-index: 50;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    /* เพิ่มตำแหน่งที่ข้างฟันเฟือง */
    .custom-controls .quality-status-bar {
        left: auto;
        right: 150px;  /* ย้ายไปข้างฟันเฟือง */
    }
        @media(max-width:480px){
        .custom-controls { font-size:14px; height:45px; }
        .custom-button { font-size:18px; padding:2px 6px; }
        .time-display { font-size:12px; }
        .quality-options { min-width: 60px; font-size:12px; }
    .custom-controls .quality-status-bar {
        left: auto;
        right: 130px;
        font-size: 12px;
    }
           .volume-menu {
          bottom: 40px;
    }
        .quality-options {
        right: -30px;
        bottom: 30px;
        min-width: 15px;
        max-height: 120px;         /* จำกัดความสูง */
        overflow-y: auto;          /* เพิ่ม scrollbar */
        font-size: 13px;           /* ย่อขนาดตัวหนังสือ */
    }

    .quality-options li {
        padding: 2px 10px;         /* ย่อ padding ให้พอดีจอ */
    }
        .progress-container {
        position: absolute;
        bottom: 40px;
        left: 0;
        right: 0;
        height: 6px;
        background: rgba(255, 255, 255, 0.3);
        cursor: pointer;
        z-index: 30;
    }
}
       

/*  กราฟโหลดล่วงหน้า*/



.progress-buffered {
    position: absolute;
    height: 100%;
    background-color: #888888; /* สีของกราฟโหลด */
    width: 0%;
    z-index: 1;
}

.progress-filled {
    position: absolute;
    height: 100%;
    background-color: #cd0000; /* สีของเวลาที่เล่นไปแล้ว */
    width: 0%;
    z-index: 2;
}


.tooltip-time {
    position: absolute;
    bottom: 10px; /* เพิ่มระยะห่างจากด้านล่าง */
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 6px;
    border-radius: 4px;
    font-size: 12px;
    display: none;
    z-index: 40;
    transform: translateX(-50%);
    pointer-events: none;
       white-space: nowrap;
}

.progress-current-marker {
  position: absolute;
  top: 50%; /* จากเดิม 0% ขยับลงกลางความสูง */
  width: 12px;
  height: 12px;
  background-color: red;
  border-radius: 50%;
  transform: translate(-50%, -50%); /* ยังคงเลื่อนจุดให้อยู่กึ่งกลาง */
  pointer-events: none;
  z-index: 10;
}






/* พื้นหลัง Popup */
.movie-modal {
  position: fixed!important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  max-width: 100% !important;
  height: 100%;
  margin: 0 !important;
  
  display: none; /* ซ่อนก่อน */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  
  /* คลุมพื้นหลัง */
  background: rgba(0,0,0,0.7);       /* ดำโปร่ง */
  backdrop-filter: blur(8px);        /* เบลอ */
  -webkit-backdrop-filter: blur(8px); /* Safari */
}

.movie-modal-box {
  background: #111;       /* กล่องเนื้อหา */
  padding: 20px;
  border-radius: 12px;
  max-width: 1000px;
  width: 100%;
  margin: auto;
  position: relative;
  color: #fff;
}

.movie-modal-close-wrap {
  position: absolute;
  top: 10px;
  right: 10px;
}

.movie-modal-close .wp-block-button__link {
  background: #e50914;
  color: #fff;
  border-radius: 6px;
  padding: 6px 16px;
}

.movie-modal-close .wp-block-button__link:hover {
  background: #b20710;
}

@media screen and (min-width: 644px) and (max-width: 1024px) and (orientation: landscape) {

    .custom-iframe iframe {
        width: 100%;
        height: 250px;  /* ให้ iframe กินเต็ม div */
    }
.movie-modal {
  position: fixed!important;
  top: 10% !important; /* เลื่อนลง 20% ของหน้าจอ */

}
}