/*
 * QN Custom Content Grid — Frontend Styles
 * Tarjetas responsive con CSS Grid
 */

/* ── Grid principal ── */
.qn-ccg-grid {
    display: grid;
    grid-template-columns: repeat(var(--qn-cols-desktop, 3), 1fr);
    gap: 20px;
    width: 100%;
}

/* ── Tarjeta individual ── */
.qn-ccg-card {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qn-ccg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ── Imagen destacada ── */
.qn-ccg-card-image {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.qn-ccg-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.qn-ccg-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.qn-ccg-card:hover .qn-ccg-card-image img {
    transform: scale(1.05);
}

/* Proporciones de imagen */
.qn-ccg-img-auto { aspect-ratio: auto; }
.qn-ccg-img-1-1  { aspect-ratio: 1 / 1; }
.qn-ccg-img-4-3  { aspect-ratio: 4 / 3; }
.qn-ccg-img-16-9 { aspect-ratio: 16 / 9; }
.qn-ccg-img-3-2  { aspect-ratio: 3 / 2; }
.qn-ccg-img-21-9 { aspect-ratio: 21 / 9; }

/* ── Badge de tipo de contenido ── */
.qn-ccg-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(22, 33, 62, 0.85);
    color: #ffffff;
    font-size: 0.75em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* ── Cuerpo de la tarjeta ── */
.qn-ccg-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Título ── */
.qn-ccg-card-title {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    line-height: 1.4;
    font-weight: 600;
}

.qn-ccg-card-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s ease;
}

.qn-ccg-card-title a:hover {
    color: #0f3460;
    text-decoration: underline;
}

/* ── Fecha ── */
.qn-ccg-card-date {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 10px;
}

/* ── Extracto ── */
.qn-ccg-card-excerpt {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    flex: 1;
}

/* ── Botón "Leer más" ── */
.qn-ccg-card-btn {
    display: inline-block;
    align-self: flex-start;
    background-color: #16213e;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease;
    margin-top: auto;
}

.qn-ccg-card-btn:hover {
    background-color: #0f3460;
    color: #ffffff;
}

/* ── Responsive ── */

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
    .qn-ccg-grid {
        grid-template-columns: repeat(var(--qn-cols-tablet, 2), 1fr);
    }
}

/* Móvil (≤ 768px) */
@media (max-width: 768px) {
    .qn-ccg-grid {
        grid-template-columns: repeat(var(--qn-cols-mobile, 1), 1fr);
    }

    .qn-ccg-card-title {
        font-size: 1em;
    }

    .qn-ccg-card-body {
        padding: 15px;
    }

    .qn-ccg-card-excerpt {
        font-size: 0.9em;
    }
}

/* Móvil pequeño (≤ 480px) */
@media (max-width: 480px) {
    .qn-ccg-card-badge {
        font-size: 0.7em;
        padding: 3px 8px;
    }
}
