/*
Theme Name: AIM - Atención Integral de la Mujer
Theme URI: https://ginecr.com
Author: AIM
Description: Tema para el sitio de Atención Integral de la Mujer. Compatible con WordPress 6+ y PHP 7.4 a 8.4. Requiere el plugin "AIM Contenido".
Version: 1.4.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: aim-theme
*/

:root {
	--slate: #51565f;
	--slate-dim: #c4c9d1;
	--panel: #eef2f5;
	--ink: #2e3238;
	--body: #5a5f67;
	--sky: #4db8d9;
	--sky-btn: #2f9fc6;
	--sky-text: #1b7fa0;
	--aqua: rgba(214, 243, 247, 0.84);
	--coral: #dc3f3c;
	--coral-deep: #bd2f2c;
	--line: #d8dfe5;
	--paper: #ffffff;
	--font: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--wrap: 73rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 400 1.0625rem/1.75 var(--font); color: var(--body); background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky-text); text-underline-offset: 0.18em; }
a:hover { color: var(--coral); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; line-height: 1.25; color: var(--ink); margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1.1em; }
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 100; width: auto; height: auto; clip: auto; background: var(--paper); padding: 0.6rem 1rem; }

.btn { display: inline-block; background: var(--coral); color: #fff; padding: 0.8rem 1.6rem; font-weight: 600; font-size: 1.15rem; text-decoration: none; border: 0; cursor: pointer; font-family: var(--font); }
.btn:hover { background: var(--coral-deep); color: #fff; }
.btn--ghost { background: transparent; color: var(--sky-text); border: 2px solid var(--sky-text); padding: 0.7rem 1.5rem; }
.btn--ghost:hover { background: var(--sky-text); color: #fff; }

/* Barra superior */
.topbar { background: var(--slate); color: #fff; font-size: 1rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 0.25rem 2rem; justify-content: space-between; padding-block: 0.65rem; }
.topbar__label { color: var(--slate-dim); }
.topbar__contact { display: flex; flex-wrap: wrap; gap: 0.1rem 0.9rem; justify-content: flex-end; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; color: #fff; }

/* Cabecera */
.site-header { background: var(--paper); position: relative; z-index: 20; }
.site-header .wrap { display: flex; flex-direction: column; gap: 0.6rem; padding-block: 1.6rem 0; }
.site-logo { display: flex; justify-content: space-between; align-items: center; }
.site-logo img, .custom-logo { width: min(26rem, 100%); height: auto; }
.nav-toggle { display: none; background: none; border: 2px solid var(--sky-text); color: var(--sky-text); padding: 0.45rem 0.9rem; font: 600 1rem var(--font); cursor: pointer; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.site-nav li { position: relative; }
.site-nav a { display: block; padding: 1rem 1.4rem; color: var(--body); text-decoration: none; font-size: 1.1rem; font-weight: 500; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-menu-ancestor > a { background: var(--sky-btn); color: #fff; }
.site-nav .menu-salud a { padding: 0.5rem 0.9rem; }
.site-nav .menu-salud img { height: 2.2rem; width: auto; }
.site-nav .menu-salud a:hover { background: transparent; }
.site-nav .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 16rem; background: var(--paper); border-top: 3px solid var(--sky-btn); box-shadow: 0 8px 24px rgba(46, 50, 56, 0.14); z-index: 30; }
.site-nav .sub-menu a { padding: 0.7rem 1.2rem; font-size: 1rem; }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: block; }

/* Franja de imagen, título y ruta */
.banner { height: clamp(8rem, 15vw, 12.5rem); background-color: var(--panel); background-size: cover; background-position: center; margin-top: 1.2rem; }
.page-head { background: var(--paper); }
.page-head__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-block: 1.6rem; }
.page-head__titles { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1.5rem; }
.page-title { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 400; margin: 0; color: var(--ink); line-height: 1.2; }
.crumbs { font-size: 1rem; color: var(--ink); }
.crumbs a { color: var(--ink); text-decoration: none; }
.crumbs a:hover { color: var(--coral); }
.crumbs__sep { margin-inline: 0.6rem; color: var(--body); }
.crumbs [aria-current] { color: var(--coral); }
.page-head .search-form { min-width: min(22rem, 100%); }

/* Portada: carrusel */
.hero { position: relative; background: var(--panel); overflow: hidden; margin-top: 1.2rem; }
.slide { display: none; position: relative; min-height: clamp(26rem, 72vh, 46rem); }
.slide.is-active { display: flex; align-items: flex-end; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% 0; }
.slide__inner { position: relative; z-index: 2; padding-block: 2rem 3rem; }
.slide__box { background: var(--aqua); padding: 2rem 2.2rem 2.2rem; max-width: 36rem; }
.slide__box h2 { font-weight: 300; font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1.15; margin-bottom: 0.5em; color: var(--ink); }
.slide__box h2 strong { font-weight: 800; }
.slide__box h2::after { content: "+"; content: "+" / ""; display: inline-block; width: 1em; height: 1em; margin-left: 0.5em; background: var(--coral); color: #fff; font-size: 0.5em; font-weight: 800; line-height: 1; text-align: center; vertical-align: 0.3em; }
.slide__box p { color: var(--ink); font-size: 1.2rem; margin-bottom: 1.6rem; }
/* Flechas del carrusel */
.hero__arrow { position: absolute; z-index: 3; top: 1rem; width: 2.9rem; height: 2.9rem; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(46, 50, 56, 0.55); color: #fff; cursor: pointer; }
.hero__arrow:hover { background: var(--coral); }
.hero__arrow:focus-visible { outline-color: #fff; }
.hero__arrow svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hero__arrow--prev { left: 0.75rem; }
.hero__arrow--next { right: 0.75rem; }
@media (min-width: 48rem) {
	.hero__arrow { top: 50%; transform: translateY(-50%); width: 3.4rem; height: 3.4rem; }
	.hero__arrow--prev { left: 1.5rem; }
	.hero__arrow--next { right: 1.5rem; }
}
@media (prefers-reduced-motion: no-preference) {
	.slide.is-active img { animation: slide-in 0.7s ease; }
	@keyframes slide-in { from { opacity: 0; } to { opacity: 1; } }
}

/* Secciones */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); background: var(--panel); }
.section--white { background: var(--paper); }
.section__head { max-width: 46rem; margin-inline: auto; margin-bottom: 2.2rem; text-align: center; }
.section__head--left { text-align: left; margin-inline: 0; }
.cita { text-align: center; }
.cita .entry-content { max-width: none; text-align: left; }
.cita .entry-content > * { max-width: none; }
.cita .entry-content > h2:first-child, .cita .entry-content > h3:first-child { text-align: center; }
.cita__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.destacados { display: grid; gap: 2rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.destacados h3 { border-top: 3px solid var(--sky); padding-top: 0.9rem; }
.destacados h3 a { color: inherit; text-decoration: none; }
.destacados h3 a:hover { color: var(--coral); }

.grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.card { background: var(--paper); display: flex; flex-direction: column; }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card__body { padding: 1.3rem 1.4rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: 0.35em; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--coral); }
.card__more { font-weight: 600; margin-top: auto; }

.testimonios { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.testimonio { margin: 0; padding: 1.6rem 1.8rem; background: var(--paper); border-top: 3px solid var(--coral); }
.testimonio blockquote { margin: 0 0 0.9rem; font-size: 1.1rem; font-style: italic; }
.testimonio blockquote p:last-child { margin-bottom: 0; }
.testimonio figcaption { font-weight: 700; color: var(--ink); }

/* Contenido interno */
.content { background: var(--panel); padding-block: 3rem 4.5rem; }
.entry-content > * { max-width: 100%; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content .alignwide, .entry-content .alignfull { max-width: none; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 0.5rem 0.75rem; text-align: left; }
.entry-content input[type="text"], .entry-content input[type="email"], .entry-content input[type="tel"], .entry-content textarea { width: 100%; max-width: 40rem; padding: 0.8rem 1rem; border: 1px solid var(--line); background: #fff; font: inherit; }
.entry-content label { font-weight: 700; color: var(--ink); }
.entry--narrow { max-width: 50rem; }
.pagination { margin-top: 2rem; }

/* Ficha del médico */
.doctor { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
.doctor__card { background: var(--paper); }
.doctor__card img { width: 100%; }
.doctor__id { padding: 1.6rem 1.8rem 1.8rem; }
.doctor__id h2 { font-size: 1.5rem; margin-bottom: 0.4em; }
.doctor__terms { margin: 0; line-height: 1.9; font-size: 1.1rem; }
.doctor__terms span { color: var(--sky-text); }
.doctor__facts { margin: 0; padding: 1.8rem; background: #f6f9fb; border-top: 1px solid var(--line); }
.doctor__facts div { margin-bottom: 1.2rem; }
.doctor__facts div:last-child { margin-bottom: 0; }
.doctor__facts dt { display: inline; font-weight: 700; color: var(--ink); margin-right: 0.8rem; }
.doctor__facts dd { display: inline; margin: 0; }
.doctor__main h1 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); padding-bottom: 1.1rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--line); }
.doctor__main .entry-content h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); margin-top: 1.6em; }

/* Pie */
.site-footer { background: var(--slate); color: #e4e7ec; padding-block: 3rem 1.5rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #bfe8f5; }
.site-footer h2 { color: #fff; font-size: 1.2rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.25); margin-top: 2rem; padding-top: 1rem; font-size: 0.95rem; }
.search-form { display: flex; }
.search-form label { flex: 1; min-width: 0; }
.search-form input[type="search"] { width: 100%; padding: 0.8rem 1rem; border: 0; background: var(--panel); font: inherit; color: var(--ink); }
.search-form input[type="submit"] { background: var(--sky-btn); color: #fff; border: 0; padding: 0 1.2rem; font: 600 1rem var(--font); cursor: pointer; }
.search-form input[type="submit"]:hover { background: var(--sky-text); }

@media (min-width: 56rem) {
	.doctor { grid-template-columns: minmax(18rem, 1fr) 2fr; }
}

@media (max-width: 62rem) {
	.nav-toggle { display: inline-block; align-self: flex-end; }
	.site-header .wrap { position: relative; }
	.site-nav { display: none; }
	.site-nav.is-open { display: block; padding-bottom: 1rem; }
	.site-nav > ul { flex-direction: column; align-items: stretch; }
	.site-nav .sub-menu { display: block; position: static; border: 0; box-shadow: none; padding-left: 1rem; }
	.topbar .wrap { flex-direction: column; }
	.topbar__contact { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}
