:root {
    --fondo-verde: rgb(255, 255, 255);
}

/* News Page Styles */
.news-hero {
    height: 50vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                url('https://source.unsplash.com/random/1600x900/?mountain');
    background-size: cover;
    background-position: center;
}

/* News Grid Layout */
.news-container {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.contenedor_ancho{
    max-width: 1200px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    row-gap: 5em;
    margin-top: 3rem;
}

/* News Card */
.news-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.news-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-date {
    position: absolute;
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 8px 12px;
    text-align: center;
    border-top-right-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.news-date .day {
    font-size: 1.8rem;
    font-weight: bold;
}

.news-date .month, .news-date .year {
    font-size: 0.8rem;
    text-transform: uppercase;
}

.news-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: var(--fondo-verde);
}

.news-content h3 {
    font-family: Roboto Slab;
    color: var(--primary-dark);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.news-content p {
    margin-bottom: 1.5rem;
    color: #444;
    line-height: 1.6;
    flex-grow: 1;
}

.news-link {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
    margin-top: auto;
    align-self: flex-start;
}

.news-leermas {
    display: inline-block;
    background-color: #ade0af;
    font-size: 0.9em;
    color: rgb(70, 116, 70);
    font-weight: bold;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    margin-top: -0.5em;
    width: fit-content;
    align-self: flex-start;
    box-shadow: 8px 8px 18px -4px rgba(0,0,0,0.6);

}

.news-leermas:hover {
    background-color: #96ce98;
    transform: translateY(-2px);
    box-shadow: 8px 8px 18px -4px rgba(0,0,0,0.6);
}

.news-link i {
    margin-left: 6px;
    transition: transform 0.3s ease;
}

.news-link:hover {
    color: var(--primary-dark);
}

.news-link:hover i {
    transform: translateX(3px);
}

/* Pagination */
.news-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.news-pagination a {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: white;
    color: var(--text-dark);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.news-pagination a.active {
    background-color: var(--primary-color);
    color: white;
}

.news-pagination a:hover:not(.active) {
    background-color: #f0f0f0;
}

/* Single News Article Page */
.news-single {
    max-width: 900px;
    margin: 6rem auto 5rem;
    padding: 0 5%;
}

.news-nav {
    margin-bottom: 2rem;
}

.news-nav a {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.news-nav a i {
    margin-right: 6px;
}

.news-nav a:hover {
    color: var(--primary-dark);
}

.news-full {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 3rem;
    transition: transform 0.3s ease;
}

.news-full:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.news-header {
    padding: 2rem 2rem 0;
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.news-meta i {
    margin-right: 6px;
    color: var(--primary-color);
}

.news-author {
    font-style: italic;
}

.news-header h1 {
    font-size: 1.8rem;
    color: var(--primary-dark);
    line-height: 1.3;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.news-header h1:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
}

.news-featured-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
}

.news-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-featured-image:hover img {
    transform: scale(1.03);
}

.news-featured-image:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
}

.news-body {
    padding: 2rem;
}

.news-body p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: #444;
    text-align: justify;
}

.news-body p:first-of-type:first-letter {
    font-size: 3.5rem;
    line-height: 1;
    float: left;
    margin-right: 0.8rem;
    color: var(--primary-dark);
    font-family: 'Montserrat', serif;
    font-weight: bold;
}

.news-body h2 {
    color: var(--primary-dark);
    margin: 2rem 0 1rem;
    position: relative;
    padding-left: 1rem;
}

.news-body h2:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background-color: var(--primary-light);
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.image-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
}

.image-gallery img:hover {
    transform: scale(1.02);
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    background-color: #f9f9f9;
    margin: 2rem 0;
    font-style: italic;
    color: #555;
}

.news-share {
    display: flex;
    align-items: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.news-share span {
    margin-right: 1rem;
    font-weight: 600;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 0.8rem;
    transition: all 0.3s ease;
}

.share-btn:nth-child(2):hover {
    background-color: #3b5998;
    color: white;
}

.share-btn:nth-child(3):hover {
    background-color: #1da1f2;
    color: white;
}

.share-btn:nth-child(4):hover {
    background-color: #25d366;
    color: white;
}

.share-btn:nth-child(5):hover {
    background-color: #FF5722;
    color: white;
}

.related-news {
    margin-top: 3rem;
}

.related-news h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.related-item:hover {
    transform: translateY(-3px);
}

.related-item img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1rem;
}

.related-item span {
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .news-header h1 {
        font-size: 1.6rem;
    }
    
    .news-featured-image {
        height: 250px;
    }
    
    .news-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos del cuadro de búsqueda de noticias */
.search-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    margin-top: -2em;
    margin-bottom: -1em;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 20px;
}

.search-box input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid rgb(210, 218, 210);
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.search-box input:hover{
    border-color: #3d7642; 
}

.search-box input:focus {
    border-color: #3d7642;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.2);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #666;
    padding: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-box button:hover {
    color: #4CAF50;
}