/* GC Poemas Viewer — lista lateral + escenario con animación verso a verso */

.gc-poemas-viewer {
    --gc-maroon: #7a1f2b;
    --gc-maroon-dark: #5c1621;
    --gc-black: #121212;
    --gc-black-soft: #1a1414;
    --gc-cream: #f5efe6;
    --gc-cream-dim: #d8cabb;

    background: linear-gradient(180deg, var(--gc-maroon) 0%, var(--gc-maroon-dark) 100%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    font-family: Georgia, 'Times New Roman', serif;
}

.gc-poemas-widget-title {
    color: var(--gc-cream);
    font-size: 1.8rem;
    font-weight: normal;
    letter-spacing: 0.02em;
    margin: 0;
    padding: 1.5rem 2rem 0.5rem 2rem;
    border-bottom: 1px solid rgba(245,239,230,0.12);
}

.gc-poemas-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: var(--gc-poemas-height, 620px);
}

/* ---------- Lista lateral ---------- */
.gc-poemas-list {
    display: flex;
    flex-direction: column;
    padding: 2rem 0.5rem;
    gap: 0.15rem;
    border-right: 1px solid rgba(245,239,230,0.15);
}

.gc-poema-item {
    background: transparent;
    border: none;
    color: var(--gc-cream-dim);
    text-align: left;
    font-family: inherit;
    font-size: 1.05rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.gc-poema-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0%;
    background: var(--gc-cream);
    border-radius: 2px;
    transition: height 0.25s ease;
}

.gc-poema-item:hover {
    color: var(--gc-cream);
    padding-left: 1.3rem;
}

.gc-poema-item.is-active {
    color: var(--gc-cream);
    font-weight: bold;
    background: rgba(0,0,0,0.18);
}

.gc-poema-item.is-active::before {
    height: 65%;
}

/* ---------- Escenario del poema ---------- */
.gc-poemas-stage {
    position: relative;
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

.gc-poema-content {
    display: none;
}

.gc-poema-content.is-active {
    display: block;
}

.gc-poema-text {
    color: var(--gc-cream);
    font-size: 1.15rem;
    line-height: 1.9;
    user-select: text; /* el texto es normal y seleccionable, a diferencia del PDF */
}

/* Letra capitular en la primera letra del poema (opcional desde el bloque) */
.gc-poemas-viewer.has-drop-cap .gc-poema-text::first-letter {
    float: left;
    font-size: 3.4em;
    line-height: 0.8;
    padding: 0.05em 0.08em 0 0;
    font-style: normal;
    font-weight: bold;
}

.gc-poema-line {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
}

.gc-poema-content.is-animating .gc-poema-line {
    animation: gc-poema-fade-up 0.55s ease forwards;
    animation-delay: calc(var(--gc-line-i) * 45ms + 150ms);
}

.gc-poem-blank {
    line-height: 0.6em;
}

@keyframes gc-poema-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Respeta a quienes prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .gc-poema-line {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .gc-poemas-grid {
        grid-template-columns: 1fr;
    }
    .gc-poemas-widget-title {
        padding: 1.25rem 1.25rem 0.5rem 1.25rem;
        font-size: 1.5rem;
    }
    .gc-poemas-list {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid rgba(245,239,230,0.15);
        padding: 1rem;
    }
    .gc-poema-item.is-active::before {
        display: none;
    }
    .gc-poemas-stage {
        padding: 1.5rem;
    }
}
