/*
Theme Name: VDV
Theme URI: https://vidadespuesdelavida.com.ar
Description: Tema personalizado para vidadespuesdelavida.com.ar
Author: CORSOxCORSO
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vdv
Tags: full-site-editing, custom-colors, custom-logo, custom-menu, editor-style, featured-images, one-column, two-columns, threaded-comments, translation-ready, wide-blocks
*/

/* Estilos globales básicos con fondo dinámico del cielo */
:root {
    --wp--preset--color--primary: #202d47;
    --wp--preset--color--secondary: #64748b;
    --wp--preset--color--accent: #f59e0b;
    --wp--preset--color--background: transparent;
    --wp--preset--color--foreground: #1f2937;
    --wp--preset--color--neutral: transparent;
    --vdv-base-font-size: 16px;
}

/* Reset y normalización */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
    /* Base para rem: hace que A+/A- afecte toda la tipografía Bootstrap */
    font-size: var(--vdv-base-font-size);
}

body {
    margin: 0;
    line-height: 1.6;
    color: var(--wp--preset--color--foreground);
    background: transparent; /* El fondo será manejado por el sistema de cielo dinámico */
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Mantener coherencia también en body si hay componentes que no usan rem */
    font-size: var(--vdv-base-font-size);
}

/* Prevenir rebote/overscroll al llegar a top/bottom (navegadores modernos) */
html, body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: contain;
}
/* Mejor control de gestos verticales en móviles */
body {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* Colores de links al primary definido */
a { color: var(--bs-link-color); }
a:hover, a:focus { color: var(--bs-link-hover-color); text-decoration: underline; }

/* Utilidades de responsive */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Botones */
.wp-block-button__link {
    border-radius: 6px;
    padding: 12px 24px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.wp-block-button__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Navegación */
.wp-block-navigation {
    font-weight: 500;
}

.wp-block-navigation-item a {
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Imágenes responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Animaciones sutiles */
@media (prefers-reduced-motion: no-preference) {
    .wp-block-group,
    .wp-block-column {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
}

/* Responsive breakpoints */
@media screen and (max-width: 768px) {
    .wp-block-columns {
        flex-direction: column;
    }
}

/* Contenido principal transparente para mostrar el gradiente */
.wp-site-blocks {
    position: relative;
    z-index: 2;
    background: transparent;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Asegurar que el contenido principal ocupe el espacio disponible */
main {
    flex: 1;
}

/* Footer siempre al fondo */
footer {
    margin-top: auto;
}
footer a {
    color: white;
}
footer a:hover {
    color: white;
}

/* Contraste específico para footer */
body.vdv-contrast footer { background-color: #000 !important; color: #fff !important; }
body.vdv-contrast footer a { color: #ffeb3b !important; }
body.vdv-contrast footer.bg-dark { background-color: #000 !important; }

/* Footer: simplificar menús (sin viñetas, vertical) */
footer ul,
footer ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

footer li {
    margin: 0;
    padding: 0;
}

/* Menús en widgets del footer: links uno debajo del otro */
footer .menu a,
footer .widget_nav_menu a,
footer .widget_pages a,
footer .widget_categories a {
    display: block;
    padding: 0.25rem 0;
    color: inherit;
    text-decoration: none;
}

footer .menu a:hover,
footer .widget_nav_menu a:hover,
footer .widget_pages a:hover,
footer .widget_categories a:hover {
    text-decoration: underline;
}

/* Sidebar tools */
.sidebar-tools .card-title { color: var(--wp--preset--color--foreground); }

/* Modo alto contraste */
body.vdv-contrast { color: #fff !important; background: #000 !important; }
body.vdv-contrast a { color: #ffeb3b !important; text-decoration: underline; }
body.vdv-contrast .vdv-sky-background { display: none !important; }
body.vdv-contrast .card { background: #111 !important; border-color: #333 !important; }
body.vdv-contrast .btn { color: #fff !important; border-color: #888 !important; }

/* Forzar contraste también en contenedores y utilidades Bootstrap */
body.vdv-contrast .container,
body.vdv-contrast .container-fluid,
body.vdv-contrast .row,
body.vdv-contrast .col,
body.vdv-contrast .wp-site-blocks,
body.vdv-contrast .entry-content,
body.vdv-contrast article {
    background-color: #000 !important;
    color: #fff !important;
}

/* Anular utilidades que fijan fondos claros */
body.vdv-contrast .bg-light,
body.vdv-contrast .bg-white,
body.vdv-contrast .bg-body,
body.vdv-contrast .bg-transparent {
    background-color: #000 !important;
}

/* Anular utilidades de color de texto claros/osc.
   Usamos blanco para máximo contraste y un gris para muted */
body.vdv-contrast .text-dark,
body.vdv-contrast .text-body { color: #fff !important; }
body.vdv-contrast .text-muted { color: #d1d5db !important; }

/* Refuerzo de contraste en el título del hero y la imagen de fondo */
body.vdv-contrast .page-hero-title { background: rgba(0,0,0,0.8) !important; }
body.vdv-contrast .page-hero-img { filter: grayscale(100%) brightness(0.45); }

/* Hero de página con imagen destacada y título superpuesto */
.page-hero {
    position: relative;
    height: min(55vh, 70rem);
    max-height: 55vh;
    overflow: hidden;
}

.page-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    will-change: transform;
    transform: translateY(var(--vdv-hero-parallax, 0px));
    transition: transform 0.06s linear; /* movimiento muy suave */
}

.page-hero-title {
    position: absolute;
    inset: auto 0 0 0; /* pegado abajo */
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
    background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0));
}


/* Elementos de contenido completamente transparentes */
.wp-block-group {
    background-color: transparent;
}

.wp-block-group.has-background {
    background-color: transparent !important; /* Forzar transparencia incluso con clases de fondo */
}

@media screen and (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ajustes de hero en móviles: altura menor y tipografía adaptable */
@media (max-width: 576px) {
    .page-hero {
        height: 16vh;
        max-height: 16vh;
    }

    .page-hero-title h1 {
        font-size: clamp(1.5rem, 6vw, 2.25rem);
        margin-bottom: 0 !important;
    }
    .page-hero img {
        min-height: 100%;
    }
}

/* Logo centrado y limitado en mobile */
@media (max-width: 991.98px) {
    header .custom-logo { max-width: 150px; height: auto; }
    header .custom-logo-link img { max-width: 150px; height: auto; }
}

/* Utilidades de impresión */
.print-only { display: none !important; }

@media print {
    @page { margin: 10mm; }

    article.page { padding: 0 !important; margin: 0 !important; width: 100%; }

    html, body, header, footer.bg-dark.text-white, .container.bg-light {
        background: transparent !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Eliminar fondos/efectos y esconder elementos no esenciales */
    .vdv-sky-background,
    .sidebar-tools,
    .back-to-top,
    .wp-block-navigation,
    .btn,
    .badge,
    .alert { display: none !important; }

    /* El menú ya tiene d-print-none, reforzamos utilidades comunes */
    .d-print-none { display: none !important; }
    .print-only { display: block !important; }

    /* Contenido a una sola columna y máximo ancho */
    .container,
    .container-fluid { max-width: 100% !important; padding: 0 !important;}
    .container {
        width: auto;
    }
    /* Tipografía legible y sin sombras */
    * { box-shadow: none !important; text-shadow: none !important;  }

    /* Enlaces subrayados y opcionalmente con URL visible */
    a, a:visited { color: #000 !important; text-decoration: underline; }
    /* a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.9em; } */

    /* Hero: mostrar título, ocultar imagen y ajustar altura */
    .page-hero { height: auto !important; max-height: none !important; }
    .page-hero-img { display: none !important; }
    .page-hero-title { background: transparent !important; padding: 0 !important; }

    /* Logo: limitar ancho máximo a 150px */
    header .custom-logo,
    .custom-logo,
    header .site-logo img,
    header a img { max-width: 150px !important; width: auto !important; height: auto !important; }

    /* Evitar cortes desagradables */
    h1, h2, h3, h4 { page-break-after: avoid; }
    img, table, pre, blockquote { page-break-inside: avoid; }

    /* Marca de agua para PDF - oculta para bibliografía */
    body:not(.category-bibliografia)::before {
        content: "vidadespuesdelavida.com.ar";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 3rem;
        font-weight: 300;
        color: rgba(0, 0, 0, 0.05);
        z-index: -1;
        pointer-events: none;
        white-space: nowrap;
    }
}