/*
Theme Name: AMEFE
Theme URI: https://www.ameyfe.es/
Author: AMEFE
Description: Tema de bloques a medida para AMEFE (Asociación Malagueña de Educación y Formación Europea). Secciones, tarjetas, etiquetas y botones disponibles como estilos de bloque y patrones en el editor.
Version: 1.6.1
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: amefe
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
p { margin-top: 0; }
.wp-site-blocks > main,
.wp-site-blocks > footer,
.wp-site-blocks > .wp-block-template-part + * { margin-block-start: 0; }
body .wp-block-post-content > * { margin-block-start: 0; margin-block-end: 0; }

/* ---------- Header ---------- */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 100; }
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; } }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; } }

.site-header { background: var(--wp--preset--color--white); border-bottom: 1px solid var(--wp--preset--color--border); }
.site-header .header-inner { padding-top: 14px; padding-bottom: 14px; gap: 20px; }
.site-header .brand { gap: 10px; }
.site-header .wp-block-site-logo img { display: block; }
.site-header .wp-block-site-title { margin: 0; line-height: 1; white-space: nowrap; }
.site-header .wp-block-site-title a { text-decoration: none; }
.site-header .site-nav { gap: 24px; }
.site-header .wp-block-navigation .wp-block-navigation-item__content {
	color: var(--wp--preset--color--ink);
	padding: 6px 2px;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
}
.site-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.site-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.site-header .wp-block-navigation [aria-current="page"] {
	color: var(--wp--preset--color--blue);
	border-bottom-color: var(--wp--preset--color--blue);
}
.site-header .wp-block-navigation__container { column-gap: 20px; row-gap: 6px; }
.site-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; }
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start; }
.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.15rem; }
.site-header .wp-block-button__link { padding: 9px 16px; font-size: 0.85rem; }
@media (max-width: 1100px) { .site-header .site-nav .wp-block-buttons { display: none; } }

/* ---------- Sections (Group block styles) ---------- */
.is-style-section-white,
.is-style-section-alt,
.is-style-section-dark,
.is-style-section-hero,
.is-style-section-page-hero { padding-top: 60px; padding-bottom: 60px; }
.is-style-section-white { background: var(--wp--preset--color--white); }
.is-style-section-alt { background: var(--wp--preset--color--bg-alt); }
.is-style-section-dark { background: var(--wp--preset--color--navy); }
.is-style-section-hero { background: var(--wp--preset--gradient--hero); padding-top: 90px; padding-bottom: 70px; }
.is-style-section-page-hero { padding-top: 60px; padding-bottom: 30px; }
.is-style-section-dark h2, .is-style-section-dark h3,
.is-style-section-dark p { color: var(--wp--preset--color--navy-text); }
.is-style-section-dark h2 { color: #fff; }
.cta-inner { text-align: center; }
.cta-inner .wp-block-buttons { justify-content: center; }

/* ---------- Cards ---------- */
.is-style-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	padding: 26px;
}
.is-style-card > :last-child { margin-bottom: 0; }
.is-style-card h3 { margin-top: 0; margin-bottom: 0.5rem; }
.is-style-card p { margin-bottom: 0; }
.is-style-card > * + * { margin-block-start: 0.5rem; }
.address-card { max-width: 340px; }
.featured-card { gap: 30px; }
.featured-card > .wp-block-group { flex: 1 1 420px; }

/* ---------- Text styles (Paragraph block styles) ---------- */
.is-style-lede { font-size: 1.05rem; }
.is-layout-flow > .is-style-lede { max-width: 720px; }
.is-style-lede-quote {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-size: 1.25rem;
	color: var(--wp--preset--color--blue);
}
.is-style-stat-num {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.9rem;
	line-height: 1.1;
	color: var(--wp--preset--color--blue);
	margin-bottom: 4px;
}
.stat p:not(.is-style-stat-num):not(.is-style-tag):not(.is-style-tag-pending) { font-size: 0.9rem; }
.is-style-tag,
.is-style-tag-pending {
	display: inline-block;
	width: fit-content;
	background: var(--wp--preset--color--blue-tint);
	color: var(--wp--preset--color--blue);
	font-size: 0.75rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	margin-bottom: 10px;
}
.is-style-tag-pending { background: var(--wp--preset--color--amber-bg); color: var(--wp--preset--color--amber-text); }
.is-style-section-hero .is-style-tag { background: var(--wp--preset--color--white); }
.is-style-chip {
	display: inline-block;
	background: var(--wp--preset--color--bg-alt);
	color: var(--wp--preset--color--body-text);
	font-size: 0.8rem;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--border);
	margin: 0;
}
.chip-row { gap: 8px; margin-top: 10px; }
.more-link { font-size: 0.9rem; font-weight: 600; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--blue);
	border: 1.5px solid var(--wp--preset--color--blue);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--blue-tint);
	color: var(--wp--preset--color--blue-dark);
}
.wp-block-buttons { gap: 14px; }
.is-style-section-dark .wp-block-button.is-style-outline > .wp-block-button__link { color: #fff; border-color: #fff; }
.is-style-section-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---------- Contact ---------- */
.contact-details strong { color: var(--wp--preset--color--navy); display: block; }
.contact-details p { margin-bottom: 14px; }
.map-embed iframe { width: 100%; height: 320px; border: 0; border-radius: 10px; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--wp--preset--color--navy); color: var(--wp--preset--color--navy-text); }
.site-footer p { color: var(--wp--preset--color--navy-text); font-size: 0.9rem; margin: 0; }
.site-footer a { color: var(--wp--preset--color--navy-text); }
.site-footer a:hover { color: #fff; }
.site-footer .footer-inner { padding-top: 40px; padding-bottom: 40px; gap: 16px; }
.site-footer .footer-bottom { border-top: 1px solid rgba(215, 225, 242, 0.15); padding-top: 18px; padding-bottom: 24px; }
.site-footer .footer-bottom p { color: var(--wp--preset--color--navy-soft); font-size: 0.8rem; }
.site-footer .wp-block-social-links .wp-social-link { color: var(--wp--preset--color--navy-text); }

/* ---------- Video hero (home) ---------- */
.is-style-section-video-hero {
	position: relative; overflow: hidden;
	background: var(--wp--preset--color--navy);
	min-height: min(86vh, 760px);
	padding-top: 110px; padding-bottom: 110px;
	display: flex; flex-direction: column; justify-content: center;
}
.is-style-section-video-hero > .wp-block-group { width: 100%; }
.is-style-section-video-hero > :not(.hero-video) { position: relative; z-index: 1; }
.hero-video {
	position: absolute !important; inset: 0; z-index: 0; overflow: hidden;
	margin: 0 !important; max-width: none !important;
	background: var(--wp--preset--color--navy) center / cover no-repeat;
	container-type: size;
}
.hero-video iframe {
	position: absolute; top: 50%; left: 50%;
	width: max(100cqw, 177.78cqh); height: max(56.25cqw, 100cqh);
	transform: translate(-50%, -50%); border: 0; pointer-events: none;
}
.hero-video video {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; border: 0; pointer-events: none;
	opacity: 0; transition: opacity 0.6s ease;
}
.hero-video video.is-playing { opacity: 1; }
.hero-video::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(18, 42, 82, 0.50) 0%, rgba(18, 42, 82, 0.70) 100%);
}
.is-style-section-video-hero h1,
.is-style-section-video-hero p { color: #fff; }
.is-style-section-video-hero h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25); }
.is-style-section-video-hero .is-style-lede-quote { color: var(--wp--preset--color--navy-text); }
.is-style-section-video-hero .is-style-tag { background: rgba(255, 255, 255, 0.92); color: var(--wp--preset--color--navy); }
.is-style-section-video-hero .wp-block-button.is-style-outline > .wp-block-button__link { color: #fff; border-color: #fff; background: transparent; }
.is-style-section-video-hero .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.12); }
.is-style-section-video-hero > .hero-video-credit {
	position: absolute; right: 16px; bottom: 10px; z-index: 1; margin: 0;
	font-size: 0.72rem; color: rgba(255, 255, 255, 0.75);
}
@media (max-width: 760px) {
	.is-style-section-video-hero { min-height: 70vh; padding-top: 80px; padding-bottom: 80px; }
	.is-style-section-video-hero.has-subs { padding-bottom: 130px; }
}

/* ---------- English subtitles over videos ---------- */
.video-subs {
	position: absolute; left: 50%; bottom: 44px; z-index: 2;
	transform: translateX(-50%);
	width: min(92%, 860px); text-align: center;
	pointer-events: none; opacity: 0; transition: opacity 0.25s ease;
}
.video-subs.is-on { opacity: 1; }
.video-subs span {
	display: inline; padding: 0.12em 0.45em;
	-webkit-box-decoration-break: clone; box-decoration-break: clone;
	background: rgba(10, 22, 44, 0.72); color: #fff; border-radius: 4px;
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: clamp(1rem, 0.9rem + 0.55vw, 1.4rem); font-weight: 600; line-height: 1.55;
	white-space: pre-line;
}
.is-style-section-video-hero > .video-subs { position: absolute; z-index: 2; margin: 0; }
.video-embed.has-subs { position: relative; }
.video-embed > .video-subs { bottom: 14%; }
@media (max-width: 760px) {
	.video-subs { bottom: 40px; }
	.video-embed > .video-subs { bottom: 18%; }
	.video-embed .video-subs span { font-size: 0.9rem; }
}

/* ---------- Video embed (click to play) ---------- */
.video-embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; }
.video-embed .consent-placeholder {
	aspect-ratio: 16 / 9; min-height: 0; border: 0; color: #fff;
	background: linear-gradient(rgba(18, 42, 82, 0.55), rgba(18, 42, 82, 0.55)), var(--poster, none) center / cover no-repeat, var(--wp--preset--color--navy);
}
.video-embed .consent-placeholder p { color: #fff; }
.video-embed .consent-placeholder a { color: #fff; }

/* ---------- Consent (cookie banner + embeds) ---------- */
.consent-banner {
	position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1000;
	max-width: 760px; margin: 0 auto; padding: 18px 20px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px; box-shadow: 0 10px 30px rgba(18, 42, 82, 0.18);
	display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px;
}
.consent-banner[hidden] { display: none; }
.consent-banner p { margin: 0; flex: 1 1 360px; font-size: 0.92rem; color: var(--wp--preset--color--ink-soft); }
.consent-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.consent-btn {
	font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
	padding: 10px 20px; border-radius: 8px;
	border: 1.5px solid var(--wp--preset--color--blue);
	background: var(--wp--preset--color--white); color: var(--wp--preset--color--blue);
}
.consent-btn-primary { background: var(--wp--preset--color--blue); color: #fff; }
.consent-btn:hover { background: var(--wp--preset--color--blue-dark); border-color: var(--wp--preset--color--blue-dark); color: #fff; }
.consent-embed:not(.is-loaded) iframe { display: none; }
.consent-placeholder {
	min-height: 260px; padding: 30px; border-radius: 10px;
	background: var(--wp--preset--color--white); border: 1px dashed var(--wp--preset--color--border);
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px;
}
.consent-placeholder p { margin: 0; max-width: 480px; }
.site-footer .footer-legal a { color: var(--wp--preset--color--navy-soft); }
.site-footer .footer-legal a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
	h1, .wp-block-heading.has-xx-large-font-size { font-size: 2rem !important; }
	.is-style-section-hero { padding-top: 60px; padding-bottom: 50px; }
	.featured-card { flex-direction: column; align-items: flex-start !important; }
	.featured-card > .wp-block-group { flex: 0 0 auto; }
}

/* ---------- Our host schools: logo strip (home) ---------- */
.logo-strip { gap: 18px !important; }
.logo-strip > .wp-block-image.school-logo {
	margin: 0; height: 120px;
	display: flex; align-items: center; justify-content: center;
	background: #fff; border: 1px solid var(--wp--preset--color--border); border-radius: 12px;
	transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.logo-strip > .wp-block-image.school-logo a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 16px 18px; }
.logo-strip > .wp-block-image.school-logo img {
	max-width: 100%; max-height: 78px; width: auto; height: auto; object-fit: contain;
	filter: grayscale(1); opacity: 0.72; transition: filter 0.3s ease, opacity 0.3s ease;
}
.logo-strip > .wp-block-image.school-logo:hover,
.logo-strip > .wp-block-image.school-logo:focus-within {
	box-shadow: 0 8px 24px rgba(18, 42, 82, 0.12); transform: translateY(-3px); border-color: #c9d4e6;
}
.logo-strip > .wp-block-image.school-logo:hover img,
.logo-strip > .wp-block-image.school-logo:focus-within img { filter: none; opacity: 1; }
@media (hover: none) {
	.logo-strip > .wp-block-image.school-logo img { filter: none; opacity: 1; }
}
@media (max-width: 760px) {
	.logo-strip > .wp-block-image.school-logo { height: 100px; }
	.logo-strip > .wp-block-image.school-logo img { max-height: 64px; }
}

/* ---------- Our host schools: cards (Mobility) ---------- */
.school-cards { gap: 22px !important; }
.is-style-card.school-card { display: flex; flex-direction: column; gap: 0; }
.is-style-card.school-card > * { margin-block: 0; }
.school-card > .wp-block-image {
	height: 130px; margin: 0 0 16px !important;
	display: flex; align-items: center; justify-content: center;
	border-bottom: 1px solid var(--wp--preset--color--border); padding-bottom: 16px;
}
.school-card > .wp-block-image a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.school-card > .wp-block-image img { max-width: 78%; max-height: 104px; width: auto; height: auto; object-fit: contain; }
.school-card h3 { font-size: 1.2rem; margin: 0 0 2px; }
.school-card h3 a { color: inherit; text-decoration: none; }
.school-card h3 a:hover { color: var(--wp--preset--color--blue); text-decoration: underline; }
.school-card .school-city { margin: 0; color: var(--wp--preset--color--ink-soft); font-size: 0.95rem; }
.school-card .is-style-tag { margin-top: 12px !important; align-self: flex-start; }
@media (max-width: 760px) {
	.is-style-card.school-card {
		display: grid; grid-template-columns: 84px 1fr; column-gap: 14px; align-items: center; padding: 12px 14px;
	}
	.school-card > .wp-block-image {
		grid-row: 1 / span 3; width: 84px; height: 84px; margin: 0 !important; padding: 0; border: 0;
	}
	.school-card > .wp-block-image img { max-width: 100%; max-height: 76px; }
	.school-card h3 { font-size: 1.05rem; }
	.school-card .is-style-tag { margin-top: 6px !important; }
}

/* Fixed column counts (WordPress' auto grid miscounts with our custom gap) */
.wp-block-group.logo-strip { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
.wp-block-group.school-cards { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 1000px) {
	.wp-block-group.logo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
	.wp-block-group.school-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
	.wp-block-group.logo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
	.wp-block-group.school-cards { grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; }
}

/* ---------- Motion ---------- */
.site-header { transition: box-shadow 0.3s ease; }
html.is-scrolled .site-header { box-shadow: 0 6px 22px rgba(18, 42, 82, 0.09); }

html.js-motion body .reveal.reveal {
	opacity: 0; transform: translateY(22px);
	transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
	transition-delay: var(--reveal-delay, 0ms);
}
html.js-motion body .reveal.reveal.is-in { opacity: 1; transform: none; }

.is-style-stat-num { font-variant-numeric: tabular-nums; }

/* cards in grids lift slightly on hover */
.is-layout-grid > .is-style-card { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.is-layout-grid > .is-style-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(18, 42, 82, 0.10);
	border-color: #cfd8e6;
}
@media (prefers-reduced-motion: reduce) {
	.is-layout-grid > .is-style-card, .logo-strip > .wp-block-image.school-logo { transition: none; }
	.is-layout-grid > .is-style-card:hover, .logo-strip > .wp-block-image.school-logo:hover { transform: none; }
}
