/* ===================================================
   1. THU GỌN PADDING VÙNG MÀU ĐEN CỦA THEME SOLEDAD
   =================================================== */
.penci-single-style-10 .post-image,
.penci-single-style-10 .penci-post-header,
.penci-single-style-10 .penci-header-text-container,
.penci-single-style-10 .penci-post-image-wrapper {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
    margin-bottom: 10px !important;
    min-height: auto !important;
}

/* ===================================================
   2. BỎ MARGIN THỪA VÀ GIẢM CHIỀU CAO GALLERY (400PX)
   =================================================== */
.ttpg {
    --ttpg-thumb: 80px;
    --ttpg-gap: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto !important; /* Xóa margin 20px gây phình khung */
    padding: 0 !important;
    box-sizing: border-box;

    display: grid;
    grid-template-columns: var(--ttpg-thumb) 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: 
        "thumbs main"
        "thumbs caption";
    gap: 12px;
}
.ttpg * { box-sizing: border-box; }

.penci-single-style-10 .ttpg:not(.ttpg-ready) { visibility: hidden; }
.penci-single-style-10 .ttpg-style10 { margin: 0 auto; max-width: 800px; }
.penci-single-style-10 .ttpg-style10-host { overflow: visible; }

/* Khung ảnh chính (Hạ từ 480px xuống 400px) */
.ttpg-main {
    grid-area: main;
    position: relative;
    width: 100%;
    background: #f8f8f8;
    overflow: hidden;
    border-radius: 8px;
    text-align: center;
    padding: 8px;
}
.ttpg-main-link { display: block; line-height: 0; cursor: zoom-in; }
.ttpg-main-image,
.penci-single-style-10 .penci-post-image-wrapper .ttpg-main-image {
    display: block;
    width: 100%;
    height: 400px !important;
    max-height: 400px !important;
    object-fit: contain;
    margin: 0 auto;
}

/* Nút chuyển ảnh */
.ttpg-arrow {
    appearance: none;
    border: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: #222222;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ttpg-arrow:hover { 
    background: #ffffff; 
    transform: translateY(-50%) scale(1.08); 
}
.ttpg-prev { left: 12px; }
.ttpg-next { right: 12px; }

/* Caption */
.ttpg-caption {
    grid-area: caption;
    min-height: 20px;
    padding: 4px 0 0;
    text-align: center;
    font-size: 14px;
    color: #ffffff;
}

/* Ẩn nút cuộn thumbnail */
.ttpg-thumb-arrow,
.ttpg-thumb-prev,
.ttpg-thumb-next {
    display: none !important;
}

/* Cột Thumbnail (Khóa cứng 400px bằng ảnh chính) */
.ttpg-thumbs-wrap {
    grid-area: thumbs;
    display: flex;
    flex-direction: column;
    width: var(--ttpg-thumb);
    height: 400px !important;
    max-height: 400px !important;
    overflow: hidden;
}

.ttpg-thumbs {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    gap: var(--ttpg-gap);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.ttpg-thumbs::-webkit-scrollbar { display: none; }

/* Ô Thumbnail */
.ttpg-thumb {
    flex: 0 0 var(--ttpg-thumb);
    width: var(--ttpg-thumb);
    height: var(--ttpg-thumb);
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
    cursor: pointer;
    opacity: .75;
    transition: all .2s ease;
}
.ttpg-thumb:hover { opacity: 1; }
.ttpg-thumb.is-active { 
    opacity: 1; 
    border-color: #ffffff; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.ttpg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Responsive Mobile (<767px) */
@media (max-width: 767px) {
    .ttpg { 
        display: block; 
        margin: 10px auto !important; 
        padding: 0 8px !important;
        --ttpg-thumb: 68px; 
    }
    .ttpg-main-image,
    .penci-single-style-10 .penci-post-image-wrapper .ttpg-main-image { 
        height: 300px !important; 
        max-height: 300px !important; 
    }
    .ttpg-thumbs-wrap {
        flex-direction: row;
        margin-top: 10px;
        width: 100%;
        height: auto !important;
        max-height: none !important;
    }
    .ttpg-thumbs {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }
}