/* ==========================================================================
   HIV PEP Bangkok: blog (index, archives, search, articles). Loaded after main.css.
   ========================================================================== */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .84rem; font-weight: 600; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* Listing header */
.blog-hero { position: relative; padding: clamp(40px, 5vw, 72px) 0 clamp(28px, 3vw, 40px); background: radial-gradient(60% 90% at 90% 0%, rgba(31, 122, 109, .11), transparent 70%), linear-gradient(180deg, #f7f3ec, var(--bg)); border-bottom: 1px solid var(--line-c); }
.blog-hero__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.blog-hero__title { font-family: var(--display); font-weight: 500; font-size: clamp(2.3rem, 1.5rem + 2.8vw, 3.8rem); letter-spacing: -.015em; line-height: 1.05; margin-bottom: 14px; }
.blog-hero__intro { font-size: 1.1rem; color: var(--ink-2); max-width: 36em; margin: 0; }
.blog-search { position: relative; flex: 0 1 340px; }
.blog-search .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.blog-search input { width: 100%; font: 500 .98rem var(--font); color: var(--ink); padding: 14px 18px 14px 46px; border: 1px solid var(--line-c); border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(13, 43, 46, .05); transition: border-color .15s, box-shadow .15s; }
.blog-search input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(31, 122, 109, .14); }
.chips { display: flex; gap: 8px; margin-top: 30px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-c); background: var(--surface); color: var(--ink-2); font-size: .88rem; font-weight: 700; text-decoration: none; transition: border-color .15s, background .15s, color .15s; }
.chip span { font-size: .75rem; color: var(--muted); font-weight: 700; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-active span { color: #8fd3c3; }

/* Cards */
.blog-list { padding-top: clamp(40px, 5vw, 64px); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.post-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-c); border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.post-card:focus-within { box-shadow: 0 0 0 3px var(--amber); }
.post-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--teal-soft), var(--primary-soft)); }
.post-media__img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post-card:hover .post-media__img { transform: scale(1.03); }
.post-media__ph { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .7), transparent 55%), linear-gradient(135deg, var(--teal-soft), #f6e3dc); }
.post-media__ph .icon { width: 56px; height: 56px; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .85); color: var(--teal); box-shadow: var(--shadow); }
.post-grid .post-card:nth-child(3n+2) .post-media__ph { background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .7), transparent 55%), linear-gradient(135deg, #fde9e5, #fcf0dc); }
.post-grid .post-card:nth-child(3n+2) .post-media__ph .icon { color: var(--primary); }
.post-grid .post-card:nth-child(3n) .post-media__ph { background: radial-gradient(circle at 40% 70%, rgba(255, 255, 255, .7), transparent 55%), linear-gradient(135deg, #e2ecf3, var(--teal-soft)); }
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 12px; }
.post-meta .icon { width: 15px; height: 15px; margin-right: 4px; vertical-align: -3px; }
.post-cat { position: relative; z-index: 2; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: #145a50; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; }
.post-cat:hover { background: var(--teal); color: #fff; }
.post-card__title { font-size: 1.18rem; line-height: 1.3; margin: 0 0 10px; text-wrap: balance; }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is clickable */
.post-card__title--lg { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 1.2rem + 1.4vw, 2.4rem); letter-spacing: -.01em; line-height: 1.12; }
.post-card__excerpt { color: var(--muted); font-size: .95rem; margin: 0 0 18px; flex: 1; }
.post-card__more { margin-top: auto; font-size: .9rem; }
.post-card--featured { display: grid; grid-template-columns: 1.15fr 1fr; margin-bottom: clamp(24px, 3vw, 40px); }
.post-card--featured .post-media { aspect-ratio: auto; min-height: 340px; }
.post-card--featured .post-card__body { justify-content: center; padding: clamp(28px, 4vw, 56px); }
.post-card--featured .post-card__excerpt { font-size: 1.05rem; flex: 0; }
.post-card--featured .post-media__ph .icon { width: 84px; height: 84px; padding: 20px; border-radius: 24px; }

/* Pagination */
.pagination { margin-top: clamp(36px, 4vw, 56px); }
.pagination .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-c); background: var(--surface); color: var(--ink); font-weight: 700; font-size: .92rem; text-decoration: none; }
.pagination .page-numbers:hover { border-color: var(--ink); }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .page-numbers.dots { border: 0; background: none; }

.blog-empty { max-width: 560px; margin: 0 auto; padding: 48px 32px; text-align: center; }
.blog-empty > .icon { width: 56px; height: 56px; padding: 14px; border-radius: 16px; background: var(--teal-soft); color: var(--teal); margin-bottom: 16px; }
.blog-empty h2 { font-family: var(--display); font-weight: 500; font-size: 1.7rem; }
.blog-empty p { color: var(--muted); }

/* CTA band */
.cta-band { padding: 0 0 clamp(64px, 7vw, 104px); }
.cta-band__card { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: clamp(32px, 4vw, 56px); border-radius: 28px; background: radial-gradient(70% 120% at 100% 0%, rgba(217, 65, 47, .35), transparent 60%), var(--ink); color: #d7e5e1; }
.cta-band__title { font-family: var(--display); font-weight: 500; font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.4rem); color: #fff; max-width: 20em; text-wrap: balance; }
.cta-band__card p:last-child { margin: 0; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; flex: none; }

/* Article */
.article-hero { padding: clamp(40px, 5vw, 72px) 0 0; background: linear-gradient(180deg, #f7f3ec, var(--bg)); }
.article-hero__inner { max-width: calc(820px + 2 * var(--gutter)); margin-left: max(0px, calc((100% - var(--container)) / 2)); }
.article-hero__title { font-family: var(--display); font-weight: 500; font-size: clamp(2.2rem, 1.4rem + 3vw, 3.7rem); letter-spacing: -.015em; line-height: 1.06; text-wrap: balance; margin-bottom: 18px; }
.article-hero__lede { font-size: clamp(1.1rem, 1rem + .3vw, 1.25rem); color: var(--ink-2); line-height: 1.55; margin-bottom: 22px; }
.post-meta--lg { font-size: .88rem; padding-bottom: clamp(28px, 3vw, 40px); margin: 0; }
.article-hero__media { margin: 0; aspect-ratio: 21 / 9; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); }
.article-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(40px, 5vw, 88px); align-items: start; padding-top: clamp(36px, 4vw, 56px); padding-bottom: clamp(56px, 6vw, 88px); }
.article-layout--single { grid-template-columns: minmax(0, 820px); }
.article-main { max-width: 760px; min-width: 0; }
.article-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }

.toc { padding: 20px 24px; margin-bottom: 36px; box-shadow: none; border: 1px solid var(--line-c); }
.toc__h { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.toc a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.toc a:hover { color: var(--teal); text-decoration: underline; }

.prose { font-size: 1.08rem; line-height: 1.75; color: var(--ink-2); }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-family: var(--display); font-weight: 500; font-size: clamp(1.6rem, 1.3rem + 1vw, 2.05rem); letter-spacing: -.01em; color: var(--ink); margin: 1.9em 0 .5em; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h3 { font-size: 1.22rem; color: var(--ink); margin: 1.6em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--teal); font-weight: 700; }
.prose strong { color: var(--ink); }
.prose a { color: var(--teal); font-weight: 600; }
.prose blockquote { margin: 1.6em 0; padding: 18px 24px; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 14px 14px 0; color: var(--ink); font-size: 1.1rem; }
.prose blockquote p { margin: 0; }
.prose img, .prose figure { border-radius: 16px; }
.prose figure { margin: 1.8em 0; }
.prose figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .96rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line-c); text-align: left; }
.prose th { background: var(--tint); color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line-c); margin: 2.4em 0; }

.disclaimer-box { display: flex; gap: 14px; align-items: flex-start; margin-top: 44px; padding: 18px 20px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line-c); font-size: .9rem; color: var(--ink-2); }
.disclaimer-box .icon { flex: none; color: var(--teal); margin-top: 2px; }
.disclaimer-box p { margin: 0; }
.tag-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-c); font-size: .84rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.tag-list a:hover { border-color: var(--ink); }

.aside-cta { padding: 26px 24px; display: grid; gap: 12px; border-top: 4px solid var(--primary); }
.aside-cta__icon { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--primary-soft); color: var(--primary); }
.aside-cta .aside-cta__title { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; color: var(--ink); margin: 0; }
.aside-cta p { margin: 0; font-size: .92rem; color: var(--muted); }
.share__h { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.share__row { display: flex; flex-wrap: wrap; gap: 8px; }
.share__btn { font: 700 .82rem var(--font); padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-c); background: var(--surface); color: var(--ink-2); text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s; }
.share__btn:hover { border-color: var(--ink); color: var(--ink); }
.share__btn.is-done { background: var(--teal); border-color: var(--teal); color: #fff; }

.related { background: var(--tint); }
.related__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 32px; }
.related__head .h2 { margin: 0; }
.related + .cta-band { background: var(--tint); }
.not-found .hero__ctas { margin-top: 28px; justify-content: center; }

@media (max-width: 1040px) {
	.post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.article-layout { grid-template-columns: minmax(0, 1fr); }
	.article-main { max-width: none; }
	.article-aside { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
	.cta-band__card { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 760px) {
	.blog-hero__row { flex-direction: column; align-items: stretch; }
	.blog-search { flex-basis: auto; }
	.post-card--featured { grid-template-columns: 1fr; }
	.post-card--featured .post-media { min-height: 0; aspect-ratio: 16 / 10; }
	.article-aside { grid-template-columns: 1fr; }
	.article-hero__media { aspect-ratio: 16 / 10; border-radius: 18px; }
}
@media (max-width: 600px) {
	.post-grid { grid-template-columns: 1fr; }
	.chips { margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
	.cta-band__actions, .cta-band__actions .btn { width: 100%; }
	.prose { font-size: 1.02rem; }
	.related__head { flex-direction: column; }
}
