/* =============================================================================
   NEWS PAGE — fixed-height cards, sidebar category filter
   ============================================================================= */

/* === NEWS ROOT === */

#bersama-news-root {
    width: 100%;
    max-width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

/* === NEWS HEADER === */

#news-header {
    padding: 60px 0 40px;
}

#news-title {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 300;
    color: var(--color-text);
    letter-spacing: -0.03em;
    margin: 0;
    line-height: 1;
}

/* === NEWS LAYOUT === */

#news-layout {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 60px;
    align-items: start;
}

/* === NEWS SIDEBAR === */

#news-sidebar {
    position: sticky;
    top: 60px;
}

#news-filter {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-filter__item a {
    display: block;
    font-size: 12px;
    color: var(--color-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 0;
    transition: var(--transition-hover);
}

.news-filter__item.is-active a,
.news-filter__item a:hover {
    color: var(--color-text);
}

/* Active bullet lives in CSS (not PHP-echoed text) so the JS filter can
   re-point it by toggling .is-active alone. */
.news-filter__item.is-active a::before {
    content: '\2022\00a0'; /* "• " */
}

/* === NEWS CARD === */

.news-card {
    display: grid;
    grid-template-rows: auto 1fr;
    border-top: 1px solid #e8e8e8;
    padding: 28px 0;
    gap: 12px;
    /* Quick fade used by the client-side category filter (news.js). */
    transition: opacity 0.16s ease, transform 0.16s ease;
}

/* Filtered out — by PHP on direct ?category= loads, by JS afterwards. */
.news-card.is-hidden {
    display: none;
}

/* Phase 1 of a filter switch: everything fades down before the swap. */
#news-main.is-fading .news-card {
    opacity: 0;
    transform: translateY(6px);
}

.news-empty.is-hidden {
    display: none;
}

.news-card__date {
    font-size: 12px;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

.news-card__body {
    display: grid;
    /* Picture enlarged ~70% (280px -> 476px). clamp keeps it responsive: never
       below the old 280px, up to 476px on standard-width screens, so it can't
       crush the text column / overflow on narrower desktops. */
    grid-template-columns: clamp(280px, 50%, 476px) 1fr;
    gap: 40px;
}

/* Now an <a> linking to the post — keep it a block-level image frame. */
.news-card__image {
    display: block;
    overflow: hidden;
}

.news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9; /* match the homepage product images */
    display: block;
    transition: transform 0.5s ease;
}

/* Gentle zoom on hover, signalling the picture is a link. */
/* Placeholder shown when a post has no featured image, so every card keeps its
   image area in the same proportions. */
.news-card__image-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9; /* match the homepage product images */
    background: linear-gradient(135deg, #ececec, #d6d6d6);
}

/* === NEWS CARD CONTENT === */

.news-card__content {
    display: flex;
    flex-direction: column;
}

.news-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    margin: 0 0 12px;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.news-card__excerpt {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.6;
    max-height: 120px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.news-card__excerpt.is-expanded {
    max-height: 2000px;
}

/* Tighten WP content inside excerpt */
.news-card__excerpt p {
    margin: 0 0 8px;
}

.news-card__excerpt p:last-child {
    margin-bottom: 0;
}

/* === READ MORE BUTTON === */

.news-card__readmore {
    background: none;
    border: none;
    padding: 8px 0 0;
    cursor: pointer;
    font-size: 11px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    text-align: left;
    transition: var(--transition-hover);
    font-family: inherit;
}

.news-card__readmore:hover {
    color: var(--color-text);
}

.news-card__readmore.is-hidden {
    display: none;
}

/* === PUBLICATION PDF LINKS === */

/* View (compressed) + Download (original), in a row below the excerpt —
   mirrors the products page .product-meta__pdf treatment. */
.news-card__pdf-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 12px;
}

.news-card__pdf {
    font-size: 13px;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
    transition: var(--transition-hover);
}

.news-card__pdf:hover {
    color: var(--color-muted);
}

/* Publication PDF "Share" button — copies the viewed PDF's URL so visitors can
   pass it on. Styled to match .news-card__pdf; sits beside it in the same flex
   row (.news-card__pdf-links, 20px gap). */
.news-card__pdf-share {
    font-family: inherit; /* form controls must not fall back to the UA font */
    font-size: 13px;
    color: var(--color-text);
    background: none;
    border: 0;
    border-bottom: 1px solid currentColor;
    padding: 0 0 2px;
    cursor: pointer;
    transition: var(--transition-hover);
}

.news-card__pdf-share:hover {
    color: var(--color-muted);
}

.news-card__pdf-share.is-copied {
    border-bottom-color: transparent;
    opacity: 0.65;
    cursor: default;
}

/* === EMPTY STATE === */

.news-empty {
    color: var(--color-muted);
    font-size: 14px;
    padding: 40px 0;
}

/* === RESPONSIVE === */

@media (max-width: 768px) {
    #bersama-news-root {
        padding: 0 20px;
    }

    #news-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    #news-sidebar {
        position: static;
    }

    #news-filter {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 24px;
    }

    .news-card__body {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
