/* ====== CSS BARU UNTUK TOMBOL SHARE DAN MODAL ====== */

.share-button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 8px 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-button i {
    margin-right: 8px;
}

.share-button:hover {
    background-color: var(--gold-color);
    border-color: var(--gold-color);
    color: var(--dark-bg);
}

/* Mengubah tampilan Read More untuk konsistensi */
.read-more-link {
    color: var(--gold-color);
    font-weight: 600;
    text-decoration: none;
    transition: letter-spacing 0.3s ease, color 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}

.read-more-link i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.news-item:hover .read-more-link { 
    letter-spacing: 1px; 
}

.news-item:hover .read-more-link i {
    transform: translateX(5px);
}


/* Styling untuk Modal Share */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none; /* diubah oleh JS menjadi 'flex' */
    justify-content: center;
    align-items: center;
    z-index: 1050; /* Pastikan di atas elemen lain */
    backdrop-filter: blur(5px);
}

/* News Image Modal Styling */
.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.news-modal-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-modal-content {
    max-width: 95vw;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: newsModalFadeIn 0.3s ease-in-out;
}

@keyframes newsModalFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.news-modal-close {
    position: fixed;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 48px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.news-modal-close:hover,
.news-modal-close:focus {
    color: var(--gold-color);
    text-decoration: none;
}

/* Responsive adjustments for news modal */
@media (max-width: 768px) {
    .news-modal-wrapper {
        max-width: 95%;
        max-height: 95%;
    }
    
    .news-modal-close {
        top: 15px;
        right: 25px;
        font-size: 35px;
    }
}

@media (max-width: 480px) {
    .news-modal-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .news-modal-wrapper {
        max-width: 98%;
    }
}

.share-modal-content {
    background-color: var(--card-bg);
    color: var(--text-light);
    padding: 2.5rem;
    border: 1px solid var(--gold-color);
    border-radius: 8px;
    position: relative;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7);
    font-family: 'Montserrat', sans-serif;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}


.share-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    color: var(--text-dark);
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease, transform 0.3s ease;
}

.share-modal-close:hover {
    color: var(--gold-color);
    transform: rotate(90deg);
}

.share-modal-content h4 {
    font-family: 'Times New Roman', Times, serif;
    color: var(--gold-color);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 2rem;
    font-weight: 600;
}

.share-modal-links {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 kolom */
    gap: 1rem;
}

.share-link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.share-link-item i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.share-link-item:hover {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Warna spesifik untuk setiap tombol share */
.share-link-item.facebook:hover { background-color: #d4ba8e; border-color: #d4ba8e; }
.share-link-item.twitter:hover { background-color: #d4ba8e; border-color: #d4ba8e; }
.share-link-item.whatsapp:hover { background-color: #d4ba8e; border-color: #d4ba8e; }
.share-link-item.telegram:hover { background-color: #d4ba8e; border-color: #d4ba8e; }

/* Responsive untuk modal di layar kecil */
@media (max-width: 576px) {
    .share-modal-links {
        grid-template-columns: 1fr; /* 1 kolom di mobile */
    }
    .share-modal-content {
        padding: 2rem 1.5rem;
    }
}
:root {
    --gold-color: #c5a473;
    --dark-bg: #222222;
    --card-bg: rgba(6, 16, 31, 0.85);
    --border-color: #333333;
    --text-light: #e0e0e0;
    --text-dark: #cccccc;
}

.news-page-content {
    font-family: 'Montserrat', sans-serif;
}

.news-page-content h1, 
.news-page-content h3 {
    font-family: 'Times New Roman', Times, serif;
}

.news-header {
    text-align: center;
    margin: 2rem 0 4rem 0;
    position: relative;
}


.news-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--gold-color);
    display: inline-block;
    position: relative;
    margin: 0 1rem;
    --header-line-gap: 14px; /* jarak antara teks & garis */
}

/* Single animated line grows leftward starting exactly at text start */
.news-header::before,
.news-header::after { display:none !important; }
.news-header h1 { position:relative; }
.news-header h1::before {
    content:'';
    position:absolute;
    top:50%;
    right:calc(100% + var(--header-line-gap)); /* beri jarak kiri */
    height:1px;
    width: 200px;
    background-color: var(--gold-color);
    opacity:.6;
    transform:translateY(-50%) scaleX(1);
}
/* Symmetric line on the right end of the heading */
.news-header h1::after {
    content:'';
    position:absolute;
    top:50%;
    left:calc(100% + var(--header-line-gap)); /* beri jarak kanan */
    height:1px;
    width:200px;
    background-color: var(--gold-color);
    opacity:.6;
    transform:translateY(-50%) scaleX(1);
}

.news-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
        /* Make card a flex container so inner row can stretch to fill */
    display: flex;
    flex-direction: column;
}

.news-item:hover {
    border-color: var(--gold-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.news-item .full-card-link { position:absolute; inset:0; z-index:5; text-indent:-9999px; }
.news-item .share-button { position:relative; z-index:10; }
.news-item .popup-image { position:relative; z-index:15; cursor:pointer; }
.news-item .news-image-wrapper { position:relative; z-index:15; }
/* Ensure global modal stays fixed & above card overlay */
.share-modal-overlay { position:fixed; z-index:2000; }
.share-modal-content { position:relative; z-index:2001; }
.news-item .pseudo-link { cursor:pointer; }

.news-image-link {
    display: block;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.news-image-wrapper { 
    /* Make wrapper participate in layout so it can stretch with its column */
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.news-image {
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Only add cursor pointer for clickable images */
.news-image.news-image-clickable {
    cursor: pointer;
    z-index: 15;
}


.news-item:hover .news-image { 
    transform: scale(1.05); 
}

.news-content-wrapper {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    justify-content: space-between;
}

.news-date {
    color: var(--text-dark);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}


.news-item-title {
    text-align: left;
    width: 100%;
}

.news-item-title { color: var(--text-light); font-size:1.5rem; font-weight:600; transition:color .3s ease; }
.news-item:hover .news-item-title { color: var(--gold-color); }

.news-excerpt {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 1rem;
    flex-grow: 1;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}


.social-share-link {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.social-share-link:hover { 
    color: var(--gold-color); 
}

.read-more-link {
    color: var(--gold-color);
    font-weight: 600;
    text-decoration: none;
    transition: letter-spacing 0.3s ease;
    font-size: 0.9rem;
}

.news-item:hover .read-more-link { 
    letter-spacing: 1px; 
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
}

.pagination .page-item {
    margin: 0 5px;
}

.pagination .page-link {
    color: var(--text-dark);
    background-color: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    display: block;
    min-width: 40px;
    text-align: center;
}

.pagination .page-item.disabled .page-link {
    color: #555;
    border-color: #333;
    cursor: not-allowed;
}

.pagination .page-item:not(.disabled) .page-link:hover {
    color: var(--dark-bg);
    background-color: var(--gold-color);
    border-color: var(--gold-color);
}

.pagination .page-item.active .page-link {
    z-index: 3;
    color: var(--dark-bg);
    background-color: var(--gold-color);
    border-color: var(--gold-color);
    font-weight: bold;
}

/* --- Ensure equal height columns within each card on desktop --- */
@media (min-width: 992px) {
    /* Let the inner row expand to fill the card's available height */
    .news-item > .row.g-0 {
        display: flex;
        align-items: stretch; /* make both columns same height */
        flex: 1 1 auto;
        min-height: 100%;
    }
    .news-item .col-lg-4,
    .news-item .col-lg-8 {
        display: flex;
        flex-direction: column; /* stack children vertically and stretch */
    }
    .news-image-link,
    .news-image-wrapper {
        height: 100%;
        flex: 1 1 auto;
    }
    .news-content-wrapper { /* already flex column; ensure it fills height */
        flex: 1 1 auto;
    }
}

/* --- News Header Responsive Breakpoints --- */
/* XL ≥1200px */
@media (min-width: 1200px) {
    .news-header h1 { font-size: 3rem; letter-spacing: 5px; }
}
/* LG 992–1199 */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .news-header h1 { font-size: 2.7rem; }
}
/* MD 768–991 */
@media (min-width: 768px) and (max-width: 991.98px) {
    .news-header h1 { font-size: 2.3rem; }
    .news-header h1::before,
    .news-header h1::after { width:120px; }
}
/* SM 576–767 */
@media (min-width: 576px) and (max-width: 767.98px) {
    .news-header h1 { font-size: 2rem; letter-spacing: 3.5px; }
    .news-header h1::before,
    .news-header h1::after { width:90px; }
}
/* XS <576 */
@media (max-width: 575.98px) {
    .news-header h1 { font-size: 1.65rem; letter-spacing: 3px; }
    .news-header h1::before,
    .news-header h1::after { width:30px; }
}

@media (max-width: 576px) {
    .news-item {
        margin-bottom: 2rem;
        border-radius: 10px;
        overflow: hidden;
    }
    .news-image-link,
    .news-image-wrapper {
        position: relative;
        width: 100%;
        height: 180px;
        min-height: 120px;
        max-height: 220px;
        display: block;
        overflow: hidden;
    }
    .news-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .news-content-wrapper {
        padding: 1.2rem 1rem 1rem 1rem;
        font-size: 0.95rem;
        min-width: 0;
        word-break: break-word;
    }
    .news-item-title a {
        font-size: 1.1rem;
        word-break: break-word;
    }
    .news-excerpt {
        font-size: 0.9rem;
        margin-top: 0.7rem;
        max-width: 100%;
        overflow-wrap: break-word;
    }
    .news-footer {
        flex-direction: row;
        align-items: flex-start;
        gap: 0.7rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }
    .social-share-link {
        font-size: 1rem;
        margin-right: 10px;
        margin-bottom: 5px;
        flex-direction: column;
        align-items: flex-start;
        display: inline-block;
    }
    .read-more-link {
        font-size: 1rem;
        margin-top: 5px;
        align-self: flex-end;
    }
    .row.g-0 > .col-lg-4, .row.g-0 > .col-lg-8 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        display: block;
    }
}

@media (max-width: 950px) and (orientation: landscape) {
    .news-image-link,
    .news-image-wrapper {
        height: 220px !important;
        min-height: 120px !important;
        max-height: 260px !important;
    }
    .news-image {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: 100% !important;
        min-height: 120px !important;
        max-height: 260px !important;
    }
}

/* Fix for md potrait: ensure news image always visible and sized properly */
@media (min-width: 577px) and (max-width: 950px) and (orientation: portrait) {
    .news-image-link,
    .news-image-wrapper {
        position: relative !important;
        width: 100% !important;
        height: 320px !important;
        min-height: 120px !important;
        max-height: 320px !important;
        display: block !important;
        overflow: hidden !important;
    }
    .news-image {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}