/**
 * Khánh Vy Auto — nền tảng CSS (theme độc lập, không dùng framework ngoài).
 *
 * Reset, khung .container, chữ, form, nội dung bài viết, class chuẩn của WordPress.
 * Breakpoint: medium ≤ 849px, small ≤ 549px; menu desktop ≥ 1200px.
 */

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

html {
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
	overflow-x: hidden;
	scroll-padding-top: var(--kva-scroll-offset, 80px);
}

body {
	margin: 0;
	font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.7;
	-moz-osx-font-smoothing: grayscale;
}

main,
header,
footer,
nav,
section,
article,
aside,
figure {
	display: block;
}

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

img {
	display: inline-block;
	height: auto;
	border-style: none;
	vertical-align: middle;
}

a {
	color: var(--kva-primary);
	text-decoration: none;
	background-color: transparent;
	touch-action: manipulation;
}

a:hover {
	color: var(--kva-secondary);
}

hr {
	margin: 24px 0;
	border: 0;
	border-top: 1px solid var(--kva-border);
}

p:empty {
	display: none;
}

/* Chữ ---------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 .5em;
	font-weight: 800;
	color: var(--kva-secondary);
}

h1 {
	font-size: 2rem;
}

h2 {
	font-size: 1.6rem;
}

h3 {
	font-size: 1.25rem;
}

h4 {
	font-size: 1.1rem;
}

h5,
h6 {
	font-size: 1rem;
}

p,
ul,
ol,
dl,
blockquote,
figure,
form,
pre,
table {
	margin-top: 0;
	margin-bottom: 1.3em;
}

ul,
ol {
	padding: 0;
}

ul {
	list-style: disc;
}

ol {
	list-style: decimal;
}

li {
	margin-bottom: .6em;
}

dt {
	font-weight: 700;
}

dd {
	margin: 0 0 1em;
}

b,
strong {
	font-weight: 700;
}

small {
	font-size: 85%;
}

blockquote {
	padding: 0 1.25em 0 1.5em;
	border-left: 3px solid var(--kva-primary);
	font-size: 1.1em;
	font-style: italic;
	color: var(--kva-text);
}

code,
kbd,
pre,
samp {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .9em;
}

pre {
	padding: 16px;
	overflow: auto;
	border-radius: var(--kva-radius);
	background: var(--kva-light);
}

table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
}

th,
td {
	padding: .6em .75em;
	border-bottom: 1px solid var(--kva-border);
	font-size: .95em;
	line-height: 1.4;
	text-align: left;
}

th {
	font-weight: 700;
	color: var(--kva-secondary);
}

/* Form --------------------------------------------------------------- */
button,
input,
select,
textarea {
	margin: 0 0 1em;
	font: inherit;
	color: inherit;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
	cursor: pointer;
	touch-action: manipulation;
}

label,
legend {
	display: block;
	margin-bottom: .4em;
	font-size: .9em;
	font-weight: 700;
	color: var(--kva-secondary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="password"],
input[type="date"],
select,
textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 2.75em;
	padding: 0 .85em;
	border: 1px solid #d6d6d6;
	border-radius: var(--kva-radius);
	background-color: #fff;
	color: var(--kva-text);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
	font-size: .97em;
	line-height: 1.3;
	transition: border-color .2s ease, box-shadow .2s ease;
	-webkit-appearance: none;
	appearance: none;
}

input[type="date"] {
	-webkit-appearance: auto;
	appearance: auto;
}

select {
	padding-right: 2.2em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-position: right .7em center;
	background-repeat: no-repeat;
	background-size: 1em;
}

textarea {
	height: auto;
	min-height: 120px;
	padding-top: .7em;
	padding-bottom: .7em;
	resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--kva-primary);
	outline: 0;
	box-shadow: 0 0 0 3px rgba(227, 6, 19, .12);
}

input[type="checkbox"],
input[type="radio"] {
	display: inline-block;
	margin: 0 8px 0 0;
	vertical-align: middle;
	accent-color: var(--kva-primary);
}

input[type="checkbox"] + label,
input[type="radio"] + label {
	display: inline;
}

::placeholder {
	color: #8a8a8a;
	opacity: 1;
}

fieldset {
	margin: 0 0 1em;
	padding: 0;
	border: 0;
}

/* Khung trang ------------------------------------------------------- */
.container {
	width: 100%;
	max-width: 1080px;
	margin-right: auto;
	margin-left: auto;
	padding-right: 15px;
	padding-left: 15px;
}

#wrapper {
	position: relative;
	background: var(--kva-bg);
}

#main {
	display: block;
	background: var(--kva-bg);
}

.page-wrapper {
	padding: 0;
}

.kva-page__body {
	padding-top: 30px;
	padding-bottom: 30px;
}

/* Nội dung soạn thảo (Classic Editor) -------------------------------- */
.entry-content {
	overflow-wrap: break-word;
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 1.4em;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.4em;
}

.entry-content li > ul,
.entry-content li > ol {
	margin: .6em 0 0;
}

/* Link trong đoạn văn/danh sách của bài viết (không áp vào form, thẻ, nút được chèn). */
.entry-content > p a,
.entry-content > ul a,
.entry-content > ol a,
.entry-content > blockquote a,
.entry-content > table a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.entry-content a.kva-btn {
	text-decoration: none;
}

.entry-content iframe,
.entry-content video {
	display: block;
	max-width: 100%;
}

/* Class chuẩn WordPress */
.alignleft {
	float: left;
	margin: .3em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: .3em 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text,
figcaption {
	margin-top: .5em;
	font-size: .875em;
	color: var(--kva-muted);
	text-align: center;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(var(--kva-gallery-cols, 3), minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 1.3em;
}

.gallery-columns-2 { --kva-gallery-cols: 2; }
.gallery-columns-4 { --kva-gallery-cols: 4; }
.gallery-columns-5 { --kva-gallery-cols: 5; }

.gallery-item {
	margin: 0;
}

.sticky,
.bypostauthor {
	display: block;
}

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

.skip-link:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 12px 20px;
	clip: auto;
	border-radius: var(--kva-radius);
	background: #fff;
	color: var(--kva-secondary);
	font-weight: 700;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

/* Tiện ích ------------------------------------------------------------ */
.mb-0 {
	margin-bottom: 0 !important;
}

@media (max-width: 849px) {
	.hide-for-medium {
		display: none !important;
	}
}

@media (max-width: 549px) {
	.gallery {
		--kva-gallery-cols: 2;
	}
}
