/*
Theme Name: XKLD Nhật Bản
Theme URI: https://xkld-nhatban.com/
Author: XKLD Nhật Bản
Author URI: https://xkld-nhatban.com/
Description: Theme WordPress chuyên nghiệp cho cổng thông tin việc làm và chương trình làm việc tại Nhật Bản.
Version: 1.0.4
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: kira-xkld-nhatban-com
*/

:root {
  --navy: #092548;
  --navy-2: #12375f;
  --red: #cd272d;
  --red-dark: #a71921;
  --gold: #f2b84b;
  --ink: #172333;
  --muted: #667487;
  --line: #dfe5ec;
  --soft: #f3f6f9;
  --white: #fff;
  --radius: 14px;
  --shadow: 0 16px 48px rgba(9, 37, 72, .12);
  --content: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.72;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { color: var(--red); }
button, input, textarea, select { font: inherit; }
h1, h2, h3, h4 { margin: 0 0 .65em; color: var(--navy); line-height: 1.22; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4vw, 3.65rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.55rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.42rem); }
p { margin: 0 0 1.15em; }
ul, ol { padding-left: 1.25rem; }
.container { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }
.site-main { min-width: 0; }
.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 { z-index: 100000; top: 8px; left: 8px; width: auto; height: auto; padding: 12px 18px; clip: auto; color: var(--navy); background: #fff; box-shadow: var(--shadow); }

.topbar { color: #dfe9f5; background: var(--navy); font-size: .86rem; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 39px; gap: 16px; }
.topbar a { color: #fff; font-weight: 700; }
.topbar-list { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
.site-header { position: sticky; z-index: 1000; top: 0; background: rgba(255,255,255,.97); border-bottom: 1px solid rgba(9,37,72,.1); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; min-height: 82px; gap: 28px; }
.site-branding { flex: 0 0 auto; }
.site-logo { width: 290px; max-height: 68px; object-fit: contain; object-position: left center; }
.custom-logo { width: auto; max-width: 290px; max-height: 68px; }
.site-navigation { display: flex; align-items: center; justify-content: flex-end; flex: 1; gap: 22px; }
.primary-menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.primary-menu a { display: block; padding: 12px 11px; color: var(--navy); font-size: .94rem; font-weight: 700; }
.primary-menu .current-menu-item > a, .primary-menu a:hover { color: var(--red); }
.header-cta, .button, .wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; color: #fff; background: var(--red); border: 0; border-radius: 999px; font-weight: 800; line-height: 1.2; box-shadow: 0 8px 24px rgba(205,39,45,.22); transition: .2s ease; }
.header-cta:hover, .button:hover, .wp-block-button__link:hover { color: #fff; background: var(--red-dark); transform: translateY(-1px); }
.button-outline { color: var(--navy); background: #fff; border: 1px solid var(--line); box-shadow: none; }
.button-outline:hover { color: #fff; background: var(--navy); }
.menu-toggle { display: none; width: 45px; height: 45px; padding: 0; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.menu-toggle span, .menu-toggle::before, .menu-toggle::after { content: ""; display: block; width: 21px; height: 2px; margin: 5px auto; background: currentColor; transition: .2s ease; }

.hero { position: relative; display: grid; min-height: 630px; color: #fff; overflow: hidden; background: var(--navy); isolation: isolate; }
.hero-media, .hero-media::after { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; background: linear-gradient(90deg, rgba(4,24,47,.97) 0%, rgba(4,24,47,.84) 45%, rgba(4,24,47,.24) 80%); }
.hero-inner { position: relative; z-index: 1; align-self: center; padding-block: 86px 110px; }
.hero-content { max-width: 720px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px; color: var(--red); font-size: .8rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 30px; height: 3px; background: currentColor; }
.hero .eyebrow { color: #ffd275; }
.hero h1 { margin-bottom: 20px; color: #fff; }
.hero-lead { max-width: 630px; color: #e3ebf4; font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-actions .button-outline { color: #fff; background: transparent; border-color: rgba(255,255,255,.5); }
.hero-actions .button-outline:hover { background: #fff; color: var(--navy); }
.hero-facts { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.95); border-top: 1px solid rgba(255,255,255,.35); }
.hero-fact { padding: 22px 25px; color: var(--ink); border-right: 1px solid var(--line); }
.hero-fact:last-child { border: 0; }
.hero-fact strong { display: block; color: var(--red); font-size: 1.35rem; }
.hero-fact span { color: var(--muted); font-size: .88rem; }

.home-content { background: #fff; }
.home-section { padding: 82px 0; }
.home-section.soft { background: var(--soft); }
.section-heading { max-width: 760px; margin: 0 auto 38px; text-align: center; }
.section-heading p { color: var(--muted); font-size: 1.05rem; }
.feature-grid, .program-grid, .story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card, .program-card, .story-card { padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(9,37,72,.05); }
.feature-card { position: relative; padding-top: 66px; }
.feature-number { position: absolute; top: 24px; left: 28px; color: var(--red); font-size: .8rem; font-weight: 900; letter-spacing: .12em; }
.program-card { padding: 0; overflow: hidden; }
.program-card img { width: 100%; height: 220px; object-fit: cover; }
.program-card-body { padding: 25px; }
.program-meta { margin-bottom: 10px; color: var(--red); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.process-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; padding: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); list-style: none; }
.process-list li { position: relative; min-height: 190px; padding: 30px; background: #fff; }
.process-list strong { display: block; margin-bottom: 12px; color: var(--red); font-size: 1.8rem; }
.trust-band { padding: 46px 0; color: #fff; background: var(--navy); }
.trust-grid { display: grid; grid-template-columns: 1.25fr repeat(3, .6fr); align-items: center; gap: 30px; }
.trust-grid h2 { color: #fff; font-size: 1.8rem; }
.trust-stat strong { display: block; color: var(--gold); font-size: 2rem; }
.trust-stat span { color: #cfdeed; font-size: .9rem; }
.cta-panel { display: grid; grid-template-columns: 1.35fr .65fr; align-items: center; gap: 32px; padding: 44px; color: #fff; background: var(--red); border-radius: 22px; }
.cta-panel h2 { color: #fff; }
.cta-panel p { margin-bottom: 0; color: #ffe6e7; }
.cta-panel .button { color: var(--navy); background: #fff; box-shadow: none; }

.page-hero { position: relative; padding: 74px 0; color: #fff; background: var(--navy); overflow: hidden; }
.page-hero.has-image { min-height: 350px; display: grid; align-items: end; }
.page-hero-media, .page-hero-media::after { position: absolute; inset: 0; }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero-media::after { content: ""; background: linear-gradient(90deg, rgba(5,27,52,.94), rgba(5,27,52,.52)); }
.page-hero-inner { position: relative; z-index: 1; max-width: 820px; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3.15rem); }
.page-hero p { margin: 0; color: #dfe9f4; font-size: 1.08rem; }
.breadcrumbs { margin-bottom: 18px; color: #c4d4e5; font-size: .85rem; }
.breadcrumbs a { color: #fff; }
.breadcrumbs span { margin: 0 8px; opacity: .7; }

.content-area { padding: 62px 0 80px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 42px; }
.content-layout.no-sidebar { grid-template-columns: minmax(0, 820px); justify-content: center; }
.entry-card, .single-entry { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(9,37,72,.05); overflow: hidden; }
.single-entry { padding: clamp(24px, 4vw, 48px); }
.entry-content { font-size: 1.02rem; }
.entry-content > * { max-width: 100%; }
.entry-content h2 { margin-top: 1.65em; }
.entry-content h3 { margin-top: 1.45em; }
.entry-content a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.entry-content .button { color: #fff; text-decoration: none; }
.entry-content .button-outline { color: var(--navy); }
.entry-content .hero .button-outline { color: #fff; }
.entry-content .hero .button-outline:hover { color: var(--navy); }
.entry-content blockquote { margin: 28px 0; padding: 22px 26px; color: var(--navy); background: var(--soft); border-left: 4px solid var(--red); }
.entry-content table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.entry-content th, .entry-content td { padding: 12px; text-align: left; border: 1px solid var(--line); }
.entry-content th { color: var(--navy); background: var(--soft); }
.entry-content .home-section { margin-inline: calc(50% - 50vw); }
.entry-featured { margin: -48px -48px 36px; }
.entry-featured img { width: 100%; max-height: 500px; object-fit: cover; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 20px; color: var(--muted); font-size: .88rem; }
.entry-meta a { color: var(--red); font-weight: 700; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.post-tags a { padding: 6px 11px; color: var(--navy); background: var(--soft); border-radius: 999px; font-size: .83rem; }

.archive-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; }
.post-card { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(9,37,72,.05); overflow: hidden; }
.post-card-image { display: block; overflow: hidden; }
.post-card-image img { width: 100%; height: 230px; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card-image img { transform: scale(1.035); }
.post-card-body { display: flex; flex: 1; flex-direction: column; padding: 24px; }
.post-card .entry-meta { margin-bottom: 10px; }
.post-card h2, .post-card h3 { font-size: 1.27rem; }
.post-card p { color: var(--muted); }
.read-more { margin-top: auto; color: var(--red); font-weight: 800; }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; }
.page-numbers.current, .page-numbers:hover { color: #fff; background: var(--red); border-color: var(--red); }

.sidebar { position: sticky; top: 112px; }
.widget { margin-bottom: 24px; padding: 25px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.widget-title { position: relative; margin-bottom: 18px; padding-bottom: 12px; font-size: 1.13rem; }
.widget-title::after { content: ""; position: absolute; bottom: 0; left: 0; width: 42px; height: 3px; background: var(--red); }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border: 0; }
.search-form { display: flex; }
.search-form label { flex: 1; }
.search-field { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px 0 0 8px; outline: 0; }
.search-field:focus { border-color: var(--navy); }
.search-submit { padding: 0 16px; color: #fff; background: var(--navy); border: 0; border-radius: 0 8px 8px 0; font-weight: 700; }
.sidebar-cta { color: #fff; background: var(--navy); }
.sidebar-cta h3 { color: #fff; }
.sidebar-cta p { color: #d8e4f0; }
.sidebar-cta .button { width: 100%; }

.related-posts { margin-top: 48px; }
.related-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-posts .post-card-image img { height: 150px; }
.related-posts .post-card-body { padding: 18px; }
.related-posts h3 { font-size: 1.02rem; }
.not-found { padding: 80px 30px; text-align: center; background: #fff; border-radius: var(--radius); }
.error-code { color: var(--red); font-size: clamp(4rem, 12vw, 8rem); font-weight: 900; line-height: 1; }

.site-footer { color: #cdd9e7; background: #061b34; }
.footer-main { padding: 64px 0 42px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .75fr .75fr 1fr; gap: 42px; }
.footer-logo { width: 250px; margin-bottom: 20px; filter: brightness(0) invert(1); }
.footer-title { color: #fff; font-size: 1rem; letter-spacing: .05em; text-transform: uppercase; }
.footer-menu, .footer-contact { margin: 0; padding: 0; list-style: none; }
.footer-menu li, .footer-contact li { margin-bottom: 10px; }
.site-footer a { color: #e7eef7; }
.site-footer a:hover { color: #fff; }
.footer-bottom { padding: 19px 0; text-align: center; border-top: 1px solid rgba(255,255,255,.13); font-size: .9rem; }

@media (max-width: 1020px) {
  .menu-toggle { display: block; margin-left: auto; }
  .site-navigation { position: fixed; z-index: 999; top: 121px; right: 0; bottom: 0; width: min(360px, 90vw); display: block; padding: 24px; background: #fff; box-shadow: -14px 20px 35px rgba(9,37,72,.18); transform: translateX(105%); transition: transform .25s ease; }
  .site-navigation.is-open { transform: translateX(0); }
  .primary-menu { display: block; }
  .primary-menu a { padding: 13px 4px; border-bottom: 1px solid var(--line); }
  .header-cta { width: 100%; margin-top: 22px; }
  .content-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .container { width: min(calc(100% - 28px), var(--content)); }
  .topbar-list li:first-child { display: none; }
  .topbar-inner { justify-content: center; }
  .header-inner { min-height: 70px; }
  .site-logo, .custom-logo { max-width: 230px; max-height: 55px; }
  .site-navigation { top: 109px; }
  .hero { display: block; min-height: 0; }
  .hero-inner { padding-block: 70px; }
  .hero-media::after { background: rgba(4,24,47,.78); }
  .hero-facts { position: relative; grid-template-columns: 1fr; }
  .hero-fact { padding: 12px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .home-section { padding: 58px 0; }
  .feature-grid, .program-grid, .story-grid, .process-list, .trust-grid, .cta-panel, .content-layout, .archive-grid { grid-template-columns: 1fr; }
  .trust-grid { text-align: center; }
  .cta-panel { padding: 30px; }
  .sidebar { position: static; }
  .entry-featured { margin: -24px -24px 26px; }
  .related-posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 480px) {
  .topbar-list { gap: 11px; font-size: .78rem; }
  .site-logo, .custom-logo { max-width: 205px; }
  .hero-actions .button { width: 100%; }
  .page-hero { padding: 54px 0; }
  .single-entry { padding: 24px; }
}

@media print {
  .topbar, .site-header, .sidebar, .site-footer, .hero-actions { display: none !important; }
  body { background: #fff; }
  .content-layout { display: block; }
  .single-entry { border: 0; box-shadow: none; }
}
