/*
Theme Name: NickDep
Description: Giao diện của NickDep.com.
Version: 1.2.0
Text Domain: nickdep
*/

@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/be-vietnam-pro-600-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: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/be-vietnam-pro-600-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: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("assets/fonts/be-vietnam-pro-600-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;
}
@font-face {
	font-family: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/be-vietnam-pro-700-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: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/be-vietnam-pro-700-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: "Be Vietnam Pro";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/be-vietnam-pro-700-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 {
	--nd-bg: #f7f8f9;
	--nd-surface: #ffffff;
	--nd-text: #222222;
	--nd-text-soft: #575760;
	--nd-border: #e6e8ec;
	--nd-link: #1e73be;
	--nd-link-hover: #155a96;
	--nd-brand: #ed1c54; /* chỉ trang trí: viền, logo */
	--nd-brand-strong: #c8104a; /* chữ/nền có chữ: 5.8:1 trên trắng */
	--nd-brand-press: #a50d3d;
	--nd-brand-soft: #fff5f8;
	--nd-radius: 14px;
	--nd-radius-sm: 8px;
	--nd-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
	--nd-max: 1100px;
	--nd-gutter: 24px;
	--nd-font-head: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
	--nd-z-totop: 40;
	--nd-z-header: 50;
	--nd-z-skip: 1000;
	--nd-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
	/* tên biến cũ còn được nội dung/widget dùng */
	--contrast: var(--nd-text);
	--contrast-2: var(--nd-text-soft);
	--contrast-3: #b2b2be;
	--base: #f0f0f0;
	--base-2: var(--nd-bg);
	--base-3: var(--nd-surface);
	--accent: var(--nd-link);
	--global-color-8: var(--nd-brand-soft);
}

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

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

body {
	margin: 0;
	background: var(--nd-bg);
	color: var(--nd-text);
	font-family: var(--nd-font);
	font-size: 17px;
	line-height: 1.65;
	overflow-wrap: break-word;
	overflow-x: clip;
}

img, video, iframe { max-width: 100%; height: auto; }
figure { margin: 0 0 1.5em; }

a { color: var(--nd-link); text-underline-offset: 2px; }
a, button, summary, [role="button"], input[type="submit"] { touch-action: manipulation; }
button, summary, [role="button"] { cursor: pointer; }
a:hover { color: var(--nd-link-hover); }

:focus-visible {
	outline: 3px solid var(--nd-link);
	outline-offset: 2px;
	border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.3;
	margin: 1.6em 0 .6em;
	font-family: var(--nd-font-head);
	font-weight: 700;
	color: var(--nd-text);
	text-wrap: balance;
}
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); margin-top: 0; }
h2 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.7rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, dl, blockquote, pre, table { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.4em; }

table { width: 100%; border-collapse: collapse; font-size: .95em; }
th, td { padding: 10px 12px; border: 1px solid var(--nd-border); text-align: left; vertical-align: top; }
th { background: var(--nd-bg); }

blockquote {
	padding: 12px 18px;
	border-left: 4px solid var(--nd-brand);
	background: var(--nd-brand-soft);
	border-radius: 0 var(--nd-radius-sm) var(--nd-radius-sm) 0;
}

code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; }
pre { background: #f1f3f5; padding: 14px; border-radius: var(--nd-radius-sm); overflow-x: auto; }

hr { border: 0; border-top: 1px solid var(--nd-border); margin: 2em 0; }

input, button, select, textarea { font: inherit; }

.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:focus {
	position: fixed !important;
	top: 8px; left: 8px; z-index: var(--nd-z-skip);
	width: auto; height: auto; clip: auto;
	padding: 10px 16px; margin: 0;
	background: var(--nd-surface); color: var(--nd-text);
	border-radius: var(--nd-radius-sm); box-shadow: var(--nd-shadow);
}

.nd-wrap {
	width: 100%;
	max-width: var(--nd-max);
	margin: 0 auto;
	padding: 0 var(--nd-gutter);
}

/* Header */
.nd-header {
	background: var(--nd-surface);
	border-bottom: 1px solid var(--nd-border);
	position: relative;
	z-index: var(--nd-z-header);
}
.nd-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
}
.nd-logo { display: flex; align-items: center; flex-shrink: 0; }
.nd-logo a { display: inline-flex; align-items: center; min-height: 44px; }
.nd-logo img { display: block; height: 48px; width: auto; }
.nd-logo__text { font-size: 1.35rem; font-weight: 800; color: var(--nd-text); text-decoration: none; }

.nd-nav ul { list-style: none; margin: 0; padding: 0; }
.nd-nav__list { display: flex; align-items: center; gap: 4px; }
.nd-nav__list a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--nd-radius-sm);
	color: var(--nd-text);
	font-family: var(--nd-font-head);
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
	transition: background-color .2s, color .2s;
}
.nd-nav__list a:hover { background: var(--nd-brand-soft); color: var(--nd-brand-strong); }
.nd-nav__list a:active { background: #ffe4ec; }
.nd-nav__list .current-menu-item > a,
.nd-nav__list .current_page_item > a { color: var(--nd-brand-strong); box-shadow: inset 0 -3px 0 var(--nd-brand); }

.nd-nav__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--nd-border);
	border-radius: var(--nd-radius-sm);
	background: var(--nd-surface);
	color: var(--nd-text);
	font-weight: 600;
	cursor: pointer;
}
.nd-nav__toggle svg { width: 20px; height: 20px; }
.nd-nav__toggle .nd-icon-close { display: none; }
.nd-nav__toggle[aria-expanded="true"] .nd-icon-open { display: none; }
.nd-nav__toggle[aria-expanded="true"] .nd-icon-close { display: block; }

.nd-nav__search { display: none; }

@media (max-width: 900px) {
	.nd-nav__search { display: block; margin-top: 12px; }
	.nd-nav__search .nd-search { max-width: none; }
	.nd-header__inner { min-height: 64px; }
	.nd-logo img { height: 40px; }
	.nd-nav__toggle { display: inline-flex; }
	.nd-nav__panel {
		display: none;
		position: absolute;
		left: 0; right: 0; top: 100%;
		background: var(--nd-surface);
		border-bottom: 1px solid var(--nd-border);
		box-shadow: 0 12px 24px rgba(16, 24, 40, .08);
		padding: 8px var(--nd-gutter) 16px;
	}
	.nd-nav.is-open .nd-nav__panel { display: block; }
	.nd-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
	.nd-nav__list a { min-height: 48px; font-size: 1rem; }
}

/* Main */
.nd-main { padding: 24px 0 40px; }
.nd-card {
	background: var(--nd-surface);
	border: 1px solid var(--nd-border);
	border-radius: var(--nd-radius);
	box-shadow: var(--nd-shadow);
	padding: clamp(18px, 3vw, 40px);
}
.nd-entry__header { margin-bottom: 20px; }
.nd-entry__title { margin: 0; }
.nd-entry__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin-top: 10px;
	color: var(--nd-text-soft);
	font-size: .9rem;
}
.nd-entry__meta a { color: inherit; font-weight: 600; }

.nd-card, .nd-content { min-width: 0; }
.nd-content .symbol-item { max-width: 100%; }
.nd-content > p, .nd-content > ul, .nd-content > ol, .nd-content > blockquote, .nd-content > h2, .nd-content > h3, .nd-content > h4 { max-width: 75ch; }
.nd-content > *:first-child { margin-top: 0; }
.nd-content > *:last-child { margin-bottom: 0; }
.nd-content img { border-radius: var(--nd-radius-sm); }
.nd-content .aligncenter, .nd-content figure.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.nd-content .aligncenter img { margin: 0 auto; }
.nd-content .alignleft { float: left; margin: 0 1.2em 1em 0; }
.nd-content .alignright { float: right; margin: 0 0 1em 1.2em; }
.nd-content::after { content: ""; display: table; clear: both; }
.nd-content .wp-block-table { overflow-x: auto; }
.nd-content details { margin-bottom: .6em; }
.nd-content summary { cursor: pointer; font-weight: 600; min-height: 44px; display: list-item; padding: 10px 0; }

/* Danh sách bài */
.nd-archive__header { margin-bottom: 20px; }
.nd-archive__desc { color: var(--nd-text-soft); }
.nd-list { display: grid; gap: 16px; }
.nd-list__item {
	background: var(--nd-surface);
	border: 1px solid var(--nd-border);
	border-radius: var(--nd-radius);
	padding: 18px 20px;
}
.nd-list__title { font-size: 1.15rem; margin: 0 0 6px; }
.nd-list__title a { color: var(--nd-text); text-decoration: none; }
.nd-list__title a:hover { color: var(--nd-link); }
.nd-list__excerpt { margin: 0; color: var(--nd-text-soft); font-size: .95rem; }
.nd-pagination { margin-top: 24px; }
.nd-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 12px;
	border: 1px solid var(--nd-border); border-radius: var(--nd-radius-sm);
	background: var(--nd-surface); text-decoration: none; color: var(--nd-text);
}
.nd-pagination .page-numbers.current { background: var(--nd-brand-strong); border-color: var(--nd-brand-strong); color: #fff; }

/* Tìm kiếm */
.nd-search { display: flex; gap: 8px; max-width: 520px; }
.nd-search input[type="search"] {
	flex: 1; min-width: 0; min-height: 48px; padding: 0 14px;
	border: 1px solid var(--nd-border); border-radius: var(--nd-radius-sm); background: var(--nd-surface);
}
.nd-search button, .nd-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 0 18px;
	border: 0; border-radius: var(--nd-radius-sm);
	background: var(--nd-brand-strong); color: #fff; font-weight: 700;
	text-decoration: none; cursor: pointer;
	transition: background-color .2s;
}
.nd-search button:hover, .nd-btn:hover { background: var(--nd-brand-press); color: #fff; }
.nd-search button:active, .nd-btn:active { transform: scale(.97); }

/* Footer */
.nd-footer {
	background: var(--nd-surface);
	border-top: 1px solid var(--nd-border);
	padding: 32px 0 0;
	font-size: .95rem;
}
.nd-footer .widget { margin-bottom: 20px; }
.nd-footer .widgettitle, .nd-footer .widget-title { font-size: 1rem; margin: 0 0 10px; color: var(--nd-text-soft); }
.nd-footer ul.menu { list-style: none; padding: 0; margin: 0; }
.nd-footer ul.menu a { display: inline-flex; align-items: center; min-height: 44px; color: var(--nd-text); text-decoration: none; }
.nd-footer ul.menu a:hover { color: var(--nd-link); text-decoration: underline; }
.nd-footer sub { font-size: .85em; line-height: 1.6; vertical-align: baseline; color: var(--nd-text-soft); }

/* «Bài viết liên quan» + menu trên cùng một dòng */
.nd-footer__widgets { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.nd-footer__widgets > .widget { flex: 1 1 100%; }
.nd-footer__widgets #block-29, .nd-footer__widgets #nav_menu-3 { display: contents; }
.nd-footer__widgets #block-29 p { display: inline; margin: 0; font-weight: 600; white-space: nowrap; }
.nd-footer__widgets #nav_menu-3 .menu { display: contents; }
.nd-footer__widgets #nav_menu-3 .menu li { display: inline; }
.nd-footer__widgets #nav_menu-3 .menu li a { white-space: nowrap; font-size: .875rem; min-height: 44px; }

.nd-footer__bar {
	margin-top: 16px;
	padding: 16px 0;
	border-top: 1px solid var(--nd-border);
	color: var(--nd-text-soft);
	font-size: .875rem;
	text-align: center;
}

.nd-totop {
	position: fixed;
	right: calc(16px + env(safe-area-inset-right, 0px));
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: var(--nd-z-totop);
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px;
	border-radius: 50%;
	background: var(--nd-surface);
	border: 1px solid var(--nd-border);
	box-shadow: var(--nd-shadow);
	color: var(--nd-text);
	opacity: 0; visibility: hidden;
	transition: opacity .2s, visibility .2s;
}
.nd-totop.is-visible { opacity: 1; visibility: visible; }
.nd-totop svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Khoảng cách gọn */
body { font-size: 18px; }
.nd-main { padding: 16px 0 32px; }
.nd-card { padding: clamp(16px, 2.4vw, 28px); }
.nd-entry__header { margin-bottom: 14px; }
h1, h2, h3, h4 { text-wrap: balance; word-break: normal; overflow-wrap: normal; }
.nd-content h2 { margin: 1.4em 0 .5em; }
.nd-content h3 { margin: 1.2em 0 .45em; }
.nd-content p, .nd-content ul, .nd-content ol { margin-bottom: 1em; }
.nd-content .xnf-item[style] { padding: 12px 14px !important; }
.nd-content .text_main { gap: 8px; margin-bottom: 16px; }

/* Hàng mục chép: mỗi mục rộng theo nội dung, hàng tự lấp đầy */
.nd-content .ndk-grid,
.nd-content .nickname-trend-wrap.text_main,
.nd-content .symbols-fonts.text_main,
.nd-content .nd-symtool .nd-symgrid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	grid-template-columns: none;
}
.nd-content .ndk-grid::after,
.nd-content .nickname-trend-wrap.text_main::after,
.nd-content .symbols-fonts.text_main::after,
.nd-content .nd-symtool .nd-symgrid::after { content: ""; flex: 1000 1 0; }
.nd-content .ndk-grid > .ndk-i,
.nd-content .ndk-grid.big > .ndk-i,
.nd-content .nickname-trend-wrap > .symbol-item,
.nd-content .symbols-fonts > .symbol-item,
.nd-content .nd-symtool .nd-sym {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: auto;
	max-width: 100%;
	padding: 8px 14px;
	white-space: nowrap;
	text-align: center;
	overflow: visible;
	font-weight: 400;
}
.nd-content .nickname-trend-wrap .xnf-item-text,
.nd-content .symbols-fonts .generated-text,
.nd-content .xnf-item .xnf-item-text { font-weight: 400; }
.nd-content .xnf-item span.xnf-item-text { font-size: 22px; }
.nd-content .ndk-i { font-size: 22px; }
.nd-content .nd-symtool .nd-sym { min-height: 44px; font-size: 22px; line-height: 1.3; }

/* Nút nhóm */
.nd-content .ndq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; padding: 0; list-style: none; }
.nd-content .ndq-chips a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
	border: 1px solid var(--nd-border); border-radius: 999px; background: var(--nd-surface);
	color: var(--nd-text); font-size: 15px; text-decoration: none; white-space: nowrap;
}
.nd-content .ndq-chips a:hover, .nd-content .ndq-chips a:focus-visible { border-color: var(--nd-brand-strong); color: var(--nd-brand-strong); }
.nd-content .ndq-g { margin: 14px 0 6px; font-size: 1.05rem; }
.nd-content .ndq .ndk-grid { margin: 6px 0 12px; }

@media (max-width: 600px) {
	:root { --nd-gutter: 16px; }
	body { font-size: 17px; }
	.nd-main { padding: 12px 0 24px; }
	.nd-card { padding: 14px; border-radius: 12px; }
	.nd-content .ndk-i, .nd-content .xnf-item span.xnf-item-text { font-size: 20px; }
}
