/* ============================================================
   SIGUEME.NET - Portada
   ============================================================ */

/* ---------- Accesibilidad ---------- */
.sg-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sg-skip {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 1000;
    background: #fff;
    color: var(--brand-primary);
    font-weight: 800;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}
.sg-skip:focus { top: 12px; }

/* ---------- HERO ---------- */
.sg-home-hero { padding: 32px 0; }
.sg-home-hero-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 24px;
    align-items: stretch;
}
.sg-home-hero-main {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}
.sg-home-hero-main:hover { box-shadow: var(--shadow-xl); }

/* Toda la imagen es clicable (enlace oculto a lectores de pantalla) */
.sg-home-hero-media {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 1;
}
.sg-home-hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 0, 0.2, 1);
}
.sg-home-hero-main:hover .sg-home-hero-media img { transform: scale(1.04); }

.sg-home-hero-main::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.9) 100%);
    pointer-events: none;
    z-index: 1;
}
.sg-home-hero-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 3;
    background: var(--brand-accent);
    color: #000;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}
.sg-home-hero-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    color: #fff;
    max-width: 90%;
    pointer-events: none;           /* el clic pasa a la imagen... */
}
.sg-home-hero-content a,
.sg-home-hero-content .sg-home-hero-meta { pointer-events: auto; } /* ...salvo en enlaces */

.sg-home-hero-cat {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--brand-accent);
    margin-bottom: 12px;
}
.sg-home-hero-title {
    font-size: 44px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin: 0 0 16px;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.sg-home-hero-title a { color: inherit; text-decoration: none; }
.sg-home-hero-title a:hover { color: var(--brand-accent); }
.sg-home-hero-excerpt {
    font-size: 17px;
    line-height: 1.55;
    color: rgba(255,255,255,0.92);
    margin-bottom: 20px;
    max-width: 640px;
}
.sg-home-hero-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    flex-wrap: wrap;
}
.sg-home-hero-meta .author {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sg-home-hero-meta .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-accent);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}

/* ---------- LO ÚLTIMO ---------- */
.sg-home-side {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}
.sg-home-side-header {
    padding: 18px 20px;
    border-bottom: 2px solid var(--brand-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sg-home-side-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand-primary);
}
.sg-home-side-header .pulse {
    width: 10px;
    height: 10px;
    background: var(--brand-hot);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
.sg-home-side-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.sg-home-side-list li { border-bottom: 1px solid var(--border); }
.sg-home-side-list li:last-child { border-bottom: none; }
.sg-home-side-list a {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    transition: background var(--transition-fast);
}
.sg-home-side-list a:hover { background: var(--bg-body); }
.sg-home-side-list .num {
    font-size: 22px;
    font-weight: 900;
    color: var(--brand-accent);
    line-height: 1;
    min-width: 30px;
    letter-spacing: -1px;
    flex-shrink: 0;
}
.sg-home-side-list .body { flex: 1; min-width: 0; }
.sg-home-side-list .title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sg-home-side-list a:hover .title { color: var(--brand-primary); }
.sg-home-side-list .meta {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.sg-home-side-list .cat-color {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ---------- GRID DE 4 ---------- */
.sg-home-secondary { padding: 32px 0; }
.sg-home-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ---------- MÁS LEÍDOS ---------- */
.sg-home-trending {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 28px;
    margin: 32px 0;
    box-shadow: var(--shadow-sm);
}
.sg-home-trending h2 {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--brand-primary);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sg-home-trending-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
}
.sg-home-trending-item {
    padding: 0 20px;
    border-right: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: transform var(--transition-fast);
}
.sg-home-trending-item:first-child { padding-left: 0; }
.sg-home-trending-item:last-child { border-right: none; padding-right: 0; }
.sg-home-trending-item:hover { transform: translateY(-3px); }
.sg-home-trending-item .num {
    font-size: 40px;
    font-weight: 900;
    line-height: 0.9;
    color: var(--brand-accent);
    letter-spacing: -3px;
    flex-shrink: 0;
}
.sg-home-trending-item .text {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sg-home-trending-item:hover .text { color: var(--brand-primary); }

/* ---------- BLOQUES EDITORIALES ---------- */
.sg-home-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}
.sg-home-editorial {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.sg-home-editorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
}
.sg-home-editorial-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--brand-primary);
}
.sg-home-editorial-title .emoji {
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.sg-home-editorial-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition-base);
}
.sg-home-editorial-link:hover { gap: 12px; }

.sg-home-editorial-grid { display: grid; grid-template-columns: 1.2fr 1fr; }
.sg-home-editorial-featured {
    padding: 28px;
    border-right: 1px solid var(--border);
}
.sg-home-editorial-featured .image {
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 20px;
    background: #e0e0e0;
}
.sg-home-editorial-featured .image a { display: block; width: 100%; height: 100%; }
.sg-home-editorial-featured .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}
.sg-home-editorial-featured:hover .image img { transform: scale(1.05); }
.sg-home-editorial-featured h3 {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.8px;
    color: var(--text-primary);
    margin: 0 0 12px;
}
.sg-home-editorial-featured h3 a { color: inherit; text-decoration: none; }
.sg-home-editorial-featured:hover h3 a { color: var(--brand-primary); }
.sg-home-editorial-featured p {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sg-home-editorial-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sg-home-editorial-list { list-style: none; margin: 0; padding: 14px 0; }
.sg-home-editorial-list li { border-bottom: 1px solid var(--border); }
.sg-home-editorial-list li:last-child { border-bottom: none; }
.sg-home-editorial-list a {
    display: flex;
    gap: 16px;
    padding: 14px 28px;
    align-items: center;
    transition: background var(--transition-fast);
}
.sg-home-editorial-list a:hover { background: var(--bg-body); }
.sg-home-editorial-list .num {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-muted);
    min-width: 28px;
    letter-spacing: -0.5px;
    opacity: 1.5;
}
.sg-home-editorial-list .body { flex: 1; min-width: 0; }
.sg-home-editorial-list .title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sg-home-editorial-list a:hover .title { color: var(--brand-primary); }
.sg-home-editorial-list .meta { font-size: 12px; color: var(--text-muted); }

/* ---------- CARRUSEL DE SALMOS ---------- */
.sg-home-carousel {
    background: linear-gradient(135deg, #0a2540 0%, #1e3a5f 100%);
    border-radius: var(--radius-md);
    padding: 32px 0;
    margin: 32px 0;
    overflow: hidden;
    color: #fff;
}
.sg-home-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px 20px;
}
.sg-home-carousel-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.5px;
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sg-home-carousel-title .emoji {
    background: #7f8c8d;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.sg-home-carousel-nav { display: flex; gap: 8px; }
.sg-home-carousel-nav button {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background var(--transition-fast);
}
.sg-home-carousel-nav button:hover,
.sg-home-carousel-nav button:focus-visible { background: rgba(255,255,255,0.3); }
.sg-home-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 0 28px 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.sg-home-carousel-track::-webkit-scrollbar { display: none; }
.sg-home-carousel-track:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: -2px;
}
.sg-salmo-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 18px;
    transition: all var(--transition-base);
}
.sg-salmo-card:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-4px);
    border-color: var(--brand-accent);
}
.sg-salmo-card .num {
    font-size: 12px;
    font-weight: 800;
    color: var(--brand-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.sg-salmo-card .title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sg-salmo-card .excerpt {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- LIBROS MÁS LEÍDOS ---------- */
.sg-home-books {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 32px 28px;
    margin: 32px 0;
    box-shadow: var(--shadow-sm);
}
.sg-home-books h2 {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--brand-primary);
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sg-home-books-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.sg-home-book {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
}
.sg-home-book:hover { transform: translateY(-4px); }
.sg-home-book-cover {
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.sg-home-book-cover img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: transform var(--transition-base);
}
.sg-home-book:hover .sg-home-book-cover img { transform: scale(1.04); }
.sg-home-book-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--brand-primary);
    margin-bottom: 4px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-fast);
    min-height: 36px;
}
.sg-home-book:hover .sg-home-book-title { color: var(--brand-accent); }
.sg-home-book-author {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .sg-home-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .sg-home-hero-grid { grid-template-columns: 1fr; }
    .sg-home-trending-list { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .sg-home-trending-item { border-right: none; padding: 0; }
    .sg-home-editorial-grid { grid-template-columns: 1fr; }
    .sg-home-editorial-featured { border-right: none; border-bottom: 1px solid var(--border); }
    .sg-home-editorial-featured h3 { font-size: 22px; }
    .sg-home-2col { grid-template-columns: 1fr; }
    .sg-home-books-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .sg-home-hero-main { min-height: 340px; }
    .sg-home-hero-title { font-size: 26px; letter-spacing: -0.5px; }
    .sg-home-hero-content { padding: 22px; }
    .sg-home-hero-excerpt { font-size: 15px; }
}
@media (max-width: 560px) {
    .sg-home-grid-4 { grid-template-columns: 1fr; }
    .sg-home-trending-list { grid-template-columns: 1fr; }
    .sg-home-books-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .sg-home-book-title { font-size: 13px; }
    .sg-home-book-author { font-size: 11px; }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .sg-home-side-header .pulse { animation: none; }
    .sg-home-hero-media img,
    .sg-home-editorial-featured .image img,
    .sg-home-book-cover img { transition: none; }
}