/*
Theme Name: Tema Turismo SEO
Theme URI: https://tudominio.com
Author: Tu Nombre
Description: Tema turístico con SEO integrado y panel de administración
Version: 3.0
License: GPL v2 or later
Text Domain: tema-turismo-seo
*/

/* ===== CRITICAL CSS ===== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --secondary: #F59E0B;
    --accent: #10B981;
    --dark: #0F172A;
    --light: #F8FAFC;
    --gray: #64748B;
    --white: #FFFFFF;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ===== HEADER CON GLASSMORPHISM ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 2px solid rgba(255,255,255,0.08);
    padding: 0.3rem 0;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
}

.site-branding a {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.site-branding .icon {
    font-size: 1.5rem;
}

.site-branding .subtitle {
    font-size: 0.6rem;
    opacity: 0.5;
    font-weight: 400;
    display: block;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==========================================
   ===== MENÚ MEJORADO CON HOVER FIX =====
   ========================================== */

.menu-automatico {
    display: flex;
    gap: 0.15rem;
    list-style: none;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.menu-automatico > li {
    position: relative;
}

.menu-automatico a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
    white-space: nowrap;
}

.menu-automatico a:hover,
.menu-automatico > li.current-menu-item > a {
    background: var(--secondary);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ===== FIX: SUBMENÚ CON ESPACIO ADECUADO ===== */
.menu-automatico .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 240px;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 0.6rem 0.4rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    list-style: none;
    animation: slideDown 0.2s ease;
    z-index: 1000;
}

/* Pseudo-elemento para eliminar el espacio muerto */
.menu-automatico > li.menu-item-has-children::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
    z-index: 999;
}

/* Hover con delay para evitar cierres accidentales */
.menu-automatico > li:hover > .sub-menu,
.menu-automatico > li:focus-within > .sub-menu {
    display: block;
}

/* Delay para mantener abierto mientras el mouse está en el área */
.menu-automatico > li.menu-item-has-children {
    cursor: pointer;
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-8px) scale(0.98); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.menu-automatico .sub-menu li {
    padding: 0.1rem 0.2rem;
}

.menu-automatico .sub-menu a {
    color: var(--dark);
    background: transparent;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    border: none;
    white-space: normal;
    border-radius: 6px;
}

.menu-automatico .sub-menu a:hover {
    background: var(--light);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: none;
}

.menu-automatico .sub-menu a .badge-count {
    background: var(--secondary);
    color: white;
    font-size: 0.55rem;
    padding: 0.05rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.3rem;
}

.menu-automatico .arrow {
    font-size: 0.6rem;
    margin-left: 2px;
    transition: transform 0.3s ease;
}

.menu-automatico > li:hover .arrow {
    transform: rotate(180deg);
}

/* ===== BOTÓN MENÚ MÓVIL ===== */
.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--white);
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ===== HERO ===== */
.hero-section {
    background: linear-gradient(135deg, var(--dark), var(--primary-dark));
    border-radius: var(--radius);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.hero-section::before {
    content: '🌍';
    position: absolute;
    right: -30px;
    top: -30px;
    font-size: 10rem;
    opacity: 0.05;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, 20px) rotate(5deg); }
}

.hero-section h1 {
    color: var(--white);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    position: relative;
}

.hero-section p {
    color: rgba(255,255,255,0.8);
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto;
}

.hero-section .highlight {
    color: var(--secondary);
}

/* ===== GRID PAÍSES ===== */
.paises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.pais-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--dark);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.pais-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.pais-card:hover::before {
    transform: scaleX(1);
}

.pais-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
}

.pais-card .emoji {
    font-size: 2.8rem;
    display: block;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.pais-card:hover .emoji {
    transform: scale(1.1) rotate(-5deg);
}

.pais-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.pais-card .count {
    font-size: 0.75rem;
    color: var(--gray);
    background: var(--light);
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
}

/* ===== LUGARES LIST ===== */
.lugares-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.lugar-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    text-decoration: none;
    color: var(--dark);
    display: block;
    position: relative;
    padding-left: 3.5rem;
}

.lugar-item::before {
    content: '📍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.lugar-item:hover::before {
    transform: translateY(-50%) scale(1.2) rotate(-10deg);
}

.lugar-item:hover {
    transform: translateX(4px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.lugar-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--dark);
}

.lugar-item .meta {
    font-size: 0.75rem;
    color: var(--gray);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lugar-item .meta span {
    background: var(--light);
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
}

/* ==========================================
   ===== FOOTER COMPLETO =====
   ========================================== */

.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    padding: 3rem 1.5rem 1rem;
    margin-top: 3rem;
    border-top: 3px solid var(--secondary);
    flex-shrink: 0;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.footer-widget {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-widget h4 {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-widget p {
    font-size: 0.85rem;
    line-height: 1.7;
    opacity: 0.7;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widget ul li {
    margin-bottom: 0.3rem;
}

.footer-widget a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.85rem;
    display: inline-block;
    padding: 0.15rem 0;
}

.footer-widget a:hover {
    color: var(--secondary);
    transform: translateX(4px);
}

/* Redes sociales en footer */
.footer-social {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    transition: var(--transition);
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--secondary);
    color: var(--white);
    transform: translateY(-2px) scale(1.05);
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.75rem;
    opacity: 0.5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-bottom a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--secondary);
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--secondary);
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    color: var(--gray);
}

/* ===== SINGLE POST ===== */
.single-post {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    position: relative;
}

.single-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    border-radius: var(--radius) var(--radius) 0 0;
}

.entry-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.entry-title .emoji {
    font-size: 2rem;
    margin-right: 0.5rem;
}

.entry-meta {
    color: var(--gray);
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--light);
    margin-bottom: 1.5rem;
}

.entry-content {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--dark);
}

.entry-content p {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--secondary);
    padding-left: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        padding: 0 1rem;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .main-navigation {
        display: none;
        width: 100%;
        background: var(--white);
        padding: 1rem;
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .main-navigation.open {
        display: block;
    }
    
    .menu-automatico {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .menu-automatico a {
        color: var(--dark);
        background: transparent;
        border: none;
        padding: 0.6rem 0.8rem;
        justify-content: space-between;
        width: 100%;
        border-radius: 6px;
    }
    
    .menu-automatico a:hover {
        background: var(--light);
        color: var(--primary);
        transform: none;
        box-shadow: none;
    }
    
    .menu-automatico .sub-menu {
        display: none;
        position: static;
        background: var(--light);
        box-shadow: none;
        border: none;
        padding: 0.3rem 0 0.3rem 1.5rem;
        animation: none;
        width: 100%;
        border-radius: 6px;
    }
    
    .menu-automatico > li.menu-item-has-children::after {
        display: none;
    }
    
    .menu-automatico > li.open > .sub-menu {
        display: block;
    }
    
    .menu-automatico .sub-menu a {
        color: var(--dark);
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .paises-grid,
    .lugares-list {
        grid-template-columns: 1fr;
    }
    
    .single-post {
        padding: 1.25rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .site-branding a {
        font-size: 1rem;
    }
    
    .site-branding .subtitle {
        font-size: 0.5rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--light);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ===== COMENTARIOS ===== */
.comments-area {
    margin-top: 1.5rem;
}

.comments-area .comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .comment {
    background: var(--light);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--secondary);
}

.comment-list .comment .comment-author {
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-list .comment .comment-author .avatar {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.comment-list .comment .comment-meta {
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.comment-list .comment .comment-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--dark);
}

.comment-list .comment .reply {
    margin-top: 0.5rem;
}

.comment-list .comment .reply a {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--primary);
    transition: var(--transition);
}

.comment-list .comment .reply a:hover {
    background: var(--primary);
    color: white;
}

.comment-respond {
    margin-top: 1.5rem;
}

.comment-respond .comment-reply-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-respond .comment-reply-title small {
    font-size: 0.8rem;
    font-weight: 400;
}

.comment-respond .comment-reply-title small a {
    color: var(--gray);
    text-decoration: none;
}

.comment-respond .comment-form {
    display: grid;
    gap: 0.8rem;
}

.comment-respond .comment-form label {
    font-weight: 500;
    color: var(--dark);
    font-size: 0.9rem;
}

.comment-respond .comment-form input[type="text"],
.comment-respond .comment-form input[type="email"],
.comment-respond .comment-form input[type="url"],
.comment-respond .comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--light);
}

.comment-respond .comment-form input[type="text"]:focus,
.comment-respond .comment-form input[type="email"]:focus,
.comment-respond .comment-form input[type="url"]:focus,
.comment-respond .comment-form textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-respond .comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-respond .comment-form .form-submit {
    margin-top: 0.5rem;
}

.comment-respond .comment-form .submit {
    padding: 0.6rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.comment-respond .comment-form .submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.comment-respond .comment-form .comment-notes {
    font-size: 0.85rem;
    color: var(--gray);
}

.comment-respond .comment-form .comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-respond .comment-form .comment-form-cookies-consent input {
    width: auto;
}

/* Comentarios en móvil */
@media (max-width: 768px) {
    .comment-list .comment {
        padding: 0.8rem;
    }
    
    .comment-respond .comment-form input[type="text"],
    .comment-respond .comment-form input[type="email"],
    .comment-respond .comment-form input[type="url"],
    .comment-respond .comment-form textarea {
        font-size: 0.9rem;
    }
}

/* Sin comentarios */
.no-comments {
    text-align: center;
    padding: 2rem 0;
    color: var(--gray);
}

.no-comments .emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}