/* ==========================================================================
   HCS Day of Giving — Alert bars
   - .hcs-dog-alert--g  : pre-event minimal navy bar
   - .hcs-dog-alert--j  : day-of full bar (countdown + mini thermometer + CTA)
   Tokens (defined in core.css): --hcs-teal, --hcs-navy, --giving-orange,
   --giving-amber, --giving-gradient, --dark-gradient, --shadow-card,
   --shadow-elevated, --hcs-font-display, --hcs-font-body, --hcs-font-accent,
   --hcs-text-soft.
   ========================================================================== */

/* ---------- shared shell ---------- */
.hcs-dog-alert {
    position: relative;
    width: 100%;
    z-index: 100;
    color: var(--wp--preset--color--white);
    font-family: var(--hcs-font-body, 'Open Sans', system-ui, sans-serif);
    box-shadow: var(--shadow-card, 0 6px 18px rgba(0, 0, 0, 0.08));
    box-sizing: border-box;
}
.hcs-dog-alert *,
.hcs-dog-alert *::before,
.hcs-dog-alert *::after { box-sizing: border-box; }

.hcs-dog-alert[data-dismissed="1"] { display: none; }

.hcs-dog-alert a { color: inherit; }
.hcs-dog-alert a:focus-visible,
.hcs-dog-alert button:focus-visible {
    outline: 2px solid var(--giving-amber, #fcb900);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- close button (shared) ---------- */
.hcs-dog-alert__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: transparent;
    color: var(--wp--preset--color--white);
    font-size: 1.125rem;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 200ms ease, border-color 200ms ease, background 200ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hcs-dog-alert__close:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   G — pre-event minimal teal bar
   ========================================================================== */
.hcs-dog-alert--g {
    background: var(--hcs-navy, #00476c);
    font-size: 0.9375rem;
}
.hcs-dog-alert--g .hcs-dog-alert__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.hcs-dog-alert--g .hcs-dog-alert__date {
    font-family: var(--hcs-font-display, 'Oswald', sans-serif);
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--giving-amber, #fcb900);
    white-space: nowrap;
}
.hcs-dog-alert--g .hcs-dog-alert__sep {
    opacity: 0.5;
    font-weight: 600;
}
.hcs-dog-alert--g .hcs-dog-alert__message {
    flex: 1 1 auto;
    line-height: 1.35;
}
/* Floating fallback host — used when the theme doesn't call wp_body_open()
   and we re-emit the alert into wp_footer instead. Pins the bar to the top
   of the viewport so it shows up regardless of theme. */
.hcs-dog-alert-floating-host {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    pointer-events: none;
}
.hcs-dog-alert-floating-host > .hcs-dog-alert {
    pointer-events: auto;
}

[data-hcs-dog-component="alert"] a.hcs-dog-alert__cta,
.hcs-dog-alert a.hcs-dog-alert__cta {
    text-decoration: none;
    border-bottom: 0;
}
.hcs-dog-alert--g a.hcs-dog-alert__cta,
[data-hcs-dog-component="alert"].hcs-dog-alert--g a.hcs-dog-alert__cta {
    color: var(--giving-amber, #fcb900);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    transition: opacity 200ms ease;
    white-space: nowrap;
    border-bottom: 0;
}
.hcs-dog-alert--g a.hcs-dog-alert__cta:visited { color: var(--giving-amber, #fcb900); }
.hcs-dog-alert--g a.hcs-dog-alert__cta:hover { opacity: 0.85; color: var(--wp--preset--color--white); }

/* ==========================================================================
   I — day-of full bar
   ========================================================================== */
.hcs-dog-alert--j {
    background: var(--dark-gradient, linear-gradient(135deg, #00476c 0%, #0d5479 50%, #206D78 100%));
    min-height: 64px;
}
.hcs-dog-alert--j::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--giving-gradient, linear-gradient(135deg, #ff6900 0%, #fcb900 100%));
    pointer-events: none;
}
.hcs-dog-alert--j .hcs-dog-alert__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hcs-dog-alert--j[data-countdown-ended="1"] .hcs-dog-alert__countdown { display: none; }
.hcs-dog-alert--h .alert-countdown-inline__unit,
.hcs-dog-alert--j .alert-countdown-inline__unit {
    display: inline-flex;
    align-items: baseline;
}
.hcs-dog-alert .alert-countdown-inline__unit[hidden],
.hcs-dog-alert .alert-countdown-inline__sep[hidden] { display: none; }

/* mini thermometer */
.hcs-dog-alert--j .hcs-dog-alert__thermo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1 1 200px;
    min-width: 200px;
}
.hcs-dog-alert--j .alert-mini-thermo__amount {
    font-family: var(--hcs-font-accent, 'Roboto Slab', Georgia, serif);
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--giving-orange, #ff6900);
    white-space: nowrap;
}
.hcs-dog-alert--j .alert-mini-thermo__track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: block;
}
.hcs-dog-alert--j .alert-mini-thermo__fill {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--giving-gradient, linear-gradient(135deg, #ff6900 0%, #fcb900 100%));
    transform-origin: left center;
    transform: scaleX(calc(var(--dog-percent, 0) / 100));
    transition: transform var(--dog-transition);
    position: relative;
    will-change: transform;
}
.hcs-dog-alert--j .alert-mini-thermo__fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: hcs-dog-thermo-shine 2.5s linear infinite;
    pointer-events: none;
}
@keyframes hcs-dog-thermo-shine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
    .hcs-dog-alert--j .alert-mini-thermo__fill { transition: none; }
    .hcs-dog-alert--j .alert-mini-thermo__fill::after { animation: none; opacity: 0; }
}
.hcs-dog-alert--j .alert-mini-thermo__pct {
    font-size: 0.8125rem;
    color: var(--hcs-text-soft, rgba(255, 255, 255, 0.85));
    white-space: nowrap;
}

/* ==========================================================================
   H — compact navy bar (2-weeks-out window)
   Inherits the brand cluster, inline countdown, and CTA pill from J via
   shared selectors below.
   ========================================================================== */
.hcs-dog-alert--h {
    background: var(--dark-gradient, linear-gradient(135deg, #00476c 0%, #0d5479 50%, #206D78 100%));
    min-height: 56px;
}
.hcs-dog-alert--h::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--giving-gradient, linear-gradient(135deg, #ff6900 0%, #fcb900 100%));
    pointer-events: none;
}
.hcs-dog-alert--h .hcs-dog-alert__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.hcs-dog-alert--h .hcs-dog-alert__countdown {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}
.hcs-dog-alert--h[data-countdown-ended="1"] .hcs-dog-alert__countdown { display: none; }

/* H borrows the brand cluster, inline countdown, and CTA pill from J. */
.hcs-dog-alert--h .hcs-dog-alert__brand,
.hcs-dog-alert--j .hcs-dog-alert__brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 1.25rem;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}
.hcs-dog-alert--h .hcs-dog-alert__brand-eyebrow,
.hcs-dog-alert--j .hcs-dog-alert__brand-eyebrow {
    font-family: var(--hcs-font-display, 'Oswald', sans-serif);
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--giving-orange, #ff6900);
}
.hcs-dog-alert--h .hcs-dog-alert__brand-title,
.hcs-dog-alert--j .hcs-dog-alert__brand-title {
    font-family: var(--hcs-font-display, 'Oswald', sans-serif);
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: var(--wp--preset--color--white);
}
.hcs-dog-alert--h .alert-countdown-inline,
.hcs-dog-alert--j .alert-countdown-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    font-family: var(--hcs-font-display, 'Oswald', sans-serif);
    font-weight: 500;
}
.hcs-dog-alert--h .alert-countdown-inline__unit > span:first-child,
.hcs-dog-alert--j .alert-countdown-inline__unit > span:first-child {
    font-size: 1.375rem;
    line-height: 1;
    color: var(--wp--preset--color--white);
    font-variant-numeric: tabular-nums;
    min-width: 1.6em;
    text-align: right;
}
.hcs-dog-alert--h .alert-countdown-inline__lbl,
.hcs-dog-alert--j .alert-countdown-inline__lbl {
    font-size: 0.6875rem;
    color: var(--hcs-text-soft, rgba(255, 255, 255, 0.85));
    margin-left: 2px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.hcs-dog-alert--h .alert-countdown-inline__sep,
.hcs-dog-alert--j .alert-countdown-inline__sep {
    color: var(--giving-amber, #fcb900);
    opacity: 0.7;
    font-weight: 600;
}
.hcs-dog-alert--h a.hcs-dog-alert__cta,
.hcs-dog-alert--j a.hcs-dog-alert__cta,
[data-hcs-dog-component="alert"].hcs-dog-alert--h a.hcs-dog-alert__cta,
[data-hcs-dog-component="alert"].hcs-dog-alert--j a.hcs-dog-alert__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    background: var(--giving-gradient, linear-gradient(135deg, #ff6900 0%, #fcb900 100%));
    background-color: var(--giving-orange, #ff6900);
    color: var(--wp--preset--color--white);
    padding: 0.625rem 1.5rem;
    border-radius: 9999px;
    font-family: var(--hcs-font-display, 'Oswald', sans-serif);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border: 0;
    border-bottom: 0;
    box-shadow: 0 4px 12px rgba(var(--giving-orange-rgb), 0.35);
    transition: transform 200ms ease, box-shadow 200ms ease;
}
.hcs-dog-alert--h a.hcs-dog-alert__cta:visited,
.hcs-dog-alert--j a.hcs-dog-alert__cta:visited {
    color: var(--wp--preset--color--white);
}
.hcs-dog-alert--h a.hcs-dog-alert__cta:hover,
.hcs-dog-alert--h a.hcs-dog-alert__cta:focus-visible,
.hcs-dog-alert--j a.hcs-dog-alert__cta:hover,
.hcs-dog-alert--j a.hcs-dog-alert__cta:focus-visible {
    transform: translateY(-1px);
    color: var(--wp--preset--color--white);
    box-shadow: 0 6px 18px rgba(var(--giving-orange-rgb), 0.5);
    color: var(--wp--preset--color--white);
}

/* ==========================================================================
   Responsive — collapse the bars on narrow screens
   ========================================================================== */
@media (max-width: 720px) {
    .hcs-dog-alert--g .hcs-dog-alert__inner {
        padding: 0.625rem 1rem;
        gap: 0.5rem;
    }
    .hcs-dog-alert--g .hcs-dog-alert__sep { display: none; }

    .hcs-dog-alert--h .hcs-dog-alert__inner,
    .hcs-dog-alert--j .hcs-dog-alert__inner {
        padding: 0.75rem 1rem;
        gap: 0.75rem 1rem;
    }
    .hcs-dog-alert--h .hcs-dog-alert__brand,
    .hcs-dog-alert--j .hcs-dog-alert__brand {
        flex: 1 1 100%;
        padding-right: 0;
        padding-bottom: 0.5rem;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    }
    .hcs-dog-alert--h .hcs-dog-alert__brand-title,
    .hcs-dog-alert--j .hcs-dog-alert__brand-title { font-size: 0.9375rem; }
    .hcs-dog-alert--h .alert-countdown-inline__unit > span:first-child,
    .hcs-dog-alert--j .alert-countdown-inline__unit > span:first-child { font-size: 1.125rem; }
    .hcs-dog-alert--j .hcs-dog-alert__thermo {
        flex: 1 1 100%;
        min-width: 0;
    }
    .hcs-dog-alert--j .alert-mini-thermo__amount { font-size: 0.9375rem; }
    .hcs-dog-alert--h .hcs-dog-alert__cta,
    .hcs-dog-alert--j .hcs-dog-alert__cta {
        padding: 0.5rem 1.125rem;
        font-size: 0.8125rem;
    }
}
