/* Grid Layout */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem;
    max-width: 1500px;
    margin: 0 auto;
}

/* Card Styles */
.product-box {
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.product-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.product:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-img {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
}

.product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product:hover .product-img img {
    transform: scale(1.05);
}

.product-text {
    padding: 1rem;
}

.box-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: hidden;
    padding-bottom: 0.25rem;
}

.box-author,
.box-category,
.box-date {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    background: #00bcd4;
    color: #fff;
}

.box-author:hover,
.box-category:hover,
.box-date:hover {
    background: #0097a7;
    color: #fff;
}

.box-title {
    margin-bottom: 1rem;
}

.box-title h2 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin: 0;
    color: #333;
}

.box-excerpt {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #666;
}

.read-more {
    color: #00bcd4;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: #0097a7;
}

/* Ad Box Styles */
.ad-box {   
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 2rem;   
    position: relative;
    overflow: visible;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* Normaliza contenedores de anuncios para evitar layouts rotos ("Ver más", etc.) */
.content-ads,
.content-ads-mobile {
    display: block;
    min-height: 300px;
}

/* Asegurar que los creativos de AdSense/Multiplex expanden el contenedor */
.ad-box .adsbygoogle,
.ad-box [class^="goog-"],
.ad-box [id^="aswift_"],
.ad-box iframe {
    display: block !important;
    width: 100% !important; /* asegura que ocupe el ancho del card */
    max-width: 100% !important;
    min-height: 300px !important; /* reserva espacio para que AdSense pinte */
}

/* Sidebar: asegura que los anuncios no colapsen */
.primary-sidebar .widget .content-ads,
.primary-sidebar .widget .content-ads-mobile,
.single-sidebar .widget .content-ads,
.single-sidebar .widget .content-ads-mobile {
    display: block;
    min-height: 300px;
}

.primary-sidebar .widget .adsbygoogle,
.primary-sidebar .widget [class^="goog-"],
.primary-sidebar .widget [id^="aswift_"],
.primary-sidebar .widget iframe,
.single-sidebar .widget .adsbygoogle,
.single-sidebar .widget [class^="goog-"],
.single-sidebar .widget [id^="aswift_"],
.single-sidebar .widget iframe {
    display: block !important;
    width: 100% !important;
    min-height: 300px !important;
}

.ad-box::before {
    content: 'Publicidad';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #00bcd4;
    color: #fff;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ad-box:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.ad-box .widget {
    margin: 0;
}

.ad-box .widget-title {
    display: none;
}

.ad-box img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a{
    display: inline-block;
    padding: 0.5rem 1rem;        
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #00bcd4;
    color: #fff;
    border-color: #00bcd4;
}

.pagination .current {
    background: #00bcd4;
    color: #fff;
    border-color: #00bcd4;
}

.product-box, .product-img, .product-box .product-img, .product-box img {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
