/*
 * Base: tokens, type, buttons, section rhythm, motion. Values from the Manual de identidad digital 2026
 * (02 Color, 03 Tipografía, 04 Componentes, 05 Movimiento) and the v2 mockup.
 */

:root {
	--negro: var(--wp--preset--color--negro);
	--vino: var(--wp--preset--color--vino);
	--oro: var(--wp--preset--color--oro);
	--marfil: var(--wp--preset--color--marfil);
	--arena: var(--wp--preset--color--arena);
	--sepia: var(--wp--preset--color--sepia);
	--rosa: var(--wp--preset--color--rosa);
	--on-dark: #d9d2c8;
	--on-dark-soft: #b9b0a4;
	--on-vino: #f1dfe1;
	--line: #eee;
	--error: #a1262f;
	--serif: var(--wp--preset--font-family--caslon);
	--sans: var(--wp--preset--font-family--manrope);
	--header-h: 84px;
	--admin-bar: 0px;
	--wrap: 1120px;
	--gutter: 28px;
	--sec: clamp(60px, 7vw, 84px);
	--ease: cubic-bezier(.2, .7, .2, 1);
}
.admin-bar { --admin-bar: 32px; }
@media (max-width: 782px) { .admin-bar { --admin-bar: 46px; } }
@media (max-width: 600px) { :root { --header-h: 72px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
/* Full-width sections and template parts sit edge to edge, like the mockup (no blockGap strip between them). */
.wp-site-blocks > * + *, .wp-block-post-content > .alignfull { margin-block-start: 0 !important; margin-block-end: 0 !important; }
[id] { scroll-margin-top: calc(var(--header-h) + var(--admin-bar) + 64px); }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

/* Accessibility (manual 05, Parte 2): visible focus everywhere, skip link first. */
:where(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
.ma-skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--oro); color: var(--negro); padding: 10px 16px; font-weight: 700; text-decoration: none; }
.ma-skip:focus { left: 8px; top: 8px; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }

/* Type helpers. Etiquetas: vino sobre claro, dorado sobre oscuro (manual 03). */
.ma-eyebrow, .ma-eyebrow a { font: 600 12px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--vino); text-decoration: none; }
.ma-lead { font-size: 17px; color: var(--sepia); }
.ma-muted { color: var(--sepia); }
.ma-small { font-size: 13px; color: var(--sepia); }
.ma-note { font-size: 11.5px; color: #8a8076; margin-top: 18px !important; }
.ma-h2-sm { font-size: clamp(26px, 3.2vw, 38px) !important; }
.ma-h1-sm { font-size: clamp(32px, 4vw, 52px) !important; }
.ma-subtitle { margin-top: 48px !important; margin-bottom: 20px !important; font-size: 21px; }

/*
 * Narrow text inside a constrained section (title, intro, lead, notes) keeps the left edge of the content
 * column: WordPress centres any narrower child on its own, which broke the alignment with the rest.
 * Centred blocks (.ma-close) opt out.
 */
.is-layout-constrained > :is(.ma-project-hero__title, .ma-project-hero__lead, .ma-school-logo, .ma-page-head__title, .ma-page-head__intro, .ma-lead, .ma-note, .ma-rights, .ma-subnav__list, .ma-form, .ma-form-done):not(.ma-close *) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
	margin-right: auto !important;
}

/* Dark surfaces: negro (peso histórico) and vino (solemne). Contrast pairs from the manual's WCAG table. */
.ma-dark-negro { background: var(--negro); color: #fff; }
.ma-dark-vino { background: var(--vino); color: #fff; }
:is(.ma-dark-negro, .ma-dark-vino) .ma-eyebrow { color: var(--oro); }
.ma-dark-negro :is(.ma-muted, .ma-small) { color: var(--on-dark-soft); }
.ma-dark-vino :is(.ma-muted, .ma-small, p) { color: var(--on-vino); }
:is(.ma-dark-negro, .ma-dark-vino) :is(h1, h2, h3) { color: #fff; }
:is(.ma-dark-negro, .ma-dark-vino) a:not(.wp-block-button__link) { color: #fff; }
.ma-bg-marfil { background: var(--marfil); }
.ma-bg-arena { background: var(--arena); }

/* Section rhythm (mockup .sec). */
.ma-sec { padding-top: var(--sec); padding-bottom: var(--sec); }
.ma-sec--tight { padding-top: 56px; padding-bottom: 56px; }
.ma-sec > h2 { margin-top: 10px !important; margin-bottom: 32px !important; }
.ma-sec > .ma-eyebrow + h2 { margin-top: 10px; }

/* Buttons (manual 04): dorado = acción principal; se elevan con sombra, se hunden al clic. */
.wp-block-button__link, .ma-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
	background: var(--oro); color: var(--negro); border: 2px solid var(--oro); border-radius: 2px;
	padding: 12px 24px; font: 700 14px/1.3 var(--sans); letter-spacing: .04em; text-decoration: none; cursor: pointer;
	transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.wp-block-button__link:hover, .ma-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .28); background: #d8b134; border-color: #d8b134; color: var(--negro); }
.wp-block-button__link:active, .ma-btn:active { transform: scale(.97); box-shadow: none; }
.is-style-ghost .wp-block-button__link { background: transparent; border-color: #fff; color: #fff; }
.is-style-ghost .wp-block-button__link:hover { background: #fff; border-color: #fff; color: var(--negro); }
.is-style-line .wp-block-button__link { background: transparent; border-color: var(--negro); color: var(--negro); }
.is-style-line .wp-block-button__link:hover { background: var(--negro); border-color: var(--negro); color: #fff; }
.is-style-dark .wp-block-button__link, .ma-btn--dark { background: var(--negro); border-color: var(--negro); color: #fff; }
.is-style-dark .wp-block-button__link:hover, .ma-btn--dark:hover { background: var(--vino); border-color: var(--vino); color: #fff; }
.is-style-link .wp-block-button__link { background: none; border: 0; border-radius: 0; padding: 0; min-height: 44px; color: inherit; letter-spacing: 0; text-decoration: underline; text-decoration-color: var(--oro); text-decoration-thickness: 2px; text-underline-offset: 7px; }
.is-style-link .wp-block-button__link:hover { background: none; box-shadow: none; transform: none; color: inherit; text-decoration-color: currentColor; }
:is(.ma-dark-negro, .ma-dark-vino) .is-style-line .wp-block-button__link { border-color: #fff; color: #fff; }
:is(.ma-dark-negro, .ma-dark-vino) .is-style-line .wp-block-button__link:hover { background: #fff; color: var(--negro); }
.wp-block-buttons { gap: 14px; margin-top: 24px; }
.wp-block-buttons.is-full .wp-block-button { width: 100%; }
.wp-block-buttons.is-full .wp-block-button__link { width: 100%; }
.wp-block-buttons.is-centered { justify-content: center; }

/* Grids. Breakpoints of Parte 2: 1 column under 768, 2 columns to 1099, full grid from 1100. */
.ma-grid { display: grid; gap: 20px; }
.ma-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ma-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ma-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1099px) { .ma-grid--3, .ma-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .ma-grid--2, .ma-grid--3, .ma-grid--4 { grid-template-columns: 1fr; } }
.ma-grid > * { margin: 0 !important; }

/* Cards (mockup .card; manual: hover sube 3-6 px y el borde pasa a dorado, 0,2-0,25 s). */
.ma-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--arena); border-radius: 6px; overflow: hidden; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.ma-card:hover, .ma-card:focus-within { transform: translateY(-6px); border-color: var(--oro); box-shadow: 0 14px 26px rgba(0, 0, 0, .12); }
.ma-card__cover { position: relative; height: 130px; background: var(--cover, var(--vino)); display: flex; align-items: flex-end; overflow: hidden; }
.ma-card__cover--portrait { height: 200px; }
.ma-card__cover--video { height: auto; aspect-ratio: 16 / 9; }
/* Covers are a wide strip: aim the crop high, where faces usually are. */
.ma-card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.ma-card__pending { padding: 10px 12px; font-size: 11px; color: #fff; letter-spacing: .05em; }
.ma-card__body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.ma-card__body .ma-eyebrow { margin-bottom: 8px; }
.ma-card__title { font-size: 19px; margin: 0 0 8px; }
.ma-card__title a { color: var(--negro); text-decoration: none; }
.ma-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ma-card__title a:focus-visible { outline: none; }
.ma-card:has(.ma-card__title a:focus-visible) { outline: 3px solid var(--oro); outline-offset: 3px; }
.ma-card__meta { font-size: 12.5px; color: var(--sepia); margin-bottom: 6px; }
.ma-card__text { font-size: 13.5px; color: var(--sepia); }
.ma-card__more { align-self: flex-start; margin-top: auto; padding-top: 12px; color: var(--vino); font-weight: 700; font-size: 13px; border-bottom: 2px solid var(--oro); line-height: 1.5; }
.ma-card__play { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--oro); }
.ma-card__body > :is(a, p).ma-download { position: relative; z-index: 2; }

/* Tiles: content boxes without a cover. */
.ma-tile { position: relative; background: #fff; border: 1px solid var(--arena); border-radius: 6px; padding: 26px; height: 100%; }
.ma-tile > * + * { margin-top: 10px; }
.ma-tile h3 { font-size: 21px; margin-top: 8px; }
.ma-tile--link { transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.ma-tile--link:hover, .ma-tile--link:focus-within { transform: translateY(-4px); border-color: var(--oro); box-shadow: 0 14px 26px rgba(0, 0, 0, .1); }
.ma-tile--link h3 a { color: var(--negro); text-decoration: none; }
.ma-tile--link h3 a::after { content: ""; position: absolute; inset: 0; }
.ma-tile__num { font: 700 28px/1 var(--serif); color: var(--vino); }
.ma-tile__more { color: var(--vino); font-weight: 700; font-size: 13px; display: inline-block; border-bottom: 2px solid var(--oro); }
.ma-tile__more a { color: inherit; text-decoration: none; }
.ma-tile--alert { border-left: 4px solid var(--vino); background: var(--marfil); }
.ma-tile--action { display: flex; flex-direction: column; }
.ma-tile--action .wp-block-buttons { margin-top: auto; padding-top: 12px; }
.ma-tile__photo { margin: -26px -26px 18px !important; border-radius: 6px 6px 0 0 !important; min-height: 150px !important; }

/* Chips (territorio). */
.ma-chips { list-style: none; padding: 0 !important; margin: 14px 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.ma-chips li { border: 1px solid var(--arena); background: var(--marfil); color: var(--vino); font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 20px; }

/* Photo still to come (Parte 4): brand gradient + visible label, never a broken image. */
.ma-photo-pending { position: relative; display: flex; align-items: flex-end; min-height: 240px; aspect-ratio: 4 / 3; padding: 16px; border-radius: 6px; background: linear-gradient(140deg, #8b5a2b 0%, #c9a227 45%, #6e1f2a 100%); }
.ma-photo-pending__label { color: #fff; font-size: 12px; letter-spacing: .05em; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.ma-rounded img { border-radius: 6px; }
figure.wp-block-image { margin: 0; }
.wp-block-image figcaption { font-size: 12px; color: var(--sepia); margin-top: 8px; }

/* Scroll reveal (manual 05): opacity + 26 px in 0,7 s; the hero never animates. Only with JS. */
.js .ma-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .ma-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	html { scroll-behavior: auto; }
	.js .ma-reveal { opacity: 1; transform: none; }
}
