/*
 * Small global layer for details that cannot be expressed in theme.json.
 * Most colors and spacing deliberately inherit WordPress presets.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 7rem;
}

body {
	overflow-wrap: break-word;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img,
video,
iframe {
	max-width: 100%;
}

iframe {
	border: 0;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 0.08em;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent, #d79841);
	outline-offset: 3px;
}

.wp-site-blocks {
	overflow: clip;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus,
.skip-link:focus {
	position: fixed !important;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	clip: auto;
	padding: 0.75rem 1rem;
	margin: 0;
	background: var(--wp--preset--color--contrast, #17232d);
	color: var(--wp--preset--color--base, #fff);
	font-weight: 700;
	border-radius: 4px;
}

/* Header and footer hooks used by the bundled template parts. */
:where(.tvt-site-header, .tanviettheme-header) {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
	background: color-mix(in srgb, var(--wp--preset--color--base, #fff) 94%, transparent);
	backdrop-filter: blur(14px) saturate(130%);
}

.admin-bar :where(.tvt-site-header, .tanviettheme-header) {
	top: 32px;
}

:where(.tvt-topbar, .tanviettheme-topbar) {
	font-size: var(--wp--preset--font-size--small, 0.8125rem);
	letter-spacing: 0.04em;
}

:where(.tvt-site-footer, .tanviettheme-footer) a {
	color: inherit;
}

/* Editorial primitives shared by patterns and Builder blocks. */
.tvt-kicker {
	font-size: 0.75rem;
	font-weight: 750;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

.tvt-balanced {
	text-wrap: balance;
}

.tvt-pretty {
	text-wrap: pretty;
}

.tvt-card,
.is-style-tanviet-card {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast, #17232d) 10%, transparent);
	border-radius: 10px;
	box-shadow: 0 16px 44px rgb(20 35 45 / 8%);
}

.is-style-tanviet-glass {
	border: 1px solid rgb(255 255 255 / 28%);
	background: rgb(255 255 255 / 78%);
	box-shadow: 0 20px 64px rgb(20 35 45 / 12%);
	backdrop-filter: blur(18px) saturate(130%);
}

.tvt-hover-lift {
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.tvt-hover-lift:hover {
	transform: translateY(-4px);
	box-shadow: 0 20px 52px rgb(20 35 45 / 13%);
}

.tvt-media-frame {
	overflow: hidden;
	border-radius: 10px;
}

.tvt-media-frame img,
.tvt-media-frame video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tvt-aspect-landscape {
	aspect-ratio: 16 / 10;
}

.tvt-aspect-video {
	aspect-ratio: 16 / 9;
}

.tvt-post-meta {
	font-size: var(--wp--preset--font-size--small, 0.8125rem);
	color: var(--wp--preset--color--muted, #66747e);
}

.tvt-rule {
	width: 3rem;
	height: 3px;
	margin-inline: 0;
	border: 0;
	background: var(--wp--preset--color--accent, #d79841);
}

.tvt-section-clip {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.tvt-section-clip::after {
	position: absolute;
	right: -8rem;
	bottom: -10rem;
	z-index: -1;
	width: 24rem;
	height: 24rem;
	content: "";
	border-radius: 999px;
	background: radial-gradient(circle, color-mix(in srgb, var(--wp--preset--color--accent, #d79841) 22%, transparent), transparent 70%);
	pointer-events: none;
}

/* Long-form content. */
.wp-block-post-content :where(h2, h3, h4) {
	scroll-margin-top: 8rem;
}

.wp-block-post-content :where(figure, .wp-block-embed, .wp-block-video) {
	margin-block: clamp(1.75rem, 4vw, 3rem);
}

.wp-block-post-content figcaption {
	color: var(--wp--preset--color--muted, #66747e);
	font-size: var(--wp--preset--font-size--small, 0.8125rem);
	line-height: 1.5;
}

.wp-block-post-content table {
	width: 100%;
	border-collapse: collapse;
}

.wp-block-post-content :where(th, td) {
	padding: 0.75rem;
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	text-align: start;
}

.wp-block-post-content th {
	background: var(--wp--preset--color--surface, #f7f8fa);
}

.wp-block-post-content pre {
	overflow-x: auto;
	border-radius: 8px;
}

/* Native controls. */
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
	max-width: 100%;
	min-height: 44px;
	padding: 0.7rem 0.85rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast, #17232d) 24%, transparent);
	border-radius: 5px;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #17232d);
	font: inherit;
}

textarea {
	min-height: 9rem;
	resize: vertical;
}

:where(input, select, textarea):focus {
	border-color: var(--wp--preset--color--primary, #315f7b);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary, #315f7b) 18%, transparent);
}

/* Comments and pagination remain readable even with long text. */
.wp-block-comment-template {
	padding-left: 0;
}

.wp-block-comment-template ol {
	padding-left: clamp(1rem, 4vw, 2.5rem);
}

.wp-block-comments-pagination,
.wp-block-query-pagination {
	gap: 0.5rem;
}

@media (max-width: 782px) {
	.admin-bar :where(.tvt-site-header, .tanviettheme-header) {
		top: 46px;
	}

	:where(.tvt-hide-mobile, .tanviettheme-hide-mobile) {
		display: none !important;
	}

	.wp-block-post-content .alignwide,
	.wp-block-post-content .alignfull {
		max-width: 100%;
	}
}

@media (max-width: 600px) {
	html {
		scroll-padding-top: 5rem;
	}

	:where(.tvt-site-header, .tanviettheme-header) {
		backdrop-filter: blur(10px);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

@media print {
	:where(.tv-header, .tv-footer, .tvt-site-header, .tanviettheme-header, .tvt-site-footer, .tanviettheme-footer),
	.wp-block-navigation,
	.wp-block-post-comments-form {
		display: none !important;
	}

	body {
		background: #fff !important;
		color: #000 !important;
	}

	a {
		color: inherit !important;
		text-decoration: underline;
	}
}
