/* =====================
   NEWS UPDATE PAGE - FULLY RESPONSIVE
===================== */

/* PARALLAX SECTIONS - MOBILE FIRST */
.parallax-section {
    position: relative;
    background-attachment: scroll; /* Default for mobile */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 50vh; /* Mobile height */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.parallax-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    padding: 1.5rem;
    max-width: 90%;
    width: 100%;
}

/* NEWS HERO SECTION - MOBILE FIRST */
.news-hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
                url('../images/dolores_about.png') center center/cover no-repeat;
    color: #fff;
    padding: 60px 20px;
    position: relative;
    overflow: hidden;
    min-height: 50vh;
}

.news-hero h1 {
    font-size: 2rem; /* Mobile font size */
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.news-hero p {
    font-size: 1.1rem; /* Mobile font size */
    font-weight: 400;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    line-height: 1.5;
    margin: 0 auto;
    max-width: 600px;
}

/* NEWS SECTION - MOBILE FIRST */
.news-section {
    padding: 2.5rem 0;
    background-color: #f8f9fa;
}

.section-title {
    font-weight: 700;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 12px;
    color: #0d3b66;
    margin-bottom: 2rem;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #d90429, #f2c94c);
    border-radius: 2px;
}

/* NEWS CARDS - MOBILE FIRST */
.news-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.news-card .news-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-img {
    transform: scale(1.03);
}

.news-card .news-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem;
}

.news-card .news-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0d3b66;
    line-height: 1.3;
}

.news-card .news-date {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.news-card .news-description {
    font-size: 1rem;
    color: #495057;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================
   RESPONSIVE BREAKPOINTS (PARALLAX FROM ABOUT.CSS)
===================== */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .news-hero {
        padding: 70px 20px;
        min-height: 55vh;
    }
    
    .news-hero h1 {
        font-size: 2.5rem;
    }
    
    .news-hero p {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-title::after {
        width: 70px;
        height: 4px;
    }
    
    .news-card .news-img {
        height: 200px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    /* Enable parallax effect on tablets and larger (FROM ABOUT.CSS) */
    .parallax-section {
        background-attachment: fixed;
        min-height: 60vh;
    }
    
    .news-hero {
        background-attachment: fixed;
        padding: 80px 0;
        min-height: 60vh;
    }
    
    .news-hero h1 {
        font-size: 3rem;
    }
    
    .news-hero p {
        font-size: 1.4rem;
    }
    
    .news-section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .parallax-content {
        padding: 2rem;
    }
    
    /* 2 cards per row on tablets */
    .col-md-4 {
        flex: 0 0 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }
    
    .news-card .news-title {
        font-size: 1.25rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .parallax-section {
        min-height: 70vh;
    }
    
    .news-hero {
        padding: 100px 0;
        min-height: 70vh;
    }
    
    .news-hero h1 {
        font-size: 3.5rem;
    }
    
    .news-hero p {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    /* 3 cards per row on desktop */
    .col-md-4 {
        flex: 0 0 calc(33.333% - 1rem);
        max-width: calc(33.333% - 1rem);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .news-hero h1 {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 2.8rem;
    }
    
    .parallax-content {
        max-width: 1200px;
        padding: 3rem;
    }
}

/* MOBILE-SPECIFIC OPTIMIZATIONS */
@media (max-width: 575px) {
    /* Ensure proper image sizing on very small screens */
    .news-hero {
        background-position: center center;
        background-size: cover;
    }
    
    /* Adjust padding for very small screens */
    .parallax-content {
        padding: 1rem;
    }
    
    .news-hero h1 {
        font-size: 1.8rem;
    }
    
    .news-hero p {
        font-size: 1rem;
    }
    
    /* 1 card per row on mobile */
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .row.g-4 {
        gap: 1rem;
    }
    
    .news-section {
        padding: 2.5rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        padding-bottom: 12px;
    }
    
    .section-title::after {
        width: 60px;
        height: 3px;
    }
    
    .news-card {
        border-radius: 10px;
    }
    
    .news-card .news-content {
        padding: 1.25rem;
    }
    
    .news-card .news-title {
        font-size: 1.15rem;
    }
    
    .news-card .news-description {
        font-size: 0.95rem;
        -webkit-line-clamp: 4;
    }
}

/* Very small devices (less than 375px) */
@media (max-width: 374px) {
    .news-hero {
        min-height: 40vh;
        padding: 40px 10px;
    }
    
    .news-hero h1 {
        font-size: 1.75rem;
    }
    
    .news-hero p {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.35rem;
    }
    
    .news-card .news-img {
        height: 150px;
    }
    
    .news-card .news-content {
        padding: 1rem;
    }
    
    .news-card .news-title {
        font-size: 1.1rem;
    }
    
    .news-card .news-description {
        font-size: 0.9rem;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .parallax-section {
        min-height: 70vh;
    }
    
    .news-hero {
        min-height: 70vh;
    }
    
    .parallax-content {
        padding: 1rem;
    }
    
    .news-hero h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .news-hero p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

/* =====================
   PERFORMANCE OPTIMIZATIONS
===================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .news-hero {
        background-attachment: scroll !important;
    }
    
    .parallax-section {
        background-attachment: scroll !important;
    }
    
    .news-card,
    .news-card .news-img {
        transition: none;
    }
    
    .news-card:hover {
        transform: none;
    }
}

/* Improve image loading */
.news-card .news-img {
    background-color: #f5f5f5;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                      linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* =====================
   ACCESSIBILITY
===================== */

/* Focus states for keyboard navigation */
.news-card:focus-within {
    outline: 2px solid #d90429;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .news-card {
        border: 2px solid #000;
    }
    
    .section-title::after {
        background: #000;
    }
    
    .news-hero h1,
    .news-hero p {
        text-shadow: 0 0 2px #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .parallax-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Touch device detection (optional) */
@media (hover: none) and (pointer: coarse) {
    .news-hero {
        background-attachment: scroll;
    }
    
    .parallax-section {
        background-attachment: scroll;
    }
}