/*
Theme Name:   Đà Nẵng
Theme URI:    https://thanhphodanang.com
Description:  Theme riêng cho thanhphodanang.com – cổng thông tin Đà Nẵng: du lịch, bất động sản. Nhẹ, không jQuery, tối ưu SEO và tốc độ.
Version:      0.1.0
Requires at least: 6.5
Requires PHP: 8.1
Author:       Thành Phố Đà Nẵng
Text Domain:  danang
*/

/* ---------- Tokens ---------- */
:root {
	--dn-ink: #10232e;
	--dn-text: #2b3d47;
	--dn-muted: #647782;
	--dn-line: #e3e9ec;
	--dn-bg: #ffffff;
	--dn-bg-soft: #f4f7f8;
	--dn-sea: #0a5f73;
	--dn-sea-deep: #0d3b52;
	--dn-accent: #e8612c;
	--dn-accent-soft: #fff1ea;
	--dn-radius: 14px;
	--dn-shadow: 0 1px 2px rgba(16, 35, 46, .06), 0 8px 24px rgba(16, 35, 46, .06);
	--dn-wrap: 1200px;
	--dn-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
	margin: 0;
	font-family: var(--dn-font);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--dn-text);
	background: var(--dn-bg);
	-webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--dn-sea); text-decoration: none; }
a:hover { color: var(--dn-accent); }
h1, h2, h3, h4 { color: var(--dn-ink); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid var(--dn-accent); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px;
	padding: .6rem 1rem; background: #fff; color: var(--dn-ink); box-shadow: var(--dn-shadow);
}
.wrap { width: 100%; max-width: var(--dn-wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .94);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--dn-line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--dn-ink); font-weight: 700; font-size: 1.08rem; white-space: nowrap; }
.brand:hover { color: var(--dn-ink); }
.brand__mark { flex: none; width: 34px; height: 34px; }
.brand__name small { display: block; font-size: .68rem; font-weight: 500; color: var(--dn-muted); letter-spacing: .04em; text-transform: uppercase; }
.custom-logo { max-height: 44px; width: auto; }

.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { display: block; color: var(--dn-ink); font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav .current-menu-item > a, .nav .current-menu-ancestor > a, .nav .current-cat > a { color: var(--dn-accent); }
.header-actions { display: flex; align-items: center; gap: .25rem; }
.icon-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px;
	border: 0; border-radius: 10px; background: transparent; color: var(--dn-ink); cursor: pointer;
}
.icon-btn:hover { background: var(--dn-bg-soft); }
.icon-btn svg { width: 22px; height: 22px; }

@media (max-width: 959px) {
	.nav {
		position: fixed; inset: 64px 0 auto 0; max-height: calc(100vh - 64px); overflow: auto;
		background: #fff; border-bottom: 1px solid var(--dn-line); box-shadow: var(--dn-shadow);
		display: none;
	}
	.nav.is-open { display: block; }
	.nav > ul { padding: .5rem 16px 1rem; }
	.nav li a { padding: .7rem 0; border-bottom: 1px solid var(--dn-line); }
	.nav .sub-menu, .nav .children { padding-left: 1rem; }
	.nav .sub-menu a, .nav .children a { font-weight: 500; }
	.header-actions { margin-left: auto; }
}
@media (min-width: 960px) {
	.menu-toggle { display: none; }
	.nav > ul { display: flex; gap: 1.6rem; }
	.nav li { position: relative; }
	.nav > ul > li > a { padding: 1.3rem 0; }
	.nav .sub-menu, .nav .children {
		position: absolute; top: 100%; left: -1rem; min-width: 230px; padding: .5rem;
		background: #fff; border: 1px solid var(--dn-line); border-radius: 12px; box-shadow: var(--dn-shadow);
		opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s ease;
	}
	.nav li:hover > .sub-menu, .nav li:focus-within > .sub-menu,
	.nav li:hover > .children, .nav li:focus-within > .children { opacity: 1; visibility: visible; transform: none; }
	.nav .sub-menu a, .nav .children a { padding: .5rem .75rem; border-radius: 8px; font-weight: 500; }
	.nav .sub-menu a:hover, .nav .children a:hover { background: var(--dn-bg-soft); }
}

.header-search { display: none; border-top: 1px solid var(--dn-line); padding: 12px 0; background: #fff; }
.header-search.is-open { display: block; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: .5rem; width: 100%; max-width: 640px; }
.search-form input[type="search"] {
	flex: 1; min-width: 0; height: 48px; padding: 0 1rem;
	font: inherit; color: var(--dn-ink);
	border: 1px solid var(--dn-line); border-radius: 12px; background: #fff;
}
.search-form button {
	height: 48px; padding: 0 1.2rem; border: 0; border-radius: 12px; cursor: pointer;
	font: inherit; font-weight: 700; color: #fff; background: var(--dn-accent);
}
.search-form button:hover { background: #cf5021; }

/* ---------- Hero ---------- */
.hero {
	position: relative; overflow: hidden; color: #fff;
	background: linear-gradient(160deg, var(--dn-sea-deep) 0%, var(--dn-sea) 55%, #138a8f 100%);
}
.hero--image { background-size: cover; background-position: center; }
.hero--image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 30, 42, .55), rgba(8, 30, 42, .78)); }
.hero__waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px; color: #fff; }
.hero__inner { position: relative; padding-top: 72px; padding-bottom: 120px; }
.hero__eyebrow { display: inline-block; margin-bottom: 1rem; padding: .3rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5.2vw, 3.4rem); max-width: 15ch; margin-bottom: .4em; }
.hero h1 em { font-style: normal; color: #ffc79a; }
.hero__lead { max-width: 56ch; font-size: 1.1rem; opacity: .9; margin-bottom: 1.6rem; }
.hero .search-form input[type="search"] { border-color: transparent; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.pills a {
	display: inline-block; padding: .4rem .9rem; border-radius: 999px; font-size: .9rem; font-weight: 600;
	color: var(--dn-ink); background: var(--dn-bg-soft); border: 1px solid var(--dn-line);
}
.pills a:hover, .pills .is-active a { color: #fff; background: var(--dn-accent); border-color: var(--dn-accent); }
.hero .pills a { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); }
.hero .pills a:hover { background: var(--dn-accent); border-color: var(--dn-accent); }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section--soft { background: var(--dn-bg-soft); }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section__head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; }
.section__head p { margin: .3rem 0 0; color: var(--dn-muted); }
.section__more { flex: none; font-weight: 700; white-space: nowrap; }
.empty { padding: 2rem; border: 1px dashed var(--dn-line); border-radius: var(--dn-radius); color: var(--dn-muted); text-align: center; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--feature { grid-template-columns: 1fr; }
@media (min-width: 900px) {
	.grid--feature { grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: auto auto; }
	.grid--feature > :first-child { grid-row: span 2; }
}
.card { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: var(--dn-radius); overflow: hidden; box-shadow: var(--dn-shadow); transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 35, 46, .06), 0 16px 36px rgba(16, 35, 46, .12); }
.card__media { position: relative; aspect-ratio: 16 / 10; background: var(--dn-bg-soft); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__ph {
	display: grid; place-items: center; width: 100%; height: 100%; padding: 1rem;
	color: rgba(255, 255, 255, .9); font-weight: 700; font-size: 1.1rem; text-align: center;
	background: linear-gradient(135deg, var(--dn-sea-deep), var(--dn-sea) 60%, #149196);
}
.card__body { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.1rem 1.2rem; flex: 1; }
.card__cat { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dn-accent); }
.card__title { font-size: 1.08rem; margin: 0; }
.card__title a { color: var(--dn-ink); }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* cả thẻ bấm được */
.card__excerpt { margin: 0; color: var(--dn-muted); font-size: .93rem; }
.card__meta { margin-top: auto; font-size: .82rem; color: var(--dn-muted); }
.card--large .card__title { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
@media (min-width: 900px) { .card--large .card__media { aspect-ratio: 4 / 3; } }

/* ---------- Danaci band (trang chủ) ---------- */
.danaci-section { background: var(--dn-sea-deep); color: #fff; }
.danaci-section .section__head h2 { color: #fff; }
.danaci-section .section__head p { color: rgba(255, 255, 255, .72); }
.danaci-section .section__more { color: #ffc79a; }
.danaci-band { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 600px) { .danaci-band { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .danaci-band { grid-template-columns: repeat(4, 1fr); } }
.danaci-band a {
	display: flex; flex-direction: column; gap: .4rem; height: 100%; padding: 1.25rem;
	border-radius: var(--dn-radius); color: #fff; background: rgba(255, 255, 255, .07);
	border: 1px solid rgba(255, 255, 255, .14); transition: background .15s ease, transform .15s ease;
}
.danaci-band a:hover { color: #fff; background: rgba(255, 255, 255, .13); transform: translateY(-2px); }
.danaci-band__kicker { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #ffc79a; }
.danaci-band__title { font-weight: 700; font-size: 1.05rem; line-height: 1.35; }
.danaci-band__more { margin-top: auto; padding-top: .4rem; font-size: .9rem; font-weight: 600; color: rgba(255, 255, 255, .8); }

/* ---------- Page header / breadcrumbs ---------- */
.page-head { padding: 32px 0 8px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: .3em; }
.page-head__desc { max-width: 70ch; color: var(--dn-muted); }
.page-head .pills { margin: 1rem 0 0; }
.breadcrumbs { font-size: .85rem; color: var(--dn-muted); margin-bottom: .8rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: #a8b6be; }
.breadcrumbs a { color: var(--dn-muted); }
.breadcrumbs a:hover { color: var(--dn-accent); }

/* ---------- Single ---------- */
.layout { display: grid; gap: 40px; padding: 24px 0 56px; }
@media (min-width: 1024px) { .layout--sidebar { grid-template-columns: minmax(0, 1fr) 320px; } }
.entry-header { margin-bottom: 1.5rem; }
.entry-header h1 { font-size: clamp(1.75rem, 4.2vw, 2.6rem); }
.entry-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; color: var(--dn-muted); }
.entry-cat { display: inline-block; margin-bottom: .7rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dn-accent); }
.entry-thumb { margin: 0 0 1.75rem; border-radius: var(--dn-radius); overflow: hidden; }
.entry-thumb img { width: 100%; }
.entry-thumb figcaption { padding: .5rem 0; font-size: .85rem; color: var(--dn-muted); }

.entry-content { font-size: 1.07rem; line-height: 1.8; max-width: 760px; }
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content h2 { font-size: 1.6rem; margin-top: 2em; }
.entry-content h3 { font-size: 1.28rem; margin-top: 1.6em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img, .entry-content figure img { border-radius: 10px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-element-caption { font-size: .88rem; color: var(--dn-muted); text-align: center; margin-top: .5rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote { margin-left: 0; padding: .6rem 1.2rem; border-left: 4px solid var(--dn-sea); background: var(--dn-bg-soft); border-radius: 0 10px 10px 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: .6rem .75rem; border: 1px solid var(--dn-line); text-align: left; vertical-align: top; }
.entry-content th { background: var(--dn-bg-soft); color: var(--dn-ink); }
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content .alignwide { max-width: none; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }

.entry-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.entry-tags a { display: inline-block; padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; background: var(--dn-bg-soft); color: var(--dn-text); }
.entry-tags a:hover { background: var(--dn-accent-soft); color: var(--dn-accent); }

.info-table { width: 100%; margin: 0 0 1.75rem; border-collapse: collapse; background: var(--dn-bg-soft); border-radius: var(--dn-radius); overflow: hidden; }
.info-table th, .info-table td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--dn-line); vertical-align: top; }
.info-table th { width: 38%; color: var(--dn-muted); font-weight: 600; }
.info-table td { color: var(--dn-ink); font-weight: 600; }
.info-table tr:last-child > * { border-bottom: 0; }

.related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--dn-line); }
.related h2 { font-size: 1.35rem; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 1024px) { .sidebar__sticky { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 28px; } }
.widget { padding: 1.25rem; border: 1px solid var(--dn-line); border-radius: var(--dn-radius); }
.widget-title, .widget h2 { font-size: 1rem; margin-bottom: .9rem; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li + li { margin-top: .6rem; }
.mini-post { display: grid; grid-template-columns: 72px 1fr; gap: .75rem; align-items: start; color: var(--dn-ink); font-weight: 600; font-size: .92rem; line-height: 1.4; }
.mini-post__img { width: 72px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--dn-bg-soft); }
.mini-post__img img { width: 100%; height: 100%; object-fit: cover; }
.sidebar .danaci-cta { margin: 0; }
/* Widget khối mặc định của WordPress */
.wp-block-search__inside-wrapper { display: flex; gap: .5rem; }
.wp-block-search__label { display: block; margin-bottom: .5rem; font-weight: 700; color: var(--dn-ink); }
.wp-block-search__input { flex: 1; min-width: 0; height: 44px; padding: 0 .9rem; font: inherit; border: 1px solid var(--dn-line); border-radius: 10px; }
.wp-block-search__button { height: 44px; padding: 0 1rem; border: 0; border-radius: 10px; font: inherit; font-weight: 700; color: #fff; background: var(--dn-accent); cursor: pointer; }
.widget .wp-block-heading { font-size: 1rem; margin-bottom: .9rem; }
.widget .wp-block-latest-posts, .widget .wp-block-latest-comments { padding: 0; margin: 0; }

/* ---------- Pagination ---------- */
.pagination { margin: 2.5rem 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 .8rem;
	border-radius: 10px; border: 1px solid var(--dn-line); color: var(--dn-ink); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--dn-ink); border-color: var(--dn-ink); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--dn-accent); color: var(--dn-accent); }

/* ---------- Comments ---------- */
.comments { margin-top: 3rem; max-width: 760px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--dn-line); }
.comment-form input:not([type="submit"]):not([type="checkbox"]), .comment-form textarea {
	width: 100%; padding: .7rem .9rem; font: inherit; border: 1px solid var(--dn-line); border-radius: 10px;
}
.comment-form .submit { padding: .75rem 1.3rem; border: 0; border-radius: 10px; font: inherit; font-weight: 700; color: #fff; background: var(--dn-sea); cursor: pointer; }

/* ---------- 404 ---------- */
.not-found { padding: 80px 0; text-align: center; }
.not-found .search-form { margin: 1.5rem auto 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; padding: 56px 0 24px; background: #0b1f29; color: rgba(255, 255, 255, .72); font-size: .93rem; }
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: #ffc79a; }
.site-footer h2 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li + li { margin-top: .5rem; }
.site-footer .brand { color: #fff; margin-bottom: 1rem; }
.site-footer .brand__name small { color: rgba(255, 255, 255, .55); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }

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