/*
Theme Name: Nexa TechID
Theme URI: https://nexa.com
Author: TechID
Author URI: https://techid.com
Description: Tema personalizado para Nexa TechID
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nexa-techid
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================
   RESET & BASE
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #0d6efd;
    --color-secondary: #6c757d;
    --color-dark: #212529;
    --color-light: #f8f9fa;
    --color-white: #ffffff;
    --font-base: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --max-width: 1920px;
}

body {
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-dark);
    background-color: var(--color-white);
    box-sizing: border-box;
    overflow-x: hidden;
}

.w-full {
    width: 100%;
}

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

a:hover {
    text-decoration: none !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Variable de altura del header para compensar el fixed */
:root {
    --header-h: 68px;
}

.site-main {
    flex: 1;
    padding: 2rem 0;
    padding-top: calc(var(--header-h) + 22px);
}

/* Páginas con hero a pantalla completa: quitan la compensación */
.page-template-page-empty .site-main {
    padding-top: 0;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.content-area.full-width {
    grid-template-columns: 1fr;
}

/* ==========================================
   HEADER — glassmorphism flotante
   ========================================== */
.site-header {
    /* background: rgba(80, 80, 80, 0.45); */
    background: #F98F48;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: var(--max-width);
    z-index: 200;
    margin: 0 auto;
    width: 100%;
}

/* Desplaza el header cuando la barra de admin de WP está visible */
.admin-bar .site-header {
    top: 32px;
}

body.home .site-header {
    background: rgba(249, 143, 72, 0.45);
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

.header-bar {
    display: flex;
    align-items: stretch;   /* permite que el hamburger ocupe el alto completo */
    gap: 2rem;
    padding: 0 0 0 1.5rem;  /* padding solo izquierdo; el botón hamburger toca el borde */
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: var(--header-h);
}

/* Branding / logo */
.site-branding {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 15px 0;
}

.site-branding .custom-logo {
    height: 60px;
    width: auto;
    display: block;
}

.site-title-link {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--color-white);
    font-style: italic;
    text-decoration: none;
    letter-spacing: -0.03em;
}

.site-title-link:hover {
    text-decoration: none;
    color: rgba(255,255,255,.8);
}

/* Buscador central */
.header-search {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.header-search form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50px;
    padding: 0.45rem 1.1rem;
    gap: 0.6rem;
    border: 1px solid rgba(255,255,255,0.5);
    width: 100%;
}

.header-search form:focus-within {
    border-color: rgba(255,255,255,0.5);
    box-shadow: none;
}

.header-search form svg {
    flex-shrink: 0;
    color: #888;
}

.header-search input[type="search"] {
    border: none;
    background: none;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
    color: var(--color-dark);
    line-height: 1.4;
}

.header-search input[type="search"]::placeholder {
    color: #aaa;
}

/* Botones de acción (home + hamburger) */
.header-actions {
    display: flex;
    align-items: stretch;   /* hijos se estiran al alto de la barra */
    gap: 0;
    flex-shrink: 0;
    align-self: stretch;
}

.header-home-btn,
.header-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    color: var(--color-white);
    transition: background .2s;
    text-decoration: none;
    line-height: 1;
}

.header-home-btn {
    background: none;
    padding: 0 0.75rem;
    border-radius: 0;
}

/* El botón hamburguesa ocupa el alto completo de la barra con fondo gris */
.header-menu-btn {
    background: transparent;
    padding: 0 1.5rem;
    border-radius: 0;
}

.header-home-btn:hover {
    background: rgba(255,255,255,.15);
    color: var(--color-white);
    text-decoration: none;
}

.header-menu-btn:hover,
.header-menu-btn[aria-expanded="true"] {
    background: #2A80C2;
    color: var(--color-white);
    text-decoration: none;
}

/* ==========================================
   PANEL DE NAVEGACIÓN (dropdown dentro del .site-header)
   ========================================== */

/* El panel es position:absolute relativo al site-header (position:fixed) */
.nav-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 400px;
    max-width: 100vw;
    max-height: calc(100vh - var(--header-h));
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 400;
    transform: translateY(-6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease, visibility .25s;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    border-radius: 0;
}

body.admin-bar .nav-panel {
    max-height: calc(100vh - var(--header-h) - 32px);
}


.nav-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Lista del menú dentro del panel */
.nav-panel__menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

/* Ítem de nivel 0 */
.nav-panel__menu > .nav-item--top {
    border-bottom: 1px solid #f0f0f0;
}

/* Botón acordeón (ítem padre) */
.nav-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #2A80C2;
    border: none;
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-white);
    text-align: left;
    transition: background .2s;
}

/* .nav-accordion-toggle:hover {
    background: #1a1c2e;
} */

.nav-accordion-arrow {
    flex-shrink: 0;
    transition: transform .3s;
    color: rgba(255,255,255,.8);
}

.nav-accordion-toggle[aria-expanded="true"] .nav-accordion-arrow {
    transform: rotate(180deg);
}

/* Enlace normal de nivel 0 */
.nav-panel__menu > .nav-item--top > .nav-link {
    display: block;
    padding: 0.9rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color .2s;
}

.nav-panel__menu > .nav-item--top > .nav-link:hover,
.nav-panel__menu > .nav-item--top.current-menu-item > .nav-link {
    color: var(--color-primary);
}

/* Sub-menú (categorías de cursos) */
.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height .35s ease;
    background: transparent;
}

.nav-submenu.is-expanded {
    max-height: 800px;
}

.nav-submenu .nav-item {
    border-bottom: 1px solid #f5f5f5;
}

.nav-submenu .nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    color: #444;
    text-decoration: none;
    transition: color .2s, background .2s;
}

.nav-submenu .nav-link:hover {
    color: var(--color-primary);
    background: #f8f9fa;
    text-decoration: none;
}

/* ==========================================
   POSTS & CARDS
   ========================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.post-card {
    border: 1px solid #dee2e6;
    overflow: hidden;
    transition: box-shadow .2s;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

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

.post-card .post-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.post-card .post-title a {
    color: #333;
}

.post-card .post-meta {
    font-size: 0.8rem;
    color: var(--color-secondary);
    margin-bottom: 0.75rem;
}

.post-card .post-excerpt {
    font-size: 0.9rem;
    color: #495057;
}

/* Entrada singular */
.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.entry-meta {
    font-size: 0.85rem;
    color: var(--color-secondary);
}

.entry-thumbnail {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
}

.entry-content {
    line-height: 1.8;
}

.entry-content h2,
.entry-content h3 {
    margin: 1.5rem 0 0.75rem;
}

.entry-content p {
    margin-bottom: 1rem;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
    padding-top: 0;
}

.widget {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

.widget-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    background-color: var(--color-white);
    color: var(--color-dark);
    font-size: 0.85rem;
    border-top: 1px solid #e8e8e8;
    width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
}

.footer-container--center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Fila principal: legal + contacto */
.footer-main {
    padding: 3rem 0 1rem;
    background-color: #D9D9D9;
}

.footer-main .footer-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    width: 80%;
    margin: 0 auto 1px;
    padding-bottom: 3rem;
}

/* Menú de política / enlaces legales */
.footer-legal-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.footer-legal-menu a {
    color: #000;
    font-size: 1.2rem;
    text-decoration: none;
    transition: color .2s;
    font-weight: 500;
}

.footer-legal-menu a:hover {
    color: var(--color-primary);
}

/* Widget de contacto */
.footer-contact-area .widget {
    border: none;
    padding: 0;
    margin: 0;
}

.nexa-contact-widget {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nexa-contact-widget .contact-label {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--color-dark);
}

.nexa-contact-widget p {
    margin: 0;
    font-size: 1.2rem;
    color: #555;
}

.nexa-contact-widget .contact-field-label {
    color: #888;
    margin-right: 0.3rem;
}

.nexa-contact-widget a {
    color: #555;
    text-decoration: none;
}

.nexa-contact-widget a:hover {
    color: var(--color-primary);
}

.nexa-contact-widget .contact-address {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.15rem;
}

/* Placeholder cuando no hay widget */
.footer-placeholder {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
}

.footer-placeholder--center {
    text-align: center;
}

/* Separador */
.footer-separator {
    border-top: 1px solid #898683;
    max-width: 80%;
    margin: 0 auto;
}

/* Fila redes sociales */
.footer-social-row {
    padding: 1.2rem 0 0;
    background-color: #D9D9D9;
}

.footer-social-row .footer-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.footer-social-row .widget {
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.nexa-social-widget {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nexa-social-widget .social-label {
    font-size: 1.4rem;
    color: #555;
    white-space: nowrap;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    transition: color .2s, border-color .2s, background .2s;
    text-decoration: none;
}

.social-icon:hover {
    color: var(--color-white);
    border-color: #ffffff;
    background: #ffffff;
    text-decoration: none;
}

.social-icon img {
    width: 100%;
    height: auto;
}

/* Logo inferior grande */
.footer-logo-row {
    padding: 2rem 0;
}

.footer-logo .footer-custom-logo {
    height: 300px;
    width: auto;
}

.footer-logo-text {
    text-align: center;
    line-height: 1;
}

.footer-logo-name {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--color-dark);
    letter-spacing: -0.03em;
    font-style: italic;
    text-transform: lowercase;
}

.footer-logo-sub {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: #777;
    letter-spacing: 0.15em;
    text-transform: lowercase;
    margin-top: -0.3rem;
}

.footer-container .footer-contact-area {
    width: 35%;
}

/* ==========================================
   PAGINACIÓN
   ========================================== */
.pagination {
    margin-top: 2rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    padding: 0.4rem 0.8rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    color: var(--color-dark);
}

.pagination .current {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

/* ==========================================
   404
   ========================================== */
.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-404 h1 {
    font-size: 6rem;
    color: var(--color-primary);
    line-height: 1;
}

/* ==========================================
   PAGE EMPTY (header/footer normales, contenedor 1920px)
   ========================================== */

/* Anula el .container y .site-main del header para esta plantilla */
.page-template-page-empty .site-main {
    padding: 0;
}

.page-template-page-empty .site-main > .container {
    max-width: none;
    padding: 0;
    margin: 0;
}

/* Contenedor real de 1920px centrado */
.page-empty-wrap {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
}

.posts-wrapper {
    padding: 50px 30px 30px;
}
/* ==========================================
   RESPONSIVE
   ========================================== */

/* Tablet: ≤ 768px */
@media (max-width: 768px) {
    :root {
        --header-h: 60px;
    }

    .header-bar {
        padding: 0 0 0 1rem;
        gap: 0.75rem;
        justify-content: space-between;
    }

    .content-area {
        grid-template-columns: 1fr;
    }

    .entry-title {
        font-size: 1.5rem;
    }

    /* Footer main: quitar el ancho fijo del 80% */
    .footer-main .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        width: 90%;
    }

    .footer-container .footer-contact-area {
        width: 100%;
    }

    .footer-legal-menu a {
        font-size: 1rem;
    }

    .nexa-contact-widget p,
    .nexa-contact-widget .contact-label {
        font-size: 1rem;
    }

    .nexa-social-widget {
        justify-content: flex-start;
        gap: 1rem;
    }

    .nexa-social-widget .social-label {
        font-size: 1.1rem;
    }

    .footer-social-row .footer-container {
        justify-content: flex-start;
    }

    .footer-logo .footer-custom-logo {
        height: 180px;
    }

    .footer-logo-name {
        font-size: 2.5rem;
    }

    .footer-separator {
        max-width: 90%;
    }
}

/* Móvil: ≤ 600px */
@media (max-width: 600px) {
    /* Ocultar buscador en pantallas muy pequeñas */
    .header-search {
        display: none;
    }

    .header-bar {
        padding: 0 0 0 1rem;
        gap: 0.5rem;
    }

    .site-branding .custom-logo {
        height: 44px;
    }

    .footer-main .footer-container {
        width: 92%;
    }

    .nexa-social-widget {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .social-icons {
        gap: 0.75rem;
    }

    .social-icon {
        width: 44px;
        height: 44px;
    }

    .footer-logo .footer-custom-logo {
        height: 120px;
    }

    .footer-logo-name {
        font-size: 2rem;
    }

    .footer-logo-sub {
        font-size: 0.85rem;
    }

    .error-404 h1 {
        font-size: 4rem;
    }
}
