/* ═══════════════════════════════════════════════════════════════════════════
   Site header and footer layout (Admin > Appearance > Header & Footer).
   Loaded after frontend.css / responsive.css. With nothing changed the header is the
   original one: logo left, menu right, container width.
   Structure: .hdr__inner > .hdr-row (1-2) > .hdr-zone (left / center / right) > items
   ═══════════════════════════════════════════════════════════════════════════ */
.hdr { background: var(--hdr-bg, #fff); }
.hdr--static { position: relative; }
.hdr .site-logo img { height: var(--hdr-logo-h, 44px); }
.hdr .site-logo { color: var(--hdr-fg, inherit); }
.hdr .nav-menu > li > a { color: var(--hdr-fg, #374151); }
.hdr .nav-toggle { color: var(--hdr-fg, #374151); }

/* width: site container (default) · own container width · full width with side padding */
.hdr-wrap { width: 100%; padding: 0 24px; box-sizing: border-box; }
.hdr-wrap--custom { max-width: var(--hdr-cw, 1140px); margin-left: auto; margin-right: auto; }
.hdr-wrap--full { max-width: none; padding: 0 var(--hdr-pad, 10px); }

/* rows and zones */
.hdr .hdr__inner { display: block; height: auto; }
.hdr-row { display: flex; align-items: stretch; justify-content: space-between; height: 72px; gap: 16px; }
.hdr-row--2 { height: 50px; border-top: 1px solid rgba(15,23,42,.07); }
.hdr-zone { display: flex; align-items: stretch; gap: 12px; min-width: 0; }
.hdr-zone--left { justify-content: flex-start; }
.hdr-zone--center { justify-content: center; flex: 1 1 auto; }
.hdr-zone--right { justify-content: flex-end; }
/* only one side + a centre item: both sides get equal room so the centre stays truly centred */
.hdr-row--balance > .hdr-zone--left, .hdr-row--balance > .hdr-zone--right { flex: 1 1 0; }
.hdr-row--balance > .hdr-zone--center { flex: 0 1 auto; }
.hdr-zone > .site-logo { padding-right: 0; }
.hdr-item { display: flex; align-items: stretch; gap: 10px; }
.hdr-item--search, .hdr-cta { align-self: center; }
.hdr-item--search { align-items: center; }
.hdr-item--menu { align-items: stretch; }

/* button */
.hdr-cta { display: inline-flex; align-items: center; padding: 9px 18px; border-radius: 8px; background: var(--primary, #4f46e5); color: #fff !important; font-weight: 600; font-size: 14px; text-decoration: none !important; white-space: nowrap; transition: filter .15s, transform .15s; }
.hdr-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* search */
.hdr-search-btn, .nav-toggle { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #e5e7eb; background: transparent; color: var(--hdr-fg, #374151); font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.hdr-search-btn:hover, .nav-toggle:hover { background: rgba(79,70,229,.08); border-color: var(--primary, #4f46e5); }
/* RESPONSIVE MENU BUTTON: the hamburger exists only where the menu collapses. On desktop the menu links are shown, so the
   button stays hidden. It is switched on by responsive.css (<= 1099px) and by the (<= 900px) block below, both with !important. */
.nav-toggle { display: none; }
.hdr-search { display: none; align-items: center; gap: 8px; height: 44px; box-sizing: border-box; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 999px; padding: 0 5px 0 16px; transition: border-color .15s, box-shadow .15s, background .15s; }
.hdr-search:hover { border-color: #cbd5e1; }
.hdr-search:focus-within { border-color: var(--primary, #4f46e5); box-shadow: 0 0 0 3px rgba(79,70,229,.15); background: #fff; }
.hdr-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: inherit; font-size: 14px; padding: 0; color: #111827; }
.hdr-search input::placeholder { color: #9ca3af; }
.hdr-search input::-webkit-search-cancel-button { display: none; }
.hdr-search__icon { font-size: 15px; opacity: .6; line-height: 1; }
.hdr-search__go { height: 34px; border: 0; background: var(--primary, #4f46e5); color: #fff; font-weight: 600; font-size: 13px; padding: 0 18px; border-radius: 999px; cursor: pointer; transition: filter .15s, transform .15s; }
.hdr-search__go:hover { filter: brightness(1.1); }
.hdr-search__go:active { transform: scale(.97); }
/* search placed in the centre zone: an inline bar (the button is not needed) */
.hdr-search--inline { display: flex; flex: 1 1 260px; max-width: 440px; margin: 0 8px; }
.hdr-item--search:has(.hdr-search--inline) { flex: 1 1 auto; justify-content: center; }
.hdr-item--search:has(.hdr-search--inline) .hdr-search-btn { display: none; }
/* search in a side zone: the button opens a bar under the header */
.hdr--search-open .hdr-search:not(.hdr-search--inline) { display: flex; position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 8px); width: min(560px, calc(100vw - 32px)); height: 52px; background: #fff; border-color: #e2e8f0; box-shadow: 0 18px 40px rgba(15,23,42,.18); z-index: 998; padding: 0 8px 0 18px; }
.hdr--search-open .hdr-search:not(.hdr-search--inline) .hdr-search__go { height: 38px; }

/* top bar (strip above the header) */
.hdr-topbar { background: var(--hdr-fg, #111827); color: var(--hdr-bg, #fff); font-size: 13px; }
.hdr-topbar__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; flex-wrap: wrap; }
.hdr-topbar a { color: inherit; text-decoration: none; opacity: .9; margin-left: 18px; }
.hdr-topbar a:hover { opacity: 1; text-decoration: underline; }
.hdr-topbar__links { display: flex; flex-wrap: wrap; }

/* header height (desktop; phones keep the compact bar) */
@media (min-width: 901px) { .hdr--h .hdr-row--1 { height: var(--hdr-h); } }

/* ═══ Responsive ═════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .hdr .nav-menu > li > a { padding: 0 11px; }
    .hdr-search--inline { max-width: 300px; }
}
@media (max-width: 900px) {
    /* every row / zone melts into ONE compact bar: logo ... search, button, menu button */
    .hdr .hdr__inner { display: flex; align-items: center; height: 64px; flex-wrap: nowrap; position: static; padding: 0; }
    .hdr .hdr-row, .hdr .hdr-zone, .hdr .hdr-item--menu, .hdr .hdr-item--search { display: contents; }
    .hdr .hdr-row--2 { border: 0; }
    .hdr .hdr__logo { order: 1; flex: 0 1 auto; min-width: 0; padding-right: 12px; }
    .hdr .hdr-search-btn { order: 2; display: inline-flex !important; margin-left: auto; }
    .hdr .hdr-cta { order: 3; margin-left: 10px; padding: 8px 14px; font-size: 13px; }
    .hdr .nav-toggle { order: 4; display: flex !important; margin-left: auto; align-self: center; }
    .hdr--has-search .nav-toggle, .hdr--has-cta .nav-toggle { margin-left: 10px; }
    .hdr--has-cta:not(.hdr--has-search) .hdr-cta { margin-left: auto; }
    .hdr .site-nav { order: 9; }
    .hdr .hdr-search--inline { display: none; }
    /* the open menu hangs under the whole header */
    .hdr .site-nav { top: 100% !important; left: 0; right: 0; width: 100%; max-height: calc(100vh - 80px) !important; flex: none; margin: 0; min-height: 0; border-top: 0; }
    .hdr .site-nav:not(.site-nav--open) { display: none !important; }
    .hdr .nav-menu { justify-content: flex-start; }
    /* the search bar opens under the header on every layout */
    .hdr--search-open .hdr-search, .hdr--search-open .hdr-search--inline { display: flex; position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + 8px); width: min(560px, calc(100vw - 32px)); height: 52px; flex: none; max-width: none; margin: 0; background: #fff; border-color: #e2e8f0; box-shadow: 0 18px 40px rgba(15,23,42,.18); z-index: 998; padding: 0 8px 0 18px; }
    .hdr-wrap { padding: 0 16px; }
    .hdr-wrap--full { padding: 0 min(var(--hdr-pad, 10px), 16px); }
}
@media (max-width: 640px) {
    .hdr .hdr__inner { height: 58px; }
    .hdr .site-logo img { height: min(var(--hdr-logo-h, 44px), 38px); }
    .hdr .hdr-cta { display: none; }
    .hdr--has-cta:not(.hdr--has-search) .nav-toggle { margin-left: auto; }
    .hdr-topbar__inner { justify-content: center; text-align: center; padding-top: 6px; padding-bottom: 6px; }
    .hdr-topbar__text { display: none; }
    .hdr-topbar a { margin: 0 9px; }
    .hdr--search-open .hdr-search { width: calc(100vw - 24px); }
    .hdr-search__go { display: none; }
}
@media (max-width: 380px) {
    .hdr .site-logo { font-size: 18px; }
    .hdr-search-btn, .hdr .nav-toggle { width: 38px; height: 38px; padding: 0; }
}
@media print { .hdr, .hdr-topbar { display: none; } }

/* ═══ Footer layout (only when the owner changed something: .site-footer--custom) ═ */
.ft-wrap { width: 100%; padding: 0 24px; box-sizing: border-box; }
.ft-wrap--custom { max-width: var(--ft-cw, 1140px); margin-left: auto; margin-right: auto; }
.ft-wrap--full { max-width: none; padding: 0 var(--ft-pad, 10px); }
.site-footer--custom { background: var(--ft-bg, linear-gradient(180deg, #0a0f1e 0%, #111827 100%)); color: var(--ft-fg, #94a3b8); }
.site-footer--custom .site-footer__grid { padding-top: var(--ft-pt, 52px); padding-bottom: var(--ft-pb, 40px); }
.site-footer--custom .site-footer__copy, .site-footer--custom .site-footer__tagline { color: var(--ft-fg, #94a3b8); }
@media (min-width: 1025px) {
    .site-footer--custom .site-footer__grid { grid-template-columns: var(--ft-cols, 1.6fr 1fr 1fr 1fr); }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .site-footer--custom .site-footer__grid { grid-template-columns: repeat(2, 1fr) !important; }
    .site-footer--custom .site-footer__brand { grid-column: 1 / -1 !important; }
}
/* bottom bar: three zones, positions chosen by drag and drop */
.ft-zone { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ft-zone--left { justify-content: flex-start; }
.ft-zone--center { justify-content: center; flex: 1 1 auto; }
.ft-zone--right { justify-content: flex-end; }
@media (max-width: 640px) {
    .ft-wrap { padding: 0 16px; }
    .ft-wrap--full { padding: 0 min(var(--ft-pad, 10px), 16px); }
    .site-footer__bottom .ft-zone { flex: 1 1 100%; justify-content: center; }
}

/* ═══ Footer text must always be readable on the dark background ═════════════ */
.site-footer .widget-recent-posts__title,
.site-footer .widget-recent-posts__title a,
.site-footer .widget-recent-posts__info a { color: var(--ft-fg, #cbd5e1); font-weight: 500; }
.site-footer .widget-recent-posts__title:hover,
.site-footer .widget-recent-posts__title a:hover { color: #a5b4fc; text-decoration: none; }
.site-footer .widget-recent-posts__date { color: var(--ft-fg, #94a3b8); opacity: .85; }
.site-footer__tagline { color: var(--ft-fg, #94a3b8); }
.site-footer__copy { color: var(--ft-fg, #94a3b8); }
.site-footer__copy strong { color: #e2e8f0; }
.site-footer .widget-text, .site-footer .widget-custom-html, .site-footer p { color: var(--ft-fg, #94a3b8); }
.site-footer__bottom .nav-menu a { color: var(--ft-fg, #94a3b8); }
.site-footer .footer-back-top { color: var(--ft-fg, #cbd5e1); }
.site-footer .footer-back-top:hover { color: #fff; }

/* ═══ Floating "back to top" with scroll progress ring ═══════════════════════ */
.site-footer .footer-back-top.fd-totop {
    position: fixed; right: 24px; bottom: 24px; z-index: 900;
    width: 54px; height: 54px; padding: 0; margin: 0; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color: #fff;
    box-shadow: 0 10px 28px rgba(79,70,229,.45), 0 2px 6px rgba(15,23,42,.25);
    cursor: pointer; letter-spacing: 0;
    opacity: 0; visibility: hidden; transform: translateY(16px) scale(.85);
    transition: opacity .25s ease, transform .25s ease, visibility .25s, box-shadow .2s ease, filter .2s ease;
}
.site-footer .footer-back-top.fd-totop.is-visible { opacity: 1; visibility: visible; transform: none; }
.site-footer .footer-back-top.fd-totop:hover { transform: translateY(-3px); filter: brightness(1.08); box-shadow: 0 16px 34px rgba(79,70,229,.55), 0 3px 8px rgba(15,23,42,.3); color: #fff; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); border: 0; }
.site-footer .footer-back-top.fd-totop:active { transform: scale(.94); }
.site-footer .footer-back-top.fd-totop:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(79,70,229,.6); }
.fd-totop__ring { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); transform: rotate(-90deg); pointer-events: none; }
.fd-totop__track { fill: none; stroke: rgba(255,255,255,.28); stroke-width: 3; }
.fd-totop__bar { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: 132; transition: stroke-dashoffset .12s linear; }
.fd-totop__arrow { position: relative; transition: opacity .15s, transform .2s; }
.fd-totop__pct { position: absolute; font-size: 12px; font-weight: 800; letter-spacing: -.02em; opacity: 0; transform: scale(.8); transition: opacity .15s, transform .2s; font-variant-numeric: tabular-nums; }
.fd-totop:hover .fd-totop__arrow { opacity: 0; transform: translateY(-4px); }
.fd-totop:hover .fd-totop__pct { opacity: 1; transform: none; }
@media (max-width: 640px) { .site-footer .footer-back-top.fd-totop { right: 14px; bottom: 14px; width: 46px; height: 46px; } .fd-totop__arrow { width: 16px; height: 16px; } }
@media (prefers-reduced-motion: reduce) { .site-footer .footer-back-top.fd-totop, .fd-totop__bar { transition: none; } }
/* credit line in the footer's bottom bar */
.site-footer__credit { font-size: 13px; color: var(--ft-fg, #94a3b8); white-space: nowrap; }
.site-footer__credit a, .site-footer__credit strong { color: #e2e8f0; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(165,180,252,.45); padding-bottom: 1px; transition: color .15s, border-color .15s; }
.site-footer__credit a:hover { color: #a5b4fc; border-color: #a5b4fc; }
@media (max-width: 640px) { .site-footer__credit { white-space: normal; text-align: center; } }

/* ═══════════════════════════════════════════════════════════════════════════
   POST DETAIL FIX v2: blog details page + content/sidebar grid, fully responsive
   (kept in this file on purpose: it is always loaded last and its URL changes whenever the file changes)

   Root cause: the page grid was `1fr 300px`. A `1fr` column may grow to fit its widest child, so ONE wide element inside
   an article (table, embed, code block, fixed-width box, wide image, long line) stretched the article column and pushed
   the sidebar off the right edge of the screen. `minmax(0, 1fr)` lets the column shrink. The rules below use !important
   and a stronger selector so no older stylesheet can bring the problem back.
   Breakpoints match responsive.css: 1099px (tablet), 767px (mobile), 479px (small mobile).
   ═══════════════════════════════════════════════════════════════════════════ */

/* 1. Page grid: article + sidebar */
body .site-main { grid-template-columns: minmax(0, 1fr) clamp(260px, 24vw, 320px) !important; }
body .site-main.site-main--full { grid-template-columns: minmax(0, 1fr) !important; }
body #main-content, body .sidebar, body .entry { min-width: 0 !important; max-width: 100% !important; }
@media (max-width: 1099px) {
    body .site-main, body .site-main:not(.site-main--full) { grid-template-columns: minmax(0, 1fr) !important; }
    body .sidebar { position: static !important; width: 100%; }
}
/* nothing a post contains may ever create a sideways scrollbar for the whole page */
html { overflow-x: hidden; }

/* 2. Article header */
.entry-title { overflow-wrap: anywhere; hyphens: auto; }
.entry-meta { gap: 8px 16px; }
.entry-meta > * { min-width: 0; }
.entry-categories { display: flex; flex-wrap: wrap; gap: 6px; }
.entry-category { margin-right: 0; }
@media (max-width: 767px) {
    .entry-header { margin-bottom: 22px; }
    .entry-meta { font-size: 12.5px; gap: 6px 12px; margin-bottom: 18px; }
    .entry-featured-image { margin-bottom: 24px; border-radius: 10px; }
    .entry-featured-image img { max-height: 340px; }
    .entry-featured-image--default { padding: 22px 14px; }
    .entry-featured-image--default img { max-width: min(220px, 70%); }
}

/* 3. Article body */
.prose { min-width: 0; max-width: 100%; overflow-x: auto; overflow-wrap: break-word; word-wrap: break-word; hyphens: auto; }
.prose :where(div, section, article, figure, figcaption, p, ul, ol, dl, blockquote, form, fieldset, span, a,
              img, video, audio, iframe, embed, object, canvas, svg, picture) { max-width: 100%; }
.prose :where(img, video, canvas, picture) { height: auto; }
.prose img[width], .prose img[height] { height: auto; }
.prose :where(span, a, p, div, li, td, th)[style*="nowrap"] { white-space: normal !important; }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose th, .prose td { overflow-wrap: break-word; }
.prose pre { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: pre; tab-size: 4; }
.prose :not(pre) > code { overflow-wrap: anywhere; }
.prose iframe { width: 100%; border: 0; }
.prose iframe[src*="youtube"], .prose iframe[src*="youtu.be"], .prose iframe[src*="vimeo"] { aspect-ratio: 16 / 9; height: auto; }
.prose video { width: 100%; }

/* Post text is justified on every screen, phone included (straight left AND right edge).
   hyphens:auto (above) splits long words at the line end, which keeps the gaps between words small even in a narrow column. */
.prose p, .prose li { text-align: justify; text-justify: inter-word; }
/* Lists on a phone: items are short, indented and often start with a bold label ("Autonomic Nervous System (ANS): ..."). Justifying that
   narrow column stretched the few words of the first line across the whole width. They stay left-aligned there; paragraphs stay justified. */
@media (max-width: 767px) { .prose li, .prose li p { text-align: left; } }
@media (max-width: 767px) {
    .prose { font-size: 16px; line-height: 1.75; }
    .prose ul, .prose ol { margin-left: 1.25em; }
    .prose blockquote { margin-left: 0; margin-right: 0; padding: 12px 14px; }
    .prose .alignleft, .prose .alignright, .prose img[align="left"], .prose img[align="right"] { float: none !important; display: block; margin: 1em auto !important; }
    .prose th, .prose td { padding: 8px 10px; font-size: .92em; }
}

/* 4. Tags, share buttons, author box */
.entry-tags { gap: 8px; }
.share-buttons { flex-wrap: wrap; gap: 8px; }
.author-box, .author-box > div { min-width: 0; }
.author-box__bio, .author-box__name { overflow-wrap: anywhere; }
@media (max-width: 479px) {
    .share-buttons__label { flex: 0 0 100%; }
    .share-btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
    .author-box { padding: 20px 16px; }
}

/* 5. Related posts */
.related-posts__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1099px) { .related-posts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px)  { .related-posts__grid { grid-template-columns: minmax(0, 1fr) !important; } }
.post-card__title, .post-card__excerpt { overflow-wrap: anywhere; }

/* 6. Comments */
.comment, .comment-body { min-width: 0; }
.comment-content { overflow-wrap: anywhere; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { max-width: 100%; box-sizing: border-box; }
.comment-form .form-row > * { min-width: 0; }
@media (max-width: 767px) {
    .comment-form .form-row { grid-template-columns: minmax(0, 1fr); }
    .comment-children { margin-left: 12px; padding-left: 10px; }
}

/* 7. Sidebar widgets */
.widget { min-width: 0; }
.widget-recent-posts__title, .widget-categories__item a, .widget-tag-cloud__tag { overflow-wrap: anywhere; }
.widget-search__wrap { min-width: 0; max-width: 100%; }
.widget-search__input { min-width: 0; width: 100%; }
.widget-search__btn { flex: 0 0 auto; }
/* ═══ Header / footer builder blocks (Admin > Appearance > Header & Footer) ═══════════════════════════════════════════════
   Bars: top (above the sticky header), main, bottom. Blocks: button, text, html, social, phone, e-mail, image, divider, spacer, extra menus.
   Nothing here changes the original header: these rules only match classes that exist when the owner uses the new blocks. */

/* show on desktop only / mobile only (the header folds into one compact bar at 900px) */
@media (min-width: 901px) { .hdr-hide-d { display: none !important; } }
@media (max-width: 900px) { .hdr-hide-m { display: none !important; } }

/* a bar is a full-width band (own colours / height / line) with the container inside it */
.hdr-bar { background: var(--bar-bg, transparent); }
.hdr-bar.has-fg, .hdr-bar.has-fg .site-logo, .hdr-bar.has-fg .nav-toggle, .hdr-bar.has-fg .hdr-search-btn { color: var(--bar-fg); }
.hdr .hdr-bar.has-fg .nav-menu > li > a { color: var(--bar-fg); }
@media (min-width: 901px) { .hdr .hdr-bar.has-h .hdr-row { height: var(--bar-h); } }
.hdr-bar--main.hdr-bar--line { border-bottom: 1px solid rgba(15,23,42,.09); }
.hdr-bar--bottom.hdr-bar--line { border-top: 1px solid rgba(15,23,42,.09); }
.hdr-bar--main.hdr-bar--line:has(~ .hdr-bar--bottom) { border-bottom: 0; }
.hdr--builder .hdr-row--2 { border-top: 0; }   /* the line belongs to the band, so it spans the full width */
/* blocks sit centred on the line of the bar */
.hdr-blk { align-self: center; }
.sb-text { font-size: 14px; color: inherit; line-height: 1.35; }
.sb-text--sm { font-size: 12.5px; } .sb-text--lg { font-size: 16px; } .sb-text--bold { font-weight: 700; }
.sb-text a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sb-link { color: inherit; text-decoration: none; font-size: 13.5px; white-space: nowrap; opacity: .95; }
.sb-link:hover { text-decoration: underline; opacity: 1; }
.sb-html { font-size: 14px; line-height: 1.4; }
.sb-html p { margin: 0; } .sb-html a { color: inherit; }
.sb-div { display: inline-block; width: 1px; background: currentColor; opacity: .25; flex: none; }
.sb-sp { display: inline-block; flex: none; height: 1px; }
.sb-img img { display: block; width: auto; max-width: 100%; }
.sb-menu .nav-menu { display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sb-menu .nav-menu > li > a { display: block; padding: 6px 9px; font-size: 13.5px; color: inherit; text-decoration: none; border-radius: 6px; }
.sb-menu .nav-menu > li > a:hover { background: rgba(127,127,127,.15); }
.sb-menu .sub-menu { display: none; }

/* social icons */
.sb-social { display: inline-flex; align-items: center; gap: 6px; }
.sb-social__a { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 50%; background: rgba(127,127,127,.18); color: inherit; font-size: 12px; font-weight: 700; text-decoration: none; line-height: 1; transition: background .15s, transform .15s; box-sizing: border-box; }
.sb-social--sm .sb-social__a { min-width: 26px; height: 26px; font-size: 11px; }
.sb-social--text .sb-social__a { border-radius: 6px; background: transparent; font-weight: 600; font-size: 13px; }
.sb-social__a:hover { background: var(--primary, #4f46e5); color: #fff; transform: translateY(-1px); }
.sb-social--text .sb-social__a:hover { background: rgba(127,127,127,.15); color: inherit; transform: none; }

/* buttons (the original header button keeps its own .hdr-cta look) */
.sb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; align-self: center; font-weight: 600; text-decoration: none; border: 2px solid transparent; line-height: 1.2; white-space: nowrap; box-sizing: border-box; transition: filter .15s, transform .15s, background .15s, color .15s; }
.sb-btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.sb-btn--sm { padding: 5px 10px; font-size: 12.5px; } .sb-btn--md { padding: 7px 16px; font-size: 14px; } .sb-btn--lg { padding: 10px 22px; font-size: 15.5px; }
.sb-r--md { border-radius: 8px; } .sb-r--pill { border-radius: 999px; } .sb-r--square { border-radius: 2px; }
.sb-btn__icon { font-size: 1.05em; line-height: 1; }
.hdr .sb-btn--solid, .site-footer .sb-btn--solid, .hdr-topbar .sb-btn--solid { background: var(--sb-bg, var(--primary, #4f46e5)); border-color: var(--sb-bg, var(--primary, #4f46e5)); color: var(--sb-fg, #fff) !important; }
.hdr .sb-btn--outline, .site-footer .sb-btn--outline, .hdr-topbar .sb-btn--outline { background: transparent; border-color: var(--sb-bg, var(--primary, #4f46e5)); color: var(--sb-fg, var(--sb-bg, var(--primary, #4f46e5))) !important; }
.hdr .sb-btn--outline:hover, .site-footer .sb-btn--outline:hover, .hdr-topbar .sb-btn--outline:hover { background: var(--sb-bg, var(--primary, #4f46e5)); color: var(--sb-fg, #fff) !important; }
.hdr .sb-btn--ghost, .site-footer .sb-btn--ghost, .hdr-topbar .sb-btn--ghost { background: transparent; color: var(--sb-fg, var(--sb-bg, currentColor)) !important; padding-left: 8px; padding-right: 8px; }
.hdr .sb-btn--ghost:hover, .site-footer .sb-btn--ghost:hover, .hdr-topbar .sb-btn--ghost:hover { background: rgba(127,127,127,.15); }
.hdr .sb-btn--dark, .site-footer .sb-btn--dark, .hdr-topbar .sb-btn--dark { background: var(--sb-bg, #111827); border-color: var(--sb-bg, #111827); color: var(--sb-fg, #fff) !important; }
.hdr .sb-btn--light, .site-footer .sb-btn--light, .hdr-topbar .sb-btn--light { background: var(--sb-bg, #fff); border-color: var(--sb-bg, #e5e7eb); color: var(--sb-fg, #111827) !important; }

/* top bar made of blocks */
.hdr-topbar--blocks { background: var(--bar-bg, var(--hdr-fg, #111827)); color: var(--bar-fg, var(--hdr-bg, #fff)); font-size: 13px; }
.hdr-topbar--blocks .hdr-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--bar-h, 38px); flex-wrap: wrap; }
.hdr-topbar--blocks a { color: inherit; margin-left: 0; opacity: 1; }
.hdr-topbar__zones > .hdr-zone { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.hdr-topbar__zones > .hdr-zone--left { justify-content: flex-start; flex: 1 1 0; }
.hdr-topbar__zones > .hdr-zone--center { justify-content: center; flex: 0 1 auto; }
.hdr-topbar__zones > .hdr-zone--right { justify-content: flex-end; flex: 1 1 0; }
.hdr-topbar--blocks .hdr-item { align-items: center; }

/* the folded phone header: extra blocks never break the compact bar */
@media (max-width: 900px) {
    .hdr .hdr-blk { order: 5; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .hdr .sb-btn { order: 3; }
}
@media (max-width: 640px) {
    .hdr .hdr-cta.sb-m { display: inline-flex; padding: 7px 12px; font-size: 12.5px; }
    .hdr-topbar--blocks .hdr-topbar__inner { justify-content: center; text-align: center; padding-top: 6px; padding-bottom: 6px; }
    .hdr-topbar__zones > .hdr-zone { flex: 1 1 100%; justify-content: center; }
}

/* footer: strip above the columns, blocks in the bottom bar */
.site-footer__strip { background: var(--bar-bg, rgba(255,255,255,.05)); color: var(--bar-fg, inherit); border-bottom: 1px solid rgba(255,255,255,.08); }
.ft-strip__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: var(--bar-h, 64px); padding-top: 12px; padding-bottom: 12px; }
.ft-strip__inner > .ft-zone--left { flex: 1 1 0; } .ft-strip__inner > .ft-zone--right { flex: 1 1 0; }
.ft-strip__inner > .ft-zone--center { flex: 0 1 auto; }
.site-footer .sb-text, .site-footer .sb-link, .site-footer .sb-html { color: var(--bar-fg, var(--ft-fg, #94a3b8)); }
.site-footer .sb-text a, .site-footer .sb-link:hover { color: #e2e8f0; }
.site-footer .hdr-item { align-items: center; }
@media (max-width: 640px) { .ft-strip__inner > .ft-zone { flex: 1 1 100%; justify-content: center; } }

/* outline / ghost buttons on a top bar follow the bar's own text colour (the brand colour would be hard to read on a dark bar) */
.hdr-topbar .sb-btn--outline { border-color: var(--sb-bg, currentColor); color: var(--sb-fg, var(--sb-bg, currentColor)) !important; }
.hdr-topbar .sb-btn--outline:hover { background: rgba(255,255,255,.14); color: var(--sb-fg, currentColor) !important; }

/* ═══ Responsive header and mobile menu (builder header) ═══════════════════════════════════════════════════════════════
   <= 1099px  the menu is the hamburger panel: sub menus and mega menus open with a tap (script in the layout adds the .sub-toggle buttons)
   <=  900px  top bar wraps compactly, main bar is one compact line, a bottom bar with more than the menu is shown as its own row */
.sub-toggle { display: none; }

@media (max-width: 1099px) {
    .hdr .site-nav { top: 100% !important; left: 0 !important; right: 0 !important; padding: 4px 16px 14px !important; background: var(--hdr-bg, #fff) !important;
        max-height: calc(100vh - 110px) !important; overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-top: 1px solid #e5e7eb; }
    @supports (height: 100dvh) { .hdr .site-nav { max-height: calc(100dvh - 110px) !important; } }
    .hdr .site-nav .nav-menu { width: 100%; }
    /* every item is a row: its link, the open / close button, and (when open) its sub menu underneath */
    .hdr .site-nav li { display: flex !important; flex-wrap: wrap; align-items: center; width: 100%; height: auto !important; border-bottom: 1px solid #f1f5f9; }
    .hdr .site-nav .nav-menu > li:last-child { border-bottom: 0; }
    .hdr .site-nav li > a { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 13px 4px !important; font-size: 15px; color: var(--hdr-fg, #374151); }
    .hdr .sub-toggle { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--hdr-fg, #374151); cursor: pointer; transition: background .15s, color .15s; }
    .hdr .sub-toggle svg { transition: transform .2s; }
    .hdr .sub-toggle:hover, .hdr .sub-toggle:focus-visible { background: rgba(79,70,229,.1); outline: none; }
    .hdr li.is-open > .sub-toggle { color: var(--primary, #4f46e5); } .hdr li.is-open > .sub-toggle svg { transform: rotate(180deg); }
    /* closed until the person taps; a hover (which phones fake on tap) never opens them */
    .hdr .site-nav .sub-menu, .hdr .site-nav .mega-dropdown { display: none !important; flex: 0 0 100%; width: 100%; position: static !important; opacity: 1 !important; transform: none !important;
        pointer-events: auto; box-shadow: none !important; border: 0 !important; background: transparent !important; animation: none !important; }
    .hdr .site-nav li.is-open > .sub-menu, .hdr .site-nav li.is-open > .mega-dropdown { display: block !important; }
    .hdr .site-nav .sub-menu { margin: 0 0 8px 6px; padding: 0 0 4px 12px !important; border-left: 2px solid #e5e7eb !important; min-width: 0; }
    .hdr .site-nav .sub-menu li { border-bottom: 0; }
    .hdr .site-nav .sub-menu li > a { padding: 10px 6px !important; font-size: 14px; font-weight: 500; color: var(--hdr-fg, #374151); }
    /* mega menu: the columns stack, each with its title and links */
    .hdr .mega-dropdown-inner { display: block !important; max-width: none !important; margin: 0 0 8px 6px; padding: 2px 0 4px 12px !important; border-left: 2px solid #e5e7eb; }
    .hdr .mega-column { display: block; flex: none; padding: 2px 0 6px !important; border: 0 !important; }
    .hdr .mega-column-title { margin: 8px 0 2px; padding: 0 6px; font-size: 11px; letter-spacing: .06em; }
    .hdr .mega-column-links { list-style: none; margin: 0; padding: 0; }
    .hdr .mega-column-links li { border-bottom: 0; }
    .hdr .mega-link { padding: 10px 6px; font-size: 14px; }
}

@media (max-width: 900px) {
    /* top bar: one compact, centred, wrapping strip (empty areas take no room) */
    .hdr-topbar--blocks .hdr-topbar__inner { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; min-height: 0; padding-top: 7px; padding-bottom: 7px; text-align: center; }
    .hdr-topbar__zones > .hdr-zone, .hdr-topbar__zones > .hdr-zone--left, .hdr-topbar__zones > .hdr-zone--center, .hdr-topbar__zones > .hdr-zone--right { display: contents; }
    .hdr-topbar--blocks { font-size: 12.5px; }
    .hdr-topbar--blocks .sb-social__a { min-width: 26px; height: 26px; font-size: 11px; }
    .hdr-topbar--blocks .sb-btn { padding: 4px 11px; font-size: 12px; }

    /* main bar: one compact line - logo, search, buttons; the hamburger sits at the right end whichever bar holds the menu */
    .hdr--builder .hdr__inner { display: block; height: auto; position: relative; }
    .hdr--builder .hdr-bar--main .hdr-row { display: flex; align-items: center; height: 64px; padding-right: 52px; min-width: 0; }
    .hdr--builder .nav-toggle { position: absolute; top: 12px; right: 16px; margin: 0 !important; order: 0; z-index: 3; }
    /* bottom bar: a visible row of its own (a bar that holds only the menu is not shown: the menu is the hamburger) */
    .hdr--builder .hdr-bar--bottom .hdr-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; height: auto; min-height: 0; padding: 8px 0; }
    .hdr--builder .hdr-bar--bottom .hdr-blk, .hdr--builder .hdr-bar--bottom .sb-btn { order: 0; max-width: 100%; overflow: visible; white-space: normal; }
    .hdr--builder .hdr-bar--navonly { display: none; }
    .hdr--builder .hdr-bar--bottom .hdr-item--menu { display: contents; }
}
@media (max-width: 640px) {
    .hdr--builder .hdr-bar--main .hdr-row { height: 58px; padding-right: 48px; }
    .hdr--builder .nav-toggle { top: 9px; right: 14px; }
    .hdr-topbar--blocks .hdr-topbar__inner { gap: 3px 12px; }
}

/* a second menu in the top / bottom bar: a compact, wrapping row of links on every screen (the general mobile menu rules make menus vertical) */
.hdr .sb-menu .nav-menu, .hdr-topbar .sb-menu .nav-menu { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; justify-content: center; gap: 2px 4px !important; height: auto !important; width: auto !important; }
.hdr .sb-menu .nav-menu > li, .hdr-topbar .sb-menu .nav-menu > li { display: block !important; width: auto !important; height: auto !important; border: 0 !important; }
.hdr .sb-menu .nav-menu > li > a, .hdr-topbar .sb-menu .nav-menu > li > a { display: block !important; padding: 6px 9px !important; font-size: 13.5px !important; color: inherit !important; }
.hdr .sb-menu .sub-menu, .hdr .sb-menu .mega-dropdown, .hdr-topbar .sb-menu .sub-menu, .hdr-topbar .sb-menu .mega-dropdown { display: none !important; }
.hdr .sb-menu .sub-toggle, .hdr-topbar .sb-menu .sub-toggle { display: none !important; }
