/* ====== CUSTOM MODAL FOR FULLSCREEN NEWS IMAGE ====== */
.custom-image-modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background-color: rgba(0,0,0,0.92);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}
.custom-image-modal-content {
    max-width: 75vw;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    background: #222;
    object-fit: contain;
    display: block;
    margin: auto;
}
.custom-image-modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
    transition: color 0.2s;
    text-shadow: 0 2px 10px #000;
}
.custom-image-modal-close:hover {
    color: #c5a473;
}
@media (max-width: 576px) {
    .custom-image-modal-content {
        max-width: 99vw;
        max-height: 70vh;
    }
    .custom-image-modal-close {
        top: 10px;
        right: 18px;
        font-size: 2.2rem;
    }
}
:root {
    --gold-color: #c5a473;
    --dark-bg: #1a1a1a;
    --card-bg: rgba(6, 16, 31, 0.85);
    --border-color: #333333;
    --text-light: #e0e0e0;
    --text-dark: #cccccc;
}


.custom-carousel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background-color: #808080;
    overflow: hidden;
    border-radius: 8px;
}
.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}
/* Ensure each slide occupies full container width so image can center properly */
.custom-carousel-container .carousel-item {
    width: 100%;
    flex: 0 0 100%;
    display: none; /* hide by default */
    align-items: center;
    justify-content: center;
}
.custom-carousel-container .carousel-item.active { display:flex; }
/* Generic image centering within slide */
.custom-carousel-container .carousel-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto; /* avoid stretching narrow images */
    height: 100%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    font-size: 24px;
    padding: 0;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 600;
}
.carousel-control:hover {
    background-color: rgba(0, 0, 0, 0.6);
}
.carousel-control.prev {
    left: 15px;
}
.carousel-control.next {
    right: 15px;
}
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: auto;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}
.indicator {
    width: 30px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.indicator.active {
    background-color: white;
}
/* Desktop (>=769px) uniform image sizing without cropping */
@media (min-width: 769px) {
    /* Hide non-active slides but keep width context */
    .custom-carousel-container .carousel-item { height: 300px; background:#111; }
    .custom-carousel-container .carousel-item:not(.active) { display:none; }
}
/* Adjusted heights for better visibility on mobile */
@media (max-width: 768px) {
    .custom-carousel-container { max-width: 100%; }
    /* was 140px */
    .custom-carousel-container .carousel-item img { height: 200px; }
}
@media (max-width: 576px) {
    .custom-carousel-container { max-width: 100%; }
    /* was 90px – increase vertical space on small phones */
    .custom-carousel-container .carousel-item img { height: 170px; }
    .carousel-control { width: 40px; height: 40px; font-size: 20px; }
    .indicator { width: 22px; height: 4px; }
}

.news-detail-page-content {
    font-family: 'Montserrat', sans-serif;
    padding: 2rem 0;
}

.news-detail-page-content h1 {
    font-family: 'Times New Roman', Times, serif;
}

.news-detail-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    overflow: hidden; /* For image border-radius */
}

.news-detail-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; 
    height: 450px; 
    overflow: hidden;
    background-color: var(--card-bg); 
}

.news-detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
}


.news-detail-content {
    padding: 3rem;
}

.news-detail-date {
    color: var(--text-dark);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-detail-title {
    color: var(--gold-color);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.news-detail-description {
    color: var(--text-light);
    line-height: 1.9;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.news-detail-description p {
    margin-bottom: 1.5rem;
    word-wrap: break-word;     
    overflow-wrap: break-word; 
}

.news-detail-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.social-share-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    margin-top: 10px;
}

.share-text {
    margin: 0;
    margin-right: 1rem;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    font-family: 'Montserrat', sans-serif;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    background-color: rgba(6, 16, 31, 0.85);
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    border: none;
    text-decoration: none;
}



.social-icon:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    opacity: 0.92;
}

.btn-back, .btn-share {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-back {
    background-color: transparent;
    color: var(--gold-color);
    border: 1px solid var(--gold-color);
}

.btn-back:hover {
    background-color: var(--gold-color);
    color: var(--dark-bg);
}

.btn-share {
    background-color: #3b5998; /* Facebook Blue */
    color: #fff;
    border: 1px solid #3b5998;
}

.btn-share:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Gallery styling */
.news-detail-gallery {
    margin-bottom: 2rem;
}

.news-detail-gallery h4 {
    color: var(--gold-color);
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    font-family: 'Times New Roman', Times, serif;
}

.gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    height: 200px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Styling for CKEditor content */
.news-detail-description{
    padding: 5px;
}
.news-detail-description img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.news-detail-description img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(197, 164, 115, 0.3);
    border-color: var(--gold-color);
}

.news-detail-description h2, 
.news-detail-description h3 {
    color: var(--gold-color);
    margin: 1.5rem 0 1rem 0;
}

.news-detail-description ul, 
.news-detail-description ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.news-detail-description blockquote {
    border-left: 3px solid var(--gold-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-dark);
}

.news-detail-description a {
    color: var(--gold-color);
    text-decoration: none;
}

.news-detail-description a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .news-detail-image-wrapper {
        /* Mengurangi tinggi gambar pada layar yang lebih kecil */
        height: 250px;
    }
    .news-detail-content {
        padding: 1.5rem;
    }
    .news-detail-title {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .news-detail-actions {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        padding-top: 1.2rem;
    }
    .btn-back {
        width: 80%;
        margin-bottom: 0.7rem;
        text-align: center;
        font-size: 1rem;
        padding: 0.9rem 0;
    }
    .social-share-group {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.7rem;
        margin-left: 0;
        width: 100%;
    }
    .share-text {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }
    .social-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        margin-bottom: 0.2rem;
    }
    .news-detail-content {
        padding: 1rem 0.5rem;
    }
}

@media (max-width: 967.98px) and (max-height: 480px) and (orientation: landscape) {
    .btn-back {
        width: auto !important;
        max-width: 320px;
        margin: 0 auto 0.7rem auto;
        display: block;
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
    }
    .news-detail-actions {
        gap: 0.7rem;
        padding-top: 1rem;
    }
}
