:root {
    --bg-dark: #050505;
    --bg-gradient-top: #2d2d2d; /* Degradado oscuro plata */
    --bg-card: rgba(15, 15, 15, 0.6);
    --gold-primary: #C0C0C0;
    --gold-light: #E5E4E2;
    --gold-dark: #8A8D8F;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(160deg, var(--bg-gradient-top) 0%, var(--bg-dark) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Effects */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
}

.golden-glow {
    position: fixed;
    top: -20vh;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 40vh;
    background: radial-gradient(ellipse at center, rgba(192, 192, 192, 0.15) 0%, rgba(0,0,0,0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* Hero Section */
.hero {
    height: 100vh; /* Ocupa exactamente el alto de la pantalla */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    animation: fadeIn 2s ease forwards;
}

.subtitle {
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--gold-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 4.5rem); /* Ajuste de escala de fuente */
    font-weight: 700;
    background: linear-gradient(to right, var(--gold-light), var(--gold-primary), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 0 40px rgba(192, 192, 192, 0.2);
}

.description {
    font-size: 1.05rem; /* Fuente reducida para aligerar el hero */
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--gold-primary);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-top: 3rem;
    animation: bounce 2s infinite;
}

.arrow {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, var(--gold-primary), transparent);
}

/* Grid Container */
.grid-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
}

/* Loader */
.loader {
    text-align: center;
    padding: 5rem 0;
    color: var(--gold-primary);
    font-family: var(--font-heading);
    letter-spacing: 2px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(192, 192, 192, 0.2);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

/* Relatos Grid */
.relatos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Tarjetas compactas, ideal para 3 columnas */
    gap: 1.2rem;
    padding: 1rem 2rem;
    opacity: 1;
    transition: opacity 1s ease;
}

.relatos-grid.hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

/* Card Design */
.relato-card {
    background: var(--bg-card);
    border: 1px solid rgba(192, 192, 192, 0.1);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.relato-card:hover {
    transform: translateY(-10px);
    border-color: rgba(192, 192, 192, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(192, 192, 192, 0.1);
}

.card-image-container {
    position: relative;
    height: 120px; /* Altura ultra reducida */
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.relato-card:hover .card-image {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5,5,5,0.9), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
}

.relato-card:hover .card-overlay {
    opacity: 1;
}

.play-audio-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(192, 192, 192, 0.2);
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: var(--transition-smooth);
}

.play-audio-btn:hover {
    background: var(--gold-primary);
    color: var(--bg-dark);
    transform: scale(1.1);
}

.play-audio-btn svg {
    width: 24px;
    height: 24px;
    margin-left: 4px;
}

.card-content {
    padding: 1rem; /* Reducción al límite del espacio interno */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold-primary);
    margin-bottom: 0.4rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1rem; /* Título aún más pequeño */
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.card-excerpt {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0; /* Eliminado el margen inferior gigante */
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Solo muestra 2 líneas de texto */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.8rem;
    margin-top: 0.8rem;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.read-more {
    color: var(--gold-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.read-more:hover {
    color: var(--gold-light);
}

/* Audio Player Settings */
.audio-player {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(192, 192, 192, 0.2);
}

.audio-player.hidden {
    display: none;
}

.elevenlabs-audio {
    width: 100%;
    height: 30px;
    outline: none;
}

.elevenlabs-audio::-webkit-media-controls-panel {
    background-color: rgba(192, 192, 192, 0.1);
}
.elevenlabs-audio::-webkit-media-controls-current-time-display,
.elevenlabs-audio::-webkit-media-controls-time-remaining-display {
    color: var(--gold-primary);
}

.audio-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Responsive */
@media (max-width: 768px) {
    .title { font-size: 3rem; }
    .hero { padding: 1rem; }
    .grid-container { padding: 2rem 1rem; }
    .back-to-hub { top: 1rem; left: 1rem; font-size: 0.8rem; }
}

/* Boton Volver al Portal */
.back-to-hub {
    position: absolute;
    top: 2rem;
    left: 2rem;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    transition: var(--transition-smooth);
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.back-to-hub:hover {
    color: var(--gold-light);
    background: rgba(0,0,0,0.6);
    border-color: var(--gold-primary);
}
