/**
 * Living - Estilo Netflix/Flix.id
 * Estructura única con featured content, categorías y grid
 */

/* ============================================
   VARIABLES
   ============================================ */
:root {
    --living-warm-1: #D4754E;
    --living-warm-2: #C86B45;
    --living-warm-3: #B85D3A;
    --living-warm-4: #8B4332;
    --living-warm-5: #5C2D22;
    
    --living-text-light: var(--text-primary);
    --living-text-gold: var(--icon-button);
    --living-text-muted: var(--text-muted);
    --living-text-whisper: var(--text-disabled);
    
    --living-bg-deep: var(--bg-primary);
    --living-bg-surface: var(--bg-secondary);
    --living-bg-card: var(--bg-card);
    --living-bg-card-hover: var(--bg-hover);
    --living-bg-glass: var(--bg-card);
    
    --living-shadow-soft: var(--shadow-card);
    --living-shadow-medium: var(--shadow-hover);
    --living-shadow-deep: var(--shadow-floating);
    
    --living-spacing-section: 3rem;
    --living-spacing-card: 1.5rem;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.living-main-content {
    /* Asegurar que el scroll funcione correctamente */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    max-height: none !important;
}

/* #app-container > main > div (living): sin padding superior ni inferior */
.living-container {
    padding: 0;
    margin: 0;
    min-height: 100vh;
    height: auto;
    background: var(--living-bg-deep);
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    box-sizing: border-box;
}

/* Con sidebar colapsado, #app-container ya tiene el offset; no duplicar. */
.side-navigation.collapsed ~ * .living-container,
body.sidebar-collapsed .living-container {
    margin-left: 0;
}

@media (max-width: 768px) {
    .living-container {
        margin-left: 0;
    }
}

/* ============================================
   SECCIÓN 1: HERO/ENCABEZADO - Producciones Automatizadas
   Jerarquía: Protagonista absoluto, mesa de edición, daily output
   ============================================ */
.living-hero-section {
    padding: var(--app-header-height, 45.8px) 4rem 5rem; /* Arriba: altura header fijo; contenedor sin padding */
    max-width: 1800px;
    margin: 0 auto;
    /* Aire alrededor, no full-width */
}

.living-hero-container {
    max-width: 1200px; /* Más estrecho para dar aire */
    margin: 0 auto;
    /* El contenedor respira */
}

.living-hero-title {
    font-size: 1.5rem;
    font-weight: 500; /* Más sutil, no grita */
    color: var(--living-text-light);
    margin-bottom: 2.5rem; /* Más espacio */
    letter-spacing: -0.3px;
    opacity: 0.9; /* No compite con las imágenes */
    text-transform: none;
    font-style: normal;
}

.living-hero-grid {
    display: flex;
    gap: 2rem; /* Más espacio entre cards, respiran */
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0 2rem; /* Aire arriba y abajo */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 117, 78, 0.2) transparent; /* Más sutil */
}

.living-hero-grid::-webkit-scrollbar {
    height: 8px;
}

.living-hero-grid::-webkit-scrollbar-track {
    background: transparent;
}

.living-hero-grid::-webkit-scrollbar-thumb {
    background: rgba(212, 117, 78, 0.3);
    border-radius: 4px;
}

.living-hero-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 117, 78, 0.5);
}

/* ============================================
   SECCIONES 2 Y 3: Grid de 2 columnas - Contenedores separados
   Jerarquía: Flujo continuo (izq) + Soporte estratégico (der)
   ============================================ */
.living-sections-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem; /* Más separación entre secciones */
    padding: 0 0 var(--living-spacing-section) 4rem; /* Padding solo a la izquierda y abajo */
    max-width: none; /* Sin límite de ancho para que llegue a la derecha */
    margin: 0; /* Sin margin auto para que no se centre */
    width: 100%; /* Ocupa todo el ancho disponible */
}

/* ============================================
   SECCIÓN 2: HISTORIAL DE PRODUCCIONES
   Archivo operativo - Productora/Estudio/Archivo creativo
   ============================================ */
.living-history-section {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    min-height: 400px;
}

/* Bloque A: Historial de Video - Strip editorial */
.living-history-videos-block {
    width: 100%;
}

.living-history-videos-strip {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0 2rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.living-history-videos-strip::-webkit-scrollbar {
    height: 8px;
}

.living-history-videos-strip::-webkit-scrollbar-track {
    background: transparent;
}

.living-history-videos-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Card de video - Strip editorial */
.history-video-card {
    flex: 0 0 auto;
    position: relative;
    cursor: pointer;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Altura consistente, ancho variable según ratio */
    height: 240px;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

.history-video-card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg-card);
}

/* Overlay mínimo - Solo iconos esenciales */
.history-video-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    pointer-events: none;
}

.history-video-card:hover .history-video-card-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* Icono de video sutil */
.history-video-card-video-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.history-video-card:hover .history-video-card-video-icon {
    opacity: 1;
}

/* Botón descargar */
.history-video-card-download {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: all;
    font-size: 0.875rem;
}

.history-video-card:hover .history-video-card-download {
    opacity: 1;
}

.history-video-card-download:hover {
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 1);
}

/* Duración (si aplica) */
.history-video-card-duration {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-video-card:hover .history-video-card-duration {
    opacity: 1;
}

/* Bloque B: Historial de Imágenes - Masonry real */
.living-history-images-block {
    width: 100%;
}

.living-history-masonry {
    column-count: 3;
    column-gap: 1.5rem;
    column-fill: balance;
}

.living-masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
}

/* Card de imagen - Flota sobre fondo oscuro */
.history-image-card {
    width: 100%;
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.history-image-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.history-image-card img {
    width: 100%;
    height: auto;
    display: block;
    /* Sin object-fit - respeta 100% el ratio original */
}

/* Overlay al hover - Acciones */
.history-image-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: background 0.3s ease;
    pointer-events: none;
}

.history-image-card:hover .history-image-card-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.history-image-card-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    pointer-events: all;
    font-size: 0.875rem;
}

.history-image-card:hover .history-image-card-action {
    opacity: 1;
    transform: scale(1);
}

.history-image-card-action:hover {
    background: rgba(0, 0, 0, 0.8);
    color: rgba(255, 255, 255, 1);
}

/* Card de texto - Minimalista */
.history-text-card {
    width: 100%;
    min-height: 200px;
    border-radius: 12px;
    background: rgba(15, 17, 21, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.history-text-card:hover {
    background: rgba(15, 17, 21, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.history-text-card-icon {
    font-size: 2.5rem;
    color: var(--living-text-muted);
    opacity: 0.4;
    font-weight: 300;
    transition: opacity 0.3s ease;
}

.history-text-card:hover .history-text-card-icon {
    opacity: 0.6;
}

.history-text-card-title {
    font-size: 0.875rem;
    color: var(--living-text-muted);
    opacity: 0.6;
    font-weight: 400;
    text-align: center;
    padding: 0 1rem;
}

/* Estado vacío - Elegante y aspiracional */
.living-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 400px;
}

.living-history-empty-illustration {
    width: 200px;
    height: 200px;
    margin-bottom: 2rem;
    opacity: 0.3;
    background: linear-gradient(135deg, rgba(212, 117, 78, 0.1) 0%, rgba(184, 93, 58, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.living-history-empty-illustration::before {
    content: '';
    position: absolute;
    inset: 20px;
    border: 2px solid rgba(212, 117, 78, 0.2);
    border-radius: 50%;
}

.living-history-empty-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--living-text-light);
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.living-history-empty-description {
    font-size: 0.938rem;
    color: var(--living-text-muted);
    line-height: 1.6;
    max-width: 500px;
    margin-bottom: 2rem;
    opacity: 0.7;
}

.living-history-empty-cta {
    padding: 0.75rem 1.5rem;
    background: var(--living-bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--living-text-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.living-history-empty-cta:hover {
    background: var(--living-bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Sección 3: Destacados / Control (Derecha) */
/* No compite visualmente, acompaña - Mesa del productor */
.living-highlights-section {
    min-height: 400px;
    margin-right: 0; /* Sin margin derecho */
    padding-right: 2rem; /* Padding mínimo para que no toque el borde */
    /* Pegado a la derecha - contenedor independiente */
    width: 100%; /* Ocupa todo el espacio de su columna del grid */
}

.living-highlights-content {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Más compacto */
}

/* Cards de destacados - Estilo similar a brands */
.highlight-card {
    background: var(--bg-card) !important;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border-divider) !important;
    cursor: default !important;
    transition: none !important;
}

.highlight-card:hover {
    background: var(--bg-card) !important;
    border-color: var(--border-divider) !important;
}

.highlight-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--living-text-gold);
    margin: 0 0 1rem 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight-card-title i {
    font-size: 0.875rem;
    opacity: 1;
    color: var(--living-text-gold);
}

.highlight-card-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.highlight-card-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
}

.highlight-card-subtitle {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
}

/* Responsive para grid de 2 columnas */
@media (max-width: 1024px) {
    .living-sections-wrapper {
        grid-template-columns: 1fr;
    }
    
    .living-history-masonry {
        column-count: 2;
    }
    
    .history-video-card {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .living-hero-section,
    .living-sections-wrapper {
        padding: 0 2rem var(--living-spacing-section);
    }
    
    .living-hero-grid .featured-card {
        width: 250px;
    }
    
    .living-history-masonry {
        column-count: 1;
    }
    
    .history-video-card {
        height: 180px;
    }
    
    .living-history-section {
        gap: 2rem;
    }
    
    .living-history-empty-illustration {
        width: 150px;
        height: 150px;
    }
}

/* Card de producción - para Hero (scroll horizontal) */
.living-hero-grid .featured-card {
    flex: 0 0 auto;
    width: 260px; /* Más pequeñas */
    border-radius: 12px; /* Más sutil */
    overflow: hidden;
    position: relative;
    cursor: pointer; /* Ahora sí pide interacción para abrir modal */
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3); /* Sombra más suave */
    background: var(--living-bg-card);
    display: inline-block;
}

.living-hero-grid .featured-card:hover {
    transform: translateY(-2px); /* Movimiento más sutil */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.featured-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--living-shadow-deep);
    z-index: 10;
}

/* Overlay oscuro en hover */
.featured-card:hover .featured-card-visual::after {
    opacity: 1;
}

.featured-card-visual {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 1;
    display: block;
    line-height: 0; /* Eliminar espacio extra debajo de la imagen */
}

.featured-card-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.featured-card-visual img {
    width: 100%;
    height: auto;
    display: block;
    /* La imagen mantiene su aspect ratio natural */
    /* No usar object-fit para que respete el tamaño original */
}

.featured-card-visual-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(212, 117, 78, 0.3) 0%, 
        rgba(184, 93, 58, 0.2) 50%,
        rgba(92, 45, 34, 0.3) 100%);
    color: var(--living-text-whisper);
    font-size: 4rem;
}

/* Overlay del prompt - aparece en hover */
.featured-card-prompt-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 3;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-height: 60%;
    overflow: hidden;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.8) 50%,
        transparent 100%
    );
}

.featured-card:hover .featured-card-prompt-overlay {
    opacity: 1;
    transform: translateY(0);
}

.featured-card-prompt-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--living-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.featured-card-prompt-text {
    font-size: 0.938rem;
    font-weight: 400;
    color: var(--living-text-light);
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.5rem;
    /* Fade en la parte inferior */
    mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
}

.featured-card-prompt-text::-webkit-scrollbar {
    width: 4px;
}

.featured-card-prompt-text::-webkit-scrollbar-track {
    background: transparent;
}

.featured-card-prompt-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* Botón de descarga - esquina inferior derecha */
.featured-card-download-btn {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--living-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.featured-card-download-btn:hover {
    background: rgba(212, 117, 78, 0.9);
    border-color: rgba(212, 117, 78, 0.5);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.featured-card-download-btn i {
    font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 768px) {
    .living-grid-section {
        padding: 0 2rem var(--living-spacing-section);
    }
    
    .living-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .featured-card {
        border-radius: 12px;
    }
    
    .featured-card-prompt-overlay {
        padding: 1.5rem;
        max-height: 70%;
    }
    
    .featured-card-prompt-title {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    }
    
    .featured-card-prompt-text {
        font-size: 0.875rem;
        max-height: 150px;
    }
    
    .featured-card-download-btn {
        width: 40px;
        height: 40px;
        bottom: 1rem;
        right: 1rem;
    }
    
    .featured-card-download-btn i {
        font-size: 1rem;
    }
}

/* ============================================
   CATEGORIES SECTION
   ============================================ */
.living-categories-section {
    padding: 0 4rem var(--living-spacing-section);
    max-width: 1800px;
    margin: 0 auto;
}

.living-categories-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.875rem 1.5rem;
    background: var(--living-bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--living-text-muted);
    font-size: 0.938rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.category-btn:hover {
    background: var(--living-bg-card);
    border-color: rgba(212, 117, 78, 0.3);
    color: var(--living-text-light);
    transform: translateY(-2px);
}

.category-btn.active {
    background: rgba(212, 117, 78, 0.2);
    border-color: rgba(212, 117, 78, 0.4);
    color: var(--living-text-gold);
}

.category-btn i {
    font-size: 0.875rem;
}

/* ============================================
   CONTENT GRID SECTION
   ============================================ */
.living-content-section {
    padding: 0 4rem var(--living-spacing-section);
    max-width: 1800px;
    margin: 0 auto;
}

.living-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.living-content-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--living-text-light);
    margin: 0;
    letter-spacing: -0.5px;
}

.living-content-actions {
    display: flex;
    gap: 0.75rem;
}

.content-action-btn {
    width: 40px;
    height: 40px;
    background: var(--living-bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--living-text-muted);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-action-btn:hover {
    background: var(--living-bg-card);
    border-color: rgba(212, 117, 78, 0.3);
    color: var(--living-text-light);
    transform: translateY(-2px);
}

.living-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: var(--living-bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--living-shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.content-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--living-shadow-medium);
    border-color: rgba(212, 117, 78, 0.3);
}

.content-card-image-container {
    width: 100%;
    min-height: 200px;
    max-height: 500px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.content-card-image {
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: 500px;
    object-fit: cover;
    object-position: center;
    display: block;
    /* Permitir que la imagen mantenga su proporción natural */
    min-width: 0;
}

.content-card-image-placeholder {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    aspect-ratio: 16/10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(212, 117, 78, 0.1) 0%, rgba(184, 93, 58, 0.1) 100%);
    color: var(--living-text-whisper);
    font-size: 2rem;
}

.content-card-info {
    padding: 1.25rem;
}

.content-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--living-text-light);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.813rem;
    color: var(--living-text-muted);
}

.content-card-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--living-text-gold);
}

.content-card-year {
    color: var(--living-text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1600px) {
    .living-featured-section,
    .living-categories-section,
    .living-content-section {
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media (max-width: 1200px) {
    .living-featured-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .featured-card {
        flex-direction: column;
        text-align: center;
    }
    
    .featured-card-visual {
        width: 100%;
        max-width: 400px;
    }
    
    .living-content-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .living-container {
        margin-left: 0;
    }
    
    .living-featured-section,
    .living-categories-section,
    .living-content-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .featured-card {
        padding: 2rem;
        min-height: 280px;
    }
    
    .featured-card-title {
        font-size: 1.5rem;
    }
    
    .living-categories-bar {
        gap: 0.75rem;
    }
    
    .category-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .living-content-title {
        font-size: 1.5rem;
    }
    
    .living-content-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* ============================================
   MODAL DE VISUALIZACIÓN - Diseño Simple
   ============================================ */
/* ============================================
   MODAL DE VISUALIZACIÓN - Editorial Card Premium
   ============================================ */
.living-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000; /* Muy alto para estar sobre todo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease-out, visibility 0.35s ease-out;
    pointer-events: none;
}

.living-viewer-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Overlay con blur suave */
.living-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

/* Card flotante principal */
.living-viewer-container {
    position: relative;
    z-index: 1000;
    background: var(--living-bg-surface);
    border-radius: 24px;
    width: 90vw;
    max-width: 1400px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3);
    margin: 0;
    animation: modalIn 0.35s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Botón cerrar */
.living-viewer-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--living-text-light);
    font-size: 1.125rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.living-viewer-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Layout interno - 2 columnas */
.living-viewer-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr; /* ~55-60% imagen, ~40-45% info */
    width: 100%;
    height: 100%;
    max-height: 90vh;
    overflow: hidden;
}

/* Columna izquierda - VISUAL */
.living-viewer-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--living-bg-deep);
    padding: 2rem;
    overflow: hidden;
    position: relative;
}

.living-viewer-visual img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* NUNCA cover */
    border-radius: 16px;
    display: block;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

/* Columna derecha - CONTENIDO EDITORIAL */
.living-viewer-editorial {
    display: flex;
    flex-direction: column;
    padding: 32px;
    gap: 20px;
    overflow-y: auto;
    background: var(--living-bg-surface);
}

/* Labels editoriales */
.living-viewer-label {
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--living-text-muted);
    font-weight: 500;
    margin: 0 0 12px 0;
    display: block;
}

/* Prompt - texto principal */
.living-viewer-prompt {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.living-viewer-prompt-text {
    font-size: 16px;
    line-height: 1.6;
    color: var(--living-text-light);
    margin: 0;
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

.living-viewer-prompt-text::-webkit-scrollbar {
    width: 6px;
}

.living-viewer-prompt-text::-webkit-scrollbar-track {
    background: transparent;
}

.living-viewer-prompt-text::-webkit-scrollbar-thumb {
    background: rgba(212, 117, 78, 0.3);
    border-radius: 3px;
}

/* Metadata */
.living-viewer-metadata {
    flex-shrink: 0;
}

.living-viewer-metadata-content {
    font-size: 13px;
    color: var(--living-text-muted);
    line-height: 1.5;
}

.metadata-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.metadata-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.metadata-label {
    font-weight: 600;
    color: var(--living-text-gold);
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-value {
    color: var(--living-text-muted);
    word-break: break-word;
}

.metadata-value pre {
    background: var(--living-bg-deep);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 12px;
    margin-top: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--living-text-light);
}

/* Acciones */
.living-viewer-actions {
    margin-top: auto;
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.living-viewer-download {
    background: var(--living-bg-card);
    border: none;
    border-radius: 999px;
    padding: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--living-text-light);
    font-size: 16px;
    transition: background 0.2s ease;
}

.living-viewer-download:hover {
    background: var(--living-bg-card-hover);
}

/* Responsive */
@media (max-width: 1200px) {
    .living-viewer-container {
        max-width: 95vw;
    }
    
    .living-viewer-content {
        grid-template-columns: 1fr;
        max-height: 90vh;
    }
    
    .living-viewer-visual {
        max-height: 50vh;
        padding: 1.5rem;
    }
    
    .living-viewer-editorial {
        padding: 24px;
    }
}
