/* Reusable countdown timer — see templates/components/countdown_timer.html */

.countdownTimer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 20px;
    background: #FFFFFF;
    border: 1px solid var(--border-normal-50, #ECEFF3);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(13, 13, 18, 0.06), 0 1px 3px rgba(13, 13, 18, 0.04);
}

.countdownTimer-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-loud-900, #0D0D12);
    white-space: nowrap;
}

/* Fixed height so swapping the digits for the expired text never shifts the layout. */
.countdownTimer-body {
    display: flex;
    align-items: center;
    min-height: 44px;
}

.countdownTimer-units {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

.countdownTimer-unit {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0; /* a deadline a year out renders 3 digits — let the cell shrink, not overflow */
}

.countdownTimer-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: #00B7FD;
    font-variant-numeric: tabular-nums; /* digits keep their width as they tick */
    transition: color 0.2s ease;
}

.countdownTimer-unitLabel {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-normal-500, #666D80);
}

/* Final 24 hours */
.countdownTimer.is-urgent .countdownTimer-value {
    color: #EF8318;
}

/* Expired */
.countdownTimer.is-expired {
    background: #F6F8FC;
    box-shadow: none;
}

.countdownTimer-expiredText {
    display: none;
    font-size: 18px;
    font-weight: 700;
    color: #8A93A6;
}

.countdownTimer.is-expired .countdownTimer-units {
    display: none;
}

.countdownTimer.is-expired .countdownTimer-expiredText {
    display: block;
}

/* ---- Placement: event detail title row ---- */

.eventDetail-titleRow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 45px; /* same gap as .eventDetail-mainContainer below it */
}

/* Flex items default to min-width:auto; without this a long unbreakable title
   would push the countdown out of the row. */
.eventDetail-titleRow > .eventDetail-eventTitle {
    min-width: 0;
    overflow-wrap: break-word;
}

/* Matches the 1fr column of .eventDetail-mainContainer (2fr 1fr, 45px gap),
   so the countdown sits directly above the sticky sidebar card. */
.eventDetail-titleRow > .countdownTimer {
    flex: 0 0 calc((100% - 45px) / 3);
    max-width: calc((100% - 45px) / 3);
}

/* Bootstrap's .container is 960px here — the four cells get tight. */
@media only screen and (max-width: 1199px) {
    .countdownTimer-units {
        gap: 8px;
    }

    .countdownTimer-value {
        font-size: 22px;
    }
}

@media only screen and (max-width: 991px) {
    .eventDetail-titleRow {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .eventDetail-titleRow > .countdownTimer {
        flex: 0 0 auto;
        max-width: 420px;
        width: 100%;
    }

    .countdownTimer-value {
        font-size: 26px;
    }
}

@media only screen and (max-width: 767px) {
    .countdownTimer-units {
        gap: 6px;
    }

    .countdownTimer-value {
        font-size: 22px;
    }
}
