/* ==========================================================================
   GHPGVN theme
   ========================================================================== */

/* ---- Font: Inter (tự lưu trong theme, SIL OFL 1.1) ---- */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("../fonts/inter-vietnamese.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("../fonts/inter-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400 800;
	font-display: swap;
	src: url("../fonts/inter-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	/* Bảng màu lấy từ logo GHPGVN */
	--brand: #c90a0c;        /* đỏ chữ logo */
	--brand-dark: #9f0607;   /* đỏ đậm (bóng chữ) */
	--brand-soft: #fdeded;   /* nền đỏ rất nhạt */
	--gold: #f9a32c;         /* vàng cam của cờ Phật giáo */
	--gold-deep: #9d501e;    /* nâu dòng khẩu hiệu */
	--green: #0d824b;        /* xanh con dấu */
	--ink: #211a17;
	--ink-soft: #5f5550;
	--line: #eadfd6;
	--paper: #ffffff;
	--cream: #fbf5ea;        /* nền ấm nhạt tông vàng */
	--dark: #2a0d0c;         /* nâu đỏ sẫm */
	--radius: 8px;
	--gap: 24px;
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-head: var(--font);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font: 16px/1.65 var(--font);
	color: var(--ink);
	background: var(--paper);
}

img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover, a:focus-visible { color: var(--brand); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.sr-only {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.container--narrow { max-width: 820px; }

/* ---- Header ------------------------------------------------------------ */
.topbar { background: var(--dark); color: #ecdcd2; font-size: 13px; border-bottom: 3px solid var(--gold); }
.topbar__inner { display: flex; justify-content: space-between; gap: 16px; padding-block: 6px; }
.topbar__date::first-letter { text-transform: uppercase; }

.brand { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.brand__side .searchform { width: 340px; max-width: 100%; }
.brand__side .searchform input { padding: 9px 14px; font-size: 14px; border-radius: 99px; background: var(--cream); }
.brand__side .searchform button { border-radius: 99px; padding: 9px 20px; font-size: 14px; }
.brand__contact { margin: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 18px; font-size: 13px; color: var(--ink-soft); }
.brand__contact a { color: var(--brand-dark); font-weight: 600; }
.site-logo img, .custom-logo { display: block; height: 96px; width: auto; }
.site-logo--text { font: 700 24px/1.2 var(--font-head); color: var(--brand); }

.primary-nav { background: var(--paper); border-block: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.admin-bar .primary-nav { top: 32px; }
.primary-nav__inner { display: flex; align-items: center; justify-content: space-between; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.menu > li { position: relative; }
.menu a { display: block; padding: 14px 16px; font: 600 13.5px/1 var(--font-head); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); }
.menu a:hover, .menu .current-menu-item > a, .menu .current-menu-ancestor > a { color: var(--brand); text-decoration: none; }
.menu .current-menu-item > a, .menu > li:hover > a { box-shadow: inset 0 -3px 0 var(--brand); }

.menu .sub-menu {
	list-style: none; margin: 0; padding: 6px 0; min-width: 220px;
	position: absolute; left: 0; top: 100%; background: var(--paper);
	border: 1px solid var(--line); border-top: 3px solid var(--brand);
	box-shadow: 0 10px 24px rgba(0,0,0,.1); display: none;
}
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { display: block; }
.menu .sub-menu a { text-transform: none; font: 500 15px/1.3 var(--font); padding: 10px 16px; }

.search-toggle, .nav-toggle { background: none; border: 0; cursor: pointer; color: var(--ink); padding: 10px; }
.search-toggle:hover { color: var(--brand); }
.nav-toggle { display: none; }
@media (min-width: 801px) { .search-toggle, .header-search { display: none; } }
.header-search { border-top: 1px solid var(--line); background: var(--cream); padding-block: 12px; }

.searchform { display: flex; gap: 8px; }
.searchform input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.searchform button, .btn {
	background: var(--brand); color: #fff; border: 0; border-radius: var(--radius);
	padding: 10px 18px; font: 600 15px var(--font); cursor: pointer; display: inline-block;
}
.searchform button:hover, .btn:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }

/* ---- Hero -------------------------------------------------------------- */
.site-main { min-height: 50vh; }
.hero {
	display: grid; gap: 12px; margin-top: var(--gap);
	grid-template-columns: 2fr 1fr; grid-template-rows: repeat(3, 1fr);
}
.hero__item { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--dark); min-height: 150px; }
.hero__item--main { grid-row: 1 / span 3; min-height: 420px; }
.hero__link { display: block; position: absolute; inset: 0; color: #fff; }
.hero__link:hover { text-decoration: none; }
.hero__link img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .4s; }
.hero__link:hover img { transform: scale(1.03); }
.hero__caption {
	position: absolute; inset: auto 0 0 0; padding: 48px 16px 14px;
	background: linear-gradient(to top, rgba(42,13,12,.94), rgba(42,13,12,0));
	display: flex; flex-direction: column; gap: 4px;
}
.hero__title { font: 700 15px/1.35 var(--font-head); letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero__item--main .hero__title { font-size: clamp(20px, 2.3vw, 27px); line-height: 1.3; }

/* ---- Truy cập nhanh ---------------------------------------------------- */
.quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: var(--gap); }
.quick__item {
	display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px;
	background: var(--brand-soft); border-radius: var(--radius); color: var(--brand-dark);
	font: 600 13px var(--font-head); text-transform: uppercase; letter-spacing: .02em; text-align: center;
	transition: background .2s, color .2s, transform .2s;
}
.quick__item:hover { background: var(--brand); color: #fff; text-decoration: none; transform: translateY(-2px); }
.quick__icon { font-size: 24px; line-height: 1; }

/* ---- Lưới trang chủ ---------------------------------------------------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; margin-top: 8px; }
.block { margin-top: 32px; }
.block--dark { background: var(--dark); color: #fff; padding: 20px; border-radius: var(--radius); }
.block--dark .section-head__title, .block--dark .card__title a, .block--dark .meta { color: #fff; }
.block--dark .section-head { border-color: #5a2a26; }
.block--dark .section-head__more { color: var(--gold); }
.block--dark .section-head__title { border-bottom-color: var(--gold); }

.panel { margin-top: 32px; }
.panel:first-child { margin-top: 32px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.section-head__title {
	margin: 0; font: 700 17px/1 var(--font-head); text-transform: uppercase; letter-spacing: .02em;
	padding: 0 0 10px; color: var(--ink); border-bottom: 3px solid var(--brand); margin-bottom: -2px;
}
.section-head__more { font-size: 14px; font-weight: 600; white-space: nowrap; }

.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---- Thẻ bài ----------------------------------------------------------- */
.card__media, .row__media { display: block; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--cream); aspect-ratio: 16 / 9; }
.card__media img, .row__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .35s; }
.card:hover .card__media img, .row:hover .row__media img { transform: scale(1.04); }
.thumb-placeholder { position: absolute; inset: 0; background: linear-gradient(135deg, var(--cream), var(--brand-soft)); }
.card__body { padding-top: 10px; }
.card__title { margin: 2px 0 0; font: 650 16px/1.4 var(--font-head); letter-spacing: -.01em; }
.card__title a { color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__title a:hover { color: var(--brand); text-decoration: none; }
.meta { font-size: 13px; color: var(--ink-soft); margin: 0; }
.meta--light { color: #ffe3b8; }

/* ---- Danh sách văn bản ------------------------------------------------- */
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist__item { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.doclist__item:first-child { padding-top: 0; }
.doclist__item a { color: var(--ink); font-weight: 600; line-height: 1.4; }
.doclist__item a:hover { color: var(--brand); }

/* ---- Archive / tìm kiếm ------------------------------------------------ */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-block: 28px 48px; }
.page-head { margin-bottom: 20px; border-bottom: 2px solid var(--line); }
.page-head__title { margin: 0 0 -2px; padding-bottom: 12px; font: 700 24px/1.25 var(--font-head); text-transform: uppercase; letter-spacing: -.01em; border-bottom: 3px solid var(--brand); display: inline-block; }
.page-head__desc { color: var(--ink-soft); padding-block: 8px; }

.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.row:first-child { padding-top: 0; }
.row__title { margin: 2px 0 6px; font: 700 19px/1.35 var(--font-head); letter-spacing: -.01em; }
.row__title a { color: var(--ink); }
.row__title a:hover { color: var(--brand); text-decoration: none; }
.row__excerpt { margin: 0; color: var(--ink-soft); }

.navigation.pagination { margin-top: 28px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 600; }
.page-numbers.current, a.page-numbers:hover { background: var(--brand); border-color: var(--brand); color: #fff; text-decoration: none; }

/* ---- Cột bên ----------------------------------------------------------- */
.widget { margin-bottom: 28px; }
.widget__title { font: 700 16px/1 var(--font-head); text-transform: uppercase; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 3px solid var(--brand); display: inline-block; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.widget li a { color: var(--ink); }
.widget li a:hover { color: var(--brand); }

/* ---- Bài viết ---------------------------------------------------------- */
.entry__cats { font: 600 12px var(--font-head); text-transform: uppercase; letter-spacing: .05em; }
.entry__title { margin: 6px 0 10px; font: 700 clamp(24px, 3.2vw, 34px)/1.25 var(--font-head); letter-spacing: -.02em; }
.entry__head { margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.entry__content { font-size: 18px; line-height: 1.8; overflow-wrap: anywhere; }
.entry__content img { border-radius: 4px; }
.entry__content figure { margin-inline: 0; }
.entry__content figcaption, .wp-caption-text { font-size: 14px; color: var(--ink-soft); text-align: center; }
.entry__content blockquote { margin: 1.5em 0; padding: 4px 20px; border-left: 4px solid var(--gold); background: var(--cream); }
.entry__content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.entry__content table { border-collapse: collapse; width: 100%; }
.entry__content th, .entry__content td { border: 1px solid var(--line); padding: 8px 10px; }
.tags a { background: var(--cream); padding: 3px 10px; border-radius: 99px; font-size: 14px; }

.comments { margin-top: 40px; }
.comments__title { font: 700 18px var(--font-head); }
.comments__list { padding-left: 20px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit;
}
.comment-form .submit { background: var(--brand); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 20px; font: 600 15px var(--font); cursor: pointer; }
.notfound { padding-block: 60px; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { background: var(--cream); margin-top: 48px; border-top: 4px solid var(--gold); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-block: 36px; }
.footer-title { font: 700 14px var(--font-head); text-transform: uppercase; margin: 0 0 10px; }
.footer-grid p { margin: 0 0 6px; font-size: 15px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { padding: 4px 0; }
.footer-bottom { background: var(--dark); color: #d9c3b8; font-size: 14px; padding-block: 12px; }
.footer-bottom p { margin: 0; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1024px) {
	.home-grid, .layout { grid-template-columns: 1fr; }
	.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.quick { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 782px) {
	.admin-bar .primary-nav { top: 46px; }
}

@media (max-width: 800px) {
	.topbar__tagline { display: none; }
	.site-logo img, .custom-logo { height: 60px; }

	.brand__side { display: none; }
	.nav-toggle { display: block; }
	.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
		display: block; width: 24px; height: 2px; background: currentColor; position: relative; content: "";
	}
	.nav-toggle__bar::before { position: absolute; top: -7px; }
	.nav-toggle__bar::after { position: absolute; top: 7px; }

	.primary-nav { position: static; display: none; }
	.primary-nav.is-open { display: block; }
	.primary-nav__inner { flex-direction: column; align-items: stretch; }
	.menu { flex-direction: column; }
	.menu a { padding: 14px 4px; border-bottom: 1px solid var(--line); }
	.menu .sub-menu { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 0 16px; }
	.search-toggle { align-self: flex-start; }

	.hero { grid-template-columns: 1fr; grid-template-rows: none; }
	.hero__item--main { grid-row: auto; min-height: 260px; }
	.hero__item--side { min-height: 150px; }

	.grid--3 { grid-template-columns: 1fr 1fr; }
	.row { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
	.row__title { font-size: 16px; }
	.row__excerpt { display: none; }
	.footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
	.grid--3, .grid--4 { grid-template-columns: 1fr; }
	.quick { grid-template-columns: repeat(2, 1fr); }
	.entry__content { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

/* ==========================================================================
   Khối bổ sung trang chủ
   ========================================================================== */

/* ---- Dòng tin mới ------------------------------------------------------ */
.ticker { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 8px 14px; background: var(--brand-soft); border-radius: var(--radius); overflow: hidden; font-size: 14px; }
.ticker__label { flex: none; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 4px 10px; border-radius: 4px; }
.ticker__list { list-style: none; margin: 0; padding: 0; min-width: 0; flex: 1; position: relative; height: 22px; }
.ticker__item { position: absolute; inset: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
/* Mục mới chỉ hiện sau khi mục cũ đã mờ, tránh chồng chữ. */
.ticker__item.is-active { opacity: 1; transform: none; pointer-events: auto; transition-delay: .2s; }
.ticker__item time { color: var(--ink-soft); margin-right: 6px; }
.ticker__item a { color: var(--ink); font-weight: 600; }
.ticker__item a:hover { color: var(--brand); }
/* Không bật JS: chỉ hiện mục đầu. */
.ticker__item:first-child { opacity: 1; transform: none; pointer-events: auto; }
.ticker.is-js .ticker__item:first-child:not(.is-active) { opacity: 0; transform: translateY(8px); pointer-events: none; }

/* ---- Đại hội IX -------------------------------------------------------- */
.block--feature { background: linear-gradient(135deg, var(--cream), #fff 70%); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 20px; }
.feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--gap); }
.feature__main .card__media { margin-bottom: 10px; }
.feature__title { margin: 2px 0 8px; font: 700 20px/1.35 var(--font-head); letter-spacing: -.01em; }
.feature__title a { color: var(--ink); }
.feature__title a:hover { color: var(--brand); text-decoration: none; }
.feature__excerpt { margin: 0; color: var(--ink-soft); font-size: 15px; }
.feature__list { display: flex; flex-direction: column; gap: 14px; }
.mini { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
.mini__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 6px; background: var(--cream); position: relative; }
.mini__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.mini__title { margin: 2px 0 0; font: 650 15px/1.4 var(--font-head); letter-spacing: -.01em; }
.mini__title a { color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini__title a:hover { color: var(--brand); text-decoration: none; }

/* ---- Phật sự theo mảng ------------------------------------------------- */
.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px var(--gap); }
.topic__title { margin: 0 0 10px; font: 700 14px var(--font-head); text-transform: uppercase; letter-spacing: .03em; padding-left: 10px; border-left: 4px solid var(--green); }
.topic__title a { color: var(--ink); }
.topic__title a:hover { color: var(--brand); text-decoration: none; }
.topic__lead { display: block; color: var(--ink); }
.topic__lead:hover { text-decoration: none; }
.topic__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--cream); position: relative; }
.topic__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .35s; }
.topic__lead:hover .topic__media img { transform: scale(1.04); }
.topic__lead-title { display: block; margin-top: 8px; font: 700 16px/1.4 var(--font-head); letter-spacing: -.01em; }
.topic__lead:hover .topic__lead-title { color: var(--brand); }
.topic__list { list-style: none; margin: 8px 0 0; padding: 0; }
.topic__list li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.topic__list a { color: var(--ink); font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.topic__list a:hover { color: var(--brand); }

/* ---- Cột phải: khối nền nhạt ------------------------------------------ */
.panel--tint { background: var(--cream); padding: 16px; border-radius: var(--radius); }
.panel--tint { border-top: 3px solid var(--green); }
.panel--tint .section-head { border-color: #eadbc4; }

/* ---- Dải số liệu ------------------------------------------------------- */
.stats { background: var(--dark); color: #fff; margin-top: 48px; }
.stats__inner { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; padding-block: 28px; }
.stats__item { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px; border-left: 1px solid #55261f; }
.stats__item:first-child { border-left: 0; }
.stats__num { font: 800 clamp(26px, 4vw, 40px)/1.1 var(--font-head); color: var(--gold); letter-spacing: -.02em; }
.stats__label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #e6d2c6; }
.stats + .site-footer { margin-top: 0; }

@media (max-width: 800px) {
	.feature { grid-template-columns: 1fr; }
	.topics { grid-template-columns: 1fr; }
	.stats__inner { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
	.stats__item:nth-child(3) { border-left: 0; }
	.ticker__label { display: none; }
}
