:root{
  --azul: #005f99;
  --gris: #333;
  --gris-claro: #f5f5f5;
  --radius: 12px;
  --max-width: 1200px;
}

/* Base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--gris);
  line-height: 1.65;
  background: #fff;
}

/* ===== Header ===== */
.header {
  width: 100%;
  background: #fff;
  border-bottom: 2px solid var(--azul);
  padding: .5rem 2rem;
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin-left: 2rem;     /* alineación a la izquierda en pantallas grandes */
  margin-right: auto;
  gap: 1rem;
}
.brand { display: flex; align-items: center; text-decoration: none; color: inherit; }
.logo { max-height: 60px; margin-right: 1rem; }
.header-text h1 { margin: 0; font-size: 1.5rem; color: var(--azul); }
.header-text .subtitle {
  margin: 0;
  font-size: 1.1rem;
  color: var(--azul);
  font-weight: 500;
}

/* ===== Hero ===== */
.hero { width: 100%; background: var(--gris-claro); padding: 3rem 2rem; }
.hero-content {
  display: flex; align-items: center; justify-content: flex-start;
  max-width: var(--max-width);
  margin-left: 2rem; margin-right: auto;   /* pegado a la izquierda */
  gap: 3rem; flex-wrap: wrap;
}
.hero-img {
  flex: 1; max-width: 420px; width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.07);
}
.hero-text { flex: 2; min-width: 320px; }
.hero-text h2 { margin-top: 0; font-size: 2rem; color: var(--azul); }
.btn {
  display:inline-block; background: var(--azul); color:#fff; text-decoration:none;
  padding:.85rem 1.25rem; border-radius: 10px; font-weight: 700; margin-top: .75rem;
}
.btn:hover { opacity: .95; }
.btn-invert { background:#fff; color: var(--azul); border: 2px solid var(--azul); }

/* ===== Servicios ===== */
.servicios {
  width: 100%;
  background: #fff;
  padding: 3rem 2rem;
}

.servicios-content {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: var(--max-width);
  margin-left: 2rem;
  margin-right: auto;
  gap: 3rem;
  flex-wrap: wrap;
}

.service-img {
  flex: 1;
  max-width: 380px;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.07);
}

.servicios-text {
  flex: 2;
  min-width: 320px;
}

/* Epígrafes principales */
.servicios-text h2 {
  font-size: 1.3rem;
  color: var(--azul);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* Subepígrafes dentro de tratamientos */
.servicios-text h3 {
  font-size: 1.1rem;
  color: #0b6ea8;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.servicios-lista {
  margin: .5rem 0 1.25rem;
  padding-left: 1.2rem;
}

.nota-foco {
  font-style: italic;
  color: #555;
}



/* ===== CTA ===== */
.cta { width: 100%; background: var(--azul); color:#fff; padding: 2.5rem 2rem; }
.cta-content {
  max-width: var(--max-width);
  margin-left: 2rem; margin-right: auto; text-align: left;
}
.cta .btn-invert { margin-top: .75rem; }

/* ===== Quiénes somos ===== */
.quienes-somos { width: 100%; background: #f8f9fa; padding: 3rem 2rem; }
.qs-content {
  display: flex; align-items: center; justify-content: flex-start;
  max-width: var(--max-width);
  margin-left: 2rem; margin-right: auto;
  gap: 3rem; flex-wrap: wrap;
}
.qs-img {
  flex: 1; max-width: 420px; width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.07);
}
.qs-text { flex: 2; min-width: 320px; }
.qs-text h2 { margin-top: 0; color: var(--azul); }

/* ===== Consulta online ===== */
.online {
  padding: 3rem 2rem;
  background: #fff;
}
.online-wrap {
  max-width: var(--max-width);
  margin-left: 2rem;
  margin-right: auto;
}
.online-wrap h2 {
  color: var(--azul);
  margin-top: 0;
}
.online-wrap h3 {
  margin-top: 2rem;
  color: #0b6ea8;
}
.online-wrap ul, .online-wrap ol {
  margin: .75rem 0 1.5rem;
  padding-left: 1.5rem;
}
.online-wrap li {
  margin-bottom: .5rem;
}
.online-cta {
  margin-top: 2rem;
}

/* Ámbitos */
.ambitos { width: 100%; background: #fff; padding: 3rem 2rem; }
.ambitos-wrap {
  max-width: var(--max-width);
  margin-left: 2rem; margin-right: auto;
}
.ambitos-wrap h2 { margin-top: 0; color: var(--azul); }
.ambitos-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem; margin-top: 1.5rem;
}
.ambito {
  background: #fff; border: 1px solid #eee; border-radius: var(--radius);
  padding: 1.25rem; box-shadow: 0 2px 10px rgba(0,0,0,.06); text-align: left;
}
.ambito img {
  width: 100%; height: auto; border-radius: 10px; margin-bottom: .75rem;
}
.ambito h3 { margin: .3rem 0 .5rem; color: #0b6ea8; }
.ambito p { margin: 0; color: #444; }

/* ===== Cita ===== */
.cita { width: 100%; background:#fff; padding: 3rem 2rem; }
.cita-wrap {
  max-width: var(--max-width);
  margin-left: 2rem; margin-right: auto;
}
.cita-wrap h2 { margin-top: 0; color: var(--azul); }
.contacto { padding-left: 1.2rem; }

/* ===== Footer ===== */
.footer { background: var(--gris-claro); padding: 1.25rem 2rem; margin-top: 2rem; }
.footer-content {
  max-width: var(--max-width);
  margin-left: 2rem; margin-right: auto; text-align: left; color: #555;
}

/* ===== Responsive ===== */
@media (max-width: 900px){
  .header-content,
  .hero-content,
  .servicios-content,
  .cta-content,
  .qs-content,
  .ambitos-wrap,
  .cita-wrap,
  .footer-content {
    margin-left: auto; margin-right: auto;   /* en móvil/tablet centramos el bloque */
  }
  .header-content { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .header-right { margin-top: .25rem; }
  .hero-content, .servicios-content, .qs-content { flex-direction: column; }
  .cta-content { text-align: center; }
}
/* ===== Blog ===== */
.blog-feed,
.blog-post {
  width: 100%;
  background: #fff;
  padding: 3rem 2rem;
}

.blog-feed .container,
.blog-post .container {
  max-width: var(--max-width);
  margin: 0 auto; /* centramos el bloque, no pegado a la izquierda */
}

/* Listado de posts */
.blog-feed .post-preview {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
}

.blog-feed .post-title a {
  text-decoration: none;
  color: var(--azul);
  font-size: 1.3rem;
  font-weight: 600;
}
.blog-feed .post-title a:hover {
  color: #0b6ea8;
}

.blog-feed .post-summary {
  font-size: 1rem;
  color: #444;
  margin-top: .5rem;
}

.blog-feed h2,
.blog-feed h3 {
  font-size: 1.3rem;
  color: var(--azul);
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Post individual */

.blog-post .post-date {
  font-size: .9rem;
  color: #777;
  margin-bottom: 1.5rem;
}

.blog-post .post-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #333;
}

.blog-post .post-content p {
  margin-bottom: 1rem;
}

.blog-post .post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
}

.blog-post .post-content h2,
.blog-post .post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: .75rem;
  color: #0b6ea8;
}

.blog-post .post-content ul,
.blog-post .post-content ol {
  margin: 1rem 0 1.5rem;
  padding-left: 1.5rem;
}

.blog-post .post-content li {
  margin-bottom: .5rem;
}

/* Cabecera del post */
.post-header {
  margin-bottom: 1.5rem;
}

.post-header .back-link {
  display: inline-block;
  margin-bottom: .75rem;
  font-size: 0.95rem;
  color: var(--azul);
  text-decoration: none;
  font-weight: 500;
}

.post-header .back-link:hover {
  text-decoration: underline;
}

/* Título principal del post */
.blog-post .post-title {
  font-size: 1.3rem;
  margin: 0 0 1rem 0;
  color: var(--azul);
  text-align: left;
}

/* Ajustar encabezados que vengan desde WordPress */
.blog-post .post-content h1 {
  font-size: 1.4rem;
  margin-top: 1.5rem;
  color: #0b6ea8;
}

.blog-post .post-content h2 {
  font-size: 1.2rem;
  margin-top: 1.25rem;
  color: #0b6ea8;
}

/* ===== Contacto ===== */

.contact-form {
  max-width: 600px;
  margin: 2rem auto;
  background: #fafafa;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.contact-form .form-group {
  margin-bottom: 1.25rem;
}

.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--gris);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--azul);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,95,153,0.15);
}

.contact-form textarea {
  resize: vertical;
  min-height: 150px;
}

.contact-form .checkbox {
  display: flex;
  align-items: center;
  font-size: .9rem;
}

.contact-form .btn {
  background: var(--azul);
  color: #fff;
  padding: .85rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s ease;
}

.contact-form .btn:hover {
  opacity: .9;
}

.flash-messages {
  max-width: 600px;
  margin: 1rem auto;
  padding: .5rem;
}

.flash {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: .75rem;
  font-weight: 500;
}

.flash.ok {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.contacto {
  width: 100%;
  background: #fff;
  padding: 3rem 2rem;
}

.contacto h2 {
  font-size: 1.3rem; /* igual que servicios y blog */
  color: var(--azul);
  margin-top: 0;
  margin-bottom: 1rem;
}

.contacto p {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  text-align: left;
  color: #444;
}


/* ===== Menú hamburguesa ===== */
.hamburger {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--azul);
  cursor: pointer;
}

/* Menú normal (desktop) */
.nav-links {
  display: flex;
  gap: 1rem;
}

/* Estilos móviles */
@media (max-width: 900px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -260px; /* oculto fuera */
    height: 100vh;
    width: 240px;
    background: #fff;
    flex-direction: column;
    padding: 2rem;
    gap: 1.2rem;
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    z-index: 999;
  }

  .nav-links.active {
    right: 0; /* se abre */
  }

  .nav-links a {
    font-size: 1.1rem;
    margin: 0;
  }
}

/* ===== Navegación enlaces ===== */
.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  text-decoration: none;
  color: var(--gris);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: var(--azul);
  border-color: var(--azul);
  background: rgba(0, 95, 153, 0.05);
}
