/* ==========================================================================
   ABM Base — shared styles for all child themes.
   Colors and fonts come from theme.json presets (set per child theme).
   ========================================================================== */

:root {
	--abm-radius-s: var(--wp--custom--radius--s, 10px);
	--abm-radius-m: var(--wp--custom--radius--m, 18px);
	--abm-radius-l: var(--wp--custom--radius--l, 28px);
	--abm-pill: var(--wp--custom--radius--pill, 999px);
	--abm-dur: var(--wp--custom--motion--duration, 700ms);
	--abm-ease: var(--wp--custom--motion--ease, cubic-bezier(.2,.7,.2,1));
	--abm-shadow: var(--wp--custom--shadow--card, 0 10px 30px rgba(0,0,0,.08));
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; }
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 4px;
}
.screen-reader-text:focus { clip-path: none; }

/* --------------------------------------------------------------------------
   Motion (only when JS is running — content is never hidden without JS)
   -------------------------------------------------------------------------- */
.abm-js :is(.is-style-abm-reveal, .abm-reveal) {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity var(--abm-dur) var(--abm-ease), transform var(--abm-dur) var(--abm-ease);
}
.abm-js :is(.is-style-abm-zoom, .abm-zoom) {
	opacity: 0;
	transform: scale(.94);
	transition: opacity var(--abm-dur) var(--abm-ease), transform var(--abm-dur) var(--abm-ease);
}
.abm-js :is(.is-style-abm-stagger, .abm-stagger) > *,
.abm-js :is(.is-style-abm-stagger, .abm-stagger) > .wp-block-post-template > * {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity var(--abm-dur) var(--abm-ease), transform var(--abm-dur) var(--abm-ease);
	transition-delay: calc(var(--abm-i, 0) * 90ms);
}
.abm-js :is(.is-style-abm-reveal, .abm-reveal, .is-style-abm-zoom, .abm-zoom).is-visible,
.abm-js :is(.is-style-abm-stagger, .abm-stagger).is-visible > *,
.abm-js :is(.is-style-abm-stagger, .abm-stagger).is-visible > .wp-block-post-template > * {
	opacity: 1;
	transform: none;
}
.abm-delay-1 { transition-delay: 120ms !important; }
.abm-delay-2 { transition-delay: 240ms !important; }
.abm-delay-3 { transition-delay: 360ms !important; }

@keyframes abm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
:is(.is-style-abm-float, .abm-float) { animation: abm-float 6s ease-in-out infinite; }

@keyframes abm-pop { 0% { transform: scale(.4) rotate(-30deg); opacity: 0; } 70% { transform: scale(1.08) rotate(-12deg); opacity: 1; } 100% { transform: scale(1) rotate(-14deg); } }
@keyframes abm-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

:is(.is-style-abm-card, .abm-lift) {
	transition: transform .35s var(--abm-ease), box-shadow .35s var(--abm-ease);
}
:is(.is-style-abm-card, .abm-lift):hover {
	transform: translateY(-6px);
	box-shadow: var(--abm-shadow);
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.abm-js :is(.is-style-abm-reveal, .abm-reveal, .is-style-abm-zoom, .abm-zoom),
	.abm-js :is(.is-style-abm-stagger, .abm-stagger) > *,
	.abm-js :is(.is-style-abm-stagger, .abm-stagger) > .wp-block-post-template > * { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
/* Let the header group stick to the page (an announcement bar above it scrolls away). */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-template-part:has(> .abm-header) { display: contents; }
.abm-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--wp--preset--color--base);
	transition: box-shadow .3s ease, background-color .3s ease;
}
.admin-bar .abm-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .abm-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .abm-header { top: 0; } }
.abm-header.is-scrolled { box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.abm-header__inner { padding-block: 0.9rem; gap: 1rem 1.5rem; }

/* --------------------------------------------------------------------------
   Post cards & archives
   -------------------------------------------------------------------------- */
.abm-kicker, .abm-kicker a {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--muted);
}
.abm-post-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	gap: .6rem;
	background: var(--wp--preset--color--surface);
	border-radius: var(--abm-radius-m);
	overflow: hidden;
	padding-bottom: 1.25rem;
	transition: transform .35s var(--abm-ease), box-shadow .35s var(--abm-ease);
}
.abm-post-card:hover { transform: translateY(-5px); box-shadow: var(--abm-shadow); }
.abm-post-card > *:not(.wp-block-post-featured-image) { margin-inline: 1.25rem; }
.abm-post-card .wp-block-post-featured-image { margin: 0; }
.abm-post-card .wp-block-post-featured-image img { width: 100%; object-fit: cover; transition: transform .6s var(--abm-ease); }
.abm-post-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.abm-post-card .wp-block-post-title { margin: 0; font-size: 1.25rem; }
.abm-post-card .wp-block-post-excerpt { margin: 0; color: var(--wp--preset--color--muted); font-size: .95rem; }
.abm-post-card .wp-block-post-excerpt__more-text { display: none; }

.wp-block-query-pagination { margin-top: 2.5rem; gap: .5rem; font-weight: 700; }
.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
	border-radius: var(--abm-pill); text-decoration: none;
}
.wp-block-query-pagination-numbers .page-numbers.current { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }

.abm-archive-head { padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40); }

/* --------------------------------------------------------------------------
   Single post
   -------------------------------------------------------------------------- */
.abm-single__head { padding-top: var(--wp--preset--spacing--50); }
.abm-single__title { margin-top: .4rem; }
.abm-meta { gap: .4rem 1.25rem; color: var(--wp--preset--color--muted); font-size: .9rem; }
.abm-single__image img { border-radius: var(--abm-radius-l); }
.abm-single__cols { gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: var(--wp--preset--spacing--50); }
.abm-single .wp-block-post-content { font-size: 1.1rem; line-height: 1.8; }
.abm-single .wp-block-post-content h2 { margin-top: 2.5rem; scroll-margin-top: 110px; }
.abm-single .wp-block-post-content h3 { margin-top: 2rem; scroll-margin-top: 110px; }

.abm-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
@media (min-width: 782px) {
	.abm-sidebar > :first-child { position: sticky; top: 110px; }
}
.abm-toc { background: var(--wp--preset--color--surface); border-radius: var(--abm-radius-m); padding: 1.25rem 1.25rem 1rem; }
.abm-toc:empty { display: none; }
.abm-toc__title { margin: 0 0 .5rem; font-weight: 800; }
.abm-toc ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; font-size: .95rem; }
.abm-toc a { color: var(--wp--preset--color--muted); text-decoration: none; }
.abm-toc a:hover, .abm-toc a.is-active { color: var(--wp--preset--color--contrast); font-weight: 700; }

.abm-progress {
	position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 100;
	background: var(--wp--preset--color--accent);
	transform: scaleX(0); transform-origin: 0 50%;
}

.abm-box {
	border-radius: var(--abm-radius-l);
	padding: 1.5rem;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
}
.abm-box :where(h2, h3, h4, p) { color: inherit; }

/* --------------------------------------------------------------------------
   Ads & newsletter
   -------------------------------------------------------------------------- */
.abm-ad { margin: 2rem auto; text-align: center; }
.abm-ad__label { display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin-bottom: .35rem; }
.abm-ad--empty, .abm-newsletter--empty {
	border: 2px dashed var(--wp--preset--color--line);
	border-radius: var(--abm-radius-m);
	padding: 1.25rem; font-size: .9rem; color: var(--wp--preset--color--muted); background: var(--wp--preset--color--base);
}
.abm-newsletter form { display: flex; flex-wrap: wrap; gap: .5rem; }
.abm-newsletter input[type="email"] {
	flex: 1 1 220px; min-height: 48px; padding: .75rem 1rem; font: inherit;
	border: 2px solid var(--wp--preset--color--contrast); border-radius: var(--abm-pill);
}
.abm-newsletter :is(button, input[type="submit"]) {
	min-height: 48px; padding: .75rem 1.4rem; font: inherit; font-weight: 700; cursor: pointer;
	border: 0; border-radius: var(--abm-pill);
	background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base);
}

/* --------------------------------------------------------------------------
   Blocks polish
   -------------------------------------------------------------------------- */
.wp-block-search__input { min-height: 48px; border-radius: var(--abm-pill); padding-inline: 1.1rem; }
.wp-block-search__button { min-height: 48px; border-radius: var(--abm-pill); font-weight: 700; }

.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 1.1rem 0;
}
.wp-block-details summary {
	cursor: pointer; font-weight: 700; font-size: 1.1rem; list-style: none;
	display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
	content: "+"; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--wp--preset--color--surface); transition: transform .3s var(--abm-ease);
}
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > :not(summary) { margin-top: .75rem; color: var(--wp--preset--color--muted); }

.wp-block-navigation .wp-block-navigation-item__content { padding: .5rem .2rem; }
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }

.abm-related { margin-top: var(--wp--preset--spacing--60); padding-top: var(--wp--preset--spacing--50); border-top: 1px solid var(--wp--preset--color--line); margin-bottom: var(--wp--preset--spacing--60); }
.abm-newsletter-band { background: var(--wp--preset--color--surface); padding-block: var(--wp--preset--spacing--60); }
.abm-newsletter-band > .wp-block-group > * { flex: 1 1 360px; }
.abm-footer { padding-block: var(--wp--preset--spacing--50); border-top: 1px solid var(--wp--preset--color--line); }
.abm-main { min-height: 50vh; }

/* 404 & search */
.abm-404 { text-align: center; padding-block: var(--wp--preset--spacing--70); }
.abm-404 .wp-block-search { max-width: 520px; margin-inline: auto; }


/* --------------------------------------------------------------------------
   Smooth page-to-page transitions (no JavaScript, browsers without support just load normally)
   -------------------------------------------------------------------------- */
@view-transition { navigation: auto; }
.abm-header { view-transition-name: abm-header; }
::view-transition-old(root) { animation: abm-vt-out .2s ease-in both; }
::view-transition-new(root) { animation: abm-vt-in .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes abm-vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes abm-vt-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
	@view-transition { navigation: none; }
}
