/* Quỹ Thành Nhân: site styles.
   Tokens follow the TN brand kit (thanh-nhan.css): jade accent, navy + cream shared with Hoa Mặt Trời. */

:root {
  --jade: #1A845C;
  --jade-deep: #0F5C3D;
  --jade-ink: #0B3D29;
  --jade-soft: #DCF0E5;
  --navy: #2A2A72;
  --navy-900: #1A1A4E;
  --cream: #FAF8D1;
  --ink: #1c2430;
  --ink-2: #3a4554;
  --muted: #5c6676;
  --hairline: #e4e8ef;
  --rule: #cfd6df;
  --paper: #FBFBF6;
  --white: #ffffff;

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
  --measure: 680px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 92px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.7 var(--body); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--jade-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--jade); }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: .4em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-weight: 500; color: var(--navy); margin: 0; line-height: 1.2; }
h1 { font-size: clamp(32px, 4.6vw, 48px); }
h2 { font-size: clamp(25px, 2.8vw, 32px); margin-bottom: 18px; }
h3 { font-size: 20px; margin-bottom: 8px; }
.lead { font-size: clamp(17px, 1.5vw, 19px); font-weight: 400; line-height: 1.65; color: var(--ink-2); max-width: var(--measure); }
.prose { max-width: var(--measure); }
.small { font-size: 14px; }
.muted { color: var(--muted); }


.draft-bar { background: var(--cream); color: var(--jade-ink); font-size: 13px; text-align: center; padding: 7px 16px; border-bottom: 1px solid #ecebc0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 1px solid var(--hairline); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand .mark { width: 42px; height: 42px; flex: none; }
.brand-name { display: block; font: 600 22px/1 var(--display); }
.brand-sub { display: block; font: 500 10px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--jade-deep); margin-top: 6px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--navy); }
.nav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--jade); font-weight: 500; }
.menu-btn { display: none; height: 44px; padding: 0 14px; border: 1px solid var(--rule); background: var(--white); color: var(--navy); font: 500 14px/1 var(--body); border-radius: 3px; cursor: pointer; }
@media (max-width: 900px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--white); border-bottom: 1px solid var(--hairline); padding: 4px var(--gutter) 12px; }
  .nav.open { display: flex; box-shadow: 0 8px 16px rgba(28,36,48,.06); }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 16px; }
  .nav a[aria-current="page"] { border-bottom-color: var(--hairline); color: var(--jade-deep); }
  .nav a:last-child { border-bottom: 0; }
}

/* Sections */
.section { padding: clamp(56px, 7vw, 88px) 0; }
.section + .section { border-top: 1px solid var(--hairline); }

/* Home hero */
.hero { background: var(--white); border-bottom: 1px solid var(--hairline); }
.hero-grid { padding-block: clamp(48px, 7vw, 88px) clamp(40px, 5vw, 64px); }
.hero-photo { padding-bottom: clamp(48px, 6vw, 72px); }
.hero-photo .ph { aspect-ratio: 16 / 7; }
.hero h1 { font-size: clamp(34px, 4.8vw, 52px); line-height: 1.1; margin-bottom: 22px; text-wrap: balance; }
.hero .lead { margin: 0; }
@media (max-width: 600px) { .hero-photo .ph { aspect-ratio: 3 / 2; } }

/* Two-column block: heading left, text right */
.row { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
.row > * { min-width: 0; }
@media (max-width: 860px) { .row { grid-template-columns: 1fr; } }

.charter-quote { margin: 0; padding-left: 20px; border-left: 3px solid var(--jade); font: 400 18px/1.75 var(--body); color: var(--ink); max-width: var(--measure); }
.source { display: block; margin-top: 12px; font-size: 14px; color: var(--muted); }


/* Image + text */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.split > * { min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gallery figure:first-child { grid-column: span 2; }
.gallery .ph { aspect-ratio: 1; }
.gallery figure:first-child .ph { aspect-ratio: 16 / 9; }

/* Image placeholder */
.ph { width: 100%; aspect-ratio: 3 / 2; background: #eef1f0; border: 1px dashed #b9c4bf; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ph strong { display: block; color: var(--ink-2); font-weight: 500; }



/* Inner page header */
.page-hero { background: var(--white); border-bottom: 1px solid var(--hairline); }
.page-hero .container { padding-top: clamp(44px, 6vw, 72px); padding-bottom: clamp(40px, 5vw, 60px); }
.page-hero h1 { margin-bottom: 14px; }
.page-hero .lead { margin: 0; }

/* Page with side contents */
.with-aside { display: grid; grid-template-columns: 210px 1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.with-aside > * { min-width: 0; }
.toc { position: sticky; top: 100px; font-size: 14px; }
.toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--hairline); }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--navy); }
.toc a.active { border-left-color: var(--jade); color: var(--jade-deep); }
.content > section { padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--hairline); }
.content > section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
@media (max-width: 900px) { .with-aside { grid-template-columns: 1fr; } .toc { display: none; } }

/* Key / value list */
.kv { display: grid; grid-template-columns: 230px 1fr; margin: 0; border-top: 1px solid var(--hairline); }
.kv dt, .kv dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.kv dt { color: var(--muted); font-size: 14px; padding-right: 16px; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .kv dt { border-bottom: 0; padding-bottom: 0; } .kv dd { padding-top: 2px; } }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--hairline); background: var(--white); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 500; font-size: 14px; color: var(--ink-2); background: #f3f5f4; padding: 12px 16px; border-bottom: 1px solid var(--hairline); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }

.pending { display: inline-block; font-size: 13px; color: #6d5f12; background: #FBF6D6; border: 1px dashed #E3D47A; padding: 0 7px; border-radius: 2px; white-space: nowrap; }

/* Documents */
.docs { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }
.docs li { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 0; margin: 0; border-bottom: 1px solid var(--hairline); }


.note { background: var(--white); border-left: 3px solid var(--jade); padding: 14px 18px; font-size: 15px; color: var(--ink-2); margin-top: 18px; }
.note p:last-child { margin: 0; }

.account { display: grid; grid-template-columns: 1fr 170px; gap: 28px; align-items: start; }
.account .ph { aspect-ratio: 1; }
@media (max-width: 600px) { .account { grid-template-columns: 1fr; } .account .ph { max-width: 170px; } }

/* Footer */
.site-footer { background: var(--navy-900); color: #b9b9d8; font-size: 14px; }
.footer-top { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 40px; padding: 56px 0 40px; }
.footer-h { font: 500 13px/1 var(--body); color: var(--white); margin: 4px 0 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #d4d4ec; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer .brand { color: var(--white); margin-bottom: 16px; }
.site-footer .brand-sub { color: #9fd9bd; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0; font-size: 13px; color: #8f8fb8; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

/* Mobile tables */
@media (max-width: 600px) {
  .table .nowrap { white-space: normal; }
  .table th, .table td { padding: 10px 12px; }
  .table td:first-child { min-width: 6em; }
  .scroll-hint { display: block; }
  .draft-more { display: none; }
}
.table .ref-line { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.row + .row { margin-top: 0; }
.home-rows .row { padding: clamp(40px, 5vw, 56px) 0; border-top: 1px solid var(--hairline); }
.home-rows .row:first-child { border-top: 0; }
.home-rows h2 a { color: inherit; text-decoration: none; }
.home-rows h2 a:hover { color: var(--jade-deep); text-decoration: underline; }
.partner-line { display: flex; gap: 18px; align-items: flex-start; }
.partner-line img { width: 52px; height: 52px; flex: none; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 24px; }
.split.top { align-items: start; }

figure { margin: 0; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.dated { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hairline); }
.dated li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; margin: 0; border-bottom: 1px solid var(--hairline); }
.dated time, .dated .d { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 15px; }
.faq dt { font-weight: 500; color: var(--navy); margin-top: 22px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 6px 0 0; color: var(--ink-2); max-width: var(--measure); }
.scroll-hint { display: none; font-size: 13px; color: var(--muted); margin-top: 6px; }
.footer-tag { font-family: var(--display); font-style: italic; color: #c9c9e4; margin-top: 12px; }
