/* =========================================================
   Semantic Related Posts – Estilos Frontend
   Compatible con tema Astra + modo oscuro automático
   ========================================================= */

.srp-section {
    margin: 2.5rem 0 1.5rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
    font-family: inherit;
    --srp-accent: #c0392b; /* rojo de acento por defecto — Pro puede sobreescribir vía inline style */
}

.srp-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #333;
    margin: 0 0 1.25rem;
    position: relative;
}

.srp-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--srp-accent);
    margin-top: 6px;
    border-radius: 2px;
}

/* ── Grid ─────────────────────────────────────────────── */

.srp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

/* ── Card ─────────────────────────────────────────────── */

.srp-card {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    background: #fff;
}

.srp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.srp-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Imagen */
.srp-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
}

.srp-thumb--no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0, #e4e4e4);
}

.srp-no-img-icon {
    font-size: 2rem;
    opacity: 0.4;
}

/* Cuerpo */
.srp-card-body {
    padding: 0.75rem 1rem 1rem;
}

.srp-cat {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--srp-accent);
    margin-bottom: 0.4rem;
    background: color-mix(in srgb, var(--srp-accent) 8%, transparent);
    padding: 2px 7px;
    border-radius: 3px;
}

.srp-post-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.srp-date {
    font-size: 0.72rem;
    color: #888;
}

.srp-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--srp-accent);
}

.srp-price del {
    font-weight: 400;
    opacity: 0.6;
    margin-right: 0.35em;
}

.srp-price ins {
    text-decoration: none;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 600px) {
    .srp-grid {
        grid-template-columns: 1fr;
    }
    .srp-row-thumb {
        flex-basis: 56px;
        width: 56px;
        height: 56px;
    }
}

/* =========================================================
   Estilo: List — filas horizontales con thumbnail pequeño
   ========================================================= */

.srp-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.srp-row {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    background: #fff;
    transition: box-shadow 0.18s ease;
}

.srp-row:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.srp-row-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: inherit;
    padding: 0.6rem;
}

.srp-row-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
}

.srp-row-thumb.srp-thumb--no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.srp-row-body {
    flex: 1;
    min-width: 0; /* permite que el título trunque en vez de desbordar */
}

.srp-row-body .srp-post-title {
    -webkit-line-clamp: 2;
    margin-bottom: 0.25rem;
}

/* =========================================================
   Estilo: Compact — solo texto, sin imágenes
   ========================================================= */

.srp-compact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.srp-compact-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #eee;
}

.srp-compact-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.srp-compact-link {
    color: var(--srp-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.4;
}

.srp-compact-link:hover {
    text-decoration: underline;
}

.srp-compact .srp-date {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Modo oscuro ──────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    .srp-section {
        border-top-color: #3a3a3a;
    }
    .srp-title {
        color: #f0f0f0;
    }
    .srp-card,
    .srp-row {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    }
    .srp-card:hover,
    .srp-row:hover {
        box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    }
    .srp-post-title {
        color: #f0f0f0;
    }
    .srp-date {
        color: #999;
    }
    .srp-thumb--no-image {
        background: linear-gradient(135deg, #2a2a2a, #222);
    }
    .srp-compact-item {
        border-bottom-color: #333;
    }
}
