/* ===========================================================
   La Mitad del Cielo — Hoja de estilos
   Paleta de marca (extraída del logo):
   - Turquesa / teal  #1BB3AE
   - Granate          #8B1A1A
   - Blanco           #FFFFFF
   =========================================================== */

:root {
    --teal: #1bb3ae;
    --teal-dark: #128a86;
    --teal-light: #e6f7f6;
    --granate: #8b1a1a;
    --granate-dark: #6e1414;
    --blanco: #ffffff;
    --gris-texto: #2b2b2b;
    --gris-suave: #5d6368;
    --gris-fondo: #f6f7f8;
    --borde: #e3e6e8;
    --sombra: 0 6px 24px rgba(0, 0, 0, 0.08);
    --radio: 12px;
    --ancho-max: 1140px;
    --fuente: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--fuente);
    color: var(--gris-texto);
    line-height: 1.65;
    background: var(--blanco);
}

h1, h2, h3 { line-height: 1.2; color: var(--granate); margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
a { color: var(--teal-dark); }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: var(--ancho-max); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--granate);
    color: #fff; padding: .6rem 1rem; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Cabecera / navegación ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--blanco);
    border-bottom: 4px solid var(--teal);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; min-height: 76px;
}
.brand-logo { height: 52px; width: auto; }
.footer-logo { height: 64px; width: auto; margin: 0 auto; }

.site-nav ul {
    list-style: none; display: flex; gap: .35rem; margin: 0; padding: 0;
}
.site-nav a {
    display: block; padding: .55rem .9rem; border-radius: 8px;
    color: var(--gris-texto); text-decoration: none; font-weight: 600;
    transition: background .2s, color .2s;
}
.site-nav a:hover { background: var(--teal-light); color: var(--teal-dark); }
.site-nav a[aria-current="page"] {
    color: var(--teal-dark); background: transparent;
    text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px;
}

.nav-toggle {
    display: none; flex-direction: column; gap: 5px; background: none;
    border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--granate); border-radius: 3px; transition: .25s; }

/* ---------- Botones ---------- */
.btn {
    display: inline-block; padding: .8rem 1.6rem; border-radius: 50px;
    font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid transparent;
    transition: transform .15s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primario { background: var(--granate); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn-primario:hover { background: var(--granate-dark); }
.btn-secundario { background: transparent; color: #fff; border-color: #fff; }
.btn-secundario:hover { background: #fff; color: var(--granate); }
.btn-teal { background: var(--teal); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn-teal:hover { background: var(--teal-dark); }

/* ---------- Hero ---------- */
.hero {
    background:
        linear-gradient(135deg, rgba(18, 138, 134, .82) 0%, rgba(139, 26, 26, .82) 100%),
        url("../img/equipo.jpg") center / cover no-repeat;
    color: #fff; padding: clamp(3rem, 8vw, 6rem) 0;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.hero h1 { color: #fff; max-width: 28ch; margin-left: auto; margin-right: auto; }
.hero p { font-size: 1.2rem; max-width: 55ch; opacity: .96; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; justify-content: center; }

/* Hero de la página principal: foto del equipo de fondo + capa de marca encima,
   con el contenido centrado. Va DESPUÉS de las reglas .hero para ganar en la cascada. */
.hero-inicio {
    background:
        linear-gradient(135deg, rgba(18, 138, 134, .82) 0%, rgba(139, 26, 26, .82) 100%),
        url("../img/equipo.jpg") center / cover no-repeat;
    min-height: 70vh; display: flex; align-items: center;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.hero-inicio h1 { max-width: none; margin-left: auto; margin-right: auto; }
.hero-inicio p { max-width: 60ch; margin-left: auto; margin-right: auto; }
.hero-inicio .hero-actions { justify-content: center; }

/* ---------- Secciones genéricas ---------- */
.seccion { padding: clamp(3rem, 7vw, 5rem) 0; }
/* Compensa la cabecera fija al saltar a una sección por ancla (#quienes-somos, #servicios) */
section[id] { scroll-margin-top: 90px; }
.seccion-alt { background: var(--gris-fondo); }
.seccion-cabecera { max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
.seccion-cabecera p { color: var(--gris-suave); font-size: 1.1rem; }
.eyebrow {
    display: inline-block; text-transform: uppercase; letter-spacing: .12em;
    font-size: .8rem; font-weight: 700; color: var(--teal-dark); margin-bottom: .5rem;
}

/* Bloque "asociación": texto + imagen */
.bloque-presentacion {
    display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}
.bloque-presentacion .media img { border-radius: var(--radio); box-shadow: var(--sombra); }
.bloque-presentacion.invertido .media { order: -1; }

/* ---------- Tarjetas de valores ---------- */
.grid-valores {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.5rem;
}
.valor-card {
    background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
    padding: 1.8rem; box-shadow: var(--sombra); border-top: 4px solid var(--teal);
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}
.valor-card:hover {
    transform: translateY(-6px) scale(1.02);
    background: var(--teal); border-color: var(--teal);
    box-shadow: 0 14px 32px rgba(27, 179, 174, .38);
}
.valor-card:hover h3,
.valor-card:hover p { color: #fff; }
.valor-card:hover .valor-icono { background: rgba(255, 255, 255, .22); color: #fff; }
.valor-icono {
    width: 56px; height: 56px; border-radius: 50%; background: var(--teal-light);
    display: grid; place-items: center; font-size: 1.5rem; color: var(--teal); margin-bottom: 1rem;
    transition: background-color .25s ease, color .25s ease;
}
.valor-card h3 { color: var(--granate); margin-bottom: .4rem; transition: color .25s ease; }
.valor-card p { color: var(--gris-suave); margin: 0; transition: color .25s ease; }

/* ---------- Servicios ---------- */
.grid-servicios {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.5rem;
}
.servicio-card {
    background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
    padding: 1.8rem; box-shadow: var(--sombra); border-left: 5px solid var(--granate);
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}
.servicio-card:hover {
    transform: translateY(-6px) scale(1.02);
    background: var(--granate); border-color: var(--granate);
    box-shadow: 0 14px 32px rgba(139, 26, 26, .35);
}
.servicio-card:hover h3,
.servicio-card:hover p { color: #fff; }
.servicio-card h3 { color: var(--teal-dark); font-size: 1.2rem; transition: color .25s ease; }
.servicio-card p { color: var(--gris-suave); margin: 0; transition: color .25s ease; }

/* ---------- Timeline (Nuestros valores): línea central con elementos alternados ---------- */
.timeline { list-style: none; position: relative; max-width: 900px; margin: 0 auto; padding: 0; }
.timeline::before {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    top: 6px; bottom: 6px; width: 3px; background: var(--teal-light);
}
.timeline-item { position: relative; width: 50%; box-sizing: border-box; padding-bottom: 2.2rem; }
.timeline-item:nth-child(odd) { left: 0; padding-right: 3rem; text-align: right; }
.timeline-item:nth-child(even) { left: 50%; padding-left: 3rem; text-align: left; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-icono {
    position: absolute; top: 0; width: 52px; height: 52px; border-radius: 50%;
    background: var(--teal); color: #fff; display: grid; place-items: center;
    font-size: 1.2rem; box-shadow: var(--sombra); z-index: 1;
    transition: transform .25s ease, background-color .25s ease;
}
.timeline-item:nth-child(odd) .timeline-icono { right: -26px; }
.timeline-item:nth-child(even) .timeline-icono { left: -26px; }
.timeline-item:hover .timeline-icono { transform: scale(1.12); background: var(--teal-dark); }
.timeline-contenido {
    background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
    box-shadow: var(--sombra); padding: 1.1rem 1.3rem;
}
.timeline-contenido h3 { color: var(--granate); margin: 0 0 .3rem; }
.timeline-contenido p { color: var(--gris-suave); margin: 0; }

@media (max-width: 700px) {
    .timeline { max-width: 520px; }
    .timeline::before { left: 26px; transform: none; }
    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%; left: 0; text-align: left; padding: 0 0 1.6rem 70px;
    }
    .timeline-item:nth-child(odd) .timeline-icono,
    .timeline-item:nth-child(even) .timeline-icono { left: 0; right: auto; }
}

/* ---------- Slideshow (Fines estatutarios) ---------- */
.slideshow { position: relative; max-width: 760px; margin: 0 auto; padding: 0 3.5rem; }
.slides { position: relative; }
.slide {
    display: none; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
    box-shadow: var(--sombra); overflow: hidden; min-height: 240px;
}
.slide.is-active { display: flex; animation: slide-in .4s ease; }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.slide-img { flex: 0 0 45%; width: 45%; object-fit: cover; }
.slide-texto {
    flex: 1; padding: 2rem; display: flex; flex-direction: column; justify-content: center;
    text-align: left; border-left: 5px solid var(--teal);
}
.slide-num { display: inline-block; font-weight: 700; color: var(--teal-dark); margin-bottom: .6rem; }
.slide p { margin: 0; font-size: 1.15rem; line-height: 1.6; color: var(--gris-texto); }
@media (max-width: 640px) {
    .slide.is-active { flex-direction: column; }
    .slide-img { width: 100%; height: 180px; flex: none; }
    .slide-texto { border-left: none; border-top: 5px solid var(--teal); }
}
.slide-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    background: var(--teal); color: #fff; display: grid; place-items: center;
    box-shadow: var(--sombra); transition: background-color .2s, transform .2s;
}
.slide-btn:hover { background: var(--teal-dark); transform: translateY(-50%) scale(1.08); }
.slide-prev { left: 0; }
.slide-next { right: 0; }
.slide-dots { display: flex; justify-content: center; gap: .5rem; margin-top: 1.2rem; }
.slide-dots button {
    width: 11px; height: 11px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
    background: var(--borde); transition: background-color .2s, transform .2s;
}
.slide-dots button.is-active { background: var(--teal); transform: scale(1.25); }

/* ---------- Blog ---------- */
.grid-posts {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2rem;
}
.post-card {
    position: relative;
    background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
    overflow: hidden; box-shadow: var(--sombra); display: flex; flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
}
.post-card::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 2;
    background: var(--teal); transform: scaleX(0); transform-origin: left;
    transition: transform .3s ease;
}
.post-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 14px 32px rgba(27, 179, 174, .35);
}
.post-card:hover::before { transform: scaleX(1); }
.post-card .thumb { aspect-ratio: 16 / 9; background: var(--teal-light); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s ease; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .thumb.placeholder { display: grid; place-items: center; color: var(--teal); font-size: 2.5rem; }
.post-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post-meta { font-size: .85rem; color: var(--gris-suave); margin-bottom: .4rem; }
.post-body h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.post-body h3 a { color: var(--granate); text-decoration: none; }
.post-body h3 a:hover { color: var(--teal-dark); }
.post-body p { color: var(--gris-suave); flex: 1; }
.post-body .leer-mas { font-weight: 700; text-decoration: none; margin-top: .5rem; }

/* Artículo detalle */
.articulo { max-width: 760px; margin: 0 auto; }
.articulo .articulo-imagen { border-radius: var(--radio); margin: 1.5rem 0; box-shadow: var(--sombra); }
.articulo .contenido { font-size: 1.08rem; }
.articulo .contenido p { margin: 1.1rem 0; }
.volver { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; text-decoration: none; }

/* Estado vacío */
.vacio { text-align: center; color: var(--gris-suave); padding: 3rem 1rem; }

/* ---------- Contacto ---------- */
.grid-contacto { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: start; }
.contacto-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; }
.contacto-lista li { display: flex; gap: 1rem; align-items: flex-start; }
.contacto-icono {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
    background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 1.1rem;
}
.contacto-lista strong { display: block; color: var(--granate); }
.contacto-lista a { color: var(--gris-texto); text-decoration: none; }
.contacto-lista a:hover { color: var(--teal-dark); }
.contacto-aside {
    background: var(--teal-light); border-radius: var(--radio); padding: 2rem;
    border-left: 5px solid var(--teal);
}

/* Franja CTA */
.cta-franja {
    background: var(--teal); color: #fff; text-align: center;
    padding: clamp(2.5rem, 6vw, 4rem) 0;
}
.cta-franja h2 { color: #fff; }
.cta-franja p { max-width: 50ch; margin: 0 auto 1.5rem; opacity: .95; }

/* ---------- Pie ---------- */
.site-footer { background: var(--granate-dark); color: #fff; padding: 3rem 0 1.5rem; margin-top: 0; }
.footer-inner { display: grid; gap: 1.5rem; justify-items: center; text-align: center; }
.footer-brand p { color: rgba(255, 255, 255, .82); max-width: 45ch; margin: .8rem auto 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-nav a { color: #fff; text-decoration: none; font-weight: 600; opacity: .9; }
.footer-nav a:hover { opacity: 1; text-decoration: underline; }
.footer-copy { width: 100%; color: rgba(255, 255, 255, .65); font-size: .9rem; border-top: 1px solid rgba(255,255,255,.15); padding-top: 1.2rem; margin: 0; }

/* ---------- Mensajes flash ---------- */
.mensajes { margin: 1.5rem auto 0; }
.mensaje {
    padding: 1rem 1.2rem; border-radius: var(--radio); margin-bottom: .8rem;
    border-left: 5px solid; font-weight: 500;
}
.mensaje-success { background: var(--teal-light); border-color: var(--teal); color: var(--teal-dark); }
.mensaje-error { background: #fdecec; border-color: var(--granate); color: var(--granate-dark); }
.mensaje-info { background: var(--gris-fondo); border-color: var(--gris-suave); color: var(--gris-texto); }

/* ---------- Formularios ---------- */
.formulario { max-width: 720px; margin: 0 auto; }
.campo { margin-bottom: 1.2rem; }
.campo label { display: block; font-weight: 600; margin-bottom: .4rem; color: var(--gris-texto); }
.campo input,
.campo textarea,
.campo select {
    width: 100%; padding: .7rem .9rem; font: inherit; color: var(--gris-texto);
    background: #fff; border: 1px solid var(--borde); border-radius: 10px;
}
.campo input:focus,
.campo textarea:focus,
.campo select:focus {
    outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(27, 179, 174, .2);
}
.campo textarea { resize: vertical; }
.campo-ayuda { font-size: .85rem; color: var(--gris-suave); margin: .35rem 0 0; }
.campo-error { font-size: .85rem; color: var(--granate); margin: .35rem 0 0; font-weight: 600; }
.formulario-acciones { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.aviso-info {
    max-width: 720px; margin: 0 auto 2rem; padding: 1rem 1.2rem;
    background: var(--teal-light); border-left: 5px solid var(--teal);
    border-radius: var(--radio); color: var(--teal-dark);
}

/* Respeta la preferencia de reducir movimiento del sistema */
@media (prefers-reduced-motion: reduce) {
    .valor-card, .servicio-card, .post-card,
    .post-card::before, .post-card .thumb img,
    .timeline-icono, .valor-icono { transition: none; }
    .valor-card:hover, .servicio-card:hover, .post-card:hover { transform: none; }
    .post-card:hover .thumb img { transform: none; }
    .timeline-item:hover .timeline-icono { transform: none; }
    .slide.is-active { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute; top: 100%; left: 0; right: 0; background: #fff;
        border-bottom: 4px solid var(--teal); box-shadow: var(--sombra);
        max-height: 0; overflow: hidden; transition: max-height .3s ease;
    }
    .site-nav.abierto { max-height: 360px; }
    .site-nav ul { flex-direction: column; padding: .5rem 1.25rem 1rem; gap: .2rem; }
    .bloque-presentacion { grid-template-columns: 1fr; }
    .bloque-presentacion.invertido .media { order: 0; }
    .grid-contacto { grid-template-columns: 1fr; }
}
