/*
Theme Name: Huntington Canarias
Theme URI: https://huntingtoncanarias.kripta.dev
Author: kripta.dev
Author URI: https://kripta.dev
Description: Tema de bloques para la Asociación Canaria de Huntington. Paleta y tipografía tomadas del logotipo; todo editable desde el editor del sitio.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: huntington
*/

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

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

:where(a, button, .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--ink);
}

/* Subrayado de rotulador en los <mark> de los titulares */
:where(h1, h2, h3) mark {
	background-color: transparent;
	background-image: linear-gradient(
		transparent 60%,
		color-mix(in srgb, var(--wp--preset--color--yellow) 70%, transparent) 60%,
		color-mix(in srgb, var(--wp--preset--color--yellow) 70%, transparent) 92%,
		transparent 92%
	);
	color: inherit;
	padding: 0 0.08em;
}

/* Las secciones a sangre van pegadas unas a otras, sin el hueco del blockGap */
.wp-site-blocks > main,
.wp-site-blocks > footer,
.section {
	margin-block: 0;
}

/* ---------- Cabecera ---------- */

/* Sticky en el <header> de la parte de plantilla: es hijo directo de .wp-site-blocks */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
}

.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.site-header {
	background: color-mix(in srgb, var(--wp--preset--color--paper) 86%, transparent);
	backdrop-filter: saturate(1.4) blur(12px);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--line) 70%, transparent);
}

.site-header .wp-block-site-logo img,
.site-header .brand-logo img {
	display: block;
}

.site-header .brand-name {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.01em;
}

.site-header .brand-name small {
	display: block;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 500;
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.site-header .brand-name a {
	color: inherit;
	text-decoration: none;
}

.site-header .wp-block-navigation a {
	text-decoration: none;
}

.site-header .wp-block-navigation-item__content {
	position: relative;
}

.site-header .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -4px;
	height: 2px;
	border-radius: 2px;
	background: var(--wp--preset--color--magenta);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

.site-header .wp-block-navigation-item__content:hover::after,
.site-header .current-menu-item > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content::after {
	display: none;
}

.site-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--paper);
}

.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	gap: 0.75rem;
}

@media (max-width: 781px) {
	.site-header .header-cta {
		display: none;
	}
}

/* ---------- Estilos de bloque ---------- */

/* Antetítulo */
.is-style-eyebrow {
	font-size: 0.78rem !important;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	line-height: 1.4;
}

/* Fondo acuarela: manchas suaves azul y amarilla como las del logo */
.is-style-blobs {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.is-style-blobs::before,
.is-style-blobs::after {
	content: "";
	position: absolute;
	z-index: -1;
	border-radius: 50%;
	filter: blur(60px);
	opacity: 0.55;
	pointer-events: none;
}

.is-style-blobs::before {
	width: min(55vw, 640px);
	aspect-ratio: 1.6;
	top: -12%;
	right: -8%;
	background: radial-gradient(closest-side, #9cc0ff, transparent);
}

.is-style-blobs::after {
	width: min(50vw, 560px);
	aspect-ratio: 1.8;
	bottom: -18%;
	left: -10%;
	background: radial-gradient(closest-side, #ffe27a, transparent);
}

/* Tarjeta */
.is-style-card {
	background: var(--wp--preset--color--white);
	border-radius: 16px;
	box-shadow: var(--wp--preset--shadow--soft);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.is-style-card:has(a):hover {
	transform: translateY(-4px);
	box-shadow: var(--wp--preset--shadow--lifted);
}

/* Polaroid */
.wp-block-image.is-style-polaroid {
	background: var(--wp--preset--color--white);
	padding: 0.75rem 0.75rem 1.1rem;
	box-shadow: var(--wp--preset--shadow--lifted);
	transform: rotate(-2.5deg);
	transition: transform 0.4s ease;
}

.wp-block-image.is-style-polaroid:hover {
	transform: rotate(0deg) scale(1.015);
}

.wp-block-image.is-style-polaroid img {
	width: 100%;
	height: auto;
	border-radius: 2px;
}

.wp-block-image.is-style-polaroid .wp-element-caption {
	margin: 0.8rem 0 0;
	text-align: center;
	font-style: italic;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
}

/* Cartel (portada) */
.wp-block-cover.is-style-poster {
	border-radius: 8px;
	box-shadow: var(--wp--preset--shadow--lifted);
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* :root sube la especificidad por encima de .js .reveal.is-visible */
:root .wp-block-cover.is-style-poster:hover {
	transform: translateY(-5px);
	box-shadow: 0 30px 60px -18px rgba(22, 36, 29, 0.45);
}

.wp-block-cover.is-style-poster .wp-block-cover__inner-container {
	width: 100%;
}

.wp-block-cover.is-style-poster h2,
.wp-block-cover.is-style-poster h3 {
	color: inherit;
}

/* Grano sutil sobre el cartel para que no parezca una tarjeta plana de app */
.wp-block-cover.is-style-poster::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	opacity: 0.07;
	mix-blend-mode: overlay;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.poster-badge {
	display: inline-block;
	align-self: flex-start;
	padding: 0.3rem 0.85rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px);
	font-size: 0.72rem !important;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Cita destacada */
.wp-block-pullquote {
	padding: 0;
	margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
}

.wp-block-pullquote p {
	font-size: clamp(1.35rem, 1rem + 1.4vw, 1.8rem);
}

.wp-block-pullquote cite,
.wp-block-quote cite {
	display: block;
	margin-top: 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.95rem;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* Botón de contorno sobre fondos oscuros o de color */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
	padding-top: calc(0.9rem - 2px);
	padding-bottom: calc(0.9rem - 2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	color: var(--wp--preset--color--ink);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: color-mix(in srgb, currentColor 12%, transparent);
}

.wp-block-button .wp-block-button__link {
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.wp-block-button .wp-block-button__link:hover {
	transform: translateY(-1px);
}

/* Lista con marcas */
.is-style-checks {
	list-style: none;
	padding-left: 0;
}

.is-style-checks li {
	position: relative;
	padding-left: 2rem;
	margin-bottom: 0.6rem;
}

.is-style-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1.2rem;
	height: 1.2rem;
	border-radius: 50%;
	background: var(--wp--preset--color--green-soft)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f7a44' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
		center / 70% no-repeat;
}

/* ---------- Secciones ---------- */

/* Cifras */
.stats .stat-number {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
	margin-bottom: 0.4rem;
}

.stats .wp-block-column {
	border-top: 2px solid color-mix(in srgb, currentColor 25%, transparent);
	padding-top: 1.25rem;
}

/* Logos de entidades */
.partners figure {
	margin: 0;
}

.partners img {
	height: 72px;
	width: auto;
	max-width: 180px;
	object-fit: contain;
	opacity: 0.72;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.partners a:hover img,
.partners img:hover {
	opacity: 1;
	transform: scale(1.04);
}

/* Logo claro sobre el pie oscuro */
.on-dark-logo img {
	filter: brightness(0) invert(1);
}

/* Rejilla de noticias */
.news-grid .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
	border-radius: 16px 16px 0 0;
}

.news-grid .wp-block-post-featured-image img {
	aspect-ratio: 16 / 10;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.news-grid .is-style-card:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.news-grid .is-style-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.news-grid .card-body {
	flex: 1;
}

/* Tarjeta sin imagen destacada: panel de color con el logo, misma proporción que la foto */
.news-grid .is-style-card:not(:has(.wp-block-post-featured-image)) {
	position: relative;
	--panel: var(--wp--preset--color--magenta);
}

.news-grid .wp-block-post:nth-child(3n + 2) .is-style-card {
	--panel: var(--wp--preset--color--blue);
}

.news-grid .wp-block-post:nth-child(3n + 3) .is-style-card {
	--panel: var(--wp--preset--color--green);
}

.news-grid .is-style-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 16 / 10;
	background:
		radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.22), transparent 55%),
		var(--panel);
}

.news-grid .is-style-card:not(:has(.wp-block-post-featured-image))::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	aspect-ratio: 16 / 10;
	background: url("assets/img/logo-bn.svg") center / 34% no-repeat;
	filter: brightness(0) invert(1);
	opacity: 0.3;
	pointer-events: none;
}

.read-more a,
a.wp-block-read-more {
	font-weight: 600;
	text-decoration: none;
}

/* Cabecera de página interior */
.page-hero h1 {
	max-width: 18ch;
}

/* Media y texto: aire arriba y abajo para que el texto no toque el borde */
.wp-block-media-text .wp-block-media-text__content {
	padding-block: var(--wp--preset--spacing--50);
}

.wp-block-media-text {
	overflow: hidden;
}

/* Mapa */
.map-embed iframe {
	display: block;
	width: 100%;
	min-height: 440px;
	border: 0;
	border-radius: 16px;
	box-shadow: var(--wp--preset--shadow--soft);
	filter: saturate(0.85);
}

/* Contenido de entradas */
.entry-content > p:first-child {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
}

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

.site-footer a {
	color: inherit;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
	text-underline-offset: 3px;
}

.site-footer a:hover {
	text-decoration-color: currentColor;
}

.site-footer .footer-links {
	list-style: none;
}

.site-footer .footer-credits {
	border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.site-footer .footer-credits a {
	text-decoration: none;
}

.site-footer .kripta-logo img {
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.site-footer .kripta-logo:hover img {
	opacity: 1;
}

/* ---------- Animación de entrada ---------- */

.js .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}

.js .reveal.delay-1 { transition-delay: 0.1s; }
.js .reveal.delay-2 { transition-delay: 0.2s; }
.js .reveal.delay-3 { transition-delay: 0.3s; }

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

	.js .reveal,
	.wp-block-image.is-style-polaroid,
	.wp-block-cover.is-style-poster,
	.is-style-card {
		transition: none;
		transform: none;
	}

	.js .reveal {
		opacity: 1;
	}
}

/* Tarjetas de síntomas: barra de acento en lugar de numeración (no son un orden) */
.symptom-card::before {
	content: "";
	display: block;
	width: 2.75rem;
	height: 6px;
	border-radius: 3px;
	margin-bottom: 1.1rem;
	background: var(--accent, var(--wp--preset--color--green));
}

.accent-green { --accent: var(--wp--preset--color--green); }
.accent-blue { --accent: var(--wp--preset--color--blue); }
.accent-magenta { --accent: var(--wp--preset--color--magenta); }

/* Tarjetas sobre sección blanca: fondo papel para que no se pierdan */
.has-white-background-color .is-style-card {
	background: var(--wp--preset--color--paper);
}
