/**
 * Turismo Malesia - components.
 *
 * Naming: .tm-block, .tm-block__element, .tm-block--modifier, .is-state.
 * Order: atoms first (kicker, buttons, badges...), then page sections.
 */

/* ==========================================================================
   Kicker (small uppercase label above titles)
   ========================================================================== */

.tm-kicker {
	display: inline-block;
	margin: 0;
	color: var(--tm-red);
	font-family: var(--tm-font-body);
	font-size: 0.71875rem; /* 11.5 */
	font-weight: 600;
	letter-spacing: var(--tm-ls-kicker);
	line-height: 1.3;
	text-transform: uppercase;
}

.tm-section--dark .tm-kicker,
.tm-dark .tm-kicker,
.tm-kicker--on-dark {
	color: var(--tm-brand-light);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.tm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--tm-space-2);
	min-height: 44px; /* touch target */
	padding: 0.75rem 1.375rem;
	border: 2px solid transparent;
	border-radius: var(--tm-radius-sm);
	background: var(--tm-brand);
	color: var(--tm-white);
	font-family: var(--tm-font-body);
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.1;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--tm-dur) var(--tm-ease), color var(--tm-dur) var(--tm-ease), border-color var(--tm-dur) var(--tm-ease);
}

.tm-btn:hover,
.tm-btn:focus-visible {
	background: var(--tm-brand-dark);
	color: var(--tm-white);
}

.tm-btn svg {
	width: 1em;
	height: 1em;
	flex: none;
}

/* Variants */
.tm-btn--dark {
	background: var(--tm-ink);
}

.tm-btn--dark:hover,
.tm-btn--dark:focus-visible {
	background: var(--tm-ink-3);
}

.tm-btn--light {
	background: var(--tm-white);
	color: var(--tm-ink);
}

.tm-btn--light:hover,
.tm-btn--light:focus-visible {
	background: var(--tm-ink);
	color: var(--tm-white);
}

.tm-btn--outline {
	border-color: var(--tm-ink);
	background: transparent;
	color: var(--tm-ink);
}

.tm-btn--outline:hover,
.tm-btn--outline:focus-visible {
	background: var(--tm-ink);
	color: var(--tm-white);
}

.tm-btn--outline-light {
	border-color: rgba(255, 255, 255, 0.3);
	background: transparent;
	color: var(--tm-white);
}

.tm-btn--outline-light:hover,
.tm-btn--outline-light:focus-visible {
	border-color: var(--tm-white);
	background: transparent;
	color: var(--tm-white);
}

.tm-btn--link {
	min-height: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--tm-brand-dark);
}

.tm-btn--link:hover,
.tm-btn--link:focus-visible {
	background: transparent;
	color: var(--tm-brand);
}

/* Sizes */
.tm-btn--sm {
	min-height: 38px;
	padding: 0.625rem 1rem;
}

.tm-btn--lg {
	padding: 0.875rem 1.5rem;
	font-size: var(--tm-fs-xs);
}

.tm-btn--block {
	width: 100%;
}

/* ==========================================================================
   Badges, chips, small marks
   ========================================================================== */

/* Badge: italic uppercase label ("Miglior prezzo", "Scelta top") */
.tm-badge {
	display: inline-flex;
	margin: 0;
	align-items: center;
	gap: var(--tm-space-2);
	padding: 0.1875rem 0.5rem;
	border-radius: var(--tm-radius-xs);
	background: var(--tm-ink);
	color: var(--tm-white);
	font-family: var(--tm-font-body);
	font-size: 0.625rem;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
	white-space: nowrap;
}

.tm-badge--brand {
	background: var(--tm-brand);
}

.tm-badge--lg {
	padding: 0.4375rem 0.875rem;
	border-radius: 6px;
	font-size: 0.71875rem;
	letter-spacing: 0.1em;
}

/* Chip: neutral tag */
.tm-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.1875rem 0.5rem;
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-xs);
	background: var(--tm-gray-150);
	color: var(--tm-text-2);
	font-size: var(--tm-fs-micro);
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
}

/* Social profile icon link (author boxes, author archive). */
.tm-social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-sm);
	color: var(--tm-text-2);
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.tm-social:hover,
.tm-social:focus-visible {
	border-color: currentColor;
	color: var(--tm-ink);
}

.tm-social--linkedin:hover,
.tm-social--linkedin:focus-visible {
	color: #0a66c2;
}

.tm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

/* Rank number square */
.tm-rank {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: var(--tm-radius-sm);
	background: var(--tm-gray-150);
	color: var(--tm-ink);
	font-family: var(--tm-font-body);
	font-size: 0.9375rem;
	font-style: normal;
	font-weight: 600;
	line-height: 1;
}

.tm-rank--brand {
	background: var(--tm-brand);
	color: var(--tm-white);
}

.tm-rank--dark {
	background: var(--tm-ink);
	color: var(--tm-white);
}

.tm-rank--lg {
	width: 38px;
	height: 38px;
	border-radius: 9px;
	font-size: 1.125rem;
}

/* Numbered checklist (hero points) */
.tm-numlist {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: tm-numlist;
}

.tm-numlist li {
	display: flex;
	align-items: center;
	gap: var(--tm-space-3);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	counter-increment: tm-numlist;
}

.tm-numlist li::before {
	content: counter(tm-numlist, decimal-leading-zero);
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 24px;
	background: var(--tm-brand);
	color: var(--tm-white);
	font-family: var(--tm-font-body);
	font-size: var(--tm-fs-2xs);
	font-weight: 600;
	clip-path: polygon(22% 0, 100% 0, 78% 100%, 0 100%); /* slanted, like content lists */
}

/* Check mark (tip line) */
.tm-check {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 19px;
	height: 19px;
	border-radius: var(--tm-radius-xs);
	background: var(--tm-brand);
	color: var(--tm-white);
	font-size: var(--tm-fs-3xs);
	font-weight: 600;
	line-height: 1;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.tm-hero {
	padding-block: var(--tm-space-10) var(--tm-space-12);
	background-color: var(--tm-ink);
	background-image: linear-gradient(90deg, rgba(var(--tm-brand-rgb), 0.14) 0%, rgba(var(--tm-brand-rgb), 0) 55%);
	color: var(--tm-on-dark);
}

.tm-hero__grid {
	display: grid;
	gap: var(--tm-space-10);
	align-items: start;
}

.tm-hero__title {
	margin: 22px 0 18px;
	font-size: var(--tm-fs-hero);
	line-height: var(--tm-lh-tight);
	letter-spacing: -0.035em;
	text-wrap: pretty;
}

.tm-hero__title em,
.tm-hero__title mark,
.tm-text-accent {
	background: none;
	color: var(--tm-brand);
	font-style: normal;
}

.tm-hero__lead {
	max-width: 46ch;
	margin: 0 0 30px;
	color: var(--tm-on-dark-2);
	font-size: var(--tm-fs-lead);
	line-height: var(--tm-lh-body);
}

.tm-hero .tm-numlist,
.tm-row--hero .tm-numlist {
	margin-bottom: 34px;
}

@media (min-width: 1025px) {
	.tm-hero {
		padding-block: 3.5rem 4rem;
	}

	.tm-hero__grid {
		grid-template-columns: 1fr 1.05fr;
		gap: var(--tm-space-14);
	}
}

/* Stats row */
.tm-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--tm-space-4);
	padding-top: 26px;
	border-top: 1px solid var(--tm-on-dark-border);
}

@media (min-width: 720px) {
	.tm-stats {
		display: flex;
		flex-wrap: wrap;
		gap: var(--tm-space-6) var(--tm-space-8);
	}
}

.tm-stat__value {
	margin: 0;
	font-family: var(--tm-font-display);
	font-size: clamp(1.75rem, 1.5rem + 1vw, 2.125rem);
	font-style: normal;
	font-weight: 500;
	line-height: 1;
}

.tm-stat__value--brand {
	color: var(--tm-brand);
}

.tm-stat__label {
	margin: 6px 0 0;
	color: var(--tm-on-dark-3);
	font-size: 0.71875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ==========================================================================
   Guide / post cards
   ========================================================================== */

.tm-guides {
	display: grid;
	gap: 14px;
}

@media (min-width: 720px) {
	.tm-guides {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tm-guides > .tm-guide--featured {
		grid-column: 1 / -1;
	}
}

@media (min-width: 1025px) {
	.tm-guides {
		grid-template-columns: 1.4fr 1fr 1fr;
	}

	.tm-guides > .tm-guide--featured {
		grid-column: auto;
	}

	/* Equal columns when no card is featured */
	.tm-guides--even {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.tm-guide {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: var(--tm-space-6);
	border: 1px solid var(--tm-border);
	border-top: 3px solid var(--tm-ink);
	border-radius: 0 0 var(--tm-radius-sm) var(--tm-radius-sm); /* square top: the accent rule stays straight */
	background: var(--tm-white);
	color: var(--tm-ink);
	transition: border-color var(--tm-dur) var(--tm-ease), box-shadow var(--tm-dur) var(--tm-ease);
}

.tm-guide:hover {
	border-top-color: var(--tm-red);
	box-shadow: var(--tm-shadow-md);
}

.tm-guide__media {
	margin: calc(var(--tm-space-6) * -1) calc(var(--tm-space-6) * -1) var(--tm-space-2);
	overflow: hidden;
	border-radius: 0;
	aspect-ratio: 3 / 2;
}

.tm-guide__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Restore the media's negative top margin (the generic flex/grid margin reset
   below zeroes margin-block at equal specificity); keeps the image flush. */
.tm-guide > .tm-guide__media,
.tm-guide > .wp-block-group__inner-container > .tm-guide__media {
	margin-top: calc(var(--tm-space-6) * -1);
}

.tm-guide__kicker {
	margin: 0;
	color: var(--tm-red);
	font-size: var(--tm-fs-micro);
	font-weight: 600;
	letter-spacing: var(--tm-ls-kicker);
	text-transform: uppercase;
}

.tm-guide__title {
	margin: 0;
	font-size: 1.375rem;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.2;
}

.tm-guide__title a {
	color: inherit;
	text-decoration: none;
}

.tm-guide__title a:hover {
	color: var(--tm-brand-dark);
}

.tm-guide__excerpt {
	flex: 1;
	margin: 0;
	color: var(--tm-text-2);
	font-size: var(--tm-fs-sm);
	line-height: 1.55;
}

.tm-guide__meta {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--tm-space-3);
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-2xs);
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.tm-guide__more {
	margin: 0;
	align-self: flex-start;
	color: var(--tm-brand-dark);
	font-family: var(--tm-font-body);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
	letter-spacing: 0;
	text-decoration: underline;
	text-decoration-color: rgba(var(--tm-brand-rgb), 0.35);
	text-underline-offset: 3px;
	text-transform: none;
}

.tm-guide__more:hover {
	color: var(--tm-brand);
}

/* Push the "read more" link to the bottom so cards in a row line up */
.tm-guide > .tm-guide__more,
.tm-guide > .wp-block-group__inner-container > .tm-guide__more {
	margin-top: auto;
}

/* Featured (red) */
.tm-guide--featured {
	gap: var(--tm-space-3);
	padding: 30px;
	border: 0;
	background: var(--tm-brand);
	color: var(--tm-white);
}

.tm-guide--featured .tm-badge {
	align-self: flex-start;
	padding: 5px 10px;
	font-size: var(--tm-fs-micro);
}

.tm-guide--featured .tm-guide__title {
	margin-top: 6px;
	font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
	line-height: 1.05;
}

.tm-guide--featured .tm-guide__title a:hover {
	color: var(--tm-white);
}

.tm-guide--featured .tm-guide__excerpt {
	color: rgba(255, 255, 255, 0.88);
	font-size: 0.90625rem;
}

.tm-guide--featured .tm-guide__meta {
	margin: 0;
	color: rgba(255, 255, 255, 0.8);
	font-weight: 600;
}

.tm-guide--featured .tm-btn {
	align-self: flex-start;
}

/* Subpages (acf/tm-subpages): same cards, equal columns, no featured card */
@media (min-width: 1025px) {
	.tm-guides.tm-subpages {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ==========================================================================
   FAQ (native <details>: works without JS, good for FAQPage schema)
   ========================================================================== */

/* Kadence wraps group content in .wp-block-group__inner-container */
.tm-faq,
.is-style-tm-faq,
.is-style-tm-faq > .wp-block-group__inner-container {
	display: grid;
	gap: var(--tm-space-2);
}

.tm-faq__item,
.is-style-tm-faq .wp-block-details {
	margin-block: 0; /* the grid gap replaces the group's flow spacing */
	overflow: hidden;
	border: 2px solid var(--tm-border);
	border-radius: var(--tm-radius-md);
	background: var(--tm-gray-50);
	transition: border-color var(--tm-dur) var(--tm-ease), background-color var(--tm-dur) var(--tm-ease);
}

.tm-faq__item[open],
.is-style-tm-faq .wp-block-details[open] {
	border-color: var(--tm-ink);
	background: var(--tm-white);
}

.tm-faq__q,
.tm-faq__item > summary,
.is-style-tm-faq .wp-block-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--tm-space-4);
	padding: 18px var(--tm-space-5);
	color: var(--tm-ink);
	font-family: var(--tm-font-display);
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.03125rem);
	font-weight: 500;
	line-height: 1.3;
	list-style: none;
	cursor: pointer;
}

.tm-faq__q::-webkit-details-marker,
.tm-faq__item > summary::-webkit-details-marker,
.is-style-tm-faq .wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.tm-faq__q::after,
.tm-faq__item > summary::after,
.is-style-tm-faq .wp-block-details > summary::after {
	content: "+";
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 7px;
	background: var(--tm-gray-200);
	color: var(--tm-ink);
	font-family: var(--tm-font-body);
	font-size: var(--tm-fs-body);
	font-weight: 600;
	line-height: 1;
	transition: transform var(--tm-dur) var(--tm-ease), background-color var(--tm-dur) var(--tm-ease);
}

.tm-faq__item[open] > .tm-faq__q::after,
.tm-faq__item[open] > summary::after,
.is-style-tm-faq .wp-block-details[open] > summary::after {
	background: var(--tm-brand);
	color: var(--tm-white);
	transform: rotate(45deg);
}

.tm-faq__a,
.is-style-tm-faq .wp-block-details > :not(summary) {
	margin: 0;
	padding: 0 var(--tm-space-5) var(--tm-space-3);
	color: var(--tm-text-2);
	font-size: var(--tm-fs-sm);
	line-height: var(--tm-lh-body);
}

.tm-faq__a > :last-child {
	margin-bottom: 0;
}

.tm-faq__a,
.is-style-tm-faq .wp-block-details > :last-child {
	padding-bottom: var(--tm-space-5);
}

/* ==========================================================================
   Footer
   Content of the footer block widgets (inc/footer.php). The rows themselves,
   the dark surface and the link colors are in kadence.css.
   ========================================================================== */

.tm-footer__logo {
	display: inline-block;
}

.tm-footer__logo img {
	display: block;
	width: 220px;
	height: auto;
}

/* Text wordmark used until the logo files exist (inc/footer.php). */
.tm-footer__wordmark {
	color: var(--tm-ink);
	font-family: var(--tm-font-display);
	font-size: 1.5rem;
	font-weight: 500;
}

.tm-footer__about {
	max-width: 38ch;
	margin: var(--tm-space-5) 0 0;
	color: var(--tm-text-2);
}

.tm-footer__note {
	max-width: 46ch;
	margin: var(--tm-space-4) 0 0;
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-2xs);
	line-height: 1.6;
}

/* Bottom bar: copyright, email, cookie preferences */
.tm-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--tm-space-1) var(--tm-space-4);
	line-height: 1.6;
}

.tm-footer__copy,
.tm-footer__owner {
	margin: 0;
}

/* ==========================================================================
   Generic card
   ========================================================================== */

.tm-card {
	padding: var(--tm-space-6);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-lg);
	background: var(--tm-white);
}

.tm-card--gray {
	background: var(--tm-gray-100);
}

.tm-card--dark {
	border-color: rgba(255, 255, 255, 0.09);
	background: var(--tm-ink-2);
	color: var(--tm-white);
}

.tm-card--outline {
	border: 2px solid var(--tm-ink);
}

.tm-card--shadow {
	border: 0;
	box-shadow: var(--tm-shadow-md);
}

.tm-card__title {
	margin: 0 0 var(--tm-space-2);
	font-size: 1.25rem;
}

/* ==========================================================================
   Callouts
   ========================================================================== */

.tm-callout {
	padding: var(--tm-space-4) var(--tm-space-5);
	border-left: 4px solid var(--tm-ink);
	border-radius: 0 var(--tm-radius-sm) var(--tm-radius-sm) 0;
	background: var(--tm-gray-100);
	font-size: var(--tm-fs-sm);
}

.tm-callout > :last-child {
	margin-bottom: 0;
}

.tm-callout__title {
	margin-bottom: var(--tm-space-1);
	font-family: var(--tm-font-display);
	font-weight: 500;
	text-transform: none;
}

.tm-callout--brand { border-color: var(--tm-brand); background: var(--tm-brand-tint); }
.tm-callout--success { border-color: var(--tm-success); background: var(--tm-success-tint); }
.tm-callout--warning { border-color: var(--tm-warning); background: var(--tm-warning-tint); }
.tm-callout--info { border-color: var(--tm-info); background: var(--tm-info-tint); }

/* ==========================================================================
   Breadcrumbs, pagination, table of contents, author
   ========================================================================== */

.tm-breadcrumbs {
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-2xs);
	font-weight: 600;
}

.tm-breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.tm-breadcrumbs a:hover {
	color: var(--tm-brand-dark);
}

.tm-breadcrumbs .separator,
.tm-breadcrumbs__sep {
	margin-inline: 6px;
	color: var(--tm-text-disabled);
}

.tm-section--dark .tm-breadcrumbs,
.tm-dark .tm-breadcrumbs,
.tm-hero .tm-breadcrumbs {
	color: var(--tm-on-dark-3);
}

.tm-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: var(--tm-space-10);
}

.tm-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 42px;
	height: 42px;
	padding: 0 var(--tm-space-3);
	border: 2px solid var(--tm-border);
	border-radius: var(--tm-radius-sm);
	color: var(--tm-ink);
	font-family: var(--tm-font-body);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
	text-decoration: none;
}

.tm-pagination a.page-numbers:hover {
	border-color: var(--tm-ink);
	color: var(--tm-ink);
}

.tm-pagination .page-numbers.current {
	border-color: var(--tm-ink);
	background: var(--tm-ink);
	color: var(--tm-white);
}

.tm-pagination .page-numbers.dots {
	border-color: transparent;
}

.tm-toc {
	padding: var(--tm-space-5);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-md);
	background: var(--tm-gray-50);
}

.tm-toc__title {
	margin: 0 0 var(--tm-space-3);
	font-size: var(--tm-fs-sm);
	letter-spacing: 0.08em;
}

.tm-toc ol {
	display: grid;
	gap: 6px;
	margin: 0;
	padding-left: 1.25em;
	font-size: var(--tm-fs-sm);
	font-weight: 600;
}

.tm-toc a {
	color: var(--tm-text-2);
	text-decoration: none;
}

.tm-toc a:hover,
.tm-toc a.is-active {
	color: var(--tm-brand-dark);
}

.tm-author {
	display: flex;
	gap: var(--tm-space-4);
	align-items: center;
	font-size: var(--tm-fs-xs);
}

.tm-author__avatar {
	flex: none;
	width: 44px;
	height: 44px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--tm-gray-200);
}

.tm-author__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tm-author__name {
	font-weight: 500;
}

.tm-author__meta {
	color: var(--tm-text-muted);
}

/* ==========================================================================
   Page header (inner pages: reviews, guides, archives)
   ========================================================================== */

.tm-page-header {
	padding-block: var(--tm-space-8) var(--tm-space-10);
	background-color: var(--tm-ink);
	background-image: linear-gradient(90deg, rgba(var(--tm-brand-rgb), 0.14) 0%, rgba(var(--tm-brand-rgb), 0) 55%);
	color: var(--tm-on-dark);
}

.tm-page-header__title {
	margin: var(--tm-space-4) 0 var(--tm-space-3);
	font-size: var(--tm-fs-h1);
}

.tm-page-header__lead {
	max-width: 62ch;
	margin: 0;
	color: var(--tm-on-dark-2);
	font-size: var(--tm-fs-lead);
}

.tm-page-header__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tm-space-2) var(--tm-space-5);
	margin-top: var(--tm-space-5);
	color: var(--tm-on-dark-3);
	font-size: var(--tm-fs-2xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ==========================================================================
   Block editor integration
   Classes and block styles used by patterns built in Gutenberg.
   ========================================================================== */

/* Dark context for any wrapper (Kadence rows, groups): text colors only */
.tm-dark {
	color: var(--tm-on-dark);
}

/* Hero row: red glow on the left, on top of the row background color */
.tm-row--hero {
	background-image: linear-gradient(90deg, rgba(var(--tm-brand-rgb), 0.14) 0%, rgba(var(--tm-brand-rgb), 0) 55%);
}

/* core/button block styles (registered in functions.php) */
.wp-block-button[class*="is-style-tm-"] .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--tm-space-2);
	min-height: 44px;
	padding: 0.75rem 1.375rem;
	border: 2px solid transparent;
	border-radius: var(--tm-radius-sm);
	background: var(--tm-brand);
	color: var(--tm-white);
	font-family: var(--tm-font-body);
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.1;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	box-shadow: none;
	transition: background-color var(--tm-dur) var(--tm-ease), color var(--tm-dur) var(--tm-ease), border-color var(--tm-dur) var(--tm-ease);
}

.wp-block-button.is-style-tm-brand .wp-block-button__link:hover,
.wp-block-button.is-style-tm-brand .wp-block-button__link:focus-visible {
	background: var(--tm-brand-dark);
	color: var(--tm-white);
	box-shadow: none;
}

.wp-block-button.is-style-tm-dark .wp-block-button__link {
	background: var(--tm-ink);
}

.wp-block-button.is-style-tm-dark .wp-block-button__link:hover,
.wp-block-button.is-style-tm-dark .wp-block-button__link:focus-visible {
	background: var(--tm-ink-3);
	color: var(--tm-white);
	box-shadow: none;
}

.wp-block-button.is-style-tm-light .wp-block-button__link {
	background: var(--tm-white);
	color: var(--tm-ink);
}

.wp-block-button.is-style-tm-light .wp-block-button__link:hover,
.wp-block-button.is-style-tm-light .wp-block-button__link:focus-visible {
	background: var(--tm-ink);
	color: var(--tm-white);
	box-shadow: none;
}

.wp-block-button.is-style-tm-outline .wp-block-button__link {
	border-color: var(--tm-ink);
	background: transparent;
	color: var(--tm-ink);
}

.wp-block-button.is-style-tm-outline .wp-block-button__link:hover,
.wp-block-button.is-style-tm-outline .wp-block-button__link:focus-visible {
	background: var(--tm-ink);
	color: var(--tm-white);
	box-shadow: none;
}

.wp-block-button.is-style-tm-outline-light .wp-block-button__link {
	border-color: rgba(255, 255, 255, 0.3);
	background: transparent;
	color: var(--tm-white);
}

.wp-block-button.is-style-tm-outline-light .wp-block-button__link:hover,
.wp-block-button.is-style-tm-outline-light .wp-block-button__link:focus-visible {
	border-color: var(--tm-white);
	background: transparent;
	color: var(--tm-white);
	box-shadow: none;
}

/* core/details as FAQ item: answer blocks sit directly inside <details> */
.tm-faq__item > :not(summary) {
	margin: 0;
	padding-inline: var(--tm-space-5);
	color: var(--tm-text-2);
	font-size: var(--tm-fs-sm);
	line-height: var(--tm-lh-body);
}

.tm-faq__item > :not(summary) + :not(summary) {
	padding-top: var(--tm-space-3);
}

.tm-faq__item > :last-child:not(summary) {
	padding-bottom: var(--tm-space-5);
}

/*
 * Blocks inside flex/grid components: kill default flow margins.
 * The second form covers Kadence's .wp-block-group__inner-container wrapper.
 */
:is(.tm-guide, .tm-guides, .tm-stats, .tm-stat, .tm-section-head, .tm-section-head__text, .tm-faq) > *,
:is(.tm-guide, .tm-guides, .tm-stats, .tm-stat, .tm-section-head, .tm-section-head__text, .tm-faq) > .wp-block-group__inner-container > * {
	margin-block: 0;
}

.tm-section-head__text > .tm-section-head__title,
.tm-section-head__text > .wp-block-group__inner-container > .tm-section-head__title {
	margin: var(--tm-space-2) 0;
}

/* ==========================================================================
   Author box (E-E-A-T) - global, so guide pages use it too.
   ========================================================================== */

.tm-author-box {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--tm-space-4) var(--tm-space-5);
	margin-top: var(--tm-space-12);
	padding: var(--tm-space-6);
	border: 2px solid var(--tm-ink);
	border-radius: var(--tm-radius-lg);
}

/* Beat prose's generic sibling spacing when appended inside .entry-content. */
body:not(.tm-landing) .entry-content > .tm-author-box {
	margin-top: var(--tm-space-12);
}

.tm-author-box__avatar {
	width: 64px;
	height: 64px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--tm-gray-200);
}

.tm-author-box__avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tm-author-box__body > p {
	margin: 0;
}

.tm-author-box__name {
	margin-top: var(--tm-space-1) !important;
	font-family: var(--tm-font-display);
	font-size: var(--tm-fs-h4);
	font-weight: 500;
}

.tm-author-box__name a {
	color: var(--tm-ink);
	text-decoration: none;
}

.tm-author-box__name a:hover {
	color: var(--tm-brand-dark);
}

.tm-author-box__role {
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
}

.tm-author-box__bio {
	margin-top: var(--tm-space-3) !important;
	color: var(--tm-text-2);
	font-size: var(--tm-fs-sm);
	line-height: var(--tm-lh-body);
}

.tm-author-box__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--tm-space-2) var(--tm-space-4);
	margin-top: var(--tm-space-4);
}

.tm-author-box__foot .tm-chip {
	text-decoration: none;
}

@media (min-width: 720px) {
	.tm-author-box__avatar {
		width: 88px;
		height: 88px;
	}
}

/* ==========================================================================
   Guide hero (dark, full-bleed): title + meta left, featured image right,
   on an ink band. Replaces Kadence's title band + feature (inc/article.php).
   ========================================================================== */

.tm-guide-hero {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-bottom: var(--tm-section-gap);
	border-bottom: 1px solid var(--tm-border);
	background: var(--tm-gray-100);
	color: var(--tm-ink);
}

.tm-guide-hero__inner {
	/* Same box as Kadence's header container, so logo and hero line up */
	max-width: var(--global-content-width, 1290px);
	margin: 0 auto;
	padding: var(--tm-space-10) var(--global-content-edge-padding, 1.5rem) var(--tm-space-12);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	gap: var(--tm-space-6) var(--tm-space-10);
	align-items: center;
}

.tm-guide-hero--no-media .tm-guide-hero__inner {
	grid-template-columns: 1fr;
}

/* Text-only hero (no featured image): the title spans the full width,
   the lead keeps a readable line length */
.tm-guide-hero--no-media .tm-guide-hero__body {
	max-width: none;
}

.tm-guide-hero--no-media .tm-guide-hero__lead {
	max-width: 72ch;
}

/* Balanced wrapping would split a long title into two short lines and
   leave half the band empty: fill the line instead */
.tm-guide-hero--no-media .tm-guide-hero__title {
	text-wrap: pretty;
}

.tm-guide-hero__body > * {
	margin: 0;
}

.tm-guide-hero__body > * + * {
	margin-top: var(--tm-space-3);
}

.tm-guide-hero__crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em;
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-xs);
}

.tm-guide-hero__crumbs a {
	color: var(--tm-brand-dark);
	text-decoration: underline;
	text-decoration-color: rgba(var(--tm-brand-rgb), 0.35);
}

.tm-guide-hero__crumbs a:hover {
	color: var(--tm-brand);
	text-decoration-color: currentColor;
}

.tm-guide-hero__sep {
	color: var(--tm-text-subtle);
}

/* Long current-page labels (news titles without a short breadcrumb title)
   stop at a readable length */
.tm-guide-hero__crumbs [aria-current="page"] {
	display: inline-block;
	max-width: 48ch;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	vertical-align: bottom;
}

/* Phones: breadcrumb on one line, the current page shortened with an ellipsis */
@media (max-width: 767px) {
	/* A one-line breadcrumb must not widen the hero column */
	.tm-guide-hero__body,
	.tm-guide-hero__top {
		min-width: 0;
		max-width: 100%;
	}

	.tm-guide-hero__top .tm-guide-hero__crumbs {
		flex: 1 1 0;
		min-width: 0;
	}

	.tm-guide-hero__crumbs {
		flex-wrap: nowrap;
		overflow: hidden;
		white-space: nowrap;
	}

	.tm-guide-hero__crumbs > * {
		flex-shrink: 0;
	}

	.tm-guide-hero__crumbs [aria-current="page"] {
		flex-shrink: 1;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

/* Breadcrumb above, kicker below it (article hero) */
.tm-guide-hero__top {
	display: flex;
	flex-direction: column-reverse;
	align-items: flex-start;
	gap: var(--tm-space-5);
}

.tm-guide-hero__top > * {
	margin: 0;
}

.tm-guide-hero__top .tm-guide-hero__kicker {
	padding-top: var(--tm-space-3);
	border-top: 3px solid var(--tm-red);
	font-size: var(--tm-fs-2xs);
	line-height: 1.2;
}

.tm-guide-hero__kicker {
	font-family: var(--tm-font-body);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: var(--tm-ls-kicker);
	color: var(--tm-red);
}

.tm-guide-hero__title {
	font-family: var(--tm-font-display);
	font-size: var(--tm-fs-h1);
	line-height: var(--tm-lh-heading);
	letter-spacing: var(--tm-ls-display);
	font-weight: 500;
	color: var(--tm-ink);
}

.tm-guide-hero__lead {
	max-width: 62ch;
	color: var(--tm-text-3);
	font-size: var(--tm-fs-lead);
	line-height: 1.55;
}

.tm-guide-hero__media {
	margin: 0;
}

.tm-guide-hero__media img {
	display: block;
	width: 100%;
	height: auto; /* natural ratio: no crop for 1200x628 and similar */
	border-radius: var(--tm-radius-sm);
}

/* Attachment caption, e.g. "Immagine generata con AI" */
.tm-guide-hero__caption {
	margin-top: var(--tm-space-1);
	font-size: 0.5625rem; /* 9px: disclosure, not content */
	line-height: 1.2;
	color: var(--tm-text-subtle);
	text-align: right;
}

.tm-guide-hero .tm-article-meta {
	margin: var(--tm-space-4) 0 0 !important;
	padding-top: var(--tm-space-4);
	padding-bottom: 0;
	border-top: 1px solid var(--tm-border);
	border-bottom: 0;
	color: var(--tm-text-muted);
}

.tm-guide-hero .tm-article-meta a {
	color: var(--tm-brand-dark);
}

.tm-guide-hero .tm-article-meta__item + .tm-article-meta__item::before {
	color: var(--tm-text-subtle);
}

@media (max-width: 1024px) {
	.tm-guide-hero__inner {
		grid-template-columns: 1fr;
		gap: var(--tm-space-6);
		padding: var(--tm-space-6) var(--global-content-edge-padding, 1.5rem);
	}
}

/* ==========================================================================
   Author archive (author.php): profile header + guides grid
   ========================================================================== */

.tm-author-archive {
	padding-block: var(--tm-section-gap);
}

.tm-author-hero {
	display: flex;
	align-items: center;
	gap: var(--tm-space-8);
	margin-bottom: var(--tm-space-12);
}

.tm-author-hero__photo {
	flex: 0 0 auto;
	width: 128px;
	height: 128px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--tm-gray-200);
}

.tm-author-hero__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tm-author-hero__body > * {
	margin: 0;
}

.tm-author-hero__body > * + * {
	margin-top: var(--tm-space-2);
}

.tm-author-hero__name {
	font-family: var(--tm-font-display);
	font-size: var(--tm-fs-h1);
	font-weight: 500;
	line-height: var(--tm-lh-heading);
	letter-spacing: var(--tm-ls-display);
	color: var(--tm-ink);
}

.tm-author-hero__role {
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-sm);
	font-weight: 600;
}

.tm-author-hero__bio {
	max-width: 62ch;
	color: var(--tm-text-2);
	font-size: var(--tm-fs-lead);
	line-height: var(--tm-lh-body);
}

.tm-author-hero__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tm-space-2);
	margin-top: var(--tm-space-4) !important;
}

.tm-author-archive__title {
	margin: 0 0 var(--tm-space-6);
	font-family: var(--tm-font-display);
	font-size: var(--tm-fs-h3);
	color: var(--tm-ink);
}

@media (max-width: 600px) {
	.tm-author-hero {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--tm-space-5);
	}

	.tm-author-hero__photo {
		width: 96px;
		height: 96px;
	}
}


/* Contact page: the email address as the main call to action */
.tm-contact-email {
	margin: var(--tm-space-6) 0;
	font-family: var(--tm-font-display);
	font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
	font-weight: 500;
}

/* Currency converter: tm/cambio (inc/currency.php) */
.tm-cambio {
	padding: var(--tm-space-6);
	border: 1px solid var(--tm-border);
	border-top: 4px solid var(--tm-brand);
	border-radius: var(--tm-radius-md);
	background: var(--tm-gray-50);
}

.tm-cambio > * {
	margin: 0 !important;
}

.tm-cambio > * + * {
	margin-top: var(--tm-space-4) !important;
}

.tm-cambio__title {
	color: var(--tm-red);
	font-size: var(--tm-fs-2xs);
	font-weight: 700;
	letter-spacing: var(--tm-ls-kicker);
	text-transform: uppercase;
}

.tm-cambio__form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto minmax(0, 1.4fr);
	gap: var(--tm-space-3);
	align-items: end;
}

.tm-cambio__field {
	display: grid;
	gap: var(--tm-space-1);
	margin: 0;
}

.tm-cambio__field > span {
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
}

.tm-cambio__field input {
	font-variant-numeric: tabular-nums;
}

.tm-cambio__swap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-sm);
	background: var(--tm-white);
	color: var(--tm-brand);
	cursor: pointer;
	transition: border-color var(--tm-dur) var(--tm-ease), background-color var(--tm-dur) var(--tm-ease);
}

.tm-cambio__swap:hover,
.tm-cambio__swap:focus-visible {
	border-color: var(--tm-brand);
	background: var(--tm-brand-tint);
	color: var(--tm-brand);
}

.tm-cambio__result {
	color: var(--tm-ink);
	font-family: var(--tm-font-display);
	font-size: var(--tm-fs-h3);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: var(--tm-lh-heading);
}

.tm-cambio__rate {
	color: var(--tm-text-2);
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.tm-cambio__quick {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 1px;
	padding: 0 !important; /* prose.css indents content lists */
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-sm);
	background: var(--tm-border);
	list-style: none;
	overflow: hidden;
}

.tm-cambio__quick li {
	display: block;
	margin: 0 !important;
	padding: var(--tm-space-2) var(--tm-space-3);
	background: var(--tm-white);
	color: var(--tm-ink);
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.35;
}

.tm-cambio__quick li::before {
	content: none;
}

.tm-cambio__quick span {
	display: block;
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-2xs);
	font-weight: 600;
}

.tm-cambio__note {
	color: var(--tm-text-subtle);
	font-size: var(--tm-fs-xs);
	line-height: 1.5;
}

@media (max-width: 719px) {
	.tm-cambio {
		padding: var(--tm-space-5) var(--tm-space-4);
	}

	.tm-cambio__form {
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	}

	.tm-cambio__field--amount {
		grid-column: 1 / -1;
	}

	.tm-cambio__quick {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Time zone clocks: tm/orario (inc/time.php) */
.tm-orario {
	padding: var(--tm-space-6);
	border: 1px solid var(--tm-border);
	border-top: 4px solid var(--tm-brand);
	border-radius: var(--tm-radius-md);
	background: var(--tm-gray-50);
}

.tm-orario p {
	margin: 0 !important;
}

.tm-orario > * + *,
.tm-orario__convert > * + * {
	margin-top: var(--tm-space-4) !important;
}

.tm-orario__title,
.tm-orario__subtitle {
	color: var(--tm-red);
	font-size: var(--tm-fs-2xs);
	font-weight: 700;
	letter-spacing: var(--tm-ls-kicker);
	text-transform: uppercase;
}

.tm-orario__clocks {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-sm);
	background: var(--tm-border);
	overflow: hidden;
}

.tm-orario__clock {
	padding: var(--tm-space-4) var(--tm-space-5);
	background: var(--tm-white);
}

.tm-orario__place {
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
}

.tm-orario__time {
	color: var(--tm-ink);
	font-family: var(--tm-font-display);
	font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
}

.tm-orario__date {
	color: var(--tm-text-3);
	font-size: var(--tm-fs-sm);
}

.tm-orario__gap {
	color: var(--tm-ink);
	font-weight: 600;
}

.tm-orario__note {
	color: var(--tm-text-subtle);
	font-size: var(--tm-fs-xs);
	line-height: 1.5;
}

.tm-orario__convert {
	padding-top: var(--tm-space-5);
	border-top: 1px solid var(--tm-border);
}

.tm-orario__form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
	gap: var(--tm-space-3);
	align-items: end;
}

.tm-orario__field {
	display: grid;
	gap: var(--tm-space-1);
	margin: 0;
}

.tm-orario__field > span {
	color: var(--tm-text-muted);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
}

.tm-orario__result {
	color: var(--tm-ink);
	font-family: var(--tm-font-display);
	font-size: var(--tm-fs-h4);
	font-weight: 600;
	line-height: var(--tm-lh-heading);
}

@media (max-width: 719px) {
	.tm-orario {
		padding: var(--tm-space-5) var(--tm-space-4);
	}

	.tm-orario__clock {
		padding: var(--tm-space-3) var(--tm-space-4);
	}

	.tm-orario__form {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.tm-orario__field--wide {
		grid-column: 1 / -1;
	}
}
