/**
 * Chrome compartido: mismo header/footer que la home (nav + hamburguesa + tema).
 * Usar junto con site-chrome.js. Las páginas internas añaden .site-page-body al body.
 */
:root {
    --primary: #2D8A4B;
    --primary-dark: #1E6B38;
    --primary-light: #E8F5EB;
    --secondary: #FFA726;
    --accent: #4A6572;
    --dark: #1A1A1A;
    --light: #F8F9FA;
    --gray: #6C757D;
    --white: #FFFFFF;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    /* Header fijo (logo + tagline + padding): reservar espacio y anclas */
    --site-header-offset: 118px;
}

html {
    scroll-padding-top: var(--site-header-offset);
}

html.dark-mode {
    color-scheme: dark;
}

.site-page-body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    color: var(--dark);
    overflow-x: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding-top: 0;
}

html.dark-mode.site-page-body,
html.dark-mode .site-page-body {
    background: #0f1419;
    color: #e2e8f0;
}

/* —— Header (igual que home) —— */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10050;
    isolation: isolate;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.header.scrolled {
    padding: 10px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-img {
    height: 72px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--secondary);
}

.logo-tagline {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    letter-spacing: 0.5px;
    margin-top: 2px;
    line-height: 1.2;
}

/* Navegación siempre en panel lateral (empresa): barra = logo + hamburguesa */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(400px, 92vw);
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 96px 24px 36px;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    transition: right 0.32s ease, visibility 0.32s ease;
    z-index: 10060;
    visibility: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.nav-menu.open {
    right: 0;
    visibility: visible;
}

.nav-link {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
    padding: 12px 4px;
    border-radius: 10px;
}

.nav-link::after {
    display: none;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-menu .cta-button {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 14px 22px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(45, 138, 75, 0.28);
    width: 100%;
    text-align: center;
    min-height: 48px;
    box-sizing: border-box;
}

.nav-menu .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(45, 138, 75, 0.38);
}

.nav-menu .nav-link,
.nav-menu .cta-button {
    justify-content: center;
    text-align: center;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    z-index: 1001;
    border-radius: 10px;
}

.hamburger:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

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

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

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

.nav-menu .site-theme-toggle {
    align-self: center;
    margin-top: 12px;
}

.theme-toggle.site-theme-toggle,
.site-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: var(--white);
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.theme-toggle:hover,
.site-theme-toggle:hover {
    transform: scale(1.08);
    background: var(--primary-light);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    touch-action: none;
}

body.menu-open .nav-overlay {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

/* Espacio bajo header fijo en páginas internas */
.site-main-offset {
    padding-top: var(--site-header-offset);
}

/*
 * Los estilos inline de muchas páginas usan `main.site-inner { padding: 48px 20px 80px }`,
 * lo que pisa el padding-top anterior. Forzar el respiro bajo el header.
 */
body.site-page-body main.site-main-offset.site-inner {
    padding-top: var(--site-header-offset);
    padding-right: 20px;
    padding-bottom: 80px;
    padding-left: 20px;
}

body.site-page-body main.site-main-offset.doc-legal {
    padding-top: var(--site-header-offset);
}

/* Posts del blog: el CSS inline usa `article.blog-post-main { padding: 32px … }` y pisa .site-main-offset */
body.site-page-body article.blog-post-main.site-main-offset {
    padding-top: var(--site-header-offset);
}

@media (min-width: 1025px) {
    .nav-menu {
        width: min(420px, 34vw);
        padding: 104px 28px 40px;
    }

    .logo-img {
        height: 64px;
    }

    .logo-text {
        font-size: 24px;
    }
}

@media (max-width: 1024px) {
    .logo-img {
        height: 52px;
    }

    .logo-text {
        font-size: 22px;
    }
}

html.dark-mode .header {
    background: rgba(15, 20, 25, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

html.dark-mode .logo-text {
    color: #86efac;
}

html.dark-mode .logo-text span {
    color: var(--secondary);
}

html.dark-mode .logo-tagline {
    color: rgba(255, 255, 255, 0.6);
}

html.dark-mode .nav-link {
    color: #cbd5e1;
}

html.dark-mode .nav-link:hover {
    color: #86efac;
    background: rgba(255, 255, 255, 0.06);
}

html.dark-mode .nav-link::after {
    background: #86efac;
}

html.dark-mode .hamburger {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

html.dark-mode .hamburger span {
    background: #cbd5e1;
}

html.dark-mode .nav-menu {
    background: #0f172a;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
}

html.dark-mode .theme-toggle,
html.dark-mode .site-theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(134, 239, 172, 0.5);
    color: #86efac;
}

html.dark-mode .theme-toggle:hover,
html.dark-mode .site-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* —— Footer (mismo grid que home) —— */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 80px 0 40px;
}

.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-brand {
    max-width: 350px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    text-decoration: none;
}

.footer-logo-img {
    height: 45px;
    width: auto;
}

.footer-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 900;
    color: var(--white);
    display: block;
}

.footer-logo-text span {
    color: var(--secondary);
}

.footer-tagline {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 25px;
}

/* Iconos de redes / compartir (solo <i>, sin texto visible) */
.footer-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 8px;
}

.footer-social-link {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-social-link i {
    font-size: 1.15rem;
    line-height: 1;
}

.footer-social-link .social-icon-x {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
    flex-shrink: 0;
}

.share-bar .share-btn .social-icon-x {
    width: 1rem;
    height: 1rem;
    display: block;
}

html.dark-mode .footer-social-link {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.footer-links h4 {
    font-size: 20px;
    margin-bottom: 25px;
    color: var(--white);
}

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

.footer-links li {
    margin-bottom: 15px;
}

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

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

.footer-bottom p {
    margin: 0 0 8px;
}

html.dark-mode .footer {
    background: #0f1419;
    border-top-color: rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
    .footer {
        padding: 56px 0 32px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
        margin-bottom: 40px;
    }

    .footer-brand {
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }

    .footer-social {
        justify-content: center;
        width: 100%;
        gap: 14px;
    }

    .footer-social-link {
        width: 46px;
        height: 46px;
    }

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

    .footer-links h4 {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .footer-links ul {
        display: inline-block;
        text-align: left;
        max-width: 280px;
        margin: 0 auto;
    }

    .footer-links a:hover {
        padding-left: 0;
    }

    .footer-bottom {
        padding-top: 28px;
    }
}

@media (max-width: 480px) {
    .footer .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .footer-content {
        gap: 28px;
    }

    .footer-description {
        font-size: 14px;
        margin-bottom: 18px;
    }

    .footer-logo {
        flex-wrap: wrap;
        justify-content: center;
        text-align: left;
    }

    .footer-bottom p {
        font-size: 13px;
        line-height: 1.5;
    }
}
