/* ==========================================
   PT MODERNLAND REALTY - NEWS PAGE STYLES
   ========================================== */

/* === NEWS PAGE SECTION === */
.news-page-section {
    width: 100%;
    min-height: 100vh;
    padding: 80px 0 120px 0;
    background-color: white;
}

.news-container {
    max-width: 1296px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === CATEGORY TABS === */
.news-category-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    gap: 1rem;
    margin-left: 0;
    position: relative;
}

.news-category-tabs::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #000;
    z-index: 0;
}

.category-tab {
    flex: 0 0 calc(33.333% - 0.667rem);
    padding: 1rem 2rem;
    font-family: "Poppins", sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
    white-space: nowrap;
}

/* Garis transparan untuk semua tab (non-active) */
.category-tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: all 0.3s ease;
}

.category-tab:hover {
    color: #dc2626;
}

.category-tab.active {
    color: #000;
    font-weight: 600;
}

/* Garis merah tebal dengan rounded top untuk tab active */
.category-tab.active::after {
    height: 8px;
    background: #dc2626;
    border-radius: 8px 8px 0 0;
    z-index: 2;
}

.category-tab:focus {
    outline: none;
}

/* === YEAR FILTER (CUSTOM DROPDOWN) === */
.news-year-filter {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 3rem;
}

.custom-dropdown {
    position: relative;
    min-width: 180px;
}

.dropdown-button {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    background: white;
    border: 2px solid #e4e4e7;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dropdown-button:hover {
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
    transform: translateY(-1px);
}

.dropdown-button.active {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.dropdown-value {
    flex: 1;
    text-align: left;
}

.dropdown-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.dropdown-button.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e4e4e7;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.875rem 1.25rem;
    font-family: "Poppins", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #000;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #dc2626;
    color: white;
}

.dropdown-item.active {
    font-weight: 600;
}

/* === NEWS GRID === */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 2rem;
    margin-bottom: 4rem;
}

/* === NEWS CARD (CSR & Corporate) === */
.news-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.news-card.hidden {
    display: none;
}

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

.news-image-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #f4f4f5;
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image {
    transform: scale(1.1);
}

.news-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0.3)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.news-card:hover .news-overlay {
    opacity: 1;
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.news-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.news-category-csr {
    background: #16a34a;
    color: white;
}

.news-category-corporate {
    background: #2563eb;
    color: white;
}

.news-category-emagz {
    background: #dc2626;
    color: white;
}

.news-date {
    font-size: 0.875rem;
    color: #71717a;
    font-weight: 400;
}

.news-title {
    font-family: "Poppins", sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    color: #000;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.news-card:hover .news-title {
    color: #dc2626;
}

.news-excerpt {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #52525b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc2626;
    margin-top: auto;
    transition: all 0.3s ease;
}

.news-card:hover .read-more {
    gap: 0.5rem;
}

/* === E-MAGZ CARD (ANNUAL REPORT STYLE - SMALLER) === */
.emagz-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.emagz-card:hover {
    transform: translateY(0);
    box-shadow: none;
}

.emagz-cover {
    width: 100%;
    aspect-ratio: 3/4; /* Smaller ratio: 3:4 instead of 225:318 */
    border: 1px solid #000000;
    overflow: hidden;
    background-color: #f5f5f4;
    transition: all 0.3s ease;
}

.emagz-cover:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.emagz-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.emagz-card:hover .emagz-cover img {
    transform: scale(1.05);
}

.emagz-date {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #a1a1aa;
    margin: 0;
}

.emagz-title {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #000000;
    margin: 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.emagz-card:hover .emagz-title {
    color: #dc2626;
}

.emagz-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.emagz-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #000;
    background-color: #000;
    color: #fff;
}

.emagz-btn:hover {
    background-color: #fff;
    color: #000;
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.emagz-btn svg {
    width: 16px;
    height: 16px;
}

/* === NO RESULTS MESSAGE === */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    display: none;
}

.no-results.show {
    display: block;
}

.no-results svg {
    width: 64px;
    height: 64px;
    color: #a1a1aa;
    margin: 0 auto 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 1rem;
    color: #71717a;
}

/* === PAGINATION (CAROUSEL STYLE) === */
.carousel-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 60px;
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.carousel-btn:hover:not(:disabled) {
    background-color: #27272a;
    transform: scale(1.1);
}

.carousel-btn:disabled {
    background-color: rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
}

.carousel-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: white;
    color: white;
}

/* === FADE IN ANIMATION === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.5s ease forwards;
}

.news-card:nth-child(1) {
    animation-delay: 0.1s;
}
.news-card:nth-child(2) {
    animation-delay: 0.2s;
}
.news-card:nth-child(3) {
    animation-delay: 0.3s;
}
.news-card:nth-child(4) {
    animation-delay: 0.4s;
}
.news-card:nth-child(5) {
    animation-delay: 0.5s;
}
.news-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem 1.5rem;
    }

    .category-tab {
        padding: 1rem 2rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 768px) {
    .news-page-section {
        padding: 60px 0 80px 0;
    }

    .news-container {
        padding: 0 1rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .news-image-wrapper {
        height: 200px;
    }

    .news-category-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-left: 0;
        gap: 0;
        justify-content: flex-start;
    }

    .news-category-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Di mobile, garis dari parent disembunyikan karena tidak ikut scroll */
    .news-category-tabs::after {
        display: none;
    }

    /* Garis per-tab supaya ikut scroll */
    .category-tab::after {
        display: block;
    }

    .category-tab:not(.active)::after {
        background: #000;
        height: 2px;
    }

    .category-tab {
        flex: 0 0 auto;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        white-space: nowrap;
    }

    .news-year-filter {
        justify-content: center;
        margin-bottom: 2rem;
    }

    .filter-select {
        width: 100%;
        max-width: 300px;
    }

    .carousel-nav {
        justify-content: center;
        margin-top: 40px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-icon {
        width: 18px;
        height: 18px;
    }

    /* E-Magz responsive */
    .emagz-actions {
        flex-direction: column;
        gap: 6px;
    }

    .emagz-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .news-page-section {
        padding: 40px 0 60px 0;
    }

    .news-content {
        padding: 1.25rem;
    }

    .news-title {
        font-size: 1rem;
    }

    .news-excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
    }

    .no-results {
        padding: 3rem 1rem;
    }

    .no-results h3 {
        font-size: 1.25rem;
    }

    .no-results p {
        font-size: 0.875rem;
    }

    .category-tab {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .emagz-title {
        font-size: 13px;
    }

    .emagz-date {
        font-size: 12px;
    }

    .emagz-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}
