/* Vuelta blog (templates home, archive, single: tools/build-blog-specs.py). Spacing, type, colour and the card frame are
   block attributes and the Card variation. Here: the whole-card link, the picture zoom, the first post across the row,
   the category and tag chips, the previous/next cards. Tokens only. Loaded on blog views (inc/blog.php) and in the editor. */

/* ---------- post card ---------- */
.vt-post-card { position: relative; height: 100%; overflow: clip; transition: transform var(--wp--custom--transition--base), box-shadow var(--wp--custom--transition--base); }
.vt-post-card:hover { transform: translateY(var(--wp--custom--motion--lift)); box-shadow: var(--wp--preset--shadow--md); }
.vt-post-card__media { margin: 0; overflow: clip; }
.vt-post-card__media img { transition: scale var(--wp--custom--transition--base); }
.vt-post-card:hover .vt-post-card__media img { scale: var(--wp--custom--motion--zoom); }
.vt-post-card__body { flex: 1; }
.vt-post-card__title a { text-decoration: none; }
.vt-post-card__title a::after { content: ""; position: absolute; inset: 0; z-index: var(--wp--custom--z--base); }
.vt-post-card__title a:focus-visible { outline: none; }
.vt-post-card:has(.vt-post-card__title a:focus-visible) { outline: var(--wp--custom--border--focus) solid var(--wp--preset--color--focus); outline-offset: var(--wp--custom--border--focus-offset); }
.vt-post-card__cat a { position: relative; z-index: calc(var(--wp--custom--z--base) + 1); text-decoration: none; color: inherit; }
.vt-post-card__cat a:hover { text-decoration: underline; }
.vt-post-card__excerpt p { margin: 0; }
.vt-post-card__meta { margin-top: auto !important; }
.vt-post-card__meta--top { margin-top: 0 !important; }
.vt-post-card__meta > * + *::before { content: "·"; margin-inline-end: var(--wp--preset--spacing--20); }

/* the newest post on the first page spans the row: picture beside the text from tablet up */
@media (min-width: 782px) {
	body:not(.paged) .vt-blog-list .wp-block-post-template > li:first-child { grid-column: 1 / -1; }
	body:not(.paged) .vt-blog-list .wp-block-post-template > li:first-child .vt-post-card { display: grid; grid-template-columns: 3fr 2fr; }
	body:not(.paged) .vt-blog-list .wp-block-post-template > li:first-child .vt-post-card__media { height: 100%; }
	body:not(.paged) .vt-blog-list .wp-block-post-template > li:first-child .vt-post-card__media img { height: 100%; }
	body:not(.paged) .vt-blog-list .wp-block-post-template > li:first-child .vt-post-card__body { justify-content: center; padding: var(--wp--preset--spacing--60) !important; }
	body:not(.paged) .vt-blog-list .wp-block-post-template > li:first-child .vt-post-card__title { font-size: var(--wp--preset--font-size--xx-large) !important; line-height: var(--wp--custom--line-height--heading) !important; }
	body:not(.paged) .vt-blog-list .wp-block-post-template > li:first-child .vt-post-card__meta { margin-top: 0 !important; }
}

/* ---------- category chips (blog header) and tag chips (single) ---------- */
.vt-blog-cats { display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--20); margin: 0; padding: 0; list-style: none; }
.vt-blog-cats li { margin: 0; }
.vt-blog-cats a,
.vt-post-tags a { display: inline-flex; align-items: center; min-height: var(--wp--custom--control--min); padding: 0 var(--wp--custom--control--padding-x-small); border-radius: var(--wp--custom--radius--chip); background: var(--wp--preset--color--surface); border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--accent-6); color: var(--wp--preset--color--contrast); font-weight: var(--wp--custom--font-weight--semibold); text-decoration: none; transition: background-color var(--wp--custom--transition--fast), border-color var(--wp--custom--transition--fast); }
.vt-blog-cats a:hover,
.vt-post-tags a:hover { border-color: var(--wp--preset--color--accent-1); color: var(--wp--preset--color--accent-1); }
.vt-blog-cats .current-cat a { background: var(--wp--preset--color--contrast); border-color: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.vt-post-tags { display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--20); }

/* ---------- single post (owner's reference order, 2026-11-14) ---------- */
/* the band: category as a pill, date · reading time */
.vt-article-hero__pill a { display: inline-flex; align-items: center; min-height: var(--wp--custom--control--min); padding: 0 var(--wp--custom--control--padding-x-small); border-radius: var(--wp--custom--radius--badge); background: var(--wp--preset--color--signature); color: var(--wp--preset--color--accent-3); font-weight: var(--wp--custom--font-weight--semibold); text-decoration: none; }
.vt-article-hero__pill a:hover { background: var(--wp--preset--color--on-accent); }
.vt-article-hero__pill a:focus-visible { outline-color: var(--wp--preset--color--focus-inverse); }
.vt-article-hero__lead p { margin: 0; }
.vt-article__meta > * + *::before { content: "·"; margin-inline-end: var(--wp--preset--spacing--30); }

/* back link with the arrow icon */
.vt-back a { display: inline-flex; align-items: center; gap: var(--wp--preset--spacing--20); min-height: var(--wp--custom--control--min); color: var(--wp--preset--color--link); text-decoration: none; }
.vt-back a::before { content: ""; width: var(--wp--custom--icon--xs); height: var(--wp--custom--icon--xs); background: currentColor; -webkit-mask: var(--wp--custom--icon-url--arrow-left) center / contain no-repeat; mask: var(--wp--custom--icon-url--arrow-left) center / contain no-repeat; transition: translate var(--wp--custom--transition--fast); }
.vt-back a:hover { text-decoration: underline; }
.vt-back a:hover::before { translate: calc(var(--wp--custom--motion--lift) * 2) 0; }

.vt-article__media { overflow: clip; }
.vt-article__media img { border-radius: inherit; }
.vt-article__tags:not(:has(a)) { display: none; }

/* sidebar stays in view beside the text from tablet up */
@media (min-width: 782px) {
	.vt-article__aside-inner { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--custom--layout--header-row) + var(--wp--preset--spacing--40)); }
}

/* share buttons: 44px round targets */
.vt-share .wp-social-link { border-radius: var(--wp--custom--radius--icon-button); }
.vt-share .wp-social-link a { display: grid; place-items: center; width: var(--wp--custom--control--min); height: var(--wp--custom--control--min); padding: 0; }
.vt-share .wp-social-link:hover { background-color: var(--wp--preset--color--accent-1-strong) !important; }

@media (prefers-reduced-motion: reduce) {
	.vt-post-card, .vt-post-card__media img, .vt-back a::before { transition: none; }
	.vt-post-card:hover { transform: none; }
	.vt-post-card:hover .vt-post-card__media img { scale: none; }
}
