/* ==========================================================================
   1. Variables visuales mínimas del tema
   ========================================================================== */

:root {
    --ob-v2-color-text: #111111;
    --ob-v2-color-muted: #666666;
    --ob-v2-color-border: #e5e5e5;
    --ob-v2-color-surface: #ffffff;
    --ob-v2-color-surface-soft: #f7f7f7;
    --ob-v2-radius-sm: 0.5rem;
    --ob-v2-radius-md: 1rem;
    --ob-v2-shadow-soft: 0 1rem 2.5rem rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   2. Base mínima del documento
   ========================================================================== */

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    color: var(--ob-v2-color-text);
    background: var(--ob-v2-color-surface);
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

a {
    text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ==========================================================================
   3. Estructura semántica sin controlar layout Gutenberg
   ========================================================================== */

.wp-site-blocks {
    min-height: 100vh;
}

.wp-site-blocks > header,
.wp-site-blocks > main,
.wp-site-blocks > footer {
    width: 100%;
}

main.wp-block-group {
    margin-top: 0;
}

/* ==========================================================================
   4. Header editable e independiente
   ========================================================================== */

.ob-v2-site-header {
    width: 100%;
    border-bottom: 1px solid var(--ob-v2-color-border);
}

.ob-v2-header-inner {
    padding-top: clamp(1rem, 2vw, 1.5rem);
    padding-bottom: clamp(1rem, 2vw, 1.5rem);
}

.ob-v2-header-brand {
    gap: 0.75rem;
}

.ob-v2-header-text {
    gap: 0.15rem;
}

.ob-v2-header-text .wp-block-site-title {
    margin: 0;
    font-weight: 700;
    line-height: 1.1;
}

.ob-v2-header-text .wp-block-site-tagline {
    margin: 0;
    color: var(--ob-v2-color-muted);
    line-height: 1.3;
}

.ob-v2-header-navigation {
    gap: 1rem;
}

/* ==========================================================================
   5. Footer editable e independiente
   ========================================================================== */

.ob-v2-site-footer {
    width: 100%;
    border-top: 1px solid var(--ob-v2-color-border);
}

.ob-v2-footer-shell {
    padding-top: clamp(1.5rem, 4vw, 3rem);
    padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

.ob-v2-footer-main {
    gap: clamp(1rem, 3vw, 2rem);
}

.ob-v2-footer-brand {
    gap: 0.25rem;
}

.ob-v2-footer-brand .wp-block-site-title {
    margin: 0;
    font-weight: 700;
    line-height: 1.1;
}

.ob-v2-footer-brand .wp-block-site-tagline {
    margin: 0;
    color: var(--ob-v2-color-muted);
    line-height: 1.3;
}

.ob-v2-footer-navigation {
    gap: 1rem;
}

.ob-v2-footer-bottom {
    margin-top: clamp(1rem, 3vw, 2rem);
    padding-top: clamp(1rem, 3vw, 2rem);
    border-top: 1px solid var(--ob-v2-color-border);
}

.ob-v2-footer-copy {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--ob-v2-color-muted);
}

/* ==========================================================================
   6. Sidebar editable e independiente
   ========================================================================== */

.ob-v2-site-sidebar {
    width: 100%;
    border-top: 1px solid var(--ob-v2-color-border);
    border-bottom: 1px solid var(--ob-v2-color-border);
    background: var(--ob-v2-color-surface-soft);
}

.ob-v2-sidebar-inner {
    padding-top: clamp(1.5rem, 4vw, 3rem);
    padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

/* ==========================================================================
   7. Templates principales
   ========================================================================== */

.ob-v2-template-main {
    width: 100%;
}

.ob-v2-template-404,
.ob-v2-template-archive,
.ob-v2-template-front-page,
.ob-v2-template-home,
.ob-v2-template-index,
.ob-v2-template-page,
.ob-v2-template-search,
.ob-v2-template-single {
    margin-top: 0;
}

.ob-v2-404-content,
.ob-v2-archive-header,
.ob-v2-home-header,
.ob-v2-index-header,
.ob-v2-search-header,
.ob-v2-single-header,
.ob-v2-single-footer {
    padding-top: clamp(2rem, 5vw, 4rem);
    padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

/* ==========================================================================
   8. Patterns visuales mínimos sin imponer ancho
   ========================================================================== */

.ob-v2-pattern {
    position: relative;
}

.ob-v2-hero,
.ob-v2-cta,
.ob-v2-text-image,
.ob-v2-query-cards,
.ob-v2-query-rows {
    padding-top: clamp(2.5rem, 6vw, 5rem);
    padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.ob-v2-hero > *:first-child,
.ob-v2-cta > *:first-child,
.ob-v2-text-image > *:first-child,
.ob-v2-query-cards > *:first-child,
.ob-v2-query-rows > *:first-child {
    margin-top: 0;
}

.ob-v2-hero > *:last-child,
.ob-v2-cta > *:last-child,
.ob-v2-text-image > *:last-child,
.ob-v2-query-cards > *:last-child,
.ob-v2-query-rows > *:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   9. Componentes visuales propios
   ========================================================================== */

.ob-v2-card {
    overflow: hidden;
    border: 1px solid var(--ob-v2-color-border);
    border-radius: var(--ob-v2-radius-md);
    background: var(--ob-v2-color-surface);
    box-shadow: var(--ob-v2-shadow-soft);
}

.ob-v2-card-content {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.ob-v2-card-content > *:first-child {
    margin-top: 0;
}

.ob-v2-card-content > *:last-child {
    margin-bottom: 0;
}

.ob-v2-row-item {
    padding-top: clamp(1rem, 3vw, 1.5rem);
    padding-bottom: clamp(1rem, 3vw, 1.5rem);
    border-bottom: 1px solid var(--ob-v2-color-border);
}

.ob-v2-row-item:last-child {
    border-bottom: 0;
}

.ob-v2-muted {
    color: var(--ob-v2-color-muted);
}

/* ==========================================================================
   10. Utilidades visuales propias sin reemplazar Gutenberg
   ========================================================================== */

.ob-v2-surface-soft {
    background: var(--ob-v2-color-surface-soft);
}

.ob-v2-border {
    border: 1px solid var(--ob-v2-color-border);
}

.ob-v2-rounded-sm {
    border-radius: var(--ob-v2-radius-sm);
}

.ob-v2-rounded-md {
    border-radius: var(--ob-v2-radius-md);
}

.ob-v2-shadow-soft {
    box-shadow: var(--ob-v2-shadow-soft);
}

/* ==========================================================================
   11. Bootstrap JS: soporte mínimo sin cargar Bootstrap CSS
   ========================================================================== */

.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

.tab-content > .tab-pane {
    display: none;
}

.tab-content > .active {
    display: block;
}

.fade {
    transition: opacity 0.15s linear;
}

.fade:not(.show) {
    opacity: 0;
}

/* ==========================================================================
   12. Accesibilidad básica
   ========================================================================== */

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

/* ==========================================================================
   13. Respeto de preferencias del usuario
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }

    .collapsing,
    .fade {
        transition-duration: 0.001ms !important;
    }
}