/* Blog pages (/blog), drawn by functions/_lib/theme.js. Plain CSS on top of styles.css: the pages
   open with the site's own band-deep hero and use its buttons; everything else is here. */

:root {
    --hb-ink: #0f1d14;
    --hb-soft: #4f5b53;          /* secondary text: 6.9:1 on white, 6.4:1 on paper */
    --hb-green: #27563a;         /* forest-700: green text and focus on light grounds */
    --hb-leaf: #6ab04c;
    --hb-gold: #e8c15a;
    --hb-paper: #f5f7f2;
    --hb-paper-2: #e8ede3;
    --hb-on-dark: rgba(245, 247, 242, 0.85);
    --hb-card-shadow: 0 1px 2px rgba(10, 26, 16, 0.06), 0 8px 24px -12px rgba(10, 26, 16, 0.25);
}

.hb-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hb-sep { margin: 0 0.55em; opacity: 0.7; }

/* ---------- heroes ---------- */

.hb-hero-inner { padding-top: 4.5rem; padding-bottom: 4rem; }
@media (min-width: 640px) { .hb-hero-inner { padding-top: 5.5rem; padding-bottom: 5rem; } }
.hb-hero-meta { margin-top: 1.75rem; color: var(--hb-on-dark); font-size: 0.875rem; }
.hb-hero-meta a, .hb-crumb { color: var(--hb-gold); text-decoration: underline; text-decoration-color: rgba(232, 193, 90, 0.45); text-underline-offset: 0.25em; }
.hb-hero-meta a:hover, .hb-crumb:hover { text-decoration-color: currentColor; }
.hb-crumb { text-decoration: none; }
.hb-crumb:hover { text-decoration: underline; }

/* ---------- sections, cards ---------- */

.hb-section { padding-top: 4rem; padding-bottom: 5rem; }
@media (min-width: 640px) { .hb-section { padding-top: 5rem; padding-bottom: 6rem; } }

.hb-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .hb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .hb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; } }

.hb-card {
    position: relative; display: flex; flex-direction: column; overflow: hidden;
    border-radius: 1rem; background: #fff; box-shadow: var(--hb-card-shadow), 0 0 0 1px rgba(15, 29, 20, 0.05);
}
/* overflow keeps the frame at 3:2 in the card's column (otherwise a tall image sets the height) */
.hb-card-media { flex: none; aspect-ratio: 3 / 2; overflow: hidden; background: var(--hb-paper-2); }
.hb-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hb-card-body { display: flex; flex: 1; flex-direction: column; padding: 1.4rem 1.5rem 1.5rem; }
.hb-meta { margin: 0; color: var(--hb-soft); font-size: 0.8125rem; }
.hb-type { color: var(--hb-green); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.hb-card-title { margin: 0.6rem 0 0; color: var(--hb-ink); font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; }
.hb-card-link { color: inherit; text-decoration: none; }
/* The title's link covers the card; the ring goes round the whole card. */
.hb-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.hb-card-link:focus-visible { outline: none; box-shadow: none; --tw-ring-shadow: 0 0 #0000; }
.hb-card:has(.hb-card-link:focus-visible) { outline: 2px solid var(--hb-green); outline-offset: 3px; }
.hb-card:hover .hb-card-title { color: var(--hb-green); }
.hb-card-summary {
    margin: 0.65rem 0 0; color: var(--hb-soft); font-size: 0.9375rem; line-height: 1.6;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.hb-card-foot { margin: auto 0 0; padding-top: 1.1rem; color: var(--hb-soft); font-size: 0.8125rem; }
@media (prefers-reduced-motion: no-preference) {
    .hb-card { transition: box-shadow 0.2s ease, transform 0.2s ease; }
    .hb-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(10, 26, 16, 0.08), 0 18px 48px -20px rgba(10, 26, 16, 0.45), 0 0 0 1px rgba(15, 29, 20, 0.05); }
    .hb-card-title { transition: color 0.2s ease; }
}

/* The newest post on the first page runs the full width. */
.hb-card--featured { grid-column: 1 / -1; }
.hb-card--featured .hb-card-title { font-size: clamp(1.625rem, 3vw, 2.25rem); line-height: 1.15; }
.hb-card--featured .hb-card-summary { -webkit-line-clamp: 4; font-size: 1rem; }
@media (min-width: 768px) {
    .hb-card--featured:not(.hb-card--text) { flex-direction: row; }
    .hb-card--featured .hb-card-media { flex: 0 0 56%; aspect-ratio: auto; min-height: 22rem; }
    .hb-card--featured .hb-card-body { justify-content: center; padding: 2.25rem 2.5rem; }
    .hb-card--featured .hb-card-foot { margin-top: 0; }
}

.hb-more-link { margin: 2.75rem 0 0; text-align: center; font-weight: 600; }
.hb-more-link a, .hb-back a, .hb-pager a, .hb-search-result a { color: var(--hb-green); text-decoration: none; }
.hb-more-link a:hover, .hb-back a:hover, .hb-pager a:hover, .hb-search-result a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
.hb-more-link .fa-solid, .hb-back .fa-solid, .hb-pager .fa-solid { font-size: 0.8em; }
/* standalone links: a full-height target, not just the line of text */
.hb-more-link a, .hb-back a, .hb-pager a { display: inline-flex; align-items: center; gap: 0.4em; min-height: 2.75rem; }

.hb-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2.75rem; font-weight: 600; font-size: 0.9375rem; }
.hb-pager-count { color: var(--hb-soft); font-weight: 400; font-size: 0.875rem; }

.hb-empty {
    max-width: 36rem; margin: 0 auto; padding: 2.5rem 2rem; text-align: center;
    border: 1px dashed rgba(39, 86, 58, 0.3); border-radius: 1rem; background: rgba(232, 237, 227, 0.5);
}
.hb-empty-icon { color: var(--hb-green); font-size: 1.5rem; }
.hb-empty-title { margin: 1rem 0 0; font-size: 1.5rem; line-height: 1.3; }
.hb-empty-link { margin: 1.5rem 0 0; }
.hb-plain-message { margin: 2rem 0 0; color: var(--hb-soft); }
.hb-back { margin: 3rem 0 0; font-weight: 600; font-size: 0.9375rem; }

/* ---------- archive ---------- */

/* left-aligned with the hero's heading, a reading width wide */
.hb-archive > * { max-width: 56rem; }
.hb-filter ul { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hb-filter-link {
    display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0.35rem 1rem;
    border: 1px solid rgba(15, 29, 20, 0.2); border-radius: 999px; color: var(--hb-ink); font-size: 0.875rem; font-weight: 500; text-decoration: none;
}
.hb-filter-link:hover { border-color: var(--hb-green); color: var(--hb-green); }
.hb-filter-link[aria-current="page"] { border-color: var(--hb-green); background: var(--hb-green); color: #fff; }
.hb-filter-count { color: inherit; opacity: 0.75; font-variant-numeric: tabular-nums; }

.hb-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.hb-search { position: relative; flex: 1 1 18rem; max-width: 26rem; }
.hb-search-input {
    width: 100%; height: 2.875rem; padding: 0 3rem 0 1.1rem; border: 1px solid #7d8a81; border-radius: 999px;
    background: #fff; color: var(--hb-ink); font: inherit; font-size: 0.9375rem;
}
.hb-search-input::placeholder { color: var(--hb-soft); opacity: 1; }
.hb-search-input:focus-visible { outline: 2px solid var(--hb-green); outline-offset: 1px; box-shadow: none; }
.hb-search-btn {
    position: absolute; top: 0.2rem; right: 0.2rem; width: 2.475rem; height: 2.475rem; display: grid; place-items: center;
    border: 0; border-radius: 999px; background: var(--hb-green); color: #fff; cursor: pointer;
}
.hb-search-btn:focus-visible { outline: 2px solid var(--hb-green); outline-offset: 2px; box-shadow: none; }
.hb-order { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hb-paper-2); }
.hb-order a { min-height: 2.25rem; display: inline-flex; align-items: center; padding: 0 1rem; border-radius: 999px; color: var(--hb-ink); font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.hb-order a[aria-current] { background: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(10, 26, 16, 0.12); }
.hb-search-result { margin: 1.25rem 0 0; color: var(--hb-soft); font-size: 0.9375rem; }
.hb-search-result a { font-weight: 600; margin-left: 0.5rem; }

.hb-year { margin-top: 3rem; }
.hb-year-heading { margin: 0; padding-bottom: 0.75rem; border-bottom: 1px solid rgba(15, 29, 20, 0.15); font-size: 1.75rem; }
.hb-log { list-style: none; margin: 0; padding: 0; }
.hb-log-row {
    display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; align-items: baseline; gap: 0.25rem 1.25rem;
    padding: 1.1rem 0; border-bottom: 1px solid rgba(15, 29, 20, 0.1);
}
.hb-log-date { color: var(--hb-soft); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.hb-log-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.hb-log-link { color: var(--hb-ink); font-family: Fraunces, Georgia, serif; font-size: 1.1875rem; line-height: 1.3; text-decoration: none; }
.hb-log-link:hover { color: var(--hb-green); text-decoration: underline; text-underline-offset: 0.2em; }
.hb-log-summary { color: var(--hb-soft); font-size: 0.875rem; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.hb-log-type { color: var(--hb-green); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
@media (max-width: 639px) {
    .hb-log-row { grid-template-columns: minmax(0, 1fr) auto; }
    .hb-log-date { grid-column: 1 / -1; }
    .hb-log-summary { -webkit-line-clamp: 2; }
}

/* ---------- a post ---------- */

.hb-preview-banner { margin: 0; padding: 0.65rem 1.25rem; background: var(--hb-gold); color: var(--hb-ink); font-size: 0.875rem; font-weight: 600; text-align: center; }

.hb-post-head { padding-top: 4rem; padding-bottom: 3.5rem; }
@media (min-width: 640px) { .hb-post-head { padding-top: 5rem; padding-bottom: 4.5rem; } }
.hb-post.has-cover .hb-post-head { padding-bottom: 7rem; }
@media (min-width: 640px) { .hb-post.has-cover .hb-post-head { padding-bottom: 9rem; } }
.hb-crumbs { margin: 0; }
.hb-post-title { max-width: 48rem; margin: 1.25rem 0 0; font-size: clamp(2.25rem, 5.5vw, 3.75rem); line-height: 1.08; letter-spacing: -0.02em; }
.hb-byline { margin: 1.5rem 0 0; color: var(--hb-on-dark); font-size: 0.9375rem; }

.hb-cover { position: relative; max-width: 66rem; margin: -5rem auto 0; }
@media (min-width: 640px) { .hb-cover { margin-top: -6.5rem; } }
.hb-cover img {
    display: block; width: 100%; height: auto; max-height: 38rem; object-fit: cover; border-radius: 1rem;
    box-shadow: 0 2px 4px rgba(10, 26, 16, 0.08), 0 18px 48px -20px rgba(10, 26, 16, 0.45);
}

.hb-body { max-width: 42.5rem; margin: 3.5rem auto 0; padding: 0 1.25rem; color: var(--hb-ink); font-size: 1.125rem; line-height: 1.75; }
@media (min-width: 640px) { .hb-body { padding: 0 2rem; } }
.hb-body > * { margin: 0; }
.hb-body > * + * { margin-top: 1.25em; }
.hb-body h2 { margin-top: 2.1em; font-size: 1.75rem; line-height: 1.25; }
.hb-body h3 { margin-top: 1.9em; font-size: 1.375rem; line-height: 1.3; }
.hb-body h4 { margin-top: 1.7em; font-size: 1.125rem; font-family: inherit; font-weight: 700; }
.hb-body h2 + *, .hb-body h3 + *, .hb-body h4 + * { margin-top: 0.6em; }
.hb-body a { color: var(--hb-green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.hb-body a:hover { text-decoration-thickness: 2px; }
.hb-body strong { font-weight: 650; }
.hb-body ul, .hb-body ol { padding-left: 1.4em; }
.hb-body li + li { margin-top: 0.45em; }
.hb-body li::marker { color: var(--hb-green); }
.hb-body blockquote { padding: 0.2em 0 0.2em 1.4rem; border-left: 3px solid var(--hb-leaf); color: #1b3d28; font-family: Fraunces, Georgia, serif; font-size: 1.3125rem; line-height: 1.55; }
.hb-body blockquote p + p { margin-top: 0.8em; }
.hb-body hr { width: 4rem; height: 1px; margin: 2.75em auto; border: 0; background: var(--hb-gold); }
.hb-body figure { margin-top: 2em; margin-bottom: 2em; }
.hb-body figure + * { margin-top: 0; }
.hb-body img { display: block; width: 100%; height: auto; border-radius: 0.75rem; }
.hb-body figcaption { margin-top: 0.65rem; color: var(--hb-soft); font-size: 0.875rem; text-align: center; }
.hb-body code { padding: 0.1em 0.35em; border-radius: 0.3em; background: var(--hb-paper-2); font-size: 0.9em; }

.hb-author { max-width: 46rem; margin: 4rem auto 0; }
.hb-author-card {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.25rem 1.5rem; padding: 1.75rem;
    border-radius: 1rem; background: #fff; box-shadow: var(--hb-card-shadow), 0 0 0 1px rgba(15, 29, 20, 0.05);
}
.hb-author-card > div { flex: 1 1 18rem; }
.hb-author-photo { width: 5.5rem; height: 5.5rem; flex: none; border-radius: 999px; object-fit: cover; box-shadow: 0 0 0 2px rgba(232, 193, 90, 0.6); }
.hb-author-name { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.375rem; line-height: 1.3; }
.hb-author-line { margin: 0.4rem 0 0; color: var(--hb-soft); font-size: 0.9375rem; line-height: 1.6; }
.hb-author-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.1rem 0 0; }

.hb-more { margin-top: 5rem; padding: 4.5rem 0 5rem; border-top: 1px solid rgba(15, 29, 20, 0.1); background: rgba(232, 237, 227, 0.6); }
@media (min-width: 640px) { .hb-more { padding: 5.5rem 0 6rem; } }
.hb-more-eyebrow { margin: 0; color: var(--hb-green); }
.hb-more-heading { margin: 1rem 0 2.25rem; font-size: clamp(1.875rem, 3.5vw, 2.25rem); line-height: 1.2; }
.hb-grid--three { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .hb-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
.hb-post:not(:has(+ .hb-more)) { padding-bottom: 5rem; }
