h2 {
    text-align: center;
    color: black;
    padding: 1em;
    background-color: #6495ED;
}

/* Wrapper para mantener footer al final */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    /* Centrar el contenido y usar el mismo ancho que la imagen principal */
    --main-width: 940px; /* ancho base para la zona principal */
    max-width: var(--main-width);
    margin: 0 auto;
    text-align: center;
    padding: 0;
    box-sizing: border-box; /* incluir padding en el cálculo de max-width si se añade */
    flex: 1;
}

.article-container {
    display: block;
    text-align: left;
    padding: 0;
}

.article {
    background-color: #ffffff;
    padding: 10px;
}

.article-date {
    font-weight: bold;
    margin-top: 0.5em;
    text-align: left;
    color: #1a1a1a;
}

.article-title {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0.5em 0;
    text-align: left;
}

.article-summary {
    font-size: 0.95em;
    color: #333;
    text-align: left;
}

.edition-title {
    background-color: steelblue;
    margin-top: 85px;
    text-align: left;
    padding: 12px;
    font-weight: bold;
    font-size: 16px;
    color: #212121;
    /*min-width: var(--main-width);*/
    margin-left: 250px;
    margin-right: 250px;
}

.edition-title p {
    margin-left: 220px;
}

.main-article.article {
    /*max-width: var(--main-width);*/
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}

.principal-image {
    position: relative;
    width: 100%;
    max-width: var(--main-width);
    margin: 0 auto 1em auto;
    overflow: hidden;
}

.principal-image img {
    display: block;
    width: 100%;
    height: auto;
}

.overlay-title {
    position: absolute;
    left: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 12px 16px;
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
    font-size: 1.05em;
}

.first-image {
    width: 100%;
    height: auto;
    display: block;
}

.article-frames {
    display: block;
    max-width: var(--main-width);
    margin: 24px auto 0 auto;
    align-items: start;
}

.article-frames .article {
    background: transparent;
    padding: 0;
}

.mostrar-mas {
    color: #b6420c;
    font-weight: bold;
    text-align: right;
    padding: 1em 40px;
}

.show-more {
    max-width: var(--main-width);
    margin: 10px auto 5px auto;
    text-align: right;
    padding-right: 6px;
    margin-right: 450px;
}

.show-more a {
    color: #b6420c;
    text-decoration: none;
}

.show-more a:hover {
    text-decoration: underline;
}

/* Estilos específicos para grilla de informaciones */
.informaciones-grid {
    max-width: 940px;
    margin: 20px auto;
    padding: 0 20px;
}

.grid-container {
    max-width: var(--main-width);
    margin: 0 auto 20px auto;
    padding: 0 20px 10px 20px;
}

.grid-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    justify-content: space-between;
}

.grid-item {
    flex: 1;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 180px;
}

.grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #a84d20;
}

.grid-item:empty {
    cursor: default;
    background-color: transparent;
    border: none;
}

.grid-item:empty:hover {
    transform: none;
    box-shadow: none;
}

.grid-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.grid-title {
    font-size: 0.9em;
    font-weight: bold;
    margin: 8px;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.grid-summary {
    font-size: 0.75em;
    color: #555;
    margin: 8px;
    line-height: 1.3;
    height: 3.9em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.grid-item .article-date {
    font-size: 0.8em;
    color: #666;
    margin: 8px;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 1024px) and (min-width: 769px) {
    .edition-title {
        margin-left: 100px;
        margin-right: 100px;
    }
    
    .edition-title p {
        margin-left: 50px;
    }
    
    .show-more {
        margin-right: 150px;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .page-wrapper {
        min-height: 100vh;
    }
    
    .main-content {
        padding-bottom: 20px;
    }
    
    .edition-title {
        margin-left: 20px;
        margin-right: 20px;
        margin-top: 60px;
        font-size: 15px;
        padding: 10px;
    }
    
    .edition-title p {
        margin-left: 10px;
    }
    
    .show-more {
        margin-right: 20px;
        margin-bottom: 20px;
    }
    
    .grid-row {
        flex-wrap: wrap;
    }
    .grid-item {
        flex: 0 0 calc(50% - 7.5px);
        margin-bottom: 15px;
    }
    .grid-item:empty {
        display: none;
    }
    .grid-container {
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .page-wrapper {
        min-height: 100vh;
    }
    
    .main-content {
        padding-bottom: 15px;
    }
    
    .edition-title {
        margin-left: 10px;
        margin-right: 10px;
        margin-top: 50px;
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .edition-title p {
        margin-left: 5px;
    }
    
    .show-more {
        margin-right: 10px;
        padding-right: 3px;
        margin-bottom: 20px;
    }
    
    .grid-item {
        flex: 0 0 100%;
    }
    .grid-item:empty {
        display: none;
    }
    .grid-container {
        padding: 0 5px;
    }
    .grid-row {
        gap: 10px;
    }
}

/* Estilos para compatibilidad con carrusel existente (si se necesita) */
.carousel-container{
    position: relative;
    max-width: var(--main-width);
    margin: 24px auto 0 auto;
}

.carousel-track{
    overflow: hidden;
    width: 100%;
    display: flex;
    gap: var(--carousel-gap, 16px);
}

/* Mostrar 5 items visibles por carrusel */
.carousel-item{ 
    box-sizing: border-box; 
    padding: 8px; 
    flex: 0 0 calc((100% - (var(--carousel-gap, 16px) * 4)) / 5);
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #a84d20;
}

.carousel-item img { 
    display: block; 
    width: 100%; 
    height: 120px;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 6px;
}

.carousel-item .article-date {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 4px;
    text-align: left;
}

.carousel-item .article-title {
    font-size: 0.85em;
    font-weight: bold;
    margin: 0 0 4px 0;
    text-align: left;
    color: #333;
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.carousel-item .article-summary {
    font-size: 0.75em;
    color: #666;
    text-align: left;
    line-height: 1.2;
    height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.carousel-btn{ 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(168, 77, 32, 0.8); 
    color: #fff; 
    border: none; 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    cursor: pointer; 
    font-size: 18px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 20; 
}

.carousel-btn.prev{ 
    left: calc(-1 * (var(--carousel-btn-offset, 48px))); 
}

.carousel-btn.next{ 
    right: calc(-1 * (var(--carousel-btn-offset, 48px))); 
}

.carousel-btn:hover {
    background: rgba(168, 77, 32, 1);
}

@media (max-width: 600px){
    .carousel-btn{ 
        width: 30px; 
        height: 30px;
        font-size: 16px;
    }
    
    .carousel-btn.prev{ 
        left: -35px; 
    }
    
    .carousel-btn.next{ 
        right: -35px; 
    }
    
    .carousel-item{ 
        flex: 0 0 calc((100% - var(--carousel-gap, 16px)) / 2);
    }
}

@media (max-width: 1000px) and (min-width: 601px) {
    .carousel-item{ 
        flex: 0 0 calc((100% - (var(--carousel-gap, 16px) * 2)) / 3);
    }
}