/*
Theme Name: Hanoian
Description: Giao diện tạp chí tái tạo theo hanoian.vn — đa ngôn ngữ (Polylang), hero 3 cột, khối chuyên mục nhãn vệt sơn xanh, mosaic EN/JA.
Author: Hanoian
Version: 1.0.0
Text Domain: hanoian
*/

:root {
  --green: #43a047;
  --green-dark: #3e9b3e;
  --dark: #212121;
  --text: #424242;
  --muted: #757575;
  --border: #e6e6e6;
  --blue: #1a73e8;
  --cream: #f5f2df;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Roboto, "Noto Sans JP", -apple-system, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
.hn-container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------- top line + header ---------- */
.hn-topline { height: 4px; background: var(--green); }
.hn-header { background: #fff; border-bottom: 1px solid var(--border); position: relative; z-index: 50; }
.hn-header-inner { display: flex; align-items: stretch; gap: 10px; }
.hn-logo { display: flex; align-items: center; padding: 10px 0; margin-right: 26px; }
.hn-logo img { width: 210px; height: auto; }
.hn-nav { display: flex; align-items: stretch; flex: 1; }
.hn-nav ul { display: flex; list-style: none; align-items: stretch; }
.hn-nav a {
  display: flex; align-items: center; padding: 0 17px;
  font-size: 15.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: #333; border-bottom: 3px solid transparent; border-top: 3px solid transparent;
  height: 100%;
}
.hn-nav li { display: flex; }
.hn-nav a:hover, .hn-nav li.current a { color: var(--green); border-bottom-color: var(--green); }
.hn-nav .hn-home-item a svg { width: 17px; height: 17px; fill: currentColor; }

/* language switcher */
.hn-lang { position: relative; display: flex; align-items: stretch; margin-left: auto; }
.hn-lang > a {
  display: flex; align-items: center; gap: 8px; padding: 0 18px;
  background: #f5f5f5; font-size: 15px; font-weight: 700; text-transform: uppercase;
  color: #333; border-bottom: 3px solid var(--green);
}
.hn-lang img { width: 18px; height: 12px; }
.hn-lang .caret { border: 4px solid transparent; border-top-color: #999; margin-top: 4px; }
.hn-lang ul {
  display: none; position: absolute; top: 100%; right: 0; min-width: 170px;
  background: #fff; border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(0,0,0,.12);
  list-style: none; z-index: 60;
}
.hn-lang:hover ul { display: block; }
.hn-lang ul a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 13px; font-weight: 500; }
.hn-lang ul a:hover { background: #f5f5f5; }

/* burger */
.hn-burger { display: flex; align-items: center; margin-left: 12px; background: none; border: 0; cursor: pointer; padding: 0 4px; }
.hn-burger span { display: block; width: 22px; height: 2px; background: #333; position: relative; }
.hn-burger span::before, .hn-burger span::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: #333; }
.hn-burger span::before { top: -7px; } .hn-burger span::after { top: 7px; }
.hn-mobilenav { display: none; background: #fff; border-bottom: 1px solid var(--border); }
.hn-mobilenav.open { display: block; }
.hn-mobilenav a { display: block; padding: 12px 20px; font-weight: 600; text-transform: uppercase; font-size: 13.5px; border-top: 1px solid var(--border); }

/* ---------- brush label ---------- */
.hn-label { text-align: center; margin: 34px 0 22px; }
.hn-label span {
  display: inline-block; position: relative; color: #fff; font-size: 16px; font-weight: 700;
  padding: 7px 40px; min-width: 165px;
  background: var(--green-dark);
  clip-path: polygon(3% 12%, 8% 2%, 96% 0%, 99% 34%, 100% 62%, 95% 96%, 88% 100%, 6% 94%, 0% 70%, 2% 38%);
}

/* ---------- cards ---------- */
.hn-thumb { position: relative; overflow: hidden; background: #eee; aspect-ratio: 3/2; }
.hn-thumb img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; transition: transform .35s; }
a:hover .hn-thumb img { transform: scale(1.04); }

.hn-title { color: var(--dark); font-weight: 700; line-height: 1.35; }
a:hover .hn-title { color: var(--green); }
.hn-excerpt { color: var(--muted); font-size: 14px; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* hero (vi) — cột 1 lớn nhất, cột 2 nhỏ (2 bài), cột 3 list */
.hn-hero { display: grid; grid-template-columns: 2.3fr 1fr 1.6fr; gap: 26px; margin-top: 28px; }
.hn-hero-big .hn-thumb { aspect-ratio: 500/330; }
.hn-hero-big .hn-title { font-size: 24px; margin-top: 14px; }
.hn-hero-big .hn-excerpt { -webkit-line-clamp: 2; font-size: 15px; }
.hn-hero-mid { display: flex; flex-direction: column; gap: 22px; }
.hn-hero-mid .hn-thumb { aspect-ratio: 4/3; }
.hn-hero-mid .hn-title { font-size: 15px; margin-top: 10px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hn-list-sm { display: flex; flex-direction: column; gap: 16px; }
.hn-item-sm { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: start; }
.hn-item-sm .hn-thumb { aspect-ratio: 88/62; }
.hn-item-sm .hn-title { font-size: 14.5px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* category blocks (vi) */
.hn-blocks { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; align-items: start; }
.hn-block-big .hn-thumb { aspect-ratio: 370/245; }
.hn-block-big .hn-title { font-size: 17.5px; margin-top: 12px; }
.hn-block .hn-list-sm { margin-top: 18px; }

/* bottom news list (vi) + archive rows */
.hn-rows { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 30px; }
.hn-row { display: grid; grid-template-columns: 255px 1fr; gap: 22px; align-items: start; }
.hn-row .hn-thumb { aspect-ratio: 255/170; }
.hn-row .hn-title { font-size: 19px; }
.hn-row .hn-excerpt { -webkit-line-clamp: 3; margin-top: 10px; font-size: 14.5px; }
.hn-loadmore-wrap { text-align: center; margin: 34px 0 10px; }
.hn-loadmore {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 18px; cursor: pointer;
  background: #fafafa; border: 1px solid #ccc; border-radius: 3px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px; color: #555; text-transform: uppercase;
}
.hn-loadmore:hover { border-color: var(--green); color: var(--green); }
.hn-loadmore svg { width: 13px; height: 13px; fill: currentColor; }

/* mosaic hero (en/ja) */
.hn-mosaic { display: grid; grid-template-columns: 1fr 22% 22%; gap: 3px; margin-top: 24px; }
.hn-mosaic a { position: relative; display: block; overflow: hidden; background: #222; }
.hn-mosaic a img { width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .35s; }
.hn-mosaic a:hover img { transform: scale(1.04); }
.hn-mosaic a::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,.08) 100%); }
.hn-mosaic .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px; z-index: 2;
  color: #fff; font-weight: 700; font-size: 15px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hn-mosaic-big { grid-row: span 2; }
.hn-mosaic-big .cap { font-size: 24px; padding: 24px; }
.hn-mosaic-big { min-height: 440px; }
.hn-mosaic a:not(.hn-mosaic-big) { min-height: 219px; }

/* en/ja home body */
.hn-cols { display: grid; grid-template-columns: 1fr 340px; gap: 44px; margin-top: 36px; }
.hn-sticky-card { background: var(--cream); padding: 18px; display: grid; grid-template-columns: 255px 1fr; gap: 20px; margin-bottom: 32px; }
.hn-sticky-card .hn-thumb { aspect-ratio: 255/170; }
.hn-sticky-card .hn-title { font-size: 19px; }
.hn-side .hn-side-big .hn-thumb { aspect-ratio: 340/225; }
.hn-side .hn-side-big .hn-title { font-size: 17px; margin-top: 12px; }
.hn-side .hn-list-sm { margin-top: 20px; }

/* single */
.hn-single-grid { display: grid; grid-template-columns: 1fr 340px; gap: 48px; margin: 30px 0 60px; }
.hn-single-grid .hn-label { margin-top: 0; }
.hn-article h1 { color: var(--dark); font-size: 30px; line-height: 1.32; margin-bottom: 14px; }
.hn-byline { display: flex; align-items: center; gap: 8px; color: #757575; font-size: 13.5px; margin-bottom: 16px; }
.hn-byline .ava { width: 26px; height: 26px; border-radius: 50%; background: #e0e0e0; display: inline-flex; align-items: center; justify-content: center; }
.hn-byline .ava svg { width: 15px; height: 15px; fill: #9e9e9e; }
.hn-byline .on { color: #9e9e9e; }
.hn-single { max-width: 820px; margin: 34px auto 60px; }
.hn-single h1 { color: var(--dark); font-size: 30px; line-height: 1.3; margin-bottom: 10px; }
.hn-meta { color: #9e9e9e; font-size: 13px; margin-bottom: 20px; }
.hn-sapo { font-weight: 700; color: #555; font-size: 16.5px; line-height: 1.7; text-align: justify; margin-bottom: 18px; }
.hn-content { font-size: 16.5px; line-height: 1.75; color: #333; text-align: justify; }
.hn-content p { margin: 0 0 18px; }
.hn-content img { margin: 6px auto 18px; height: auto !important; }
.hn-content h2, .hn-content h3 { color: var(--dark); margin: 26px 0 12px; line-height: 1.35; }
.hn-content iframe { max-width: 100%; }
.hn-tags { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.hn-tags a { font-size: 12.5px; background: #f1f1f1; padding: 5px 12px; border-radius: 3px; color: #555; }
.hn-tags a:hover { background: var(--green); color: #fff; }

/* share buttons (đầu bài, giống bản gốc) */
.hn-share { display: flex; gap: 7px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.hn-share a, .hn-share .share-lbl, .hn-share .more {
  display: inline-flex; align-items: center; gap: 7px;
  color: #fff; font-size: 13px; font-weight: 500; padding: 8px 15px; border-radius: 4px;
}
.hn-share svg { width: 14px; height: 14px; fill: currentColor; }
.hn-share a:hover { opacity: .88; color: #fff; }
.hn-share .share-lbl { background: #fff; color: #444; border: 1px solid #ddd; }
.hn-share .fb { background: #3b5998; }
.hn-share .tw { background: #55acee; }
.hn-share .ms { background: #0084ff; }
.hn-share .wa { background: #25d366; }
.hn-share .tg { background: #0088cc; }
.hn-share .more { background: #fff; color: #666; border: 1px solid #ddd; cursor: pointer; font-size: 17px; padding: 6px 13px; font-family: inherit; }
.hn-share .extra { display: inline-flex; gap: 7px; }

/* caption ảnh trong bài */
.hn-content .wp-caption { max-width: 100%; margin: 6px auto 18px; }
.hn-content .wp-caption img { margin: 0 auto 8px; }
.hn-content .wp-caption-text, .hn-content figcaption {
  text-align: center; font-size: 14px; color: #555; font-style: italic; font-weight: 700; }

/* mascot cột phải (trang chủ vi) — dính theo khi cuộn */
.hn-mascot { display: flex; justify-content: center; align-items: flex-start; padding-top: 46px;
  position: sticky; top: 30px; align-self: start; }
.hn-mascot img { width: 78%; max-width: 300px; }

/* sidebar dính theo khi cuộn (bài viết + trang chủ en/ja + danh mục) */
.hn-side { position: sticky; top: 24px; align-self: start; }
.hn-bottom-grid { display: grid; grid-template-columns: 2.05fr 1fr; gap: 40px; }
.hn-rows-left { max-width: none; margin: 0; }

/* archive — lưới 2 cột card + sidebar như bản gốc */
.hn-archive { margin-top: 30px; margin-bottom: 60px; }
.hn-archive-grid { display: grid; grid-template-columns: 1fr 340px; gap: 48px; }
.hn-archive-grid .hn-label { margin-top: 0; }
.hn-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 30px; }
.hn-cards .hn-thumb { aspect-ratio: 3/2; }
.hn-cards .hn-title { font-size: 17px; margin-top: 12px; }
.hn-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 38px; }
.hn-pagination .page-numbers { padding: 7px 14px; border: 1px solid var(--border); font-size: 14px; color: #555; }
.hn-pagination .current, .hn-pagination a:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* footer */
.hn-footer { background: #f7f7f7; border-top: 1px solid var(--border); margin-top: 60px; }
.hn-footer-inner { display: grid; grid-template-columns: 1.1fr 1.2fr 1.2fr; gap: 40px; padding: 44px 0; align-items: center; }
.hn-footer img { width: 290px; }
.hn-footer p { font-size: 14px; color: #555; margin: 6px 0; display: flex; gap: 9px; align-items: baseline; }
.hn-footer svg { width: 13px; height: 13px; fill: #777; flex: none; position: relative; top: 1px; }
.hn-copy { font-size: 13.5px; color: #777; margin-top: 10px; }
.hn-footer-bottom { border-top: 1px solid var(--border); padding: 14px 0; font-size: 13px; color: #888; text-align: center; }

/* language modal */
.hn-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 900; display: none; }
.hn-modal { position: fixed; z-index: 901; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 375px; max-width: calc(100vw - 30px); background: #fff; border-radius: 8px; padding: 28px 30px 26px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25); display: none; }
.hn-modal.show, .hn-modal-overlay.show { display: block; }
.hn-modal h3 { text-align: center; font-size: 22px; color: var(--dark); margin-bottom: 14px; }
.hn-modal .sub { text-align: center; font-size: 12.3px; color: #666; margin-bottom: 8px; line-height: 1.5; }
.hn-modal .langs { margin: 18px 0 20px; display: flex; flex-direction: column; gap: 12px; }
.hn-modal .langs button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; cursor: pointer;
  background: #fff; border: 1px solid #d0d0d0; border-radius: 6px; font-size: 14.5px; color: #333; font-family: inherit;
}
.hn-modal .langs button img { width: 22px; height: 15px; }
.hn-modal .langs button.sel { border: 2px solid var(--blue); background: #eef4fe; padding: 12px 15px; }
.hn-modal .confirm {
  display: block; width: 100%; padding: 13px; cursor: pointer; text-align: center;
  background: var(--blue); color: #fff; border: 0; border-radius: 4px;
  font-size: 13.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; font-family: inherit;
}
.hn-modal .confirm:hover { background: #1663c7; }

/* sections spacing */
.hn-section { margin-bottom: 10px; }
.hn-home-bottom { margin-top: 44px; }

/* responsive */
@media (max-width: 1023px) {
  .hn-nav { display: none; }
  .hn-hero, .hn-blocks { grid-template-columns: 1fr 1fr; }
  .hn-cols, .hn-single-grid, .hn-bottom-grid, .hn-archive-grid { grid-template-columns: 1fr; }
  .hn-mosaic { grid-template-columns: 1fr 1fr; }
  .hn-mosaic-big { grid-column: span 2; }
  .hn-mascot { display: none; }
}
@media (min-width: 1024px) {
  .hn-burger { display: none; }
}
@media (max-width: 640px) {
  .hn-hero, .hn-blocks, .hn-cards { grid-template-columns: 1fr; }
  .hn-row, .hn-sticky-card { grid-template-columns: 1fr; }
  .hn-mosaic { grid-template-columns: 1fr; }
  .hn-mosaic-big { grid-column: auto; }
  .hn-footer-inner { grid-template-columns: 1fr; text-align: left; }
  .hn-logo img { width: 165px; }
  .hn-lang > a { padding: 0 10px; }
}
