/* Andrea Samblancat — Psicóloga Online
   Sistema de diseño "Guided Tranquility" (ver DESIGN.md), CSS a mano —
   sin Tailwind runtime, para maximizar performance/INP. */

*, *::before, *::after { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    /* Paleta fija (no editable desde el admin) */
    --surface: #faf9f7;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f4f3f1;
    --surface-container: #efeeec;
    --surface-container-high: #e9e8e6;
    --surface-container-highest: #e3e2e0;
    --on-surface-variant: #42474b;
    --outline-variant: #c2c7cb;
    --on-primary: #ffffff;
    --primary-container: #5d737e;
    --on-primary-container: #e9f7ff;
    --on-secondary: #ffffff;
    --secondary-container: #c9e7cc;
    --on-secondary-container: #4e6953;
    --on-tertiary: #ffffff;
    --tertiary-container: #e9e1d7;

    /* Paleta editable desde /admin/ (estos valores son fallback;
       el <style> inline generado por index.php los sobreescribe) */
    --primary: #455a65;
    --secondary: #4a654f;
    --tertiary: #5b574f;
    --background: #faf9f7;
    --surface-card: #ffffff;
    --on-surface: #1a1c1b;

    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    --gutter: 24px;
    --container-max: 1120px;
    --margin-desktop: 64px;
    --margin-mobile: 20px;
    --section-gap: 72px;

    --shadow-soft: 0 4px 20px rgba(93, 115, 126, 0.08);
    --font-serif: "Source Serif 4", Georgia, serif;
    --font-body: "Hanken Grotesk", -apple-system, Segoe UI, Roboto, sans-serif;
}

@media (min-width: 768px) {
    :root { --section-gap: 120px; }
}

body {
    margin: 0;
    overflow-x: hidden;
    background-color: var(--background);
    color: var(--on-surface);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 24px;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary);
    color: var(--on-primary);
    padding: 12px 20px;
    z-index: 100;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--margin-mobile);
}
@media (min-width: 768px) {
    .container { padding: 0 32px; }
}
@media (min-width: 1024px) {
    .container { padding: 0 var(--margin-desktop); }
}

.section-alt { background: var(--surface-container-low); }

/* Espaciado editable por seccion desde /admin/ (variables definidas
   inline en index.php, con estos valores como respaldo por si faltaran). */
.sec-hero { padding-top: var(--sp-hero-top, 64px); padding-bottom: var(--sp-hero-bottom, 64px); }
.sec-benefits { padding-top: var(--sp-benefits-top, 120px); padding-bottom: var(--sp-benefits-bottom, 120px); }
.sec-services { padding-top: var(--sp-services-top, 120px); padding-bottom: var(--sp-services-bottom, 120px); }
.sec-steps { padding-top: var(--sp-steps-top, 120px); padding-bottom: var(--sp-steps-bottom, 120px); }
.sec-about { padding-top: var(--sp-about-top, 120px); padding-bottom: var(--sp-about-bottom, 120px); }
.sec-testimonials { padding-top: var(--sp-testimonials-top, 120px); padding-bottom: var(--sp-testimonials-bottom, 120px); }
.sec-faq { padding-top: var(--sp-faq-top, 120px); padding-bottom: var(--sp-faq-bottom, 120px); }
.sec-contact { padding-top: var(--sp-contact-top, 120px); padding-bottom: var(--sp-contact-bottom, 120px); }

.eyebrow {
    color: var(--secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    color: var(--primary);
    margin: 0;
    font-weight: 500;
}

h1 {
    font-size: 26px;
    line-height: 33px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
@media (min-width: 1024px) {
    h1 { font-size: 48px; line-height: 56px; letter-spacing: -0.02em; }
}

h2 { font-size: 28px; line-height: 36px; }
@media (min-width: 1024px) {
    h2 { font-size: 32px; line-height: 40px; }
}

h3 { font-size: 22px; line-height: 30px; }
@media (min-width: 1024px) {
    h3 { font-size: 24px; line-height: 32px; }
}

p { margin: 0; }
.text-body-lg { font-size: 18px; line-height: 28px; }
.text-muted { color: var(--on-surface-variant); }

/* Respeta los saltos de linea cargados desde los campos de texto del admin */
.hero-subtitle,
.text-muted,
.card p,
.service-card p,
.step-item p,
.about-bio,
.testimonial-card p,
.faq-answer p,
.contact-info p {
    white-space: pre-line;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 200ms ease, color 200ms ease, transform 150ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-container); }
.btn-hero-secondary { background: var(--hero-secondary-bg); color: var(--hero-secondary-text); }
.btn-hero-secondary:hover { opacity: 0.9; }
.btn-invert { background: #ffffff; color: var(--primary); }
.btn-invert:hover { background: var(--surface-container-low); }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 249, 247, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
}
.brand {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.brand-logo {
    display: block;
    height: 40px;
    width: auto;
}
.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}
.brand-name {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--primary);
    font-weight: 500;
}
.brand-subtitle {
    margin-top: 2px;
    font-size: 12px;
}
.nav-links {
    display: none;
    align-items: center;
    gap: 32px;
}
.nav-links a {
    text-decoration: none;
    color: var(--on-surface-variant);
    font-size: 15px;
    padding-bottom: 4px;
    transition: color 200ms ease;
}
.nav-links a:hover { color: var(--primary); }
.nav-cta { margin-left: 8px; }
.nav-links a.nav-cta,
.nav-links a.nav-cta:hover { color: var(--on-primary); padding-bottom: 12px; }
.nav-toggle {
    background: none;
    border: none;
    color: var(--primary);
    padding: 8px;
    display: flex;
}
.nav-toggle svg { width: 28px; height: 28px; }
@media (min-width: 900px) {
    .nav-links { display: flex; }
    .nav-toggle { display: none; }
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px var(--margin-mobile) 20px;
    background: var(--surface);
    border-top: 1px solid var(--outline-variant);
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a {
    text-decoration: none;
    color: var(--on-surface-variant);
    padding: 12px 4px;
    border-bottom: 1px solid var(--surface-container-low);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
}
.hero-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--secondary) 22%, transparent), transparent 55%),
        radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--tertiary) 18%, transparent), transparent 60%),
        var(--background);
}
.hero-art-photo {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        color-mix(in srgb, var(--background) 90%, transparent) 0%,
        color-mix(in srgb, var(--background) 60%, transparent) 45%,
        color-mix(in srgb, var(--background) 28%, transparent) 100%
    );
    backdrop-filter: blur(1px);
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero-subtitle { margin: 24px 0 40px; color: var(--on-surface-variant); }
.hero-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px; }
.hero-actions .btn { align-self: center; flex: 0 1 auto; }
@media (min-width: 560px) {
    .hero-actions { gap: 16px; }
}

/* ---------- Grid de tarjetas (beneficios) ---------- */
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gutter);
}
@media (min-width: 768px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Slideshow mobile (reutilizado por "por que elegir terapia online" y por
   "Servicios"): todas las tarjetas ocupan la misma celda de grid (una
   encima de otra) y se cruzan con fade, asi no hay salto de scroll ni
   descentrado. Los puntos quedan superpuestos dentro de la tarjeta, abajo.
   En desktop no se activa: sigue siendo la grilla de 3 columnas de siempre. */
.carousel-dots { display: none; }
@media (max-width: 767px) {
    .slideshow-mobile { display: grid; touch-action: pan-y; }
    .slideshow-mobile .card {
        grid-area: 1 / 1;
        opacity: 0;
        visibility: hidden;
        transition: opacity 450ms ease;
        padding-bottom: 56px;
    }
    .slideshow-mobile .card.is-active { opacity: 1; visibility: visible; }
    .slideshow-mobile .carousel-dots {
        grid-area: 1 / 1;
        align-self: end;
        justify-self: center;
        display: flex;
        gap: 8px;
        margin-bottom: 18px;
        padding: 8px 10px;
        border-radius: var(--radius-full);
        background: rgba(0, 0, 0, 0.08);
        z-index: 2;
    }
}
.carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.25);
    transition: background-color 200ms ease, transform 200ms ease;
}
.carousel-dot.is-active { background: var(--primary); transform: scale(1.3); }

.section-heading { text-align: center; margin-bottom: 48px; }
.section-heading .rule {
    width: 64px;
    height: 4px;
    background: var(--secondary-container);
    margin: 16px auto 0;
    border-radius: var(--radius-full);
}

.card {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 32px;
    text-align: center;
    transition: transform 200ms ease;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-4px); }
.card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    background: var(--tertiary-container);
    color: var(--primary);
}
.card-icon svg { width: 28px; height: 28px; }
.card-icon-outline { background: #ffffff; border: 2px solid var(--primary); }
.card h3 { margin-bottom: 12px; }
.card p { color: var(--on-surface-variant); line-height: 1.6; margin-bottom: 20px; }
.card .btn { margin-top: auto; align-self: center; }
.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin-bottom: 14px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: opacity 200ms ease;
}
.btn-cta:hover { opacity: 0.85; }

/* ---------- Pasos ---------- */
.steps-wrap {
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: center;
}
@media (min-width: 900px) {
    .steps-wrap { flex-direction: row; align-items: stretch; }
}
.steps-list { flex: 1; display: flex; flex-direction: column; gap: 40px; width: 100%; }
.steps-cta { align-self: center; margin-top: 12px; }
.step-item { display: flex; gap: 20px; align-items: flex-start; }
.step-num {
    font-family: var(--font-serif);
    font-size: 40px;
    color: var(--primary);
    opacity: 0.35;
    line-height: 1;
}
.step-item h4 { margin-bottom: 8px; font-size: 20px; }
.step-item p { color: var(--on-surface-variant); }
.steps-visual {
    flex: 1;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    background: var(--surface-container);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.steps-card {
    background: var(--surface-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 28px;
    width: 100%;
    max-width: 320px;
}
.steps-card .row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.steps-card .avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.steps-card .bar { height: 12px; border-radius: var(--radius-full); background: var(--surface-container-low); margin-bottom: 10px; }
.steps-card .bar.w-80 { width: 80%; }
.steps-card .bar.w-60 { width: 60%; }
.steps-card .cta-ghost { margin-top: 20px; height: 36px; width: 96px; border-radius: var(--radius-full); background: var(--primary); margin-left: auto; }

/* ---------- Sobre mí ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    align-items: center;
}
@media (min-width: 900px) {
    .about-grid { grid-template-columns: 1fr 1fr; gap: var(--section-gap); }
}
.about-portrait {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 8px solid var(--surface-container-lowest);
    background: linear-gradient(160deg, var(--primary-container) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.about-portrait svg { width: 40%; height: 40%; color: rgba(255,255,255,0.85); }
.about-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-badge {
    position: absolute;
    bottom: -20px;
    right: -20px;
    background: var(--badge-bg);
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    width: max-content;
    text-align: center;
    white-space: nowrap;
    line-height: 1.3;
    display: none;
}
@media (min-width: 1100px) {
    .about-badge { display: block; }
}
.about-badge p:first-child { font-weight: 600; font-size: 14px; color: var(--badge-text); letter-spacing: 0.03em; }
.about-badge p:last-child { color: var(--badge-text); font-size: 13px; margin-top: 2px; }
.about-bio { margin: 20px 0; color: var(--on-surface-variant); line-height: 1.7; }
.tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 28px 0 40px; }
.tag {
    padding: 7px 13px;
    border-radius: var(--radius-full);
    background: var(--tag-bg);
    color: var(--secondary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Testimonios ---------- */
.testimonial-quote { text-align: center; font-family: var(--font-serif); font-style: italic; margin-bottom: 48px; }
.testimonial-card {
    background: var(--background);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-xl);
    padding: 32px;
}
.testimonial-card p { font-style: italic; color: var(--on-surface-variant); margin-bottom: 24px; line-height: 1.7; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-author .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--secondary-container);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px; color: var(--secondary);
}
.testimonial-author span { font-weight: 600; color: var(--primary); font-size: 14px; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-family: var(--font-serif);
    font-size: 17px;
    color: var(--primary);
}
.faq-question .chev { transition: transform 300ms ease; flex-shrink: 0; }
.faq-question .chev svg { width: 20px; height: 20px; }
.faq-item.is-open .chev { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 350ms ease;
}
.faq-answer p {
    padding: 0 24px 20px;
    color: var(--on-surface-variant);
    line-height: 1.7;
}

/* ---------- Contacto ---------- */
.contact-panel {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
@media (min-width: 900px) {
    .contact-panel { flex-direction: row; }
}
.contact-info {
    background: var(--primary);
    color: var(--on-primary);
    padding: 48px;
    flex: 0 0 40%;
}
.contact-info h2 { color: var(--on-primary); margin-bottom: 20px; }
.contact-info p { color: rgba(255,255,255,0.8); margin-bottom: 32px; }
.contact-info .item { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.contact-info .item svg { width: 22px; height: 22px; flex-shrink: 0; }
.contact-booking-cta { margin-top: 32px; text-align: center; }
.contact-booking-cta p { margin-bottom: 16px; }
.contact-form { padding: 48px; flex: 1; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
@media (min-width: 640px) {
    .form-row.two-col { grid-template-columns: 1fr 1fr; }
}
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--on-surface-variant); margin-bottom: 8px; letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--surface-container-low);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--on-surface);
    min-height: 48px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.consent-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.consent-row input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--primary); }
.consent-row span { font-size: 14px; color: var(--on-surface-variant); }

/* ---------- Páginas internas (CMS de bloques) ---------- */
.sec-page-title { padding-top: 32px; padding-bottom: 12px; }
.sec-page-content { padding-top: 8px; padding-bottom: 24px; }
@media (min-width: 768px) {
    .sec-page-title { padding-top: 48px; padding-bottom: 16px; }
    .sec-page-content { padding-top: 12px; padding-bottom: 32px; }
}
.page-breadcrumb { font-size: 13px; color: var(--on-surface-variant); margin-bottom: 16px; }
.page-breadcrumb a { color: var(--on-surface-variant); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--primary); }
.page-content { max-width: 720px; margin: 0 auto; }
.page-content > * + * { margin-top: 24px; }
.page-content h2, .page-content h3 { margin-top: 8px; }
.page-content p { line-height: 1.75; color: var(--on-surface); }
.page-content ul, .page-content ol { padding-left: 22px; line-height: 1.9; color: var(--on-surface); }
.page-content .rich-text p:last-child { margin-bottom: 0; }
.page-content .rich-text p { margin: 0 0 16px; }
.page-content .rich-text a { color: var(--secondary); }
.page-content img { width: 100%; height: auto; border-radius: var(--radius-lg); display: block; }
.page-content blockquote { margin: 0; border-left: 3px solid var(--secondary); padding-left: 20px; font-style: italic; color: var(--on-surface-variant); }
.page-content blockquote cite { display: block; margin-top: 8px; font-style: normal; font-weight: 600; font-size: 14px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-alert {
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
}
.form-alert.success { background: var(--secondary-container); color: var(--on-secondary-container); }
.form-alert.error { background: #ffdad6; color: #93000a; }

/* ---------- Recursos / blog ---------- */
.resource-list { display: flex; flex-direction: column; gap: 8px; }
.resource-list a { color: var(--secondary); text-decoration: none; font-size: 14px; }
.resource-list a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-container-low); border-top: 1px solid var(--outline-variant); margin-top: var(--section-gap); }
.footer-grid { display: flex; flex-direction: column; gap: var(--gutter); padding: 48px 0; }
@media (min-width: 768px) {
    .footer-grid { flex-direction: row; justify-content: space-between; }
}
.footer-brand .brand { display: block; margin-bottom: 12px; }
.footer-brand p { color: var(--on-surface-variant); font-size: 14px; max-width: 320px; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col span.title { font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.footer-col a { text-decoration: none; color: var(--on-surface-variant); font-size: 14px; }
.footer-col a:hover { color: var(--secondary); }

/* ---------- Animaciones ---------- */
.fade-target { opacity: 0; transform: translateY(12px); transition: opacity 700ms ease, transform 700ms ease; }
.fade-target.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .fade-target { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}
