/* ==========================================================================
   Kira Cong Thuc Nau An — main stylesheet
   Mobile-first, responsive, tự viết hoàn toàn.
   ========================================================================== */

:root {
	--color-bg: #fffaf4;
	--color-surface: #ffffff;
	--color-text: #2a2320;
	--color-muted: #6f655d;
	--color-primary: #e8590c;
	--color-primary-dark: #c2410c;
	--color-accent: #d6336c;
	--color-border: #efe4d8;
	--color-soft: #fbeee2;
	--radius: 14px;
	--radius-sm: 8px;
	--shadow: 0 6px 24px rgba(80, 50, 20, 0.08);
	--shadow-sm: 0 2px 8px rgba(80, 50, 20, 0.06);
	--container: 1140px;
	--font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-head: "Be Vietnam Pro", system-ui, sans-serif;
	--font-serif: "Lora", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	color: var(--color-text);
	background: var(--color-bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover, a:focus { color: var(--color-accent); text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; font-weight: 700; color: #1f1a17; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* Accessibility ----------------------------------------------------------- */
.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;
}
.skip-link {
	position: absolute; left: -9999px; top: 0;
	background: var(--color-primary); color: #fff;
	padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0; z-index: 1000;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

/* Buttons ----------------------------------------------------------------- */
.btn {
	display: inline-block;
	padding: 12px 24px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 16px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover, .btn--primary:focus { background: var(--color-primary-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--color-primary-dark); border-color: var(--color-primary); }
.btn--ghost:hover, .btn--ghost:focus { background: var(--color-soft); color: var(--color-primary-dark); }

/* Header ------------------------------------------------------------------ */
.site-header {
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
	position: sticky; top: 0; z-index: 100;
	box-shadow: var(--shadow-sm);
}
.site-header__inner {
	display: flex; align-items: center; gap: 16px;
	padding-top: 14px; padding-bottom: 14px;
	flex-wrap: wrap;
}
.site-branding { margin-right: auto; }
.site-title { margin: 0; font-size: 24px; font-weight: 700; }
.site-title a { color: var(--color-primary-dark); display: inline-flex; align-items: center; gap: 8px; }
.site-title a:hover { text-decoration: none; }
.site-title__mark { font-size: 26px; }
.site-description { margin: 2px 0 0; font-size: 13px; color: var(--color-muted); }
.custom-logo { max-height: 56px; width: auto; }

.main-navigation { order: 3; flex-basis: 100%; border-top: 1px solid var(--color-border); margin-top: 12px; padding-top: 10px; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.main-navigation a {
	display: block; padding: 8px 16px; border-radius: var(--radius-sm);
	color: var(--color-text); font-weight: 500;
}
.main-navigation a:hover, .main-navigation .current-menu-item > a {
	background: var(--color-soft); color: var(--color-primary-dark); text-decoration: none;
}

.site-search { order: 2; flex: 0 0 clamp(200px, 24vw, 280px); }

.menu-toggle {
	display: none;
	background: var(--color-soft); border: 1px solid var(--color-border);
	width: 44px; height: 44px; border-radius: var(--radius-sm); cursor: pointer;
	position: relative;
}
.menu-toggle__bar, .menu-toggle__bar::before, .menu-toggle__bar::after {
	content: ""; position: absolute; left: 50%; transform: translateX(-50%);
	width: 22px; height: 2px; background: var(--color-text); transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.menu-toggle__bar { top: 50%; margin-top: -1px; }
.menu-toggle__bar::before { top: -7px; }
.menu-toggle__bar::after { top: 7px; }
/* Hamburger -> X khi menu mở */
.menu-toggle[aria-expanded="true"] .menu-toggle__bar { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::before { top: 0; transform: translateX(-50%) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::after { top: 0; transform: translateX(-50%) rotate(-45deg); }

/* Search form ------------------------------------------------------------- */
.search-form { display: flex; gap: 6px; }
.search-form label { flex: 1; }
.search-field {
	width: 100%; padding: 9px 14px; border: 1px solid var(--color-border);
	border-radius: 999px; background: var(--color-bg); font-size: 15px;
}
.search-submit {
	border: none; background: var(--color-primary); color: #fff;
	padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 600;
}
.search-submit:hover { background: var(--color-primary-dark); }

/* Hero -------------------------------------------------------------------- */
.hero {
	background: linear-gradient(135deg, #fff3e6 0%, #ffe3ec 100%);
	padding: 64px 0;
}
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero__text { max-width: 600px; }
.hero__eyebrow {
	text-transform: uppercase; letter-spacing: .12em; font-size: 13px;
	font-weight: 600; color: var(--color-primary); margin: 0 0 10px;
}
.hero__title { font-size: clamp(30px, 5vw, 48px); margin: 0 0 16px; }
.hero__subtitle { font-size: 18px; color: var(--color-muted); margin: 0 0 28px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__media { position: relative; }
.hero__media img {
	width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
	border-radius: 24px; box-shadow: var(--shadow);
}
.hero__media-badge {
	position: absolute; bottom: 18px; left: -14px;
	background: var(--color-surface); color: var(--color-primary-dark);
	font-weight: 700; padding: 12px 20px; border-radius: 999px;
	box-shadow: var(--shadow); border: 1px solid var(--color-border);
}

/* Sections ---------------------------------------------------------------- */
.home-section { padding: 56px 0; }
.home-section--alt { background: var(--color-soft); }
.section-head { margin-bottom: 28px; }
.section-head__title { font-size: clamp(24px, 3.5vw, 32px); margin: 0; }
.section-head__desc { color: var(--color-muted); margin: 8px 0 0; }

/* Recipe grid + cards ----------------------------------------------------- */
.recipe-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 26px;
}
.recipe-card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: var(--shadow-sm);
	transition: transform .18s ease, box-shadow .18s ease;
}
.recipe-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.recipe-card__media {
	position: relative; display: block; aspect-ratio: 16 / 10;
	background: var(--color-soft); overflow: hidden;
}
.recipe-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.recipe-card:hover .recipe-card__media img { transform: scale(1.05); }
.recipe-card__placeholder {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 100%; font-size: 48px;
}
.recipe-card__badge {
	position: absolute; left: 12px; bottom: 12px;
	background: rgba(0,0,0,.62); color: #fff; font-size: 13px; font-weight: 600;
	padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(2px);
}
.recipe-card__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.recipe-card__cat { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.recipe-card__cat a { color: var(--color-accent); }
.recipe-card__title { margin: 0; font-size: 20px; }
.recipe-card__title a { color: #1f1a17; }
.recipe-card__title a:hover { color: var(--color-primary-dark); text-decoration: none; }
.recipe-card__excerpt { margin: 0; color: var(--color-muted); font-size: 15px; flex: 1; }
.recipe-card__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.meta-pill {
	background: var(--color-soft); color: var(--color-text);
	font-size: 13px; padding: 4px 10px; border-radius: 999px;
}

/* Category chips ---------------------------------------------------------- */
.category-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.category-chip {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--color-surface); border: 1px solid var(--color-border);
	padding: 10px 18px; border-radius: 999px; font-weight: 600; color: var(--color-text);
	box-shadow: var(--shadow-sm); transition: .18s;
}
.category-chip:hover { border-color: var(--color-primary); color: var(--color-primary-dark); text-decoration: none; transform: translateY(-2px); }
.category-chip__count { background: var(--color-soft); color: var(--color-muted); font-size: 12px; padding: 2px 8px; border-radius: 999px; }

/* Content layout ---------------------------------------------------------- */
.content-area { padding: 44px 0 64px; }
.content-area--with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.site-main--single { max-width: 820px; margin: 0 auto; }

.page-header { margin-bottom: 28px; }
.page-title { font-size: clamp(26px, 4vw, 36px); margin: 0; }
.archive-description { color: var(--color-muted); margin-top: 10px; }

/* Single entry ------------------------------------------------------------ */
.entry--single, .entry--page, .recipe-single { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }
.entry-title { font-size: clamp(26px, 4vw, 38px); margin: 0 0 14px; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--color-muted); font-size: 14px; margin-bottom: 8px; }
.entry-thumbnail { margin: 22px 0; border-radius: var(--radius); overflow: hidden; }
.entry-content { font-size: 17px; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content h2 { font-size: 26px; margin: 1.6em 0 .6em; }
.entry-content h3 { font-size: 21px; margin: 1.4em 0 .5em; }
.entry-content img { border-radius: var(--radius-sm); margin: 1em 0; }
.entry-content blockquote {
	border-left: 4px solid var(--color-primary); margin: 1.4em 0; padding: 8px 20px;
	background: var(--color-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	font-family: var(--font-serif); font-style: italic;
}
.entry-tags { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tags li a { background: var(--color-soft); padding: 4px 12px; border-radius: 999px; font-size: 14px; }

/* Recipe single ----------------------------------------------------------- */
.recipe-single__cat { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.recipe-single__cat a { color: var(--color-accent); }
.recipe-single__intro { font-size: 19px; color: var(--color-muted); font-family: var(--font-serif); }

.recipe-stats {
	list-style: none; margin: 24px 0; padding: 18px;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px;
	background: var(--color-soft); border-radius: var(--radius);
}
.recipe-stats__item { text-align: center; }
.recipe-stats__label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); margin-bottom: 4px; }
.recipe-stats__value { font-weight: 700; font-size: 17px; color: var(--color-primary-dark); }

.recipe-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; margin-top: 16px; align-items: start; }
.recipe-block__title { font-size: 24px; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 3px solid var(--color-primary); display: inline-block; }

.recipe-ingredients { position: sticky; top: 90px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px; }
.ingredient-list { list-style: none; margin: 0; padding: 0; }
.ingredient-list li { border-bottom: 1px dashed var(--color-border); }
.ingredient-list li:last-child { border-bottom: 0; }
.ingredient-list__item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; cursor: pointer; }
.ingredient-check { margin-top: 6px; width: 18px; height: 18px; accent-color: var(--color-primary); flex: 0 0 auto; }
.ingredient-check:checked + span { text-decoration: line-through; color: var(--color-muted); }

.step-list { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.step-list__item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.step-list__item:last-child { border-bottom: 0; }
.step-list__num {
	flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
	background: var(--color-primary); color: #fff; font-weight: 700;
	display: flex; align-items: center; justify-content: center;
}
.step-list__item p { margin: 4px 0 0; }

/* Sidebar / widgets ------------------------------------------------------- */
.widget-area { display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 18px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--color-soft); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 7px 0; border-bottom: 1px solid var(--color-border); }
.widget ul li:last-child { border-bottom: 0; }

/* Pagination -------------------------------------------------------------- */
.pagination, .comments-pagination { margin-top: 40px; }
.pagination .nav-links, .comments-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers, .comments-pagination .page-numbers {
	display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center;
	padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
	background: var(--color-surface); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination a.page-numbers:hover { background: var(--color-soft); text-decoration: none; }

/* Post navigation --------------------------------------------------------- */
.post-navigation { margin-top: 36px; display: flex; gap: 16px; flex-wrap: wrap; }
.post-navigation .nav-links { display: flex; gap: 16px; width: 100%; justify-content: space-between; flex-wrap: wrap; }
.post-navigation a { background: var(--color-surface); border: 1px solid var(--color-border); padding: 14px 18px; border-radius: var(--radius); display: block; }
.nav-subtitle { display: block; font-size: 12px; text-transform: uppercase; color: var(--color-muted); }
.nav-title { font-weight: 600; }

/* Comments ---------------------------------------------------------------- */
.comments-area { margin-top: 44px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 28px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list ol { list-style: none; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-family: inherit; font-size: 15px;
}
.comment-form p { margin-bottom: 14px; }
.form-submit .submit { background: var(--color-primary); color: #fff; border: none; padding: 12px 26px; border-radius: 999px; font-weight: 600; cursor: pointer; }

/* 404 / no results -------------------------------------------------------- */
.error-404 .page-content, .no-results .page-content { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 28px; }
.error-404 .search-form, .no-results .search-form { margin: 18px 0; }

/* Footer ------------------------------------------------------------------ */
.site-footer { background: #211b18; color: #e8ddd2; margin-top: 64px; }
.site-footer__inner { padding: 54px 20px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; }
.footer-col__title { font-size: 17px; color: #fff; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid rgba(232,89,12,.5); }
.site-footer__brand { font-size: 24px; font-weight: 700; color: #fff; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.site-footer__brand-mark {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 50%; background: var(--color-primary);
	font-size: 22px; line-height: 1;
}
.site-footer__tagline { color: #b8a99c; margin: 0 0 16px; }
.site-footer a { color: #f0c8a8; }
.site-footer a:hover { color: #fff; }
.footer-links, .footer-contact, .footer-social { list-style: none; margin: 0; padding: 0; }
.footer-links li { padding: 6px 0; }
.footer-links a { color: #d9cabc; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-contact li { display: flex; gap: 10px; padding: 8px 0; color: #cdbbac; font-size: 15px; line-height: 1.5; }
.footer-contact a { color: #f0c8a8; }
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-social li a {
	display: inline-block; padding: 7px 14px; border: 1px solid rgba(255,255,255,.2);
	border-radius: 999px; font-size: 13px; color: #e8ddd2;
}
.footer-social li a:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; text-decoration: none; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 20px; }
.site-footer__copy { margin: 0; color: #9b8d80; font-size: 14px; }

@media (max-width: 980px) {
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 560px) {
	.footer-grid { grid-template-columns: 1fr; }
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 980px) {
	.content-area--with-sidebar { grid-template-columns: 1fr; }
	.recipe-layout { grid-template-columns: 1fr; }
	.recipe-ingredients { position: static; }
	.site-footer__cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
	body { font-size: 16px; }
	.menu-toggle { display: block; order: 3; }
	.site-search { order: 4; flex-basis: 100%; }
	.main-navigation {
		order: 5; width: 100%; display: none;
	}
	.main-navigation.is-open { display: block; }
	.main-navigation ul { flex-direction: column; gap: 2px; }
	.main-navigation a { padding: 12px 14px; border-radius: var(--radius-sm); }
	.site-branding { margin-right: auto; }
	.hero { padding: 44px 0; }
	.hero__inner { grid-template-columns: 1fr; gap: 28px; }
	.hero__media-badge { left: 12px; }
	.home-section { padding: 40px 0; }
	.entry--single, .entry--page, .recipe-single { padding: 20px; }
	.site-footer__cols { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
	.recipe-grid { grid-template-columns: 1fr; }
	.btn { width: 100%; text-align: center; }
	.hero__actions { flex-direction: column; }
}

/* Dark mode (theo cài đặt hệ thống) -------------------------------------- */
@media (prefers-color-scheme: dark) {
	:root {
		--color-bg: #1a1614;
		--color-surface: #241f1c;
		--color-text: #ece3da;
		--color-muted: #b0a397;
		--color-border: #38302b;
		--color-soft: #2e2723;
		--shadow: 0 6px 24px rgba(0,0,0,.4);
		--shadow-sm: 0 2px 8px rgba(0,0,0,.3);
	}
	h1, h2, h3, h4 { color: #f6efe8; }
	.hero { background: linear-gradient(135deg, #2a201a 0%, #2c1a22 100%); }
	.recipe-card__title a { color: #f6efe8; }
	.search-field { background: var(--color-surface); color: var(--color-text); }
}

/* Reduce motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
