/* Promotion bar (layouts/_partials/promo.html + static/js/promo.js).
   Shared look with the client portal and hostbillapp.com: keep the bar and pill rules in sync
   with the portal's components/promo.blackfriday.tpl. Only the "page offset" block is blog-specific. */
:root {
    --hbpromo-h: 0px;
    --hbpromo-radius: .43rem;
    --hbpromo-red: #e8343f;
    --hbpromo-orange: #f4583b;
    --hbpromo-navy: #141a28;
    --hbpromo-maroon: #5f2330;
    --hbpromo-brown: #4a302c;
    --hbpromo-blue: #80a6e8;
    --hbpromo-muted: #c1ccde;
    --hbpromo-gradient: linear-gradient(100deg, var(--hbpromo-red) 0%, var(--hbpromo-orange) 100%);
}

/* ---------- page offset (blog) ----------
   The topbar and header are in the normal flow, so padding on body moves them down.
   The sticky header that main-site script.min.js clones on scroll (.sticky_nav) is fixed
   at top:0 with an inline style, hence !important. */
html.hbpromo-ready { scroll-padding-top: var(--hbpromo-h); }
html.hbpromo-ready body { padding-top: var(--hbpromo-h); }
html.hbpromo-ready .sticky_nav { top: var(--hbpromo-h) !important; }
html.hbpromo-anim body { transition: padding-top .3s ease; }
html.hbpromo-anim .sticky_nav { transition: top .3s ease; }

/* ---------- bar ---------- */
.hbpromo {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1031;
    display: none;
    align-items: center;
    min-height: 48px;
    padding: 6px 44px;
    color: #fff;
    font-size: 14px;
    line-height: 1.35;
    background-color: var(--hbpromo-navy);
    background-image:
        radial-gradient(45% 240% at 82% 0%, rgba(95, 35, 48, .95) 0%, rgba(95, 35, 48, 0) 100%),
        radial-gradient(30% 220% at 100% 100%, rgba(74, 48, 44, .9) 0%, rgba(74, 48, 44, 0) 100%),
        radial-gradient(25% 200% at 0% 0%, rgba(232, 52, 63, .28) 0%, rgba(232, 52, 63, 0) 100%);
    overflow: hidden;
    box-sizing: border-box;
    transition: transform .3s ease, visibility 0s linear .3s;
}
.hbpromo::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--hbpromo-gradient);
}
.hbpromo::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: hbpromo-shine 7s ease-in-out 1.5s infinite;
    pointer-events: none;
}
@keyframes hbpromo-shine {
    0% { transform: translateX(-100%); }
    35%, 100% { transform: translateX(100%); }
}
html.hbpromo-ready .hbpromo { display: flex; }
html.hbpromo-collapsed .hbpromo {
    transform: translateY(-100%);
    visibility: hidden;
}
html.hbpromo-open .hbpromo { transition: transform .3s ease, visibility 0s; }

.hbpromo__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    text-align: center;
}
.hbpromo__text { color: var(--hbpromo-muted); }
.hbpromo__percent {
    color: #fff;
    font-weight: 800;
}
.hbpromo__code-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.hbpromo__code-label { color: var(--hbpromo-muted); opacity: .8; }
.hbpromo__code {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 3px 9px;
    border: 1px dashed var(--hbpromo-blue);
    border-radius: var(--hbpromo-radius);
    background: rgba(128, 166, 232, .1);
    color: #fff;
    font: 700 13px/1.3 SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    letter-spacing: .06em;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.hbpromo__code:hover,
.hbpromo__code:focus-visible {
    background: rgba(128, 166, 232, .22);
    border-style: solid;
    outline: none;
}
.hbpromo__code-icon { color: var(--hbpromo-blue); flex-shrink: 0; }
.hbpromo__code.is-copied .hbpromo__code-text,
.hbpromo__code.is-copied .hbpromo__code-icon { visibility: hidden; }
.hbpromo__code.is-copied::after {
    content: attr(data-copied);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hbpromo-blue);
    font-family: inherit;
}
.hbpromo__timer {
    color: var(--hbpromo-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    opacity: .75;
    white-space: nowrap;
}
.hbpromo__cta,
.hbpromo__cta:visited {
    display: inline-block;
    padding: 5px 14px;
    border-radius: var(--hbpromo-radius);
    background: var(--hbpromo-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(244, 88, 59, .3);
    transition: filter .15s, transform .15s, box-shadow .15s;
}
.hbpromo__cta:hover,
.hbpromo__cta:focus {
    color: #fff;
    text-decoration: none;
    filter: brightness(1.08);
    box-shadow: 0 3px 14px rgba(244, 88, 59, .45);
    transform: translateX(2px);
}
.hbpromo__close {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 8px;
    width: 30px;
    height: 30px;
    margin-top: -15px;
    padding: 0;
    border: 0;
    border-radius: var(--hbpromo-radius);
    background: transparent;
    color: var(--hbpromo-muted);
    font-size: 22px;
    line-height: 30px;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.hbpromo__close:hover,
.hbpromo__close:focus-visible { color: #fff; background: rgba(255, 255, 255, .1); outline: none; }

/* ---------- collapsed pill ---------- */
.hbpromo-pill {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 1031;
    display: none;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 3px 12px 4px;
    border: 0;
    border-radius: 0 0 var(--hbpromo-radius) var(--hbpromo-radius);
    background: var(--hbpromo-gradient);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .02em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(20, 26, 40, .3);
    transform: translate(-50%, -100%);
    transition: transform .25s ease, padding .15s ease;
}
.hbpromo-pill strong { font-weight: 800; }
html.hbpromo-collapsed .hbpromo-pill { display: inline-flex; }
html.hbpromo-collapsed.hbpromo-pill-in .hbpromo-pill { transform: translate(-50%, 0); }
.hbpromo-pill:focus { outline: none; }
.hbpromo-pill:hover,
.hbpromo-pill:focus-visible {
    padding-top: 6px;
    box-shadow: 0 4px 16px rgba(232, 52, 63, .45);
}
.hbpromo-pill:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--hbpromo-red); }
.hbpromo-pill__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: hbpromo-pulse 1.8s ease-in-out infinite;
}
@keyframes hbpromo-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); }
    50% { opacity: .7; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0); }
}

@media (max-width: 767px) {
    .hbpromo { padding: 8px 38px 8px 12px; font-size: 13px; }
    .hbpromo__inner { gap: 6px 10px; }
    .hbpromo__timer, .hbpromo__code-label { display: none; }
    .hbpromo__close { right: 4px; }
    .hbpromo-pill { font-size: 11px; padding: 2px 10px 3px; }
}
@media (prefers-reduced-motion: reduce) {
    .hbpromo::after { animation: none; display: none; }
    .hbpromo-pill__dot { animation: none; }
    .hbpromo, .hbpromo-pill { transition: none; }
    html.hbpromo-anim body, html.hbpromo-anim .sticky_nav { transition: none; }
}
@media print {
    .hbpromo, .hbpromo-pill { display: none !important; }
    html.hbpromo-ready body { padding-top: 0; }
}
