/* ==========================================================================
   Editorial content: articles, tables, post header, archives, search, 404.
   ========================================================================== */

/* 1. ARTICLE LAYOUT -------------------------------------------------------------- */
.bhf-article { background: var(--bhf-paper); padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 5.5rem); }
.bhf-article__grid { display: grid; gap: 1.5rem; }
.bhf-toc { align-self: start; }
.bhf-toc__box { padding: 1.1rem 1.2rem; border-radius: var(--bhf-r); background: var(--bhf-white); border: 1px solid var(--bhf-line); }
.bhf-toc summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--bhf-emerald); }
.bhf-toc summary::-webkit-details-marker { display: none; }
.bhf-toc summary::after { content: "+"; font-size: 1.3rem; font-weight: 500; line-height: 1; }
.bhf-toc[open] summary::after { content: "–"; }
.bhf-toc__list { list-style: none; display: grid; gap: .1rem; margin-top: .9rem; counter-reset: toc; }
.bhf-toc__list li { counter-increment: toc; }
.bhf-toc__list a { display: flex; gap: .7rem; padding: .5rem .2rem; font-size: .92rem; font-weight: 600; line-height: 1.4; color: var(--bhf-text-soft); border-bottom: 1px solid var(--bhf-line); transition: color .2s; }
.bhf-toc__list a::before { content: counter(toc, decimal-leading-zero); flex: none; font-family: var(--bhf-serif); font-style: italic; color: var(--bhf-gold-d); }
.bhf-toc__list a:hover, .bhf-toc__list a.is-active { color: var(--bhf-emerald); }
@media (min-width: 1000px) {
    .bhf-article__grid { grid-template-columns: 300px minmax(0, 1fr); gap: clamp(2.5rem, 5vw, 4.5rem); }
    .bhf-toc { position: sticky; top: calc(var(--bhf-top) + 1.5rem); }
    .bhf-toc summary { pointer-events: none; }
    .bhf-toc summary::after { display: none; }
}
.bhf-article--solo .bhf-article__grid { grid-template-columns: minmax(0, 1fr); }

/* 2. PROSE ------------------------------------------------------------------------- */
.bhf-prose { max-width: 46rem; color: var(--bhf-text); font-size: 1.06rem; }
.bhf-article--solo .bhf-prose { margin-inline: auto; }
.bhf-prose > * + * { margin-top: 1.15em; }
.bhf-prose h2 { margin-top: 2.4em; font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.15rem); scroll-margin-top: calc(var(--bhf-top) + 1rem); }
.bhf-prose h2:first-child { margin-top: 0; }
.bhf-prose h3 { margin-top: 1.9em; font-size: clamp(1.25rem, 1.1rem + .5vw, 1.5rem); }
.bhf-prose h4 { margin-top: 1.6em; font-size: 1.15rem; }
.bhf-prose > * { margin-bottom: 0; }
.bhf-prose a { color: var(--bhf-emerald); font-weight: 700; text-decoration: underline; text-decoration-color: var(--bhf-gold); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color .2s; }
.bhf-prose a:hover { color: var(--bhf-ink); }
.bhf-prose ul, .bhf-prose ol { display: grid; gap: .55rem; padding-left: 1.4rem; }
.bhf-prose ul { list-style: none; padding-left: 0; }
.bhf-prose ul li { position: relative; padding-left: 1.5rem; }
.bhf-prose ul li::before { content: ""; position: absolute; left: .1rem; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--bhf-gold); }
.bhf-prose ol li::marker { font-weight: 800; color: var(--bhf-emerald); }
.bhf-prose blockquote { margin-inline: 0; padding: 1.1rem 1.3rem; border-left: 4px solid var(--bhf-gold); border-radius: 0 var(--bhf-r) var(--bhf-r) 0; background: var(--bhf-emerald-soft); font-family: var(--bhf-serif); font-size: 1.15rem; }
.bhf-prose blockquote p + p { margin-top: .7em; }
.bhf-prose img { border-radius: var(--bhf-r); }
.bhf-prose figure figcaption { margin-top: .5rem; font-size: .85rem; color: var(--bhf-muted); }
.bhf-prose hr { border: 0; height: 1px; background: var(--bhf-line); margin-block: 2.2em; }
.bhf-prose strong { color: var(--bhf-ink); }
.bhf-prose iframe, .bhf-prose video { max-width: 100%; border-radius: var(--bhf-r); }

/* Tables: scroll on tablets, stacked cards on phones */
.bhf-table-wrap { overflow-x: auto; border: 1px solid var(--bhf-line); border-radius: var(--bhf-r); background: var(--bhf-white); }
.bhf-table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.bhf-table th { padding: .8rem 1rem; text-align: left; font-size: .74rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--bhf-emerald-d); background: var(--bhf-emerald-soft); white-space: nowrap; }
.bhf-table td { padding: .85rem 1rem; border-top: 1px solid var(--bhf-line); vertical-align: top; }
.bhf-table tbody tr:first-child td, .bhf-table tr:first-child td { border-top: 0; }
.bhf-table tr:nth-child(even) td { background: rgba(247, 243, 234, .55); }
@media (max-width: 639px) {
    .bhf-table-wrap { border: 0; background: transparent; overflow: visible; }
    .bhf-table, .bhf-table tbody, .bhf-table tr, .bhf-table td { display: block; width: 100%; }
    .bhf-table tr:first-child:has(th) { display: none; }
    .bhf-table thead { display: none; }
    .bhf-table tr { margin-bottom: .8rem; border: 1px solid var(--bhf-line); border-radius: var(--bhf-r); background: var(--bhf-white); overflow: hidden; }
    .bhf-table tr:nth-child(even) td { background: transparent; }
    .bhf-table td { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .75rem; padding: .7rem .95rem; border-top: 1px solid var(--bhf-line); }
    .bhf-table tr td:first-child { border-top: 0; font-weight: 800; background: var(--bhf-emerald-soft); }
    .bhf-table td::before { content: attr(data-label); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--bhf-muted); padding-top: .2em; }
    .bhf-table tr td:first-child::before { color: var(--bhf-emerald-d); }
}

/* 3. POST HEADER ---------------------------------------------------------------------- */
.bhf-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; margin-top: 1.25rem; font-size: .88rem; font-weight: 600; color: rgba(255, 255, 255, .78); }
.bhf-post-meta span { display: inline-flex; align-items: center; gap: .4rem; }
.bhf-post-meta .ti { color: var(--bhf-gold-l); font-size: 1.1rem; }
.bhf-post-cover { margin-bottom: 2rem; }
.bhf-post-cover img { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--bhf-r-lg); }

/* 4. ARCHIVE / SEARCH / 404 ------------------------------------------------------------ */
.bhf-listing { background: var(--bhf-paper); padding-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem); }
.bhf-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .bhf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .bhf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
.bhf-empty { padding: 3rem 1rem; text-align: center; color: var(--bhf-text-soft); }

.bhf-pagination { margin-top: 2.5rem; }
.bhf-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.bhf-pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .9rem; border-radius: 999px; border: 1.5px solid var(--bhf-line-2); font-weight: 800; font-size: .92rem; transition: background .2s, color .2s, border-color .2s; }
.bhf-pagination a.page-numbers:hover { background: var(--bhf-ink); border-color: var(--bhf-ink); color: #fff; }
.bhf-pagination .page-numbers.current { background: var(--bhf-emerald); border-color: var(--bhf-emerald); color: #fff; }
.bhf-pagination .page-numbers.dots { border-color: transparent; }

.bhf-search { display: flex; gap: .5rem; max-width: 34rem; margin: 1.25rem 0 0; }
.bhf-search__input { flex: 1; min-width: 0; min-height: 50px; padding: 0 1.2rem; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); color: #fff; }
.bhf-search__input::placeholder { color: rgba(255, 255, 255, .65); }
.bhf-search__input:focus { outline: 2px solid var(--bhf-gold-l); outline-offset: 2px; }

.bhf-notfound { background: var(--bhf-paper); padding-block: clamp(3rem, 8vw, 6rem); text-align: center; }
.bhf-notfound__code { font-family: var(--bhf-serif); font-style: italic; font-size: clamp(5rem, 4rem + 8vw, 9rem); line-height: 1; color: var(--bhf-gold); }
.bhf-notfound .bhf-lead { max-width: 34rem; margin-inline: auto; }
.bhf-notfound__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.75rem; }

/* 5. CONTENT ADDED BY OTHER PLUGINS INSIDE ARTICLES ----------------------------------------- */
.bhf-prose [style*="background"] { border-radius: var(--bhf-r); }
.bhf-prose .juara-cta, .bhf-prose [class*="cta"] { max-width: 100%; }
