/**
 * Countdown Timer Block - Frontend and Editor Styles
 */

.advertorial-countdown-timer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}

/* Respond to Bootstrap text-align classes for positioning */
.advertorial-countdown-timer.text-center {
    justify-content: center;
}

.advertorial-countdown-timer.text-end {
    justify-content: flex-end;
}

.advertorial-countdown-timer .timer-label {
    font-weight: 500;
}

.advertorial-countdown-timer .timer-display {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.advertorial-countdown-timer .timer-unit {
    padding: 0.5rem;
    border-radius: 0.25rem;
    text-align: center;
    min-width: 60px;
}

.advertorial-countdown-timer .timer-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.2;
}

.advertorial-countdown-timer .timer-label-small {
    display: block;
    font-size: 0.75rem;
    line-height: 1;
    margin-top: 0.25rem;
}

/* Redirect (circular dots) format */
.advertorial-countdown-timer .redirect-timer-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.advertorial-countdown-timer .redirect-timer-dots {
    animation: redirect-timer-spin 1s linear infinite;
}

@keyframes redirect-timer-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.advertorial-countdown-timer .redirect-timer-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    line-height: 1;
    z-index: 1;
}

/* Inline format specific */
.advertorial-countdown-timer small {
    margin-right: 0.25rem;
}

/**
 * Inline format: let the typography colour reach the digits.
 *
 * The digits sit in a Bootstrap .badge, and .badge sets `color:
 * var(--bs-badge-color)` — which defaults to #fff — ON THE ELEMENT ITSELF.
 * The typography utility puts its text-* class on the wrapper, and an
 * inherited colour never beats a colour set directly on the child, so the
 * digits stayed white whatever the block settings said. The split and
 * redirect formats were unaffected because their digits are plain spans
 * that do inherit.
 *
 * Redefining the Bootstrap variable (rather than `color`) keeps the badge's
 * own rule intact and still lets a text-* utility on the badge win, since
 * that sets `color` directly and outranks var() resolution here.
 */
.advertorial-countdown-timer .badge {
    --bs-badge-color: inherit;
    color: inherit;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .advertorial-countdown-timer {
        gap: 0.5rem;
    }

    .advertorial-countdown-timer .timer-unit {
        min-width: 50px;
        padding: 0.375rem;
    }

    .advertorial-countdown-timer .timer-value {
        font-size: 1.25rem;
    }
}
