/*
 * The blog article page (/blog/{slug}), redesigned 25 Nov 2026.
 *
 * Headings keep the site's own h1/h2/h3 sizes from style.css (they shrink at the same breakpoints as
 * every other page); this file only gives them room. Body copy is the project page's size
 * (1.125rem), left-aligned rather than justified, which on a phone opened gaps between words.
 * Colours and corners come from ui.css (--ui-*), which every page loads.
 */

.ba {
    --ba-ink: var(--ui-ink, #171617);
    --ba-text: var(--black-2-font-color, #1c2430);
    --ba-muted: var(--ui-muted, #5b6677);
    --ba-line: var(--ui-line, #e3e7ed);
    --ba-subtle: var(--ui-subtle, #f4f5f7);
    --ba-anchor: 110px; /* the sticky site header, so a heading jumped to is not hidden under it */
}

/* ---------- Head: category, title, byline, cover ---------- */
.ba-head { padding-top: 12px; }

.ba-cat {
    display: inline-flex; align-items: center; min-height: 30px; padding: 0 14px; border-radius: 999px;
    background: var(--ba-subtle); border: 1px solid var(--ba-line);
    font: 600 13px/1.2 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-ink) !important; text-decoration: none !important;
}
.ba-cat:hover { border-color: var(--ba-ink); }

.ba-title { margin: 14px 0 18px; line-height: 1.2; max-width: 36ch; }
@media (max-width: 991.98px) { .ba-title { max-width: none; } }

.ba-byline { display: flex; align-items: center; gap: 12px; }
.ba-byline__avatar {
    width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover;
    background: var(--ba-subtle); border: 1px solid var(--ba-line);
}
.ba-byline__initials {
    display: inline-flex; align-items: center; justify-content: center;
    font: 700 15px/1 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-ink);
}
.ba-byline__name { font: 600 15px/1.3 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-ink); margin: 0; }
.ba-byline__meta { font: 400 13px/1.4 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-muted); margin: 2px 0 0; }
.ba-byline__meta span { color: inherit; }
.ba-byline__dot { margin: 0 6px; }

.ba-cover {
    display: block; width: 100%; height: auto; max-height: 560px; aspect-ratio: 16 / 7.5; object-fit: cover;
    border-radius: 20px; margin-top: 24px; background: var(--ba-subtle);
}
@media (max-width: 767.98px) {
    .ba-cover { aspect-ratio: 4 / 3; border-radius: 14px; margin-top: 18px; }
}

.ba-layout { margin-top: 36px; }
@media (max-width: 767.98px) { .ba-layout { margin-top: 24px; } }

/* ---------- The article text ---------- */
.ba-body {
    font-size: 1.125rem; line-height: 1.8; color: var(--ba-text);
    overflow-wrap: anywhere; text-align: start;
}
.ba-body p, .ba-body li, .ba-body div, .ba-body span { text-align: start; }
.ba-body p { margin: 0 0 1.1em; line-height: 1.8; }
/* Empty paragraphs the editor leaves behind (<p><br></p>) would otherwise be blank lines. */
.ba-body p:empty, .ba-body p:has(> br:only-child) { display: none; }

.ba-body h1, .ba-body h2, .ba-body h3, .ba-body h4, .ba-body h5, .ba-body h6 {
    text-align: start; line-height: 1.25; scroll-margin-top: var(--ba-anchor);
}
.ba-body h2 { margin: 2.4rem 0 .9rem; }
.ba-body h3 { margin: 1.9rem 0 .6rem; }
.ba-body h4, .ba-body h5, .ba-body h6 { margin: 1.5rem 0 .5rem; }
.ba-body > :first-child { margin-top: 0; }

.ba-body ul, .ba-body ol { padding-inline-start: 1.4rem; margin: 0 0 1.1em; }
.ba-body li { margin-bottom: .4em; }
.ba-body li::marker { color: var(--ba-muted); }
.ba-body a:not(.ba-zoom) { color: var(--ba-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ba-body strong, .ba-body b { color: var(--ba-ink); }

.ba-body blockquote {
    margin: 1.6rem 0; padding: 16px 20px; border-inline-start: 4px solid var(--ui-gold, #e2b93b);
    background: var(--ba-subtle); border-radius: 0 12px 12px 0; color: var(--ba-ink);
}
.ba-body blockquote p:last-child { margin-bottom: 0; }

/* Pictures in the text. The editor sizes them (often at half width); a run of two or more in a row
   is put side by side by the page script (.ba-imgrow), so they read as a set and not a tall column. */
.ba-body img { max-width: 100%; height: auto; border-radius: 14px; }
.ba-body figure { margin: 0; }
.ba-body .se-component { margin: 1.4rem 0; }
.ba-body img[data-ba-zoom] { cursor: zoom-in; }
.ba-imgrow {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 1.4rem 0;
}
.ba-imgrow .se-component { width: 100% !important; margin: 0; }
.ba-imgrow figure, .ba-imgrow img { width: 100% !important; }
.ba-imgrow img { aspect-ratio: 4 / 3; object-fit: cover; height: 100% !important; }
@media (max-width: 575.98px) { .ba-imgrow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* Tables: a bordered, rounded box with a tinted header row; wide ones scroll sideways on a phone. */
.ba-table { margin: 1.4rem 0 1.6rem; overflow-x: auto; border: 1px solid var(--ba-line); border-radius: 14px; }
.ba-table table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; margin: 0; }
.ba-table th, .ba-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--ba-line); vertical-align: top; text-align: start;
    white-space: normal; /* style.css sets every td to nowrap, which pushed a third column off the box */
    min-width: 110px;
}
.ba-table tr:last-child > th, .ba-table tr:last-child > td { border-bottom: 0; }
.ba-table tr:first-child > th, .ba-table thead th { background: var(--ba-subtle); color: var(--ba-ink); font-weight: 700; }
.ba-table tr:nth-child(even) > td { background: #fafbfc; }
.ba-table td:first-child { font-weight: 600; color: var(--ba-ink); }
.ba-table p { margin: 0 !important; line-height: 1.5; }
@media (max-width: 767.98px) {
    .ba-table th, .ba-table td { padding: 10px 12px; font-size: .9rem; }
}

/* ---------- Sections under the text: gallery, video, FAQs, related ---------- */
.ba-section { margin-top: 52px; scroll-margin-top: var(--ba-anchor); }
.ba-section__title { margin: 0 0 18px; }
@media (max-width: 767.98px) { .ba-section { margin-top: 40px; } }

/* Gallery: four in a row, three on a tablet, two on a phone. */
.ba-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 991.98px) { .ba-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .ba-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.ba-gallery__item {
    position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
    background: var(--ba-subtle); cursor: zoom-in;
}
.ba-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.ba-gallery__item:hover img { transform: scale(1.05); }
.ba-gallery__item:focus-visible { outline: none; box-shadow: var(--ui-focus, 0 0 0 3px rgba(23, 22, 23, .22)); }
.ba-gallery__item[hidden] { display: none; }
.ba-gallery__more {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(17, 17, 17, .55); color: #fff !important; font: 700 22px/1 var(--ui-font, "Montserrat", sans-serif);
}

/* Video: 16:9, a YouTube link shows its own thumbnail and plays only when clicked. */
.ba-video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0d0d0d; }
.ba-video iframe, .ba-video video, .ba-video__poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ba-video video { object-fit: contain; background: #000; }
.ba-video__play {
    position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer;
}
.ba-video__poster { object-fit: cover; }
.ba-video__play::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.35)); }
.ba-video__icon {
    position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; transform: translate(-50%, -50%);
    border-radius: 50%; background: rgba(255, 255, 255, .95); box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
    display: flex; align-items: center; justify-content: center; transition: transform .2s;
}
.ba-video__icon svg { width: 28px; height: 28px; margin-left: 4px; fill: var(--ba-ink); }
.ba-video__play:hover .ba-video__icon { transform: translate(-50%, -50%) scale(1.08); }
.ba-video__play:focus-visible .ba-video__icon { box-shadow: 0 0 0 4px rgba(255, 255, 255, .6), 0 8px 24px rgba(0, 0, 0, .3); }
@media (max-width: 575.98px) { .ba-video { border-radius: 12px; } .ba-video__icon { width: 60px; height: 60px; } }

/* FAQs use the site's accordion (ui.css .ui-acc); a slightly larger question to suit an article. */
.ba-faqs .ui-acc > summary { font-size: 16px; padding: 18px 20px; }
.ba-faqs .ui-acc__body { font-size: 1rem; line-height: 1.75; padding: 0 20px 20px; }

/* Related articles */
.ba-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 575.98px) { .ba-related { grid-template-columns: 1fr; } }
.ba-card {
    display: flex; flex-direction: column; height: 100%; border: 1px solid var(--ba-line); border-radius: var(--ui-r-card, 14px);
    overflow: hidden; background: #fff; text-decoration: none !important; color: inherit !important;
    transition: box-shadow .2s, transform .2s;
}
.ba-card:hover { box-shadow: var(--ui-shadow-md, 0 6px 18px rgba(16, 24, 40, .1)); transform: translateY(-2px); }
.ba-card__img { aspect-ratio: 16 / 9; background: var(--ba-subtle); overflow: hidden; }
.ba-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-card__body { padding: 16px 18px 18px; }
.ba-card__date { font: 400 13px/1.4 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-muted); margin: 0 0 6px; }
.ba-card__title {
    font: 600 18px/1.35 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-ink); margin: 0 0 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ba-card__text {
    font: 400 15px/1.6 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-muted); margin: 0; text-align: start;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- On this page ---------- */
.ba-toc { border: 1px solid var(--ba-line); border-radius: var(--ui-r-card, 14px); background: #fff; padding: 18px 18px 14px; margin-bottom: 20px; }
.ba-toc__title { font: 700 12px/1.4 var(--ui-font, "Montserrat", sans-serif); letter-spacing: .08em; text-transform: uppercase; color: var(--ba-muted); margin: 0 0 10px; }
.ba-toc__list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.ba-toc__list li { margin: 0; }
.ba-toc__list a {
    display: block; padding: 7px 0 7px 12px; border-inline-start: 2px solid var(--ba-line);
    font: 500 14px/1.4 var(--ui-font, "Montserrat", sans-serif); color: var(--ba-muted) !important; text-decoration: none !important;
    transition: color .15s, border-color .15s;
}
.ba-toc__list a:hover { color: var(--ba-ink) !important; }
.ba-toc__list a.is-active { color: var(--ba-ink) !important; font-weight: 700; border-inline-start-color: var(--ba-ink); }
.ba-toc__list .is-sub a { padding-inline-start: 24px; font-size: 13px; }

.ba-toc-mobile { margin-bottom: 24px; }
.ba-toc-mobile .ba-toc__list { max-height: none; padding: 0 18px 12px; }
