/* ============================================
 * News Page Styles
 * ============================================ */

/* Article list section — no top padding on mobile, bottom room for pagination */
.news-list-section {
    padding-top: 0;
    padding-bottom: 4rem;
}
@media (min-width: 1024px) {
    .news-list-section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* Hero image height */
@media (min-width: 1024px) {
    .design-hero-img {
        height: 630px;
    }
}

/* News list — one card per row, image left + text right */
.news-article {
    display: flex;
    flex-direction: column;
    padding: 6rem 0;
    border-bottom: 1px solid #000;
}
@media (min-width: 48rem) {
    .news-article {
        display: grid;
        grid-template-columns: 52fr 48fr;
    }
}

.news-article-img {
    width: 100%;
}

.news-article-img a {
    display: block;
}

.news-article-img .img-wrap {
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: #f5f5f5;
}

.news-article-img .img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-article-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 1rem;
}
@media (min-width: 48rem) {
    .news-article-content {
        padding-top: 0;
        padding-left: 3rem;
    }
}
@media (min-width: 64rem) {
    .news-article-content {
        padding-left: 8rem;
    }
}

/* Last article — no bottom border */
.news-article:last-child {
    border-bottom: none;
}

.news-article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    color: #b71c1c;
    margin-bottom: 1rem;
}
.news-article-meta .cat {
    color: #b71c1c;
}
.news-article-meta time {
    color: #b71c1c;
}

.news-article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    line-height: 1.375;
}
@media (min-width: 64rem) {
    .news-article-title {
        font-size: 2.2rem;
    }
}

.news-article-title a {
    color: inherit;
    text-decoration: none;
}
.news-article-title a:hover {
    text-decoration: underline;
    text-underline-offset: 0.25em;
}

.news-article-excerpt {
    font-size: 0.9375rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 64rem) {
    .news-article-excerpt {
        font-size: 1.2rem;
    }
}

.news-article-more {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    color: #1a1a1a;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    background: transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 0;
    transition: color 0.7s ease, border-color 0.7s ease;
    width: fit-content;
    margin-top: 3rem;
}
.news-article-more::before {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left center;
    background: #b71c1c;
    border-radius: inherit;
    transition: transform 0.7s ease;
}
.news-article-more::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background: #fff;
    border-radius: inherit;
}
.news-article-more:hover {
    color: #fff;
    border-color: #b71c1c;
}
.news-article-more:hover::before {
    transform: scaleX(1);
}
.news-article-more svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ============================================
 * Pagination (aligned with projects page)
 * ============================================ */
.news-pagination {
    margin-top: 3rem;
}
@media (min-width: 1024px) {
    .news-pagination {
        margin-top: 6rem;
    }
    .news-cta-btn { font-size: 1.2rem; }
}
.news-pagination .page-numbers {
    font-size: 1.5rem;
}

/* ============================================
 * CTA Section — aligned with projects page
 * ============================================ */
.news-cta-section {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-image: url('../images/news_img_CTA.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}
.news-cta-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.news-cta-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
@media (min-width: 1024px) {
    .news-cta-row {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 4rem;
    }
}
.news-cta-text-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.news-cta-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
@media (min-width: 1024px) {
    .news-cta-title {
        font-size: 3rem;
    }
}
.news-cta-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}
@media (min-width: 1024px) {
    .news-cta-text {
        font-size: 1rem;
    }
    .news-cta-btn { font-size: 1.2rem; }
}
.news-cta-btn {
    display: inline-flex;
    margin-bottom: 0.5rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    background: transparent;
    color: #1a1a1a;
    border: none;
    border-radius: 0.375rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 0;
    transition: color 0.7s ease;
    white-space: nowrap;
    flex-shrink: 0;
    width: fit-content;
}
.news-cta-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left center;
    background: #b71c1c;
    border-radius: inherit;
    transition: transform 0.7s ease;
}
.news-cta-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background: #fff;
    border-radius: inherit;
}
.news-cta-btn:hover {
    color: #fff;
}
.news-cta-btn:hover::before {
    transform: scaleX(1);
}

/* ============================================
 * Prev/Next Nav (copied from single-project)
 * ============================================ */
.sp-nav-section {
    border-top: 1px solid #e5e5e5;
    padding: 1.5rem 0;
}
.sp-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sp-nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;
    color: inherit;
}
.sp-nav-item:hover .sp-nav-title {
    color: #b71c1c;
}
.sp-nav-item:hover .sp-nav-label {
    color: #b71c1c;
}
.sp-nav-label {
    font-size: 1rem;
    font-weight: 400;
    color: #1a1a1a;
    transition: color 0.2s ease;
}
.sp-nav-title {
    font-size: 0.875rem;
    font-weight: 300;
    color: #666;
    transition: color 0.2s ease;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 64rem) {
    .sp-nav-label { font-size: 1.15rem; }
    .sp-nav-title {
        font-size: 1rem;
        max-width: none;
        white-space: normal;
        overflow: visible;
    }
}

/* ============================================
 * Recommend Section (copied from single-project)
 * ============================================ */
.sp-recommend {
    padding: 2rem 0 8rem;
    background: #fff;
}
.sp-recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}
.sp-recommend-title {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: #1a1a1a;
}
@media (min-width: 64rem) {
    .sp-recommend-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 2.9rem;
        font-weight: 500;
    }
}
.sp-recommend-more {
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
@media (min-width: 64rem) {
    .sp-recommend-more { font-size: 1.3rem; }
}
.sp-recommend-more:hover {
    color: #b71c1c;
    border-color: #b71c1c;
    opacity: 1;
}

.sp-recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4.5rem;
}

/* ---- Recommend Card ---- */
.sp-rec-card {
    display: block;
    text-decoration: none;
    color: inherit;
}
.sp-rec-card-img {
    position: relative;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 0.75rem;
}
.sp-rec-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sp-rec-card-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #475569, #1e293b);
}

.sp-rec-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: none;
    pointer-events: none;
}
.sp-rec-card:hover .sp-rec-card-overlay {
    opacity: 1;
}
.sp-rec-card:hover .sp-rec-card-img img {
    filter: grayscale(100%);
}
.sp-rec-card-img img {
    transition: filter 0.4s ease;
    will-change: filter;
}
.sp-rec-card-more {
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
@media (min-width: 64rem) {
    .sp-rec-card-more { font-size: 1.4rem; }
}

.sp-rec-card-title {
    font-family: 'Google Sans Flex', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: #1a1a1a;
    margin: 0;
    transition: color 0.2s ease;
}
.sp-rec-card:hover .sp-rec-card-title {
    color: #dc2626;
    text-decoration: underline;
    text-underline-offset: 0.25em;
}
@media (min-width: 64rem) {
    .sp-rec-card-title { font-size: 1.6rem; }
}

/* ---- Mobile ---- */
@media (max-width: 63.9375rem) {
    .sp-nav-row {
        flex-direction: row;
        gap: 0.75rem;
        align-items: center;
        justify-content: space-between;
    }
    .sp-nav-item {
        flex-direction: row;
        align-items: baseline;
        gap: 0.35rem;
    }
    .sp-nav-label {
        font-size: 0.75rem;
        white-space: nowrap;
    }
    .sp-nav-title {
        font-size: 0.7rem;
        max-width: 80px;
    }
    .sp-recommend-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .sp-recommend { padding-bottom: 4rem; }
    .sp-recommend-header { margin-bottom: 1.5rem; }
    .news-pagination .page-numbers {
        font-size: 1rem;
    }

    /* News list — tighter card spacing, smaller meta + button margin, remove line clamp */
    .news-article {
        padding: 3rem 0;
    }
    .news-article-excerpt {
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
        margin-bottom: 1rem;
    }
    .news-article-meta {
        font-size: 0.9rem;
    }
    .news-article-more {
        display: none;
    }
}

@media (min-width: 1024px) {
    .news-cta-btn { font-size: 1.2rem; }
}
