/**
 * News (1.5.0): the News page, article pages and category lists.
 * Uses the theme's colour tokens, so it follows the dark palette.
 */

/* ---- Heading block ---------------------------------------------------- */
.hbs-news-hero { padding: 28px 0 8px; text-align: center; }
.hbs-news-hero h1 { margin: 0 0 8px; }
.hbs-news-intro { max-width: 720px; margin: 0 auto; color: var(--hbs-gray); font-size: 1rem; line-height: 1.6; }
.hbs-news-intro p { margin: 0 0 8px; }

/* ---- Filter chips ----------------------------------------------------- */
.hbs-news-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 26px; }
.hbs-news-chip {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--hbs-border);
    border-radius: 999px;
    background: var(--hbs-surface);
    color: var(--hbs-dark);
    font-size: 0.85rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hbs-news-chip:hover { border-color: var(--hbs-red); color: var(--hbs-red-fg); }
.hbs-news-chip.is-active { background: var(--hbs-red); border-color: var(--hbs-red); color: #fff; }

/* ---- Card grid -------------------------------------------------------- */
.hbs-news-list { padding: 8px 0 48px; }
.hbs-news-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 640px)  { .hbs-news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .hbs-news-grid { grid-template-columns: repeat(3, 1fr); } }

.hbs-news-card {
    display: flex;
    flex-direction: column;
    background: var(--hbs-surface);
    border: 1px solid var(--hbs-border);
    border-radius: var(--hbs-radius);
    overflow: hidden;
}
.hbs-news-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--hbs-light-bg); }
.hbs-news-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hbs-news-thumb-fallback { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--hbs-red-fg); }
.hbs-news-thumb-fallback .dashicons { width: 48px; height: 48px; font-size: 48px; }
.hbs-news-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.hbs-news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--hbs-gray); }
.hbs-news-cat { padding: 2px 8px; border-radius: 4px; background: rgba(217, 32, 39, 0.16); color: var(--hbs-red-fg); font-weight: 600; }
.hbs-news-title { margin: 8px 0 6px; font-size: 1.1rem; line-height: 1.3; }
.hbs-news-title a { color: var(--hbs-dark); text-decoration: none; }
.hbs-news-title a:hover { color: var(--hbs-red-fg); }
.hbs-news-excerpt { margin: 0 0 12px; color: var(--hbs-gray); font-size: 0.9rem; line-height: 1.55; }
.hbs-news-more { margin-top: auto; color: var(--hbs-red-fg); font-weight: 600; font-size: 0.88rem; text-decoration: none; }
.hbs-news-more:hover { text-decoration: underline; }
.hbs-news-empty { text-align: center; color: var(--hbs-gray); padding: 40px 0; }

/* ---- Pagination ------------------------------------------------------- */
.hbs-news-pagination { margin-top: 28px; text-align: center; }
.hbs-news-pagination .page-numbers,
.hbs-news-pagination .nav-links .page-numbers {
    display: inline-block; min-width: 38px; margin: 2px; padding: 8px 12px;
    border: 1px solid var(--hbs-border); border-radius: 6px; background: var(--hbs-surface);
    color: var(--hbs-dark); text-decoration: none; font-size: 0.9rem;
}
.hbs-news-pagination .page-numbers.current { background: var(--hbs-red); border-color: var(--hbs-red); color: #fff; }
.hbs-news-pagination a.page-numbers:hover { border-color: var(--hbs-red); }
.hbs-news-pagination .screen-reader-text { position: absolute; left: -9999px; }

/* ---- Article ---------------------------------------------------------- */
.hbs-article { padding-bottom: 8px; }
.hbs-article-header { max-width: 860px; padding-top: 18px; text-align: center; }
.hbs-article-header h1 { margin: 12px 0 8px; font-size: clamp(1.6rem, 6vw, 2.4rem); }
.hbs-article-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hbs-article-meta { margin: 0; color: var(--hbs-gray); font-size: 0.85rem; }
.hbs-article-hero { max-width: 960px; margin: 22px auto 0; }
.hbs-article-hero-img { width: 100%; height: auto; border-radius: var(--hbs-radius); display: block; }
.hbs-article-hero figcaption { margin-top: 8px; text-align: center; color: var(--hbs-gray); font-size: 0.82rem; }

.hbs-article-content { max-width: 760px; margin: 26px auto 0; font-size: 1.02rem; line-height: 1.75; overflow-wrap: break-word; }
.hbs-article-content > *:first-child { margin-top: 0; }
.hbs-article-content h2, .hbs-article-content h3, .hbs-article-content h4 { margin: 1.6em 0 0.5em; }
.hbs-article-content p { margin: 0 0 1.1em; }
.hbs-article-content a { color: var(--hbs-red-fg); }
.hbs-article-content img, .hbs-article-content video, .hbs-article-content iframe { max-width: 100%; height: auto; border-radius: 8px; }
.hbs-article-content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.hbs-article-content figure { margin: 1.4em 0; }
.hbs-article-content figcaption, .hbs-article-content .wp-element-caption { margin-top: 6px; color: var(--hbs-gray); font-size: 0.82rem; text-align: center; }
.hbs-article-content blockquote { margin: 1.4em 0; padding: 4px 0 4px 16px; border-left: 4px solid var(--hbs-red); color: var(--hbs-gray); font-style: italic; }
.hbs-article-content ul, .hbs-article-content ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.hbs-article-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.hbs-article-content th, .hbs-article-content td { border: 1px solid var(--hbs-border); padding: 8px 10px; text-align: left; }
/* Photo galleries (block gallery and classic [gallery]) */
.hbs-article-content .wp-block-gallery, .hbs-article-content .gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 1.4em 0; }
@media (min-width: 640px) { .hbs-article-content .wp-block-gallery, .hbs-article-content .gallery { grid-template-columns: repeat(3, 1fr); } }
.hbs-article-content .wp-block-gallery figure, .hbs-article-content .gallery .gallery-item { margin: 0; width: auto !important; max-width: none; }
.hbs-article-content .wp-block-gallery img, .hbs-article-content .gallery img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.hbs-article-content .alignleft { float: left; margin: 4px 16px 8px 0; max-width: 50%; }
.hbs-article-content .alignright { float: right; margin: 4px 0 8px 16px; max-width: 50%; }
.hbs-article-content::after { content: ""; display: block; clear: both; }

.hbs-article-share { max-width: 760px; margin: 28px auto 0; padding-top: 16px; border-top: 1px solid var(--hbs-border); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hbs-article-share span { color: var(--hbs-gray); font-size: 0.9rem; }

.hbs-article-nav { max-width: 760px; margin: 24px auto 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .hbs-article-nav { grid-template-columns: 1fr 1fr; } }
.hbs-article-nav a { display: block; padding: 12px 14px; border: 1px solid var(--hbs-border); border-radius: var(--hbs-radius); background: var(--hbs-surface); color: var(--hbs-dark); text-decoration: none; }
.hbs-article-nav a:hover { border-color: var(--hbs-red); }
.hbs-article-nav small { display: block; color: var(--hbs-gray); margin-bottom: 4px; }
.hbs-article-nav-next { text-align: right; }
.hbs-news-more-section { margin-top: 36px; border-top: 1px solid var(--hbs-border); padding-top: 28px; }
.hbs-article-share .btn { padding: 8px 16px; background: var(--hbs-surface); border: 1px solid var(--hbs-border); color: var(--hbs-dark); border-radius: 999px; font-size: 0.85rem; text-decoration: none; }
.hbs-article-share .btn:hover { border-color: var(--hbs-red); color: var(--hbs-red-fg); }
