/* ===================================================================
   PUBLICACIONES (Libros y Artículos) — complementa site.css
   Paleta: --primary #eb9626 · --dark #2B2825
   =================================================================== */

/* ── Chips de filtro ─────────────────────────────────────────────── */
.pub-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .85rem;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 500;
    border: 1.5px solid #dee2e6;
    color: #495057;
    background: #fff;
    text-decoration: none;
    transition: border-color .15s, color .15s, background .15s;
    white-space: nowrap;
}

.pub-chip:hover {
    border-color: var(--primary, #eb9626);
    color: var(--primary, #eb9626);
    text-decoration: none;
}

.pub-chip.active {
    background: var(--primary, #eb9626);
    border-color: var(--primary, #eb9626);
    color: #fff;
}

.pub-chip-count {
    font-size: .72rem;
    background: rgba(0, 0, 0, .15);
    border-radius: 50px;
    padding: 0 .4rem;
}

.pub-chip.active .pub-chip-count {
    background: rgba(255, 255, 255, .25);
}

/* ── Cards de publicación ────────────────────────────────────────── */
.pub-card-link {
    transition: transform .2s, box-shadow .2s;
    border-radius: .5rem;
    overflow: hidden;
}

.pub-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12) !important;
    text-decoration: none;
}

.pub-card-img-wrap {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: #e9ecef;
}

.pub-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.pub-card-link:hover .pub-card-img {
    transform: scale(1.04);
}

.pub-badge-tipo {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(43, 40, 37, .85);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    padding: .25rem .65rem;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}

.pub-badge-destacado {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary, #eb9626);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: .22rem .6rem;
    border-radius: 50px;
    letter-spacing: .3px;
}

.pub-card-cat {
    display: inline-flex;
    align-items: center;
    font-size: .75rem;
    font-weight: 600;
    padding: .2rem .6rem;
    border-radius: 50px;
    letter-spacing: .2px;
}

/* ── Paginación — hereda Bootstrap, solo el color activo ─────────── */
.pagination .page-item.active .page-link {
    background-color: var(--primary, #eb9626);
    border-color: var(--primary, #eb9626);
    color: #fff;
}

.pagination .page-link {
    color: var(--dark, #2B2825);
}

.pagination .page-link:hover {
    color: var(--primary, #eb9626);
}

/* ── Detalle: contenido Markdown ─────────────────────────────────── */
.pub-contenido {
    line-height: 1.85;
    font-size: 1.04rem;
    color: var(--dark, #2B2825);
}

.pub-contenido h1,
.pub-contenido h2,
.pub-contenido h3,
.pub-contenido h4,
.pub-contenido h5 {
    margin-top: 2rem;
    margin-bottom: .75rem;
    font-family: "Oswald", sans-serif;
    font-weight: 500;
}

.pub-contenido h2 {
    border-bottom: 2px solid var(--primary, #eb9626);
    padding-bottom: .4rem;
}

.pub-contenido p {
    margin-bottom: 1.2rem;
}

.pub-contenido img {
    max-width: 100%;
    border-radius: .5rem;
    margin: 1rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

.pub-contenido blockquote {
    border-left: 4px solid var(--primary, #eb9626);
    padding: .75rem 1.25rem;
    margin: 1.5rem 0;
    background: #faf3eb;
    border-radius: 0 .4rem .4rem 0;
    color: #555;
    font-style: italic;
}

.pub-contenido pre {
    background: #f1f3f5;
    border-radius: .4rem;
    padding: 1rem;
    overflow-x: auto;
    font-size: .9rem;
    margin-bottom: 1.2rem;
}

.pub-contenido code {
    background: #f1f3f5;
    padding: .1rem .35rem;
    border-radius: .2rem;
    font-size: .88em;
    color: #c7254e;
}

.pub-contenido pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.pub-contenido table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.2rem;
    font-size: .92rem;
}

.pub-contenido table th,
.pub-contenido table td {
    border: 1px solid #dee2e6;
    padding: .5rem .75rem;
    text-align: left;
}

.pub-contenido table thead th {
    background: var(--dark, #2B2825);
    color: #fff;
    font-weight: 600;
}

.pub-contenido table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.pub-contenido ul,
.pub-contenido ol {
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
}

.pub-contenido li {
    margin-bottom: .4rem;
}

/* ── Sidebar autor card ──────────────────────────────────────────── */
.card .list-group-item {
    font-size: .88rem;
}

/* ── Portada detalle con sombra naranja sutil ────────────────────── */
.pub-portada {
    border-radius: .5rem;
    box-shadow: 0 4px 24px rgba(235, 150, 38, .18);
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    margin-bottom: 1.75rem;
}

/* ── Sidebar: borde superior naranja en cards ────────────────────── */
.pub-sidebar-card {
    border-top: 3px solid var(--primary, #eb9626) !important;
    border-radius: .5rem;
}

/* ── CTA section ─────────────────────────────────────────────────── */
.pub-cta {
    border-top: 2px solid var(--primary, #eb9626) !important;
    margin-top: 2rem;
    padding-top: 1.5rem;
}

/* ── Sección relacionadas: título con línea naranja ──────────────── */
.pub-related-title {
    position: relative;
    display: inline-block;
    padding-bottom: .5rem;
}

.pub-related-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary, #eb9626);
    border-radius: 2px;
}

/* ── Responsive tweaks ───────────────────────────────────────────── */
@media (max-width: 575px) {
    .pub-card-img-wrap {
        height: 180px;
    }
    .pub-meta-bar {
        gap: .6rem;
    }
}
