/* Thư viện cà phê VINACANOFI — /thu-vien/ (dùng chung biến màu, font của style.css) */
.lib { background: #fff; }
.lib h2 { text-align: start; letter-spacing: normal; }  /* style.css căn giữa mọi h2 cho trang chủ */
.lib .header-inner { gap: 10px 16px; }
.lib-header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lib-nav-link { font-weight: 600; color: var(--green-dark); text-decoration: none; font-size: 15px; }
.lib-nav-link:hover { text-decoration: underline; }
.lib .lang-switch a.lang-btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.lib-draft-banner { background: #FFF4D6; color: #7A4D00; text-align: center; font-weight: 600; font-size: 14px; padding: 8px 16px; border-bottom: 1px solid #F0D48A; }

.lib-narrow { max-width: 760px; }
.lib-breadcrumb { font-size: 13px; color: var(--ink-mute); display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 18px; }
.lib-breadcrumb a { color: var(--ink-mute); text-decoration: none; }
.lib-breadcrumb a:hover { color: var(--green-dark); text-decoration: underline; }
.lib-eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin: 0 0 8px; }
.lib-title { font-family: var(--font-head); font-size: clamp(30px, 5vw, 44px); line-height: 1.15; color: var(--green-ink); margin: 0 0 14px; text-wrap: balance; }
.lib-lead { font-size: 19px; color: var(--ink-soft); margin: 0 0 16px; }
.lib-intro { color: var(--ink-soft); margin: 0 0 22px; }
.lib-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 26px; }
.lib-chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--tint-1); color: var(--ink-soft); border: 1px solid var(--line); }
.lib-chip-a { background: #FBF3E2; color: #7A5418; border-color: #EBD7AE; }
.lib-chip-b { background: var(--tint-4); color: var(--green-dark); border-color: var(--tint-5); }
.lib-chip-c { background: #EEF0F7; color: #3A4470; border-color: #D9DDEC; }
.lib-chip-date { background: transparent; }

.lib-hero { margin: 0 auto 34px; padding: 0 24px; }
.lib-hero img { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; border-radius: var(--radius); display: block; box-shadow: var(--shadow-md); }

.lib-keypoints { background: var(--tint-1); border: 1px solid var(--line); border-inline-start: 4px solid var(--green); border-radius: var(--radius-sm); padding: 18px 22px; margin: 0 0 26px; }
.lib-keypoints h2 { font-family: var(--font-body); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--green-dark); margin: 0 0 8px; }
.lib-keypoints ul { margin: 0; padding-inline-start: 20px; }
.lib-keypoints li { margin: 4px 0; }
.lib-toc { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 20px; margin: 0 0 30px; }
.lib-toc-title { font-weight: 600; margin: 0 0 6px; font-size: 14px; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .06em; }
.lib-toc ol { margin: 0; padding-inline-start: 20px; }
.lib-toc a { color: var(--green-dark); text-decoration: none; }
.lib-toc a:hover { text-decoration: underline; }

.lib-body { font-size: 17px; line-height: 1.75; color: var(--ink); }
.lib-body h2 { font-family: var(--font-head); font-size: 27px; line-height: 1.25; color: var(--green-ink); margin: 42px 0 14px; scroll-margin-top: 90px; }
.lib-body h3 { font-size: 19px; margin: 28px 0 10px; }
.lib-body p { margin: 0 0 16px; }
.lib-body ul, .lib-body ol { padding-inline-start: 24px; margin: 0 0 18px; }
.lib-body li { margin: 6px 0; }
.lib-body a { color: var(--green-dark); }
.lib-body .lib-xref { color: var(--ink); font-weight: 500; }
.lib-table-wrap { overflow-x: auto; margin: 0 0 22px; -webkit-overflow-scrolling: touch; }
.lib-body table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.lib-body th, .lib-body td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: start; vertical-align: top; }
.lib-body thead th { background: var(--tint-2); color: var(--green-ink); font-weight: 600; }
.lib-figure { margin: 26px 0; }
.lib-figure img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }
.lib-figure figcaption { font-size: 14px; color: var(--ink-mute); margin-top: 8px; }
.lib-brand { background: #FBF6EA; border: 1px solid #EBD7AE; border-radius: var(--radius-sm); padding: 18px 22px; margin: 26px 0; }
.lib-brand-label { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7A5418; margin-bottom: 8px; }
.lib-brand p { margin: 0 0 10px; font-size: 16px; }
.lib-brand p:last-child { margin-bottom: 0; }
.lib-brand ul { margin: 0 0 10px; }

.lib-faq { margin: 44px 0 0; }
.lib-faq h2, .lib-products h2, .lib-related h2 { font-family: var(--font-head); font-size: 24px; color: var(--green-ink); margin: 0 0 14px; }
.lib-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.lib-faq summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.lib-faq details p { margin: 10px 0 0; color: var(--ink-soft); }

.lib-products { margin: 46px 0 0; }
.lib-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.lib-product { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); background: #fff; transition: box-shadow .2s, transform .2s; }
.lib-product:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.lib-product img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.lib-product-name { font-weight: 600; }
.lib-product-cta { font-size: 14px; color: var(--green-dark); }

.lib-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 46px 0 0; }
.lib-pn { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.lib-pn span { font-size: 13px; color: var(--ink-mute); font-weight: 500; }
.lib-pn-next { text-align: end; grid-column: 2; }
.lib-pn:hover { border-color: var(--green); }
.lib-related { margin: 36px 0 0; }
.lib-related ul { padding-inline-start: 20px; }
.lib-related a { color: var(--green-dark); }
.lib-back { margin: 34px 0 60px; }
.lib-back a { color: var(--green-dark); font-weight: 600; text-decoration: none; }

/* Trang mục lục */
.lib-index-hero { background: var(--tint-1); border-bottom: 1px solid var(--line); padding: 1px 0 34px; }  /* 1px chặn margin breadcrumb tràn ra ngoài nền */
.lib-search input { width: 100%; font: inherit; font-size: 17px; padding: 14px 18px; border: 1px solid var(--tint-3); border-radius: 999px; background: #fff; }
.lib-search input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.lib-results { display: grid; gap: 10px; margin-top: 16px; }
.lib-result { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; text-decoration: none; color: var(--ink); }
.lib-result span:last-child { color: var(--ink-soft); font-size: 15px; }
.lib-result:hover { border-color: var(--green); }
.lib-no-results { margin-top: 14px; color: var(--ink-mute); }
.lib-clusters { padding-top: 26px; padding-bottom: 60px; }
.lib-cluster { padding: 26px 0; border-bottom: 1px solid var(--line); }
.lib-cluster:last-child { border-bottom: none; }
.lib-cluster-title { font-family: var(--font-head); font-size: 26px; color: var(--green-ink); margin: 0 0 18px; display: flex; align-items: baseline; gap: 12px; }
.lib-cluster-num { font-family: var(--font-body); font-size: 13px; font-weight: 700; color: var(--gold); border: 1px solid #EBD7AE; border-radius: 999px; padding: 2px 10px; }
.lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; margin-bottom: 14px; }
.lib-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); background: #fff; transition: box-shadow .2s, transform .2s; }
.lib-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.lib-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.lib-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.lib-card-order { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .06em; margin-inline-end: 8px; }
.lib-card-title { font-family: var(--font-head); font-size: 20px; line-height: 1.3; color: var(--green-ink); }
.lib-card-desc { font-size: 15px; color: var(--ink-soft); }
.lib-upcoming { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 6px 18px; }
.lib-upcoming li { color: var(--ink-mute); font-size: 15px; padding: 6px 0; }
.lib-upcoming em { font-style: normal; font-size: 13px; }

.lib-footer { border-top: 1px solid var(--line); background: var(--tint-1); padding: 30px 0; }
.lib-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.lib-footer-logo { height: 46px; width: auto; }
.lib-footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.lib-footer-links a { color: var(--ink-soft); text-decoration: none; font-size: 15px; }
.lib-footer-links a:hover { color: var(--green-dark); }
.lib-footer-copy { width: 100%; margin: 0; font-size: 13px; color: var(--ink-mute); }

@media (max-width: 640px) {
  .lib .header-inner { padding: 10px 16px; }
  .lib-header-right { width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 12px; }
  .lib .lang-switch { width: auto; flex: 0 1 200px; }
  .lib-nav-link { white-space: nowrap; }
  .lib-hero { padding: 0 16px; }
  .lib-hero img { aspect-ratio: 4 / 3; }
  .lib-lead { font-size: 17px; }
  .lib-body { font-size: 16px; }
  .lib-body h2 { font-size: 23px; }
  .lib-prevnext { grid-template-columns: 1fr; }
  .lib-pn-next { grid-column: auto; }
  .lib-cards { grid-template-columns: 1fr; }
}
