/*
Theme Name: Bản Đồ Du Học
Theme URI: https://bandoduhoc.info
Author: Bản Đồ Du Học
Author URI: https://bandoduhoc.info
Description: Theme WordPress nhẹ, dễ đọc dành cho website tin tức và hướng dẫn du học.
Version: 1.0.4
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: bandoduhoc
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --bd-primary: #e69a16;
  --bd-primary-dark: #bd6b00;
  --bd-primary-soft: #fff2d4;
  --bd-ink: #27231d;
  --bd-muted: #6f6659;
  --bd-line: #e9e2d7;
  --bd-paper: #ffffff;
  --bd-canvas: #fffaf1;
  --bd-footer: #34281d;
  --bd-success: #2e7158;
  --bd-radius: 18px;
  --bd-shadow: 0 12px 34px rgba(63, 44, 16, 0.08);
  --bd-container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--bd-ink);
  background: var(--bd-paper);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(189, 107, 0, .08) 1px, transparent 1.5px);
  background-size: 26px 26px;
  background-position: calc(100% - 54px) 110px;
  mask-image: linear-gradient(to left, #000 0, transparent 18%);
}
img { max-width: 100%; height: auto; }
a { color: var(--bd-primary-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8f4f00; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; }
.container { width: min(calc(100% - 40px), var(--bd-container)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { width: auto; height: auto; margin: 8px; padding: 12px 16px; clip: auto; background: #fff; z-index: 100000; }

/* Header */
.site-topbar { background: var(--bd-footer); color: #fff4dc; font-size: 14px; }
.site-topbar .container { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-contact { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar-contact a { color: #fff; text-decoration: none; }
.site-header { position: sticky; top: 0; z-index: 80; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--bd-line); backdrop-filter: blur(10px); }
.header-inner { min-height: 78px; display: flex; align-items: center; gap: 30px; }
.site-branding { flex: 0 0 auto; }
.custom-logo-link { display: block; }
.custom-logo { display: block; max-height: 52px; width: auto; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--bd-ink); text-decoration: none; }
.wordmark-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--bd-primary); color: #2e2111; border-radius: 13px 13px 13px 4px; font-weight: 900; font-size: 22px; }
.wordmark-copy { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark-name { font-weight: 850; letter-spacing: -.03em; font-size: 20px; text-transform: uppercase; }
.wordmark-tagline { margin-top: 6px; color: var(--bd-muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.main-navigation { margin-left: auto; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 5px; }
.main-navigation li { position: relative; }
.main-navigation a { display: block; padding: 12px 11px; color: var(--bd-ink); font-size: 15px; font-weight: 680; text-decoration: none; border-radius: 9px; }
.main-navigation a:hover, .main-navigation .current-menu-item > a, .main-navigation .current-menu-ancestor > a { background: var(--bd-primary-soft); color: #7c4500; }
.main-navigation .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 230px; padding: 8px; background: #fff; border: 1px solid var(--bd-line); border-radius: 12px; box-shadow: var(--bd-shadow); }
.main-navigation li:hover > .sub-menu, .main-navigation li:focus-within > .sub-menu { display: block; }
.main-navigation .sub-menu a { white-space: nowrap; }
.header-search { flex: 0 0 auto; }
.search-toggle, .menu-toggle { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--bd-line); border-radius: 11px; background: #fff; color: var(--bd-ink); }
.menu-toggle { display: none; }
.search-panel { display: none; padding: 14px 0; border-top: 1px solid var(--bd-line); background: #fff; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-field { min-width: 0; flex: 1; padding: 12px 14px; color: var(--bd-ink); background: #fff; border: 1px solid #d8cfc2; border-radius: 10px; }
.search-submit, .button { padding: 11px 18px; border: 0; border-radius: 10px; background: var(--bd-primary); color: #2e2111; font-weight: 800; text-decoration: none; transition: background .15s ease, transform .15s ease; }
.search-submit:hover, .button:hover { background: #f0aa2c; color: #21170b; transform: translateY(-1px); }

/* Home */
.hero { position: relative; overflow: hidden; padding: 66px 0 56px; background: var(--bd-canvas); border-bottom: 1px solid var(--bd-line); }
.hero::after { content: ""; position: absolute; width: 340px; height: 340px; right: -90px; top: -130px; border-radius: 50%; background: rgba(230,154,22,.16); }
.hero::before {
  content: "";
  position: absolute;
  left: -72px;
  bottom: -92px;
  width: 230px;
  height: 230px;
  border: 2px solid rgba(189,107,0,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(230,154,22,.045), 0 0 0 54px rgba(230,154,22,.025);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); gap: 58px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 17px; color: #8b5207; font-size: 14px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--bd-primary); border-radius: 3px; }
.hero h1 { max-width: 760px; margin: 0 0 20px; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: clamp(38px, 5vw, 65px); line-height: 1.08; letter-spacing: -.035em; font-weight: 850; }
.hero h1 em { color: var(--bd-primary-dark); font-style: normal; }
.hero-intro { max-width: 660px; margin: 0 0 27px; color: #595145; font-size: 19px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button-secondary { background: #fff; border: 1px solid #d9c8ae; }
.button-secondary:hover { background: var(--bd-primary-soft); }
.guide-card { position: relative; padding: 28px; overflow: hidden; background: #fff; border: 1px solid #f0dfc3; border-radius: 24px; box-shadow: var(--bd-shadow); }
.guide-card::before { content: ""; position: absolute; inset: 12px auto 12px 0; width: 5px; border-radius: 6px; background: var(--bd-primary); }
.guide-card::after { content: "↗"; position: absolute; right: 18px; top: 5px; color: rgba(189,107,0,.08); font-family: "Segoe UI", Arial, sans-serif; font-size: 92px; line-height: 1; font-weight: 800; pointer-events: none; }
.guide-card > * { position: relative; z-index: 1; }
.guide-card h2 { margin: 0 0 6px; font-size: 22px; }
.guide-card p { margin: 0 0 16px; color: var(--bd-muted); font-size: 15px; }
.guide-steps { list-style: none; margin: 0; padding: 0; }
.guide-steps li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--bd-line); font-weight: 700; font-size: 15px; }
.step-number { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--bd-primary-soft); color: #84500b; font-size: 13px; }
.section { padding: 62px 0; }
.section-soft { position: relative; overflow: hidden; background: #fbf8f2; border-block: 1px solid var(--bd-line); }
.section-soft::before {
  content: "";
  position: absolute;
  right: -42px;
  top: 34px;
  width: 170px;
  height: 170px;
  opacity: .34;
  background-image: radial-gradient(circle, var(--bd-primary) 1.5px, transparent 2px);
  background-size: 15px 15px;
  transform: rotate(9deg);
}
.section-soft::after {
  content: "";
  position: absolute;
  left: -58px;
  bottom: -80px;
  width: 190px;
  height: 190px;
  border: 2px dashed rgba(189,107,0,.16);
  border-radius: 50%;
}
.section-soft > .container { position: relative; z-index: 1; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 22px; margin-bottom: 26px; }
.section-title { margin: 0; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: clamp(29px, 4vw, 40px); line-height: 1.2; font-weight: 820; letter-spacing: -.025em; }
.section-description { max-width: 610px; margin: 8px 0 0; color: var(--bd-muted); }
.section-link { flex: 0 0 auto; font-weight: 800; text-decoration: none; }
.country-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.country-card { position: relative; display: block; min-height: 180px; overflow: hidden; padding: 24px; color: var(--bd-ink); background: #fff; border: 1px solid var(--bd-line); border-radius: var(--bd-radius); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.country-card::after { content: ""; position: absolute; width: 74px; height: 74px; right: -27px; bottom: -29px; border: 9px solid rgba(230,154,22,.09); border-radius: 50%; }
.country-card:hover { color: var(--bd-ink); border-color: #dfb66d; box-shadow: var(--bd-shadow); transform: translateY(-3px); }
.country-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 24px; border-radius: 14px; background: var(--bd-primary-soft); font-size: 25px; }
.country-card h3 { margin: 0 0 6px; font-size: 19px; }
.country-card p { margin: 0; color: var(--bd-muted); font-size: 14px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--bd-line); border-radius: var(--bd-radius); }
.post-card-image { display: block; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(135deg,#f6e2ba,#f4b648); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.post-card:hover .post-card-image img { transform: scale(1.025); }
.post-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: #7c4d08; font-size: 40px; }
.post-placeholder::before, .post-placeholder::after { content: ""; position: absolute; border: 1px solid rgba(124,77,8,.12); border-radius: 50%; }
.post-placeholder::before { width: 104px; height: 104px; }
.post-placeholder::after { width: 152px; height: 152px; border-style: dashed; }
.post-placeholder { position: relative; }
.post-card-body { padding: 21px; }
.post-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; color: var(--bd-muted); font-size: 13px; }
.post-category { color: #884e00; font-weight: 800; text-decoration: none; }
.post-card-title { margin: 0 0 10px; font-size: 20px; line-height: 1.35; }
.post-card-title a { color: var(--bd-ink); text-decoration: none; }
.post-card-title a:hover { color: var(--bd-primary-dark); }
.post-excerpt { margin: 0; color: var(--bd-muted); font-size: 15px; }
.empty-state { grid-column: 1/-1; padding: 34px; text-align: center; background: var(--bd-canvas); border: 1px dashed #d8bc8b; border-radius: var(--bd-radius); }
.newsletter { padding: 36px; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; background: var(--bd-footer); color: #fff; border-radius: 24px; }
.newsletter h2 { margin: 0 0 6px; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 30px; font-weight: 820; letter-spacing: -.02em; }
.newsletter p { margin: 0; color: #ddd1c4; }
.newsletter-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter .button-secondary { color: #fff; background: transparent; border-color: #756451; }

/* Archives and content */
.page-header { padding: 46px 0; background: var(--bd-canvas); border-bottom: 1px solid var(--bd-line); }
.page-header h1 { margin: 0; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: clamp(34px, 5vw, 50px); line-height: 1.15; font-weight: 850; letter-spacing: -.025em; }
.archive-description { max-width: 700px; color: var(--bd-muted); }
.content-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(250px, 1fr); gap: 58px; align-items: start; padding: 54px 0 72px; }
.site-main > :first-child { margin-top: 0; }
.article-header { margin-bottom: 28px; }
.article-header h1 { margin: 8px 0 14px; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: clamp(35px, 5vw, 54px); line-height: 1.15; letter-spacing: -.025em; font-weight: 850; }
.featured-image { margin: 0 0 30px; overflow: hidden; border-radius: 20px; background: var(--bd-canvas); }
.featured-image img { width: 100%; display: block; }
.entry-content { font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 18px; }
.entry-content > * { max-width: 760px; }
.entry-content h2, .entry-content h3 { font-family: Inter, "Segoe UI", sans-serif; line-height: 1.3; scroll-margin-top: 110px; }
.entry-content h2 { margin-top: 2.1em; font-size: 29px; }
.entry-content h3 { margin-top: 1.7em; font-size: 23px; }
.entry-content blockquote { margin: 28px 0; padding: 20px 24px; background: var(--bd-canvas); border-left: 5px solid var(--bd-primary); }
.entry-content a { font-weight: 650; }
.entry-content table { width: 100%; border-collapse: collapse; font-family: Inter, "Segoe UI", sans-serif; font-size: 15px; }
.entry-content th, .entry-content td { padding: 12px; border: 1px solid var(--bd-line); text-align: left; }
.entry-content th { background: var(--bd-primary-soft); }
.entry-content .wp-block-image img { border-radius: 14px; }
.article-note { margin: 30px 0; padding: 18px 20px; color: #57401b; background: #fff7e5; border: 1px solid #efd59f; border-radius: 12px; font-family: Inter, "Segoe UI", sans-serif; font-size: 14px; }
.post-tags { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--bd-line); font-size: 14px; }
.post-navigation { margin-top: 42px; padding-top: 26px; border-top: 1px solid var(--bd-line); }
.comments-area { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--bd-line); }
.comment-list { padding-left: 22px; }
.comment-body { margin-bottom: 18px; padding: 18px; background: #fbf8f2; border-radius: 12px; }
.comment-form label { display: block; margin-bottom: 5px; font-weight: 700; }
.comment-form input:not([type="submit"]), .comment-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #d8cfc2; border-radius: 9px; }
.comment-form .submit { padding: 11px 18px; border: 0; border-radius: 10px; background: var(--bd-primary); color: #2e2111; font-weight: 800; }
.nav-links { display: flex; justify-content: space-between; gap: 20px; }
.nav-links a { font-weight: 750; text-decoration: none; }
.pagination { margin-top: 36px; }
.page-numbers { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 9px; border: 1px solid var(--bd-line); border-radius: 8px; text-decoration: none; }
.page-numbers.current { background: var(--bd-primary); border-color: var(--bd-primary); color: #2e2111; font-weight: 800; }
.sidebar { position: sticky; top: 110px; }
.widget { margin-bottom: 24px; padding: 22px; background: #fff; border: 1px solid var(--bd-line); border-radius: 15px; }
.widget-title { margin: 0 0 14px; font-size: 18px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--bd-line); font-size: 14px; }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--bd-ink); text-decoration: none; }
.widget a:hover { color: var(--bd-primary-dark); }
.contact-widget { background: var(--bd-canvas); border-color: #efd9b1; }
.contact-widget p { color: var(--bd-muted); font-size: 14px; }
.contact-links { display: grid; gap: 8px; }
.contact-links a { display: block; padding: 10px 12px; background: #fff; border: 1px solid var(--bd-line); border-radius: 9px; font-weight: 750; }
.breadcrumbs { margin-bottom: 16px; color: var(--bd-muted); font-size: 13px; }
.breadcrumbs a { color: var(--bd-muted); text-decoration: none; }

/* Footer */
.site-footer { position: relative; overflow: hidden; padding: 52px 0 20px; background: var(--bd-footer); color: #e8dfd5; }
.site-footer::after { content: ""; position: absolute; width: 280px; height: 280px; right: -100px; bottom: -140px; border: 1px solid rgba(255,201,102,.12); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,201,102,.025); }
.site-footer > .container { position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 50px; }
.site-footer .wordmark { color: #fff; }
.site-footer .wordmark-tagline { color: #cfc1b2; }
.footer-about { max-width: 420px; color: #cfc1b2; font-size: 14px; }
.footer-owner { margin: 16px 0 0; padding-top: 14px; max-width: 420px; color: #f5eadf; border-top: 1px solid #594a3c; font-size: 13px; line-height: 1.65; }
.footer-owner strong { display: block; color: #ffc966; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.footer-title { margin: 0 0 14px; color: #fff; font-size: 16px; }
.footer-menu, .footer-contact { list-style: none; margin: 0; padding: 0; }
.footer-menu li, .footer-contact li { margin: 8px 0; }
.site-footer a { color: #f5eadf; text-decoration: none; }
.site-footer a:hover { color: #ffc966; }
.site-info { margin-top: 38px; padding-top: 18px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid #594a3c; color: #baa997; font-size: 13px; }

/* Responsive */
@media (max-width: 980px) {
  .menu-toggle { display: grid; margin-left: auto; }
  .main-navigation { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 12px 20px 20px; background: #fff; border-bottom: 1px solid var(--bd-line); box-shadow: var(--bd-shadow); }
  .main-navigation.is-open { display: block; }
  .main-navigation ul { align-items: stretch; flex-direction: column; }
  .main-navigation .sub-menu { display: block; position: static; min-width: 0; padding: 0 0 0 18px; border: 0; box-shadow: none; }
  .header-search { margin-left: 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .country-grid { grid-template-columns: repeat(2,1fr); }
  .post-grid { grid-template-columns: repeat(2,1fr); }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .container { width: min(calc(100% - 28px), var(--bd-container)); }
  .site-topbar .container { justify-content: center; }
  .topbar-note { display: none; }
  .topbar-contact { justify-content: center; gap: 13px; font-size: 12px; }
  .header-inner { min-height: 68px; gap: 8px; }
  .wordmark-mark { width: 37px; height: 37px; font-size: 19px; }
  .wordmark-name { font-size: 16px; }
  .wordmark-tagline { display: none; }
  .hero { padding: 45px 0; }
  .hero::before { width: 150px; height: 150px; left: -90px; bottom: -45px; }
  .hero::after { width: 210px; height: 210px; right: -120px; top: 20px; }
  .hero h1 { font-size: 39px; }
  .hero-intro { font-size: 17px; }
  .section { padding: 46px 0; }
  .section-soft::before { width: 100px; height: 100px; right: -45px; opacity: .22; }
  .section-head { display: block; }
  .section-link { display: inline-block; margin-top: 12px; }
  .country-grid, .post-grid { grid-template-columns: 1fr; }
  .country-card { min-height: 0; }
  .newsletter { grid-template-columns: 1fr; padding: 26px; }
  .content-layout { padding-top: 38px; gap: 36px; }
  .entry-content { font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .site-info { display: block; }
}

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