.title-limited {
    line-height: 1.5;
    height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.title-limited a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Warna teks tabel pada mode terang */
.table tbody td,
.table tbody td a,
.table tbody td span {
    color: #333;
}

/* Mode gelap - sesuaikan selector dengan class template */
.dark-mode .table tbody td,
.dark-mode .table tbody td a,
.dark-mode .table tbody td span,
body.dark .table tbody td,
body.dark .table tbody td a,
body.dark .table tbody td span,
[data-theme="dark"] .table tbody td,
[data-theme="dark"] .table tbody td a,
[data-theme="dark"] .table tbody td span {
    color: #f1f1f1 !important;
}

/* Mode terang */
.table thead th {
    color: #333;
}

/* Mode gelap */
[data-theme="dark"] .table thead th,
[data-theme="dark"] .table tbody th {
    color: #f1f1f1 !important;
}

.btn-action {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-action i {
    font-size: 14px;
}

/* Pastikan sel aksi memenuhi tinggi baris */
.table tbody td {
    vertical-align: middle;
}

/* Rapikan pembungkus tombol */
.table .action-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
}

/* Pastikan hover tombol tidak mengganggu garis tabel */
.table tbody tr:hover td {
    border-bottom-color: #dee2e6;
}

.post-title .popular-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.post-title .popular-title-2 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    overflow-wrap: anywhere;
}


/* Item berita kecil di sebelah kanan */
.rt-post.post-sm.style-2,
.rt-post.post-md.style-10 {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

/* Bagian teks mengambil sisa ruang */
.rt-post.post-sm.style-2 .post-content,
.rt-post.post-md.style-10 .post-content {
    flex: 1;
    min-width: 0;
}

/* Area gambar mengikuti tinggi item berita */
.rt-post.post-sm.style-2 .post-img,
.rt-post.post-md.style-10 .post-img {
    flex: 0 0 143px;
    align-self: stretch;
    display: flex;
}

/* Gambar mengisi seluruh area */
.rt-post.post-sm.style-2 .post-img a,
.rt-post.post-sm.style-10 .post-img a {
    display: flex;
    width: 100%;
    height: 100%;
}

.rt-post.post-sm.style-2 .post-img img,
.rt-post.post-sm.style-10 .post-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#bannerCarousel .post-img {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

#bannerCarousel .post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Kolom pembungkus carousel */
.banner-column {
    display: flex;
    flex-direction: column;
}

/* Carousel memenuhi tinggi kolom */
#bannerCarousel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Area slide memenuhi ruang carousel */
#bannerCarousel .carousel-inner {
    flex: 1;
    min-height: 0;
}

/* Setiap slide memiliki tinggi penuh */
#bannerCarousel .carousel-item {
    height: 100%;
}

/* Konten banner memenuhi tinggi slide */
#bannerCarousel .rt-post-overlay,
#bannerCarousel .post-img,
#bannerCarousel .post-img a {
    height: 100%;
}

/* Gambar memenuhi area banner */
#bannerCarousel .post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Section Portal */
.portal-section {
    border-radius: 10px;
}

.portal-heading {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
}

/* Item portal */
.portal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px 10px;
    text-align: center;
    text-decoration: none;
    color: #222;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.portal-item:hover {
    transform: translateY(-5px);
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Ukuran semua gambar dibuat sama */
.portal-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.portal-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.portal-item h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

/* Tampilan HP */
@media (max-width: 576px) {
    .portal-section {
        padding: 15px 8px;
    }

    .portal-icon {
        width: 65px;
        height: 65px;
        margin-bottom: 10px;
    }

    .portal-item {
        padding: 15px 5px;
    }

    .portal-item h5 {
        font-size: 12px;
    }
}

.footer-post-list .post-img {
    width: 100px;
    height: 100px;
    min-width: 100px;
    overflow: hidden;
    border-radius: 0;
    /* Hilangkan jika ingin sudut kotak */
    line-height: 0;
}

.footer-post-list .post-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.footer-post-list .post-img img.footer-thumbnail {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    margin: 0;
}

.post-list .post-img {
    width: 100px;
    height: 100px;
    min-width: 100px;
    overflow: hidden;
    border-radius: 50%;
    line-height: 0;
}

.post-list .post-img a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.post-list .post-img img.footer-thumbnail {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    object-position: center;
    border-radius: 50% !important;
    margin: 0;
}


/* ===== Gallery page ===== */
.gallery-page {
    padding-top: 50px;
    padding-bottom: 60px;
}

.gallery-heading {
    margin-bottom: 30px;
}

.gallery-heading h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 8px;
}

.gallery-heading p {
    color: #777;
    margin-bottom: 0;
}

/* Gallery card */
.gallery-card {
    height: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.09);
}

.gallery-card-header {
    padding: 20px 20px 15px;
}

.gallery-card-header h4 {
    font-size: 18px;
    line-height: 1.5;
    font-weight: 700;
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.gallery-date {
    font-size: 13px;
    color: #888;
}

.gallery-date i {
    margin-right: 5px;
    color: #e65353;
}

/* Grid foto: 2 kolom */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 0 12px;
}

.gallery-photo-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 5px;
}

.gallery-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    transition: transform .3s ease;
}

.gallery-photo-wrap:hover .gallery-photo {
    transform: scale(1.06);
}

/* Sembunyikan foto kelima dan seterusnya,
tetapi tetap tersedia untuk lightbox */
.gallery-photo-hidden {
    display: none;
}

/* Overlay +N */
.gallery-more {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, .65);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background .2s ease;
}

.gallery-more:hover {
    background: rgba(0, 0, 0, .78);
}

.gallery-more span {
    font-size: 30px;
    font-weight: 700;
}

.gallery-more small {
    font-size: 12px;
}

/* Tombol transparan untuk membuka foto */
.gallery-photo-open {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

/* Pesan kosong */
.gallery-empty {
    grid-column: 1 / -1;
    padding: 30px 10px;
    text-align: center;
    color: #999;
}

.gallery-empty i {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Footer */
.gallery-card-footer {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gallery-card-footer>span {
    font-size: 13px;
    color: #777;
}

.gallery-view-all {
    padding: 0;
    border: 0;
    background: transparent;
    color: #d74747;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.gallery-view-all i {
    margin-left: 5px;
}

.gallery-no-data {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.gallery-no-data>i {
    font-size: 45px;
    margin-bottom: 15px;
}

.gallery-no-data h4 {
    color: #333;
}

/* ===== Lightbox ===== */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 55px 70px 30px;
    background: rgba(0, 0, 0, .94);
}

.gallery-lightbox.is-open {
    display: flex;
}

.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: calc(100% - 55px);
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
}

.lightbox-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 1000px;
    padding-top: 15px;
    color: #fff;
    font-size: 14px;
}

.lightbox-caption span:first-child {
    overflow-wrap: anywhere;
}

.lightbox-caption span:last-child {
    flex-shrink: 0;
    color: #bbb;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    z-index: 2;
    color: #fff;
    border: 0;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background .2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, .25);
}

.lightbox-close {
    top: 15px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 32px;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 60px;
    border-radius: 8px;
    font-size: 22px;
}

.lightbox-prev {
    left: 15px;
}

.lightbox-next {
    right: 15px;
}

body.gallery-lightbox-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 767px) {
    .gallery-page {
        padding-top: 30px;
        padding-bottom: 35px;
    }

    .gallery-heading h2 {
        font-size: 24px;
    }

    .gallery-card-header {
        padding: 15px 15px 12px;
    }

    .gallery-card-header h4 {
        font-size: 16px;
    }

    .gallery-card-footer {
        padding: 12px 15px;
    }

    .gallery-lightbox {
        padding: 65px 12px 20px;
    }

    .lightbox-prev,
    .lightbox-next {
        top: auto;
        bottom: 12px;
        transform: none;
        width: 42px;
        height: 42px;
        border-radius: 50%;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-caption {
        font-size: 12px;
        padding: 12px 45px 0;
    }
}

/* Thumbnail informasi berbentuk kotak */
.information-thumbnail {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: cover;
    object-position: center;
}

/* Pastikan gambar memenuhi area penampung */
.rt-post.post-md.style-9 .post-img {
    width: 100%;
    overflow: hidden;
}

.rt-post.post-md.style-9 .post-img a {
    display: block;
    width: 100%;
}

/* Semua gambar informasi memiliki ukuran seragam */
.rt-post.post-md.style-9 .post-img {
    width: 100%;
    height: 260px;
    overflow: hidden;
}

.rt-post.post-md.style-9 .post-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.rt-post.post-md.style-9 .post-img img.information-thumbnail {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    max-width: none;
}