/* Blog templates (home.php, single-post.php, single-author_profile.php).
   Also supplies the contact sidebar on service pages. Text colors are picked for >= 4.5:1 on white: the brand
   red (#F35355, 3.4:1) is kept for decoration and buttons (same as the rest
   of the site), --primary_aa carries text and links. */

.hb-blog-wrap a:focus-visible,
.hb-blog-wrap button:focus-visible,
.hb-blog-wrap summary:focus-visible,
.hb-blog-wrap input:focus-visible,
.hb-blog-wrap select:focus-visible,
.hb-blog-wrap textarea:focus-visible,
.hb-blog-sidebar :is(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--primary_aa);
    outline-offset: 2px;
    border-radius: var(--radius_sm);
}

.hb-blog-wrap .hb-blog-breadcrumbs a:hover { color: var(--primary_aa); }
.hb-blog-wrap .hb-blog-breadcrumbs .hb-breadcrumbs__sep { color: var(--text_muted); }

/* The WebP plugin wraps every <img> in <picture>, so the wrapper — not the
   image — is the flex item here. Left shrinkable it squeezes to less than the
   avatar's width, and the image follows it via max-width:100%, which turns
   every round avatar into an oval. */
.hb-post__meta > picture,
.hb-card__meta > picture,
.hb-author-box > picture,
.hb-author-hero > picture {
    flex: none;
    align-self: flex-start;
}

/* Cards */
.hb-card__body { padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.hb-card__category {
    margin: 0;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary_aa);
}
.hb-card__title { margin: 0; font-size: 1.2rem; }
.hb-card__title a { color: var(--accent); text-decoration: none; }
.hb-card__title a:hover { color: var(--primary_aa); }
.hb-card__excerpt { margin: 0; font-size: .95rem; line-height: 1.6; }
.hb-card__meta {
    margin: 4px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: var(--text_muted);
}
.hb-card__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.hb-card__media img { transition: transform .4s ease; }
.hb-card:hover .hb-card__media img { transform: scale(1.03); }

/* Pagination */
.hb-pagination { margin-top: 48px; }
.hb-pagination ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.hb-pagination a,
.hb-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius_sm);
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}
.hb-pagination a:hover { border-color: var(--primary_aa); color: var(--primary_aa); }
.hb-pagination .current { background: var(--dark); border-color: var(--dark); color: #fff; }

/* TOC */
.hb-toc {
    margin: 0 0 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background_light);
}
.hb-toc summary {
    padding: 14px 20px;
    font-weight: 800;
    color: var(--accent);
    cursor: pointer;
}
.hb-toc ol { list-style: none; margin: 0; padding: 0 20px 18px; display: grid; gap: 8px; }
.hb-toc a { color: var(--text); text-decoration: none; line-height: 1.4; }
.hb-toc a:hover { color: var(--primary_aa); text-decoration: underline; }
.hb-toc__l2 { font-weight: 700; }
.hb-toc__l3 { padding-left: 18px; font-size: .93rem; }

/* Article body — typography comes from .hb-seo-content in style.css */
.hb-post__body { font-size: 1.05rem; max-width: 76ch; }
.hb-post__body.hb-seo-content p { font-size: 1.05rem; line-height: 1.8; }
.hb-post__body.hb-seo-content a { color: var(--primary_aa); }
.hb-post__body :is(h2, h3) { scroll-margin-top: calc(var(--hb-header-h) + 20px); }
.hb-post__body figure { margin: 28px 0; }
.hb-post__body figure img { border-radius: var(--radius); }
.hb-post__body figcaption { font-size: .85rem; color: var(--text_muted); margin-top: 8px; }
.hb-post__body .wp-block-table { overflow-x: auto; }

.hb-inline-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 36px 0;
    padding: 16px 20px;
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius_sm) var(--radius_sm) 0;
    background: var(--background_light);
    font-weight: 700;
    color: var(--accent);
}
.hb-post__body.hb-seo-content .hb-inline-cta a { text-decoration: none; white-space: nowrap; }
.hb-post__body.hb-seo-content .hb-inline-cta a:hover { text-decoration: underline; }

/* Author box */
.hb-author-box {
    display: flex;
    gap: 20px;
    margin: 48px 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.hb-author-box .hb-author-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; }
.hb-author-box p { margin: 0; }
.hb-author-box__name a { font-size: 1.15rem; font-weight: 800; color: var(--accent); text-decoration: none; }
.hb-author-box__job { font-size: .9rem; color: var(--text_muted); margin-bottom: 10px !important; }
.hb-author-box__bio { line-height: 1.65; }
.hb-author-box__credentials { margin: 12px 0 0; padding-left: 18px; font-size: .9rem; line-height: 1.6; }
.hb-author-box__all { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 700; color: var(--primary_aa); text-decoration: none; }
.hb-author-box__all:hover { text-decoration: underline; }
@media (max-width: 600px) { .hb-author-box { flex-direction: column; } }

/* Related, FAQ, CTA, prev/next */
.hb-related { margin: 56px 0; }
.hb-related > h2,
.hb-blog-wrap section > h2 { margin: 0 0 24px; }
.hb-related .hb-card__title { font-size: 1.05rem; }
@media (min-width: 601px) { .hb-related .hb-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.hb-related .hb-card__excerpt { display: none; }

.hb-blog-faq { margin: 56px 0; }

.hb-blog-cta {
    margin: 56px 0;
    padding: 36px 32px;
    border-radius: var(--radius_lg);
    background: var(--dark);
    color: #fff;
}
.hb-blog-wrap .hb-blog-cta__title { color: #fff; margin: 0 0 10px; }
.hb-blog-cta__text { margin: 0 0 24px; max-width: 60ch; line-height: 1.65; color: rgba(255,255,255,.92); }
.hb-blog-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.hb-blog-cta__phone { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; text-decoration: none; }
.hb-blog-cta__phone:hover { text-decoration: underline; }

.hb-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.hb-post-nav a {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--accent);
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}
.hb-post-nav a:hover { border-color: var(--primary_aa); }
.hb-post-nav span { display: block; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text_muted); margin-bottom: 6px; }
.hb-post-nav__next { grid-column: 2; text-align: right; }
@media (max-width: 600px) {
    .hb-post-nav { grid-template-columns: 1fr; }
    .hb-post-nav__next { grid-column: 1; text-align: left; }
}

/* Blog sidebar is instantiated from 1200px; services render it at every width. */
.hb-blog-sidebar {
    --hb-header-h: 64px;
    display: grid;
    gap: 14px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius_lg);
    background: #fff;
    color: var(--text);
    max-height: calc(100vh - var(--hb-header-h) - 48px);
    overflow-y: auto;
}
.hb-blog-sidebar,
.hb-blog-sidebar *,
.hb-blog-sidebar *::before,
.hb-blog-sidebar *::after { box-sizing: border-box; }
.hb-blog-sidebar__phone { display: inline-flex; align-items: center; gap: 10px; font-size: 1.45rem; font-weight: 800; color: var(--accent); text-decoration: none; }
.hb-blog-sidebar__phone:hover { color: var(--primary_aa); }
.hb-blog-sidebar__book { justify-content: center; }
.hb-blog-sidebar__facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; line-height: 1.5; }
.hb-blog-sidebar__facts dt { font-weight: 800; color: var(--accent); }
.hb-blog-sidebar__facts dd { margin: 0; }
.hb-blog-sidebar__emergency { margin: 0; padding: 10px 12px; border-radius: var(--radius_sm); background: var(--background_light); font-size: .88rem; font-weight: 700; color: var(--accent); }

.hb-lead-form { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.hb-lead-form__title { margin: 0; font-weight: 700; color: var(--accent); }
.hb-lead-form label { display: grid; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--text); }
.hb-lead-form input,
.hb-lead-form select,
.hb-lead-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #8A8A8A;
    border-radius: var(--radius_sm);
    font: inherit;
    font-size: .95rem;
    font-weight: 500;
    color: var(--accent);
    background: #fff;
}
.hb-lead-form select {
    appearance: none;
    padding-right: 40px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    cursor: pointer;
}
.hb-lead-form textarea { resize: vertical; }
.hb-lead-form [aria-invalid="true"] { border-color: var(--primary_aa); }
.hb-lead-form .hb-btn { justify-content: center; }
.hb-lead-form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hb-lead-form__status { margin: 0; font-size: .88rem; min-height: 1.2em; }
.hb-lead-form__status--ok { color: var(--success); }
.hb-lead-form__status--err { color: var(--primary_aa); }

@media (max-width: 900px) {
    .hb-sidebar .hb-blog-sidebar { max-height: none; overflow-y: visible; }
}

/* Author page */
.hb-author-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin: 16px 0 32px; }
.hb-author-hero__photo { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; }
.hb-author-hero h1 { margin-bottom: 8px; }
.hb-author-hero__job { margin: 0 0 14px; font-size: 1.05rem; color: var(--text_muted); }
.hb-author-hero__socials { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0; }
.hb-author-hero__socials a { color: var(--primary_aa); font-weight: 700; }
.hb-author-bio { max-width: 76ch; margin-bottom: 56px; }

@media (prefers-reduced-motion: reduce) {
    .hb-card__media img { transition: none; }
    .hb-card:hover .hb-card__media img { transform: none; }
}
