/* ═══════════════════════════════════════════════════════════════════════════
   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 { 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 { background: rgba(79,70,229,.08); border-color: var(--primary, #4f46e5); }
.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; } }