/*
Theme Name: GeneratePress Child
Template: generatepress
Version: 1.3.0
Description: Dark aesthetic, mobile-first optimized design with custom single posts and header.
*/

/* ==========================================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================================== */
:root {
    --bg-color: #09090b;          /* Deep dark background */
    --card-bg: #131316;           /* Card background */
    --text-color: #f4f4f5;        /* Primary soft white text */
    --text-muted: #a1a1aa;        /* Secondary muted gray text */
    --accent-color: #ff2a74;      /* Neon pink brand color */
    --accent-hover: #e01b5d;      /* Accent color hover state */
    --border-color: #202024;      /* Subtle borders for structure */
    --header-bg: rgba(9, 9, 11, 0.85); /* Semi-transparent header */
}

/* Base resets to secure correct centering and prevent mobile horizontal shift */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* Prevent body scroll when mobile navigation drawer is open */
body.menu-open {
    overflow: hidden;
}

/* 
   GP Sidebar Overrides: Force 100% full width layout on homepage to prevent 
   asymmetric right space reserved for inactive sidebar columns.
*/
.home #primary,
.home .content-area,
.home #main {
    width: 100% !important;
    float: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

/* ==========================================================================
   2. CUSTOM SITE HEADER & MOBILE MENU (GLASSMORPHISM)
   ========================================================================== */
.custom-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.custom-logo-link {
    text-decoration: none;
    color: var(--text-color);
}

.custom-logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-color);
}

/* Elegant Hamburger Icon */
.custom-menu-toggle {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    padding: 0;
    box-shadow: none !important;
    outline: none !important;
}

.custom-menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

/* CSS Transformations: Toggle Burger button into 'X' shape */
.custom-menu-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.custom-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.custom-menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Drawer Panel */
.custom-mobile-nav {
    position: fixed;
    top: 61px; /* Header height offset */
    left: 0;
    width: 100%;
    height: calc(100vh - 61px);
    background-color: #0b0b0d;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 40px 20px;
}

.custom-mobile-nav.open {
    transform: translateX(0);
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-menu-list li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.mobile-menu-list li a:hover {
    color: var(--accent-color);
}

/* ==========================================================================
   3. HERO SECTION & FLOATING SEARCH BAR
   ========================================================================== */
.hero-section {
    padding: 60px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: radial-gradient(circle at top, #1c1015 0%, var(--bg-color) 100%);
}

.hero-content h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

/* Centered Form Wrapper */
.search-container {
    max-width: 550px;
    margin: 0 auto;
    position: relative; /* Keep suggestions absolute layout safe */
}

/* Form border container */
.search-form {
    display: flex;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 4px 4px 4px 18px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px rgba(255, 42, 116, 0.15);
}

/* Force text inputs to remain transparent on iOS/Android */
.search-field {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--text-color) !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    width: 100%;
    font-size: 0.95rem;
    -webkit-appearance: none;
}

.search-field::placeholder {
    color: var(--text-muted);
}

/* Search Submit Button Style */
.search-submit {
    background-color: var(--accent-color);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px; /* Prevent shrink on low-width devices */
    transition: background-color 0.2s ease;
    padding: 0;
}

.search-submit:hover {
    background-color: var(--accent-hover);
}

/* Ensure SVG Magnifying Glass renders correctly with proper line thickness */
.search-submit svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #ffffff !important;
    stroke-width: 2.5 !important;
    fill: none !important;
    display: block !important;
    margin: auto !important;
}

/* ==========================================================================
   4. HORIZONTAL FILTER BAR (MOBILE OPTIMIZED)
   ========================================================================== */
.filter-bar-container {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 15px;
    max-width: 1400px;
    margin: 0 auto;
    scrollbar-width: none; /* Firefox scrollbar reset */
    -webkit-overflow-scrolling: touch; /* Smooth iOS swipe momentum */
}

.filter-bar::-webkit-scrollbar {
    display: none; /* Webkit/Chrome scrollbar reset */
}

/* Individual Pill Button Base */
.filter-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    user-select: none;
}

/* Hover style for inactive buttons */
.filter-btn:hover {
    color: var(--text-color);
    border-color: var(--text-muted);
}

/* Highlight style ONLY for the selected/active button */
.filter-btn.active {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   5. POSTS GRID & CARD LAYOUT
   ========================================================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 Columns on mobile by default */
    gap: 12px;
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Core Card Styles with smooth fade-in entry */
.grid-item-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-item-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Portrait aspect ratio container (3:4) */
.card-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: #0e0e11;
    overflow: hidden;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.grid-item-card:hover .card-thumbnail img {
    transform: scale(1.04);
}

/* Dark gradient overlay for text protection */
.card-thumbnail::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(9, 9, 11, 0.95) 0%, rgba(9, 9, 11, 0) 100%);
    pointer-events: none; /* Prevent clicks on overlay blocking card-link */
}

/* Details Section */
.card-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: var(--card-bg);
    position: relative;
    z-index: 2;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.card-category {
    font-size: 0.7rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: left;
}

.placeholder-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    background: linear-gradient(135deg, #131316 0%, #09090b 100%);
}

/* ==========================================================================
   6. AUTOCOMPLETE LIVE SEARCH DROP-DOWN
   ========================================================================== */
.search-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 1100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: none;
}

/* Suggestion Item row */
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: rgba(255, 42, 116, 0.1);
}

.suggestion-thumb {
    width: 35px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #0c0c0e;
}

.suggestion-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.suggestion-no-results {
    padding: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* ==========================================================================
   7. SKELETON LOADERS & INFINITE SCROLL
   ========================================================================== */

/* Shimmer animation container */
.skeleton-card {
    background: linear-gradient(90deg, #131316 25%, #1c1c22 50%, #131316 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
    aspect-ratio: 3 / 4.7;
    border: 1px solid var(--border-color);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Spinner Styles */
.loading-trigger {
    text-align: center;
    padding: 40px 0;
    width: 100%;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS (MEDIA QUERIES)
   ========================================================================== */
@media (min-width: 600px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 Columns on Tablet */
        gap: 16px;
        padding: 20px;
    }
    .hero-content h1 {
        font-size: 3rem;
    }
}

@media (min-width: 900px) {
    .posts-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 Columns on Laptops */
    }
}

@media (min-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(5, 1fr); /* 5 Columns on Desktop */
    }
}

/* ==========================================================================
   9. SINGLE POST LAYOUT & CARDS (MOBILE FIRST DESIGN)
   ========================================================================== */

/* Contenedor general de tarjetas */
.single-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Encabezado común de tarjetas internas */
.card-title-header {
    padding: 18px 20px 0 20px;
    border-bottom: none;
    text-align: left;
}

.card-title-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

/* --- TARJETA PRINCIPAL (CARD 1) --- */
.profile-header {
    position: relative;
    width: 100%;
}

.profile-banner {
    width: 100%;
    aspect-ratio: 3 / 1;
    background-color: #0e0e11;
    overflow: hidden;
}

.profile-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Foto de Perfil */
.profile-pfp-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: -55px !important;
    margin-bottom: 0px !important;
    z-index: 5;
}

.profile-pfp {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid var(--card-bg);
    object-fit: cover;
    background-color: #0e0e11;
    transition: transform 0.2s ease;
    display: block;
}

.profile-pfp:hover {
    transform: scale(1.03);
}

/* Información de Perfil (Username & Alt Names) */
.profile-info-block {
    padding: 10px 15px 12px 15px !important; /* Relleno vertical controlado */
    text-align: center;
}

.profile-username {
    font-size: 1.65rem !important; /* Ajustado para móvil */
    font-weight: 800;
    margin: 0 0 4px 0 !important;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.profile-alt-names {
    font-size: 0.95rem !important;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 !important;
}

/* Botones de Descarga (Symmetric Spacing) */
.profile-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px !important; /* Separación ajustada y limpia entre botones */
    padding: 0 15px 12px 15px !important; /* Sincronizado a 12px inferior */
}

.btn-download-free,
.btn-download-vip,
.btn-social {
    padding: 10px 16px !important;  /* Compacto y no invasivo en móvil */
    font-size: 0.92rem !important;  /* Texto perfectamente legible */
    height: 38px !important;        /* Forzar altura unificada para simetría */
    border-radius: 50px !important; /* Bordes redondeados idénticos */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-download-free {
    background-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 42, 116, 0.2);
}

.btn-download-free:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-download-vip {
    background-color: transparent;
    color: #ffd700;
    border: 2px solid #ffd700 !important;
}

.btn-download-vip:hover {
    background-color: #ffd700;
    color: #000000;
    transform: translateY(-1px);
}

/* Cuadrícula de Estadísticas (Stats Grid 2x2 - Ultra Compact) */
.profile-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 12px 15px !important; /* Sincronizado para perfecta simetría */
    border-top: 1px solid var(--border-color) !important;
    background-color: rgba(255, 255, 255, 0.01);
    box-sizing: border-box !important;
    width: 100% !important;
}

.stat-box {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;   /* Más compacto horizontalmente */
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;            /* Reduce el espacio entre el icono y el texto */
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;        /* Bloquea el desborde en el grid */
}

.stat-icon {
    color: var(--accent-color);
    background-color: rgba(255, 42, 116, 0.08);
    width: 34px !important;         /* Reducido para evitar saltos de línea */
    height: 34px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 16px !important;         /* Reducido sutilmente */
    height: 16px !important;
}

.stat-data {
    display: flex !important;
    flex-direction: column !important;
    text-align: left !important;
    min-width: 0 !important;        /* Clave para obligar a los textos a mantenerse dentro */
}

.stat-number {
    font-size: 0.92rem !important;  /* Ajustado para que cifras con K quepan holgadamente */
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
    white-space: nowrap !important; /* Impide cualquier salto de línea como "123.4 \n K" */
}

.stat-label {
    font-size: 0.72rem !important;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- TARJETA COMUNIDAD SOCIAL (CARD 2) --- */
.social-buttons-grid {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
    padding: 15px !important;
}

/* Unificación de colores y hover */
.btn-social:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-social svg {
    width: 18px !important;
    height: 18px !important;
}

.btn-telegram {
    background-color: #229ED9 !important;
    color: #ffffff !important;
}

.btn-discord {
    background-color: #5865F2 !important;
    color: #ffffff !important;
}

/* --- TARJETA CATEGORÍAS (CARD 3) --- */
.post-categories-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
}

.post-categories-pills a {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.post-categories-pills a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: rgba(255, 42, 116, 0.05);
}

/* --- TARJETAS DE TEXTO Y DESCRIPCIÓN (SEO CARDS) --- */
.profile-desc-card, 
.seo-content-card {
    text-align: left;
}

.profile-bio-text,
.card-text-body {
    padding: 20px;
}

.card-text-body h3,
.profile-desc-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-color);
    line-height: 1.4;
}

.profile-bio-text p,
.card-text-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 14px 0;
}

.profile-bio-text p:last-child,
.card-text-body p:last-child {
    margin-bottom: 0;
}

.seo-highlight-box {
    background-color: rgba(255, 42, 116, 0.03);
    border-left: 3px solid var(--accent-color);
    border-radius: 0 10px 10px 0;
    padding: 15px;
    margin-top: 15px;
}

.seo-highlight-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

/* ==========================================================================
   10. DESKTOP ADAPTATIONS (MIN-WIDTH: 768px)
   ========================================================================== */
@media (min-width: 768px) {
    .profile-banner {
        aspect-ratio: 3.5 / 1;
    }

    .profile-pfp-container {
        justify-content: flex-start !important;
        padding-left: 30px !important;
        margin-top: -65px !important;
    }

    .profile-pfp {
        width: 125px !important;
        height: 125px !important;
    }

    .profile-info-block {
        text-align: left !important;
        padding: 12px 30px 20px 30px !important;
    }

    .profile-username {
        font-size: 2.2rem !important;
    }

    /* Los botones de descarga se ordenan horizontalmente */
    .profile-actions-wrapper {
        flex-direction: row !important;
        gap: 15px !important;
        padding: 0 30px 20px 30px !important;
    }

    .btn-download-free,
    .btn-download-vip {
        width: 50% !important;
        height: 42px !important; /* Ligeramente más amplios en pantallas de escritorio */
        font-size: 1rem !important;
    }

    /* Cuadrícula de estadísticas escalada para monitor */
    .profile-stats-grid {
        padding: 20px 30px !important;
        gap: 15px !important;
    }

    .stat-box {
        padding: 15px !important;
        gap: 15px !important;
    }

    .stat-icon {
        width: 42px !important;
        height: 42px !important;
        border-radius: 10px !important;
    }

    .stat-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    .stat-number {
        font-size: 1.15rem !important;
    }

    .stat-label {
        font-size: 0.8rem !important;
    }

    /* Botones de Telegram y Discord lado a lado */
    .social-buttons-grid {
        flex-direction: row !important;
        gap: 15px !important;
        padding: 20px 30px 25px 30px !important;
    }

    .btn-social {
        width: 50% !important;
        height: 42px !important;
    }

    /* Más espaciado de lectura interna en pantallas grandes */
    .profile-bio-text,
    .card-text-body,
    .card-title-header {
        padding: 25px 30px !important;
    }
}

/* ==========================================================================
   11. DOUBLE SCROLLBAR DESKTOP FIX (PREVENTS ACCIDENTAL OVERFLOWS)
   ========================================================================== */
.home #page,
.home #primary,
.home .site-main,
.home .grid-container-wrapper,
.home .content-container,
#infinite-grid,
.posts-grid {
    overflow: visible !important;
    height: auto !important;
    min-height: unset !important;
}