/*--------------------------------------------------------------
# Archivo: front-page.css
# Se carga SÓLO en la página de inicio.
--------------------------------------------------------------*/

.section-title {
    font-size: 2.25rem;
    font-family: var(--font-family-serif);
    text-align: center;
    margin-top: 0;
    margin-bottom: calc(var(--spacing) * 2.5);
}

/* --- Hero Section v3 (Extremo y Minimalista) --- */
.hero-section-v3 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: calc(var(--spacing) * 2) 0;
    text-align: center;
    color: var(--color-text-light);
    background-color: var(--color-dark-bg);
    overflow: hidden;
}
.hero-background-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(17, 24, 39, 0.8) 0%, rgba(17, 24, 39, 1) 70%);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px; /* Aumentamos el ancho del contenedor del buscador */
}
.hero-title {
    font-family: var(--font-family-serif);
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -1px;
    margin: 0 0 1rem 0;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: #D1D5DB;
    max-width: 60ch;
    margin: 0 auto calc(var(--spacing) * 2) auto;
}
#typing-animation {
    font-weight: 600;
    color: var(--color-background);
}
#typing-animation::after {
    content: '|';
    animation: blink 0.7s infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}


/* --- Buscador Avanzado --- */
.hero-search-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.hero-search-form {
    display: flex;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease-in-out;
}
.hero-search-form:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.4);
}
.hero-search-wrapper .search-field {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    background-color: transparent;
    border: none;
    color: white;
    outline: none;
}
.hero-search-wrapper .search-field::placeholder {
    color: #9CA3AF;
}
.hero-search-wrapper .search-submit {
    background-color: var(--color-primary);
    border: none;
    color: white;
    padding: 0 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease-in-out;
}
.hero-search-wrapper .search-submit:hover {
    background-color: var(--color-secondary);
}


/* --- Resultados de Búsqueda en Vivo --- */
#live-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background-color: #1F2937; /* Un gris oscuro un poco más claro */
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 100;
    text-align: left;
    overflow: hidden;
    display: none; /* Se mostrará con JS */
}
.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.search-result-item a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--color-text-light);
    text-decoration: none;
    border-bottom: 1px solid #374151;
    transition: background-color 0.2s ease-in-out;
}
.search-result-item:last-child a {
    border-bottom: none;
}
.search-result-item a:hover {
    background-color: var(--color-primary);
    color: white;
}
.live-search-message {
    padding: 1rem 1.25rem;
    color: #9CA3AF;
}
.live-search-loading {
    padding: 1rem 1.25rem;
    color: #9CA3AF;
    text-align: center;
}


/* --- Features Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing);
    text-align: center;
}
.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}
.feature-item p {
    color: #6B7280;
    margin: 0;
}

/* --- Topics Grid con Imágenes de Categoría --- */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing);
}
.topic-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    background-size: cover;
    background-position: center;
}
.topic-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: black;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}
.topic-card:hover::before {
    opacity: 0;
}
.topic-card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%);
}
.topic-card-title {
    position: absolute;
    bottom: var(--spacing);
    left: var(--spacing);
    right: var(--spacing);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    z-index: 2;
    transition: transform 0.3s ease;
}
.topic-card:hover .topic-card-title {
    transform: translateY(-5px);
}

/* --- Latest Posts PREMIUM --- */
.latest-posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--spacing); }
.latest-post-item { background-color: var(--color-background); border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out; }
.latest-post-item:hover { border-color: var(--color-primary); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03); }
.post-thumbnail-link img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-content { padding: var(--spacing); display: flex; flex-direction: column; flex-grow: 1; }
.post-date { display: block; font-size: 0.875rem; color: #6B7280; margin-bottom: 0.5rem; }
.post-title { font-size: 1.25rem; margin: 0 0 0.75rem 0; }
.post-title a { text-decoration: none; color: var(--color-text); }
.post-excerpt { color: var(--color-text); font-size: 1rem; flex-grow: 1; margin-bottom: 1rem; }
.post-excerpt p { margin: 0; }
.read-more { font-weight: 600; color: var(--color-primary); text-decoration: none; }

/* --- CTA Section --- */
.cta-section { background-color: var(--color-dark-bg); color: var(--color-text-light); text-align: center; }
.cta-title { font-family: var(--font-family-serif); font-size: 2.25rem; margin: 0 0 0.5rem 0; }
.cta-subtitle { color: #D1D5DB; max-width: 500px; margin: 0 auto var(--spacing) auto; }
.cta-button { display: inline-block; background-color: var(--color-primary); color: white; padding: 0.75rem 2rem; border-radius: 6px; text-decoration: none; font-weight: 600; transition: background-color 0.2s ease-in-out; }
.cta-button:hover { background-color: var(--color-secondary); }

@media (max-width: 768px) {
    .hero-title { font-size: 2.8rem; }
    .hero-search-wrapper .search-field { padding: 1rem; font-size: 1rem; }
}