/* Footer odometer-style visitor counter — compact & eye-catching */
.footer-counter-bar {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.odometer-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* Footer: single compact pill */
.odometer-counter--footer {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1a1410 0%, #0d0b0a 55%, #1a1008 100%);
    border: 1px solid rgba(194, 65, 12, 0.55);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 4px 16px rgba(194, 65, 12, 0.22),
        0 2px 8px rgba(0, 0, 0, 0.35);
    animation: odometer-pill-glow 3s ease-in-out infinite;
}

@keyframes odometer-pill-glow {
    0%,
    100% {
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.06) inset,
            0 4px 14px rgba(194, 65, 12, 0.2),
            0 2px 8px rgba(0, 0, 0, 0.35);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.08) inset,
            0 4px 20px rgba(194, 65, 12, 0.38),
            0 2px 10px rgba(0, 0, 0, 0.4);
    }
}

.odometer-counter--footer:hover {
    transform: translateY(-1px) scale(1.02);
    filter: brightness(1.08);
    border-color: rgba(234, 88, 12, 0.75);
}

.odometer-counter--footer:focus-visible {
    outline: 2px solid #ea580c;
    outline-offset: 3px;
}

.odometer-counter__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-right: 4px;
    border-right: 1px solid rgba(194, 65, 12, 0.35);
}

.odometer-counter__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    animation: odometer-dot-pulse 1.8s ease-in-out infinite;
}

@keyframes odometer-dot-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.65;
        transform: scale(0.85);
    }
}

.odometer-counter__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fdba74;
    white-space: nowrap;
    line-height: 1;
}

.odometer-counter__frame {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.odometer-counter--footer .odometer-counter__frame {
    gap: 2px;
}

.odometer-digit {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 26px;
    border-radius: 3px;
    border: 1px solid #9ca3af;
    background: linear-gradient(
        180deg,
        #404040 0%,
        #2a2a2a 24%,
        #181818 48%,
        #0c0c0c 52%,
        #1f1f1f 76%,
        #0a0a0a 100%
    );
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.odometer-digit::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    margin-top: -1px;
    background: #000;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 2;
    pointer-events: none;
}

.odometer-digit__value {
    position: relative;
    z-index: 1;
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

/* Modal: slightly larger display */
.reader-counter-modal__body .odometer-counter__frame {
    gap: 4px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #1c1c1c 0%, #0a0a0a 100%);
    border-radius: 8px;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.reader-counter-modal__body .odometer-digit {
    width: clamp(26px, 5vw, 36px);
    height: clamp(36px, 7vw, 48px);
    border-radius: 5px;
    border-width: 2px;
}

.reader-counter-modal__body .odometer-digit__value {
    font-size: clamp(20px, 4.5vw, 28px);
}

.odometer-counter--static {
    cursor: default;
    pointer-events: none;
    animation: none;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.odometer-counter--static:hover {
    transform: none;
    filter: none;
}

/* Modal */
.reader-counter-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.reader-counter-modal--open {
    display: flex;
}

.reader-counter-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 18, 15, 0.55);
}

.reader-counter-modal__panel {
    position: relative;
    width: min(480px, 100%);
    background: linear-gradient(180deg, #fffdf8 0%, #fff 100%);
    border-radius: 16px;
    border: 1px solid #e8dfd0;
    box-shadow: 0 28px 64px rgba(23, 18, 15, 0.2);
    overflow: hidden;
}

.reader-counter-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #efe6d8;
    background: linear-gradient(135deg, #c2410c 0%, #9a3412 100%);
    color: #fff;
}

.reader-counter-modal__eyebrow {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.9;
}

.reader-counter-modal__header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
}

.reader-counter-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.reader-counter-modal__close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.reader-counter-modal__body {
    padding: 24px 20px 20px;
    text-align: center;
}

.reader-counter-modal__lead {
    margin: 0 0 16px;
    color: #6b5f54;
    font-size: 14px;
}

.reader-counter-modal__body .odometer-counter__frame {
    margin: 0 auto;
}

.reader-counter-modal__note {
    margin: 16px 0 0;
    font-size: 13px;
    color: #6b5f54;
    line-height: 1.5;
}

.reader-counter-modal__footer {
    padding: 0 20px 20px;
    display: flex;
    justify-content: center;
}

.reader-counter-modal__btn {
    padding: 10px 22px;
    border-radius: 999px;
    border: 0;
    background: #c2410c;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}

.reader-counter-modal__btn:hover {
    background: #9a3412;
}

@media (prefers-reduced-motion: reduce) {
    .odometer-counter--footer,
    .odometer-counter__dot {
        animation: none;
    }
}

@media (max-width: 380px) {
    .odometer-counter--footer {
        gap: 8px;
        padding: 4px 6px 4px 8px;
    }

    .odometer-digit {
        width: 16px;
        height: 24px;
    }

    .odometer-digit__value {
        font-size: 13px;
    }

    .odometer-counter__label {
        font-size: 9px;
    }
}
