/*
Theme Name: Clinica Ma i Cos
Description: Tema propio de Clínica Mà i Cos: fisioterapia y osteopatía en Sagunto. Bilingüe (es/en) mediante Polylang.
Author: Lukas Polak
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.2
Text Domain: maicos
*/

/* Clínica Mà i Cos — hoja de estilos principal */

:root {
  --teal: #02aaa5;
  --teal-dark: #04726f;
  --teal-deep: #063f3d;
  --ink: #16302e;
  --muted: #5d6f6d;
  --line: #e3e8e6;
  --bg: #ffffff;
  --bg-soft: #f5f8f7;
  --bg-warm: #faf7f2;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(6, 63, 61, .06), 0 12px 32px rgba(6, 63, 61, .07);
  --wrap: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-dark); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: .75rem;
  font-weight: 700; color: var(--teal); margin-bottom: .8rem;
}
.lead { font-size: 1.15rem; color: var(--muted); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px;
  font-weight: 650; font-size: .98rem; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer; transition: .18s ease;
}
.btn-primary { background: var(--teal-dark); color: #fff; }   /* 5,77:1; el teal claro se quedaba en 2,88:1 */
.btn-primary:hover { background: var(--teal-deep); transform: translateY(-1px); }
.btn-ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-outline { border-color: var(--teal); color: var(--teal-dark); }
.btn-outline:hover { background: var(--teal); color: #fff; }

/* ---------- cabecera ---------- */
.topbar {
  background: var(--teal-deep); color: #cdeceb;
  font-size: .84rem; padding: .45rem 0;
}
.topbar .wrap { display: flex; gap: 1.4rem; justify-content: flex-end; flex-wrap: wrap; }
.topbar a { color: #eafaf9; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 74px; }

.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { width: auto; height: 44px; }

.nav { margin-left: auto; }
/* conmutador de idioma */
.lang-switch {
  margin-left: 1rem; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-decoration: none;
  color: var(--ink); background: #fff;
}
.lang-switch:hover { border-color: var(--teal); color: var(--teal-dark); }
.nav ul { display: flex; align-items: center; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: .45rem .55rem; border-radius: 8px; white-space: nowrap;
  text-decoration: none; color: var(--ink); font-size: .88rem; font-weight: 550;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--bg-soft); color: var(--teal-dark); }
/* el botón del menú necesita ganar a «.nav a», si no hereda el color oscuro */
.nav .btn-primary { color: #fff; }
.nav .btn-primary:hover { background: var(--teal-deep); color: #fff; }

.has-sub { position: relative; }
.has-sub > ul {
  position: absolute; top: 100%; left: 0; display: none; flex-direction: column;
  min-width: 250px; padding: .5rem; gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.has-sub:hover > ul, .has-sub:focus-within > ul { display: flex; }
.has-sub > a::after { content: "▾"; font-size: .7em; margin-left: .35em; color: var(--muted); }

.nav-cta { margin-left: .5rem; }

.burger {
  display: none; margin-left: auto; background: none; border: 0;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); padding: .3rem .5rem;
}

/* ---------- hero ---------- */
.hero { position: relative; color: #fff; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(6, 63, 61, .92) 0%, rgba(6, 63, 61, .72) 45%, rgba(2, 170, 165, .35) 100%);
}
.hero img.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .wrap { position: relative; z-index: 2; padding: clamp(4rem, 11vw, 8rem) 0; max-width: 780px; margin-inline: auto; }
.hero h1 { color: #fff; margin-bottom: .4em; }
.hero p { font-size: 1.15rem; color: #d8ecea; max-width: 46ch; }
.hero .actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.8rem; }

.page-hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 3rem 0 2.6rem; }
.page-hero h1 { margin-bottom: .3em; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .9rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--teal-dark); }

/* ---------- franja de confianza ---------- */
.trust { background: var(--bg-warm); border-bottom: 1px solid var(--line); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding: 2rem 0; }
.trust-item strong { display: block; font-size: 1.5rem; color: var(--teal-dark); }
.trust-item span { font-size: .88rem; color: var(--muted); }

/* ---------- secciones ---------- */
section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 680px; margin: 0 auto 2.8rem; text-align: center; }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- tarjetas de servicio ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; }
.card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; transition: .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfe4e2; }
.card-img { aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: .4rem; }
.card-body p { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.card-more { margin-top: auto; font-weight: 650; color: var(--teal-dark); font-size: .92rem; }

/* ---------- dos columnas ---------- */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- contenido de artículo ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3rem; align-items: start; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { margin-top: 1.6rem; color: var(--teal-dark); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose > img { border-radius: var(--radius); margin: 0 0 2rem; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.prose > p:first-of-type { font-size: 1.12rem; color: #33504d; }

.sidebar { position: sticky; top: 100px; display: grid; gap: 1.2rem; }
.side-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.side-card h3 { margin-bottom: .6rem; }
.side-card p { font-size: .93rem; color: var(--muted); }
.side-card .btn { width: 100%; justify-content: center; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list a { display: block; padding: .5rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: .93rem; }
.side-list li:last-child a { border-bottom: 0; }
.side-list a:hover { color: var(--teal); }

/* ---------- banda CTA ---------- */
.cta-band { background: var(--teal-deep); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #b9dedc; max-width: 52ch; margin-inline: auto; }
.cta-band .actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }

/* ---------- galería ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.gallery img { border-radius: 10px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1.1rem; }
.contact-list li { display: flex; gap: .9rem; align-items: flex-start; }
.contact-list .ico {
  flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--bg-soft);
  display: grid; place-items: center; font-size: 1.05rem;
}
.contact-list strong { display: block; font-size: .95rem; }
.contact-list span, .contact-list a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.contact-list a:hover { color: var(--teal-dark); }

form.contact-form { display: grid; gap: 1rem; background: var(--bg-soft); padding: 1.8rem; border-radius: var(--radius); border: 1px solid var(--line); }
form.contact-form label { font-size: .88rem; font-weight: 650; display: block; margin-bottom: .35rem; }
form.contact-form input, form.contact-form textarea, form.contact-form select {
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-size: .95rem; background: #fff;
}
form.contact-form input:focus, form.contact-form textarea:focus, form.contact-form select:focus {
  outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal);
}
form.contact-form .consent { display: flex; gap: .6rem; align-items: flex-start; font-size: .85rem; color: var(--muted); }
form.contact-form .consent input { width: auto; margin-top: .25rem; }

.map { border: 0; width: 100%; height: 380px; border-radius: var(--radius); }

/* ---------- pie ---------- */
.site-footer { background: var(--teal-deep); color: #c9e4e3; padding: 3.5rem 0 0; font-size: .93rem; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.site-footer a { color: #c9e4e3; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-logo {
  display: inline-block; background: #fff; padding: .6rem .9rem;
  border-radius: 10px; margin-bottom: 1rem;
}
.footer-logo img { width: auto; height: 40px; }
.social { display: flex; gap: .6rem; }
.social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff;
}
.social a:hover { background: var(--teal); }

.footer-gva { margin-top: 1.2rem; }
.footer-gva span { display: block; font-size: .78rem; opacity: .75; margin-bottom: .4rem; }
.footer-gva img { width: 150px; height: auto; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12); padding: 1.2rem 0;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .85rem;
}
.footer-bottom ul { display: flex; gap: 1.2rem; }

/* ---------- banner de la subvención ---------- */
.funding {
  background: #fff; border-radius: var(--radius); padding: 1rem 1.3rem;
  margin: 0 0 2rem; display: flex; justify-content: center;
}
.funding img { width: 100%; max-width: 620px; height: auto; }
.funding-band { background: var(--bg-warm); border-top: 1px solid var(--line); padding: 2.4rem 0; }
.funding-band .funding { margin: 0; border: 1px solid var(--line); }
@media (max-width: 560px) { .funding { padding: .8rem; } }

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: .5rem;
  background: #0f7a6c; color: #fff; text-decoration: none; font-weight: 650; font-size: .93rem;  /* verde WhatsApp oscuro: 5,22:1 */
  padding: .8rem 1.1rem; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.wa-float:hover { background: #0f7a6c; color: #fff; }

/* ---------- aviso de cookies ---------- */
.cookie-bar {
  position: fixed; left: 18px; right: 18px; bottom: 18px; z-index: 70;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.3rem;
  display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; font-size: .9rem;
  max-width: 720px; margin-inline: auto;
}
.cookie-bar p { margin: 0; flex: 1 1 320px; color: var(--muted); }
.cookie-bar .btn { padding: .6rem 1.2rem; font-size: .9rem; }
.cookie-bar[hidden] { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .layout, .contact-grid, .split { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trust .wrap { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1180px) {
  .burger { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    padding: .8rem 1.25rem 1.4rem; max-height: 75vh; overflow-y: auto;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: .7rem .4rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .has-sub > ul { position: static; display: flex; box-shadow: none; border: 0; padding: 0 0 0 1rem; min-width: 0; }
  .has-sub > a::after { content: ""; }
  .nav-cta { margin: 1rem 0 0; }
  .lang-switch { margin-left: auto; }
  .nav-cta a { border-radius: 999px; text-align: center; border-bottom: 0; }
  .topbar .wrap { justify-content: center; gap: 1rem; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .footer-grid, .trust .wrap { grid-template-columns: 1fr; }
  .wa-float span { display: none; }
}

/* ---------- mapa con consentimiento ---------- */
.map-consent {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; display: flex; flex-direction: column; align-items: flex-start; gap: .9rem;
}
.map-consent p { margin: 0; font-size: .9rem; color: var(--muted); }
.map-open { font-size: .88rem; }

/* ---------- errores del formulario ---------- */
.form-errors {
  background: #fdecec; border: 1px solid #e6b3b3; color: #8a2b2b;
  border-radius: var(--radius); padding: .9rem 1.1rem; font-size: .9rem;
}
.form-errors p { margin: 0 0 .3rem; }
.form-errors p:last-child { margin: 0; }
