/*
Theme Name: Logopedia Málaga
Theme URI: https://www.logopediamalaga.com
Author: Logopedia Málaga
Description: Tema de bloques a medida para Logopedia Málaga (Cristina Guijarro, logopeda). Mantiene la estructura y los contenidos del sitio anterior con un diseño renovado.
Version: 1.0.5
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: logopedia-malaga
*/

/* ---------- Base ---------- */

html {
	scroll-behavior: smooth;
}

:where(a) {
	text-underline-offset: 0.18em;
}

/* Clase heredada usada en los contenidos (párrafos y listas justificados) */
.justificar {
	text-align: justify;
	hyphens: auto;
}

.grecaptcha-badge {
	visibility: hidden;
}

/* ---------- Barra superior y cabecera ---------- */

.lm-topbar a {
	color: inherit;
	text-decoration: none;
}

.lm-topbar a:hover {
	text-decoration: underline;
}

.lm-icon::before {
	display: inline-block;
	width: 1.2em;
	margin-right: 0.35em;
	text-align: center;
}

.lm-icon-mail::before {
	content: "✉";
}

.lm-icon-phone::before {
	content: "☎";
}

.lm-header {
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 1px 0 var(--wp--preset--color--line), 0 6px 18px rgba(17, 123, 131, 0.06);
}

.admin-bar .lm-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	.admin-bar .lm-header {
		top: 0;
	}
}

.lm-header .wp-block-site-logo img {
	height: auto;
}

.lm-header .wp-block-navigation-item__content {
	padding: 0.35em 0;
	border-bottom: 2px solid transparent;
}

.lm-header .wp-block-navigation-item__content:hover,
.lm-header .current-menu-item > .wp-block-navigation-item__content {
	border-bottom-color: var(--wp--preset--color--accent);
}

.lm-header .wp-block-navigation {
	font-size: 1rem;
}

.lm-header .wp-block-navigation-item__content,
.lm-header-cta .wp-block-button__link {
	white-space: nowrap;
}

@media (min-width: 600px) and (max-width: 900px) {
	.lm-header-cta {
		display: none !important;
	}
}

@media (max-width: 781px) {
	.lm-topbar > .wp-block-group > p:first-child {
		display: none;
	}

	.lm-topbar > .wp-block-group {
		justify-content: center !important;
	}

	.lm-header .wp-block-site-logo img {
		width: 130px !important;
	}
}

@media (max-width: 480px) {
	.lm-header-cta {
		display: none !important;
	}
}

/* ---------- Portada ---------- */

.lm-hero .wp-block-cover__inner-container {
	max-width: var(--wp--style--global--wide-size);
}

.lm-hero-card {
	backdrop-filter: blur(2px);
}

.lm-kicker {
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* WordPress añade relleno por defecto a los grupos con fondo: las tarjetas no lo necesitan */
.wp-block-group.lm-card,
.wp-block-group.lm-post-card {
	padding: 0;
}

.lm-card .wp-block-image,
.lm-card .wp-block-image a,
.lm-card .wp-block-image img,
.lm-post-card .wp-block-post-featured-image,
.lm-post-card .wp-block-post-featured-image a,
.lm-post-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
}

@media (min-width: 782px) and (max-width: 1080px) {
	.lm-services .wp-block-columns {
		flex-wrap: wrap !important;
	}

	.lm-services .wp-block-columns > .wp-block-column {
		flex-basis: calc(50% - 1rem) !important;
		flex-grow: 1;
	}
}

.lm-card {
	height: 100%;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lm-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px rgba(17, 123, 131, 0.14);
}

.lm-card .wp-block-image {
	margin: 0;
}

.lm-card .wp-block-image img {
	width: 100%;
	aspect-ratio: 642 / 300;
	object-fit: cover;
}

.lm-services .wp-block-column {
	display: flex;
}

.lm-services .lm-card {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.lm-services .lm-card .lm-card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.lm-services .lm-card .lm-card-body .wp-block-buttons {
	margin-top: auto;
}

.lm-profile-photo img {
	border-radius: 999px;
	aspect-ratio: 1;
	object-fit: cover;
	border: 6px solid var(--wp--preset--color--base);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* ---------- Tarjetas del blog ---------- */

.lm-post-card {
	height: 100%;
	overflow: hidden;
}

.lm-post-card .wp-block-post-featured-image {
	margin: 0;
}

.lm-post-card .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.lm-post-card .wp-block-post-title a {
	text-decoration: none;
}

.lm-post-card .wp-block-post-title a:hover {
	text-decoration: underline;
}

/* ---------- Barra lateral ---------- */

@media (min-width: 782px) {
	.lm-sidebar-sticky {
		position: sticky;
		top: 7rem;
	}
}

.lm-sidebar strong {
	color: var(--wp--preset--color--primary);
}

/* ---------- Página de contacto (clases heredadas del contenido) ---------- */

/* El contenido antiguo usa bloques HTML con estilos en línea (inline-block, float, <br>) */
.lm-contacto .entry-content > div[style*="inline-block"] {
	display: grid !important;
	grid-template-columns: 1fr 1.3fr;
	gap: 2rem;
	align-items: center;
	width: 100%;
}

.lm-contacto .entry-content > div[style*="float"] {
	float: none !important;
	margin-top: 2.5rem !important;
	margin-bottom: 0 !important;
}

.lm-contacto .entry-content > p:has(> br:only-child),
.lm-contacto .entry-content > br {
	display: none;
}

@media (max-width: 781px) {
	.lm-contacto .entry-content > div[style*="inline-block"] {
		grid-template-columns: 1fr;
	}
}

.texto-contacto h4 {
	margin-top: 0;
	color: var(--wp--preset--color--primary);
}

.caja-contacto {
	padding: 2rem 2.25rem;
	border-radius: 16px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}

.caja-contacto h1 {
	margin-top: 0;
	font-size: var(--wp--preset--font-size--x-large);
	color: var(--wp--preset--color--base);
}

.caja-contacto ul {
	margin: 0;
	padding: 0;
}

.caja-contacto hr {
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.caja-contacto li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4rem;
}

.caja-contacto a,
.caja-contacto .contacto {
	color: var(--wp--preset--color--base);
	font-size: 1.15rem;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.caja-contacto .fa-envelope::before {
	content: "✉";
}

.caja-contacto .fa-phone::before {
	content: "☎";
}

.caja-contacto .fa {
	font-style: normal;
}

/* ---------- Formularios (Contact Form 7 y búsqueda) ---------- */

.wpcf7 form p {
	margin: 0 0 1.1rem;
}

.wpcf7 label {
	display: block;
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="date"],
.wpcf7 input[type="number"],
.wpcf7 input[type="url"],
.wpcf7 select,
.wpcf7 textarea,
.wp-block-search__input {
	width: 100%;
	margin-top: 0.35rem;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	box-sizing: border-box;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus,
.wp-block-search__input:focus {
	outline: 3px solid rgba(17, 123, 131, 0.25);
	border-color: var(--wp--preset--color--primary);
}

.wpcf7 input[type="submit"] {
	padding: 0.85rem 1.8rem;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--primary-dark);
}

.wpcf7 .wpcf7-list-item {
	margin: 0 1rem 0 0;
}

/* ---------- Pie ---------- */

.lm-footer a {
	color: inherit;
}

.lm-footer .wp-block-navigation-item__content {
	text-decoration: none;
}

.lm-footer .wp-block-navigation-item__content:hover {
	text-decoration: underline;
}

.lm-footer .wp-block-social-links .wp-social-link {
	background: rgba(255, 255, 255, 0.12);
	color: var(--wp--preset--color--base);
}

.lm-footer .wp-block-social-links .wp-social-link:hover {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}

.lm-footer .wp-block-search__button {
	border-radius: 10px;
}

/* ---------- Contenido de páginas antiguas ---------- */

.entry-content .wp-block-image.alignleft,
.entry-content figure.alignleft {
	margin-right: 1.5rem;
	margin-bottom: 1rem;
}

.entry-content img {
	border-radius: 10px;
}

@media (max-width: 781px) {
	.entry-content .alignleft,
	.entry-content .alignright {
		float: none;
		margin-left: 0;
		margin-right: 0;
	}

	.entry-content .alignleft img,
	.entry-content .alignright img {
		width: 100% !important;
		height: auto !important;
	}

	.justificar {
		text-align: left;
	}
}
