/**
 * Custom Styles for the Movie Single Page Template (Final & Correct Version)
 */

/* Bố cục cột và hình ảnh */
.movie-sidebar-column {
    flex-basis: 33.33%; /* Điều chỉnh chiều rộng cột trái */
    width: 33.33%;
}
movie-sidebar-column header.entry-header {
    margin-bottom: 0px;
}
.profile-image-container { display: flex; flex-direction: column; gap: 10px; }
.profile-image { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; }
.profile-thumbnails { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.profile-thumbnail { width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; cursor: pointer; transition: transform 0.2s; }
.profile-thumbnail:hover { transform: scale(1.05); }

/* Danh sách thông tin chi tiết */
.movie-title, .profile-dates { margin: 0; }
.profile-dates { font-size: 1em; color: var(--newspack-theme-color-secondary-text, #555); margin-bottom: 20px; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-item { display: flex; margin-bottom: 10px; }
.info-label { font-weight: 600; flex-shrink: 0; color: var(--newspack-theme-color-secondary-text, #555); }
.info-value { flex: 1; color: var(--newspack-theme-color-primary-text, #333); padding-left: 10px; }

/* Phần giải thưởng */
.awards-list-container { margin-top: 1.5em; }
.award-year-group { margin-bottom: 25px; padding-bottom: 25px; border-bottom: 1px solid var(--newspack-border-color, #eee); }
.award-year-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.award-year { font-size: 1.2em; font-weight: 600; color: var(--newspack-theme-color-primary-text, #333); margin-bottom: 20px; }
.award-item-block { margin-bottom: 20px; }
.award-item-block:last-child { margin-bottom: 0; }
.award-title { font-size: 1.1em; font-weight: 600; margin: 0 0 5px 0; }
.award-category { font-style: italic; }
.award-category, .award-work { color: var(--newspack-theme-color-secondary-text, #555); margin: 0 0 5px 0; }
.award-work { font-size: 0.9em; }
.award-result { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; font-weight: 600; margin-left: 8px; }
.award-won { background-color: #d1e7dd; color: #0f5132; }
.award-nominated { background-color: #fff3cd; color: #664d03; }

/* "Show More" Button */
.profile-bio { position: relative; max-height: 150px; overflow: hidden; margin-bottom: 20px; transition: max-height 0.5s ease; }
.person-name{ color: var(--newspack-theme-color-secondary-text, #555); }
.profile-bio.expanded { max-height: none; }
.profile-bio-gradient { position: absolute; bottom: 0; left: 0; width: 100%; height: 70px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--newspack-background-color, #fff)); pointer-events: none; opacity: 1; transition: opacity 0.3s ease; }
.profile-bio.expanded .profile-bio-gradient { opacity: 0; }
.show-more-btn { display: none; padding: 10px 20px; background-color: var(--newspack-theme-color-primary, #7033ff); color: var(--newspack-theme-color-against-primary, #fff); border: none; border-radius: 50px; cursor: pointer; margin: 20px auto; text-align: center; }
.show-more-btn:hover { background-color: var(--newspack-theme-color-primary-variation, #5c1de4); }

/* Video Modal */
.video-item { cursor: pointer; text-align: center; }
.video-item .wp-block-image figcaption { margin-top: 0.5em; }
.video-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 20px; }
.video-modal-content { position: relative; background-color: #000; border-radius: 8px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4); width: 90%; max-width: 880px; }
.video-modal-close { position: absolute; top: -35px; right: -5px; color: #fff; font-size: 35px; font-weight: bold; cursor: pointer; background: none; border: none; }
.video-modal-iframe-container { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; }
.video-modal-iframe-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.category-title {
    font-size: var(--newspack-theme-font-size-lg);
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--newspack-border-color, #eee);
    color: var(--newspack-theme-color-primary-text, #333);
}

.grid-layout {
    display: grid;
    gap: 20px;
    margin-top: 15px;
}

.grid-3-col { grid-template-columns: repeat(3, 1fr); }
.grid-5-col { grid-template-columns: repeat(5, 1fr); }

.card-item {
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-image { width: 100%; display: block; object-fit: cover; }
.person-image { aspect-ratio: 1/1; }
.article-image { aspect-ratio: 16/9; }

.card-info { padding: 15px; flex-grow: 1; }
.person-info { padding: 10px; text-align: center; flex-grow: 1; }

.person-name, .article-title {
    font-size: 16px; 
    margin: 0 0 5px 0;
    font-weight: 600;
    /*color: var(--newspack-theme-color-primary, #7033ff);*/
}
.article-title {
    line-height: 1.4;
}

.article-time {
    font-size: 14px; 
    color: var(--newspack-theme-color-secondary-text, #555);
}


/* == Các style khác đã có == */

/* Bố cục cột và hình ảnh */
.movie-sidebar-column { flex-basis: 33.33%; }

/* ================================================= */
/* == CSS BỔ SUNG ĐỂ SỬA LỖI BỐ CỤC BÀI VIẾT == */
/* ================================================= */

/* Định nghĩa Bố cục Lưới (Grid) */
.wp-block-newspack-blocks-homepage-posts.is-grid {
    display: grid;
    gap: 24px; /* Khoảng cách giữa các bài viết */
    margin-top: 1.5em;
}

/* Chia lưới thành 3 cột */
.wp-block-newspack-blocks-homepage-posts.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Style cho từng bài viết bên trong lưới */
.wp-block-newspack-blocks-homepage-posts article {
    display: flex;
    flex-direction: column;
}

.wp-block-newspack-blocks-homepage-posts .entry-title {
    font-size: 1.1em; /* Giảm kích thước tiêu đề một chút cho phù hợp */
    line-height: 1.4;
    margin: 0.5em 0 0.25em;
}

.wp-block-newspack-blocks-homepage-posts .entry-title a {
    text-decoration: none;
    color: var(--newspack-theme-color-primary, #7033ff);
}

.wp-block-newspack-blocks-homepage-posts .entry-meta {
    font-size: 0.8em;
    color: var(--newspack-theme-color-secondary-text, #555);
}

.wp-block-newspack-blocks-homepage-posts .post-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
}

/* Responsive cho điện thoại */
@media (max-width: 768px) {
    .wp-block-newspack-blocks-homepage-posts.columns-3 {
        grid-template-columns: repeat(2, 1fr); /* Chuyển thành 2 cột trên tablet */
    }
}

@media (max-width: 576px) {
    .wp-block-newspack-blocks-homepage-posts.columns-3 {
        grid-template-columns: 1fr; /* Chuyển thành 1 cột trên mobile */
    }
}

/* ================================================= */
/* == CSS BỔ SUNG ĐỂ SỬA LỖI BỐ CỤC BÀI VIẾT == */
/* ================================================= */

/* Định nghĩa Bố cục Lưới (Grid) */
.wp-block-newspack-blocks-homepage-posts.is-grid {
    display: grid;
    gap: 24px; /* Khoảng cách giữa các bài viết */
    margin-top: 1.5em;
}

/* Chia lưới thành 3 cột */
.wp-block-newspack-blocks-homepage-posts.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Style cho từng bài viết bên trong lưới */
.wp-block-newspack-blocks-homepage-posts article {
    display: flex;
    flex-direction: column;
}

.wp-block-newspack-blocks-homepage-posts .entry-title {
    font-size: 1.1em; /* Giảm kích thước tiêu đề một chút cho phù hợp */
    line-height: 1.4;
    margin: 0.5em 0 0.25em;
}

.wp-block-newspack-blocks-homepage-posts .entry-title a {
    text-decoration: none;
    color: var(--newspack-theme-color-primary, #7033ff);
}

.wp-block-newspack-blocks-homepage-posts .entry-meta {
    font-size: 0.8em;
    color: var(--newspack-theme-color-secondary-text, #555);
}

.wp-block-newspack-blocks-homepage-posts .post-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
}

/* Responsive cho điện thoại */
@media (max-width: 768px) {
    .wp-block-newspack-blocks-homepage-posts.columns-3 {
        grid-template-columns: repeat(2, 1fr); /* Chuyển thành 2 cột trên tablet */
    }
}

@media (max-width: 576px) {
    .wp-block-newspack-blocks-homepage-posts.columns-3 {
        grid-template-columns: 1fr; /* Chuyển thành 1 cột trên mobile */
    }
}





.wp-block-newspack-blocks-homepage-articles .entry-wrapper {
    margin-top: 0.75rem; /* hoặc 1rem nếu muốn rộng hơn */
}

.wp-block-newspack-blocks-homepage-articles img {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 0.75rem; /* tạo khoảng cách giữa ảnh và tiêu đề */
}




.video-slider-wrapper {
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
}

.video-slider-track {
  overflow-x: auto;
  scroll-behavior: smooth;
}

.video-slider-inner {
  display: flex;
  gap: 16px;
}

.video-item {
  flex-shrink: 0;
  width: calc(33.333% - 11px); /* 3 items trên desktop */
}

.video-item img {
  border-radius: 8px;
  width: 100%;
  height: auto;
  display: block;
}

.video-slider-prev,
.video-slider-next {
  position: absolute;
  top: 40%;
  z-index: 1;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}
.video-slider-prev {
  left: 0.5rem;
}
.video-slider-next {
  right: 0.5rem;
}

/* Responsive: 2 items trên mobile */
@media screen and (max-width: 768px) {
  .video-item {
    width: calc(50% - 8px);
  }
}
.video-slider-prev.hidden,
.video-slider-next.hidden {
  display: none;
}

/* ============================================= */
/* == CSS Responsive cho bố cục Lưới (Grid) == */
/* ============================================= */

/* Cho màn hình máy tính bảng (dưới 992px) */
@media (max-width: 992px) {
    .grid-5-col, 
    .grid-4-col {
        /* Chuyển layout 5 cột và 4 cột thành 3 cột */
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cho màn hình điện thoại (dưới 576px) */
@media (max-width: 576px) {
    .grid-5-col, 
    .grid-4-col, 
    .grid-3-col {
        /* Chuyển tất cả các layout lưới thành 2 cột để dễ nhìn hơn */
        grid-template-columns: repeat(2, 1fr);
    }
}

.card-item a{
    text-decoration: none;
}
.card-info p{
    margin: 0px;
}
.movie-item a.card-link {
    font-size: 18px;
    color: var(--newspack-theme-color-secondary-text, #555);
}
.card-link h3{
    font-size: 18px;
}
.card-info .movie-year{
    font-size: 15px;
    font-style: italic;
}
.movie-director {
    font-size: 14px;
}

#news-review h3.entry-title.post-title.has-medium-font-size{
    margin-top:15px;
    line-height: 20px;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
}

.color-box {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    border-radius: 4px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-all-link {
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
    margin-left: 10px;
}

.view-all-link:hover {
    text-decoration: underline;
}