/* Dana banner countdown: what the three designs share - the section's
   colours, the text and the three clock looks (countdown_style). Each
   design's geometry is in banner-countdown-1/2/3.css.

   The clocks are the template's .wg-countdown-2 (inline: digits with a
   colon between them, styles.css 17388-17440), .wg-countdown (boxes: 90px
   cells with a 1px line, 17361-17386) and .s-banner-cd-baby .wg-countdown
   (circles: white round cells 70/90/120px, 17809-17818, 18710-18716,
   20042-20049), with the steps of 22460-22467 and 23011-23027 and the 5px
   gap of 23169 (`.js-countdown .countdown__timer` under 426px).

   Colours: the merchant's text_color (--dana-bcd-text) paints the title,
   the text, the labels and the colons; title_color (--dana-bcd-title-color)
   the title alone, before all of these (empty: text_color's, as before);
   countdown_color (--dana-bcd-digits) the digits; panel_color
   (--dana-bcd-panel) the ground behind the text.
   Empty, each falls back to the look's own token, except that words on a
   picture, a card or a coloured panel get that ground's ink from the
   section (--dana-bcd-text, banner-countdown.jinja). */
.dana-bcd__eyebrow,
.dana-bcd__text {
  margin: 0;
  color: var(--dana-bcd-text, var(--dana-text));
  overflow-wrap: break-word;
}
.dana-bcd__text { font-size: var(--dana-fs-md); line-height: var(--dana-lh-md); }
/* --dana-bcd-title-color: the merchant's title_color, first. --dana-bcd-title:
   the heading's role of our own dark ink (the section writes it only with
   --dana-bcd-text, never with the merchant's). */
.dana-banner-countdown .dana-bcd__title {
  color: var(--dana-bcd-title-color, var(--dana-bcd-title, var(--dana-bcd-text, var(--dana-heading))));
  overflow-wrap: break-word;
}

/* ---- The clock ------------------------------------------------------------
   ui.js writes the digits and marks the timer data-counting; until then the
   whole clock (its white box and hairline too) keeps its room but paints
   nothing, so a date that has already passed never flashes an empty box or
   00 : 00 before it is hidden. The timer rule stays for a browser without
   :has(), which then hides the digits at least. */
.dana-bcd__clock { max-inline-size: 100%; }
.dana-bcd__clock[hidden] { display: none; }
.dana-bcd__timer { display: flex; }
.dana-bcd__timer:not([data-counting]) { visibility: hidden; }
.dana-bcd__clock:has(> .dana-bcd__timer:not([data-counting])) { visibility: hidden; }
.dana-bcd__unit {
  display: flex;
  flex-direction: column;
  text-align: center;
}
.dana-bcd__value { display: block; font-weight: 500; }
.dana-bcd__label {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--dana-bcd-text, var(--dana-text));
}
/* A label or colon inside a white ground (the inline look's box, the
   circles) stays the template's dark (var(--dark)), whatever text_color
   says: white text for a dark panel left them invisible on the white
   cells. The digits keep countdown_color. */
.dana-bcd__clock--circles .dana-bcd__label,
.dana-bcd__clock--inline .dana-bcd__label { color: #000000; }
.dana-banner-countdown .dana-bcd__clock--inline .dana-bcd__unit:not(:last-child) .dana-bcd__value::after { color: #000000; }
/* end_message, written by ui.js into the timer in place of the digits. */
.dana-bcd__timer.is-expired {
  display: block;
  font-size: var(--dana-fs-md);
  line-height: var(--dana-lh-md);
  font-weight: 500;
  color: var(--dana-bcd-text, var(--dana-heading));
}
/* In the inline look's white box the message stays dark like the labels:
   a white text_color over a dark picture left it white on white. */
.dana-bcd__clock--inline .dana-bcd__timer.is-expired { color: #000000; }

/* Inline: .wg-countdown-2, a white box with a hairline. */
.dana-bcd__clock--inline {
  inline-size: max-content;
  max-inline-size: 100%;
  padding: 16px 32px;
  border: 1px solid var(--dana-line);
  border-radius: 8px;
  background-color: #ffffff;
}
.dana-bcd__clock--inline .dana-bcd__timer { gap: 29px; }
.dana-bcd__clock--inline .dana-bcd__unit { gap: 4px; min-inline-size: 56px; }
.dana-bcd__clock--inline .dana-bcd__unit:first-child { min-inline-size: 30px; }
.dana-bcd__clock--inline .dana-bcd__value {
  position: relative;
  font-size: 40px;
  line-height: 50px;
  color: var(--dana-bcd-digits, var(--dana-accent-ink));
}
/* The colon sits 14px past each value's end edge, centred on that point
   (right: -14px + translate(50%) in the template); mirrored in Arabic. */
.dana-bcd__clock--inline .dana-bcd__unit:not(:last-child) .dana-bcd__value::after {
  content: ":";
  position: absolute;
  inset-block-start: 50%;
  left: auto;
  right: auto;
  inset-inline-end: -14px;
  transform: translate(50%, -50%);
  font-family: var(--dana-font-body);
  font-size: 20px;
  line-height: 30px;
  font-weight: 500;
  color: var(--dana-bcd-text, var(--dana-heading));
}
[dir="rtl"] .dana-bcd__clock--inline .dana-bcd__unit:not(:last-child) .dana-bcd__value::after { transform: translate(-50%, -50%); }
@media (max-width: 767px) {
  .dana-bcd__clock--inline .dana-bcd__unit { gap: 0; min-inline-size: 40px; }
  .dana-bcd__clock--inline .dana-bcd__unit:first-child { min-inline-size: 30px; }
  .dana-bcd__clock--inline .dana-bcd__value { font-size: 30px; line-height: 40px; }
}
@media (max-width: 575px) {
  .dana-bcd__clock--inline { padding: 15px; }
}

/* Boxes: .wg-countdown, 90px cells with a 1px line in the accent. */
.dana-bcd__clock--boxes .dana-bcd__timer { gap: 20px; }
.dana-bcd__clock--boxes .dana-bcd__timer,
.dana-bcd__clock--circles .dana-bcd__timer { align-items: flex-start; }
/* The cells keep their shape and give way together when a column is
   narrower than four of them (a panel column at 768-1199px holds 300-416px;
   four 90px cells and their gaps need 390-420px), instead of running out of
   the panel. */
.dana-bcd__clock--boxes .dana-bcd__unit,
.dana-bcd__clock--circles .dana-bcd__unit {
  flex: 0 1 auto;
  justify-content: center;
  inline-size: 90px;
  min-inline-size: 0;
  aspect-ratio: 1;
  border: 1px solid var(--dana-accent);
  border-radius: 6px;
}
.dana-bcd__clock--boxes .dana-bcd__value,
.dana-bcd__clock--circles .dana-bcd__value {
  font-size: 36px;
  line-height: 44px;
  letter-spacing: -0.02em;
  color: var(--dana-bcd-digits, var(--dana-heading));
}
/* The boxes are open cells: their digits sit on what the words sit on, so
   with no countdown_color they take the words' colour (the section writes
   --dana-bcd-text for a picture, a card or a coloured panel). */
.dana-bcd__clock--boxes .dana-bcd__value { color: var(--dana-bcd-digits, var(--dana-bcd-text, var(--dana-heading))); }
/* Circles: the same cells, round and white, the digits in the heading font
   at 700 in the accent (Grandstander #f6620c on home-baby). */
.dana-bcd__clock--circles .dana-bcd__timer { gap: 10px; }
.dana-bcd__clock--circles .dana-bcd__unit { border-radius: 50%; background-color: #ffffff; }
.dana-bcd__clock--circles .dana-bcd__value {
  font-family: var(--dana-font-heading);
  font-weight: 700;
  color: var(--dana-bcd-digits, var(--dana-accent-ink));
}
@media (min-width: 1200px) {
  .dana-bcd__clock--circles .dana-bcd__unit { inline-size: 120px; }
  .dana-bcd__clock--circles .dana-bcd__value { font-size: 40px; }
}
@media (max-width: 575px) {
  .dana-bcd__clock--boxes .dana-bcd__timer,
  .dana-bcd__clock--circles .dana-bcd__timer { gap: 10px; }
  .dana-bcd__clock--boxes .dana-bcd__unit,
  .dana-bcd__clock--circles .dana-bcd__unit { inline-size: 70px; }
  .dana-bcd__clock--boxes .dana-bcd__value,
  .dana-bcd__clock--circles .dana-bcd__value { font-size: 24px; line-height: 32px; }
}
@media (max-width: 425px) {
  .dana-bcd__clock--boxes .dana-bcd__timer,
  .dana-bcd__clock--circles .dana-bcd__timer { gap: 5px; }
}
