/*
 * Cún Yêu — CSS nền (docs/02). Nạp sau CSS GeneratePress.
 * Màu, chữ cơ bản, container đã cấu hình trong GeneratePress (scripts/gp-config.php);
 * file này bổ sung cỡ chữ responsive, thành phần giao diện và các mốc breakpoint riêng.
 */

/* ---------- Nền ---------- */
body {
	background-color: var(--cy-cream);
	color: var(--cy-ink);
	font-family: var(--cy-font-body);
}

/* GeneratePress in font chữ không kèm font dự phòng: bổ sung để không rơi về Times khi font chưa tải. */
body :is(button, input, select, textarea, .button),
body .wp-block-button .wp-block-button__link,
body .main-navigation a {
	font-family: var(--cy-font-body);
}
body .main-title {
	font-family: var(--cy-font-heading);
}

h1, h2, h3, h4, h5, h6,
.cy-heading {
	font-family: var(--cy-font-heading);
	font-weight: 600;
	letter-spacing: var(--cy-heading-tracking);
	color: var(--cy-green);
}
h1 em, h2 em { font-style: italic; font-weight: 500; color: var(--cy-clay-text); }

h1 { font-size: 56px; line-height: 1.06; }
h2 { font-size: 42px; line-height: 1.1; }
h3 { font-size: 25px; line-height: 1.25; }
h4 { font-size: 21px; line-height: 1.3; }

/* H1 trang chủ, H2 trong bài, thân bài: gắn class trên block (Advanced → Additional CSS class). */
.cy-h1-home { font-size: 68px; line-height: 1.04; }
.entry-content h2 { font-size: 32px; line-height: 1.2; }
.single .entry-content { font-size: 18px; line-height: 1.8; }
.cy-story { font-family: var(--cy-font); font-size: 19px; line-height: 1.75; }

a { color: var(--cy-green); text-underline-offset: 3px; }
a:hover { color: var(--cy-clay-text); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--cy-green);
	outline-offset: 2px;
}
.cy-btn:focus-visible, .cy-chip:focus-visible { outline: none; box-shadow: var(--cy-focus-ring); }

/* ---------- Bố cục ---------- */
.cy-section { margin-block: var(--cy-section-gap); }
.cy-article-col { max-width: var(--cy-article); margin-inline: auto; }
.cy-grid { display: grid; gap: var(--cy-grid-gap); }
.cy-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cy-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cy-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cy-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---------- Chữ nhỏ ---------- */
.cy-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	font-family: var(--cy-font);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--cy-clay-text);
}
/* Gạch ngang sau eyebrow; khối căn giữa có gạch ở 2 bên */
.cy-eyebrow--line::after { content: ""; width: 64px; height: 1px; background: var(--cy-eyebrow-line); }
.cy-eyebrow--center::before,
.cy-eyebrow--center::after { content: ""; width: 88px; height: 1px; background: var(--cy-eyebrow-line); }
.cy-on-dark .cy-eyebrow { color: var(--cy-clay-on-dark); }
.cy-meta { font-size: 14px; color: var(--cy-ink-3); }
.cy-dek { color: var(--cy-ink-2); }

/* ---------- Nền section ---------- */
.cy-bg-beige { background-color: var(--cy-beige); }
.cy-bg-white { background-color: var(--cy-white); }
.cy-bg-warm { background-color: var(--cy-warm); }
.cy-bg-warm-2 { background-color: var(--cy-warm-2); }
/* Pastel theo chuyên mục */
.cy-bg-peach { background-color: var(--cy-p-peach); }
.cy-bg-blue { background-color: var(--cy-p-blue); }
.cy-bg-lavender { background-color: var(--cy-p-lavender); }
.cy-bg-sage { background-color: var(--cy-p-sage); }
.cy-bg-pink { background-color: var(--cy-p-pink); }
.cy-on-dark {
	background-color: var(--cy-green);
	color: var(--cy-on-dark);
}
.cy-on-dark :is(h1, h2, h3, h4, a) { color: var(--cy-on-dark); }
.cy-on-dark p { color: var(--cy-on-dark-2); }

/* ---------- Nút ---------- */
.cy-btn,
.btn-green,
.btn-clay,
.btn-ghost,
.btn-soft {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 28px;
	border: 0;
	border-radius: var(--cy-radius-pill);
	font-family: var(--cy-font);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.cy-btn-sm { min-height: 48px; padding: 0 20px; }
.cy-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-green,
.btn-green:visited { background-color: var(--cy-green); color: var(--cy-on-dark); }
.btn-green:hover,
.btn-green:focus-visible { background-color: var(--cy-green-dark); color: var(--cy-on-dark); }

/* Đất nung: nền --cy-clay-text, chữ sáng (docs/12 mục 3.2) */
.btn-clay,
.btn-clay:visited,
.cy-on-dark .btn-clay,
.cy-on-dark .btn-clay:visited { background-color: var(--cy-clay-text); color: var(--cy-on-dark); }
.btn-clay:hover,
.btn-clay:focus-visible,
.cy-on-dark .btn-clay:hover,
.cy-on-dark .btn-clay:focus-visible { background-color: var(--cy-clay-dark); color: var(--cy-on-dark); }

.btn-ghost,
.btn-ghost:visited {
	min-height: 50px;
	padding: 0 24px;
	background-color: transparent;
	color: var(--cy-green);
	box-shadow: inset 0 0 0 1.5px var(--cy-green);
}
.btn-ghost:hover,
.btn-ghost:focus-visible { background-color: var(--cy-green); color: var(--cy-on-dark); }

/* Nút mềm "Thêm vào giỏ", "Mua ngay" trong thẻ */
.btn-soft,
.btn-soft:visited { width: 100%; min-height: 46px; background-color: var(--cy-clay-soft); color: var(--cy-clay-dark); }
.btn-soft:hover,
.btn-soft:focus-visible { background-color: var(--cy-clay-soft-2); color: var(--cy-clay-dark); }

/* Nút mũi tên tròn ở góc thẻ */
.cy-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: var(--cy-radius-pill);
	background-color: var(--cy-clay-soft);
	color: var(--cy-clay-text);
}

/* Nút mặc định của WordPress/GeneratePress theo màu thương hiệu */
.button,
input[type="submit"],
input[type="button"],
.wp-block-button__link {
	border-radius: var(--cy-radius-pill);
	font-weight: 600;
}

/* ---------- Tag, chip ---------- */
.cy-tag {
	display: inline-flex;
	align-items: center;
	padding: 5px 11px;
	border-radius: var(--cy-radius-pill);
	background-color: var(--cy-beige);
	color: var(--cy-green);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
}
.cy-tag--accent { background-color: var(--cy-clay-text); color: var(--cy-on-dark); }

.cy-chip {
	display: inline-flex;
	align-items: center;
	min-height: 46px;
	padding: 0 22px;
	border: 1px solid var(--cy-line);
	border-radius: var(--cy-radius-pill);
	background-color: var(--cy-white);
	color: var(--cy-ink);
	font-family: var(--cy-font);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.cy-chip:hover { border-color: var(--cy-green); }
.cy-chip[aria-pressed="true"],
.cy-chip.is-active {
	background-color: var(--cy-green);
	border-color: var(--cy-green);
	color: var(--cy-on-dark);
}

/* ---------- Form ---------- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
	min-height: 52px;
	padding: 12px 16px;
	border: 1.5px solid var(--cy-line-2);
	border-radius: var(--cy-radius-input);
	background-color: var(--cy-white);
	color: var(--cy-ink);
	font-family: var(--cy-font);
	font-size: 16px;
}
textarea { min-height: 120px; }
input:focus,
select:focus,
textarea:focus {
	border-color: var(--cy-green);
	box-shadow: var(--cy-focus-ring);
	outline: none;
}
.cy-field-error,
[aria-invalid="true"] { border-color: var(--cy-error) !important; }
.cy-error-text { color: var(--cy-error); font-size: 14px; margin-top: 6px; }

/* ---------- Thẻ ---------- */
.cy-card {
	background-color: var(--cy-white);
	border-radius: var(--cy-radius-card);
	box-shadow: var(--cy-shadow-card);
	transition: transform .2s ease, box-shadow .2s ease;
}
.cy-card:hover { transform: translateY(-3px); box-shadow: var(--cy-shadow-hover); }
.cy-card img { border-radius: var(--cy-radius-md); }
.cy-card:hover .cy-card-title,
.cy-card-title a:hover { color: var(--cy-clay-text); }

/* ---------- Thành phần mới Warm Editorial (docs/12 mục 3) ---------- */
/* Đầu section: eyebrow + H2 trái, nút .btn-ghost có mũi tên phải */
.cy-sechead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 40px; }
.cy-sechead h2 { margin: 12px 0 0; font-size: 52px; line-height: 1.08; font-weight: 600; }

/* Khung icon hữu cơ; mảng trang trí là div rỗng aria-hidden trong khối position:relative; overflow:hidden */
.cy-blob { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--cy-radius-blob); color: var(--cy-clay-text); }
.cy-blob--36 { width: 36px; height: 36px; }
.cy-blob--56 { width: 56px; height: 56px; }
.cy-blob--104 { width: 104px; height: 104px; }
.cy-deco { position: absolute; z-index: 0; border-radius: var(--cy-radius-blob); pointer-events: none; }

/* Ô tìm kiếm lớn dạng pill */
.cy-bigsearch { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 28px; border-radius: var(--cy-radius-pill); background-color: var(--cy-white); box-shadow: var(--cy-shadow-card); }
.cy-bigsearch input { flex: 1; min-height: 52px; padding: 0; border: 0; background: transparent; box-shadow: none; outline: none; font: 400 17px var(--cy-font); color: var(--cy-ink); }

/* Dòng bài viết gọn */
.cy-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 24px; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--cy-line-soft); color: var(--cy-ink); text-decoration: none; }
.cy-row img { width: 112px; height: 80px; object-fit: cover; border-radius: 16px; }
.cy-row__cat { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cy-clay-text); }
.cy-row__title { font-size: 16px; line-height: 1.4; font-weight: 600; }

/* Bài nổi bật: ảnh lớn + ô chữ nổi */
.cy-overlay { position: relative; display: block; min-height: 460px; border-radius: var(--cy-radius-lg); overflow: hidden; }
.cy-overlay > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cy-overlay__box { position: absolute; left: 24px; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; max-width: 480px; padding: 24px 26px; border-radius: 22px; background-color: var(--cy-white); box-shadow: var(--cy-shadow-float); }

/* Hai cột ngăn bằng kẻ dọc */
.cy-split-rule { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.cy-split-rule > :first-child { padding-right: 44px; border-right: 1px solid var(--cy-line); }
.cy-split-rule > :last-child { padding-left: 44px; }

/* ---------- Ẩn/hiện theo mốc thiết kế (docs/02 mục 6) ---------- */
@media (max-width: 1400px) { .cy-hide-1400 { display: none !important; } }
@media (min-width: 1401px) { .cy-show-1400 { display: none !important; } }

@media (max-width: 1180px) {
	.cy-hide-1180 { display: none !important; }
	.cy-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.cy-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1181px) { .cy-show-1180 { display: none !important; } }

@media (max-width: 960px) { .cy-hide-960 { display: none !important; } }
@media (min-width: 961px) { .cy-show-960 { display: none !important; } }

@media (max-width: 860px) {
	.cy-sechead { flex-direction: column; align-items: flex-start; }
	.cy-sechead h2 { font-size: 36px; }
	.cy-split-rule { grid-template-columns: minmax(0, 1fr); }
	.cy-split-rule > :first-child { padding-right: 0; border-right: 0; }
	.cy-split-rule > :last-child { padding-left: 0; margin-top: 36px; }
	h1 { font-size: 40px; }
	h2 { font-size: 32px; }
	.cy-h1-home { font-size: 44px; }
	.entry-content h2 { font-size: 28px; }
	.single .entry-content { font-size: 17px; }
	.cy-story { font-size: 19px; }
	.cy-grid-2,
	.cy-grid-split { grid-template-columns: minmax(0, 1fr); }
	/* Lỗi đã gặp: khối dính đè nội dung khi xếp 1 cột */
	.cy-sticky,
	.cy-sticky-860 { position: static !important; }
	.cy-hide-860 { display: none !important; }
}

@media (max-width: 560px) {
	.cy-bigsearch { flex-direction: column; align-items: stretch; border-radius: 28px; }
	.cy-h1-home { font-size: 38px; }
	.cy-grid-3,
	.cy-grid-6 { grid-template-columns: minmax(0, 1fr); }
	.cy-stack-560 { flex-direction: column; align-items: stretch; }
	.cy-stack-560 > .cy-btn,
	.cy-stack-560 > [class*="btn-"] { width: 100%; }
}

/* ---------- Chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.cy-card:hover { transform: none; }
}

/* Văn bản chỉ cho trình đọc màn hình: luôn 1×1px (WooCommerce in thông báo dài trong .screen-reader-text
   ở trang sản phẩm có biến thể — không giới hạn chiều rộng thì gây tràn ngang). */
.screen-reader-text:not(:focus),
.cy-visually-hidden:not(:focus) {
	position: absolute !important;
	width: 1px !important;
	min-width: 0 !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Eyebrow trên nền đào: đất nung đậm để đạt 4.5:1 (R7). */
.cy-bg-peach .cy-eyebrow { color: var(--cy-clay-dark); }
