/*
 * Limited-time promo: bar, in-article box, homepage card (inc/promo.php).
 * Loaded only while a piece is switched on and the campaign has not ended.
 */
:root {
  --tht-promo-bar-bg: #17402f;
  --tht-promo-bar-fg: #ffffff;
  --tht-promo-bar-accent: #ffe08a;
  --tht-promo-panel-bg: #f4f7f3;
  --tht-promo-panel-border: #d9e2d8;
  --tht-promo-panel-fg: #17402f;
  --tht-promo-button-bg: #0b6e4f;
  --tht-promo-button-bg-hover: #095a41;
  --tht-promo-button-fg: #ffffff;
}

/* Expired (checked before first paint by the head script) or dismissed. */
.tht-promo-expired [data-tht-promo],
.tht-promo-bar-off .tht-promo-bar,
.tht-promo-bar[hidden] {
  display: none !important;
}

/* ---- Bar: in normal flow above the header, so it never covers ad slots ---- */
.tht-promo-bar {
  background: var(--tht-promo-bar-bg);
  box-sizing: border-box;
  color: var(--tht-promo-bar-fg);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.3;
  min-height: 2.75rem;
  overflow-anchor: none;
  padding: 0.35rem 3rem 0.35rem var(--tht-pad, 40px);
  position: relative;
  width: 100%;
}

.tht-promo-bar__inner {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
  margin-inline: auto;
  max-width: var(--tht-shell, 1600px);
  min-height: 2rem;
}

.tht-promo-bar__text {
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tht-promo-bar__meta {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.75rem;
}

.tht-promo-bar__count {
  color: var(--tht-promo-bar-accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tht-promo-bar__button {
  background: #ffffff;
  border-radius: 4px;
  color: #111111;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.35rem 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.tht-promo-bar__button:hover,
.tht-promo-bar__button:focus {
  background: var(--tht-promo-bar-accent);
  color: #111111;
}

.tht-promo-bar__dismiss {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--tht-promo-bar-fg);
  cursor: pointer;
  display: none;
  font-size: 1.5rem;
  height: 2.25rem;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  position: absolute;
  right: calc(var(--tht-pad, 40px) / 2);
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
}

.tht-js .tht-promo-bar__dismiss {
  display: inline-flex;
}

.tht-promo-bar__dismiss:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tht-promo-bar a:focus-visible,
.tht-promo-bar button:focus-visible {
  outline: 2px solid var(--tht-promo-bar-accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  /* Two fixed rows (text, then countdown + button), so the height is the same on every phone. */
  .tht-promo-bar {
    padding: 0.4rem 2.75rem 0.45rem 0.75rem;
  }

  .tht-promo-bar__inner {
    align-items: stretch;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 4.25rem;
  }

  .tht-promo-bar__text {
    font-size: 0.875rem;
    text-align: left;
  }

  .tht-promo-bar__meta {
    justify-content: space-between;
    min-width: 0;
  }

  .tht-promo-bar__count {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tht-promo-bar__dismiss {
    right: 0.25rem;
    top: 1.35rem;
    transform: translateY(-50%);
  }
}

/* ---- In-article box ---- */
.tht-promo-box {
  align-items: center;
  background: var(--tht-promo-panel-bg);
  border: 1px solid var(--tht-promo-panel-border);
  border-left: 4px solid var(--tht-promo-button-bg);
  border-radius: 8px;
  box-sizing: border-box;
  clear: both;
  color: var(--tht-promo-panel-fg);
  display: flex;
  flex-wrap: wrap;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  gap: 0.75rem 1.25rem;
  line-height: 1.45;
  margin: 1.75rem 0;
  max-width: var(--tht-measure, 70ch);
  padding: 1rem 1.25rem;
}

.tht-promo-box__text {
  flex: 1 1 18rem;
  min-width: 0;
}

.tht-promo-box__button,
.tht-promo-card__button {
  background: var(--tht-promo-button-bg);
  border-radius: 4px;
  color: var(--tht-promo-button-fg);
  display: inline-block;
  flex: 0 0 auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 0.65rem 1.1rem;
  text-align: center;
  text-decoration: none;
}

.tht-promo-box__button:hover,
.tht-promo-box__button:focus,
.tht-promo-card__button:hover,
.tht-promo-card__button:focus {
  background: var(--tht-promo-button-bg-hover);
  color: var(--tht-promo-button-fg);
}

.tht-promo-box__button:focus-visible,
.tht-promo-card__button:focus-visible {
  outline: 2px solid var(--tht-promo-panel-fg);
  outline-offset: 2px;
}

/* ---- Homepage card (above .tht-rows, same side padding as the rows) ---- */
.tht-promo-card {
  align-items: stretch;
  background: var(--tht-promo-panel-bg);
  border: 1px solid var(--tht-promo-panel-border);
  border-radius: 8px;
  box-sizing: border-box;
  color: var(--tht-promo-panel-fg);
  display: flex;
  margin: 1rem var(--tht-pad, 40px) 0.5rem;
  overflow: hidden;
}

.tht-promo-card__media {
  display: block;
  flex: 0 0 min(42%, 26rem);
  min-height: 11rem;
  position: relative;
}

.tht-promo-card__img {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.tht-promo-card__body {
  align-self: center;
  flex: 1 1 auto;
  padding: 1.5rem 1.75rem;
}

.tht-promo-card__title {
  color: var(--tht-promo-panel-fg);
  font-size: 1.7rem;
  font-weight: normal;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}

.tht-promo-card__text {
  color: #3d4b42;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  max-width: 44rem;
}

@media (max-width: 720px) {
  .tht-promo-card {
    flex-direction: column;
    margin-inline: 1rem;
  }

  .tht-promo-card__media {
    aspect-ratio: 3 / 2;
    flex: 0 0 auto;
    min-height: 0;
  }

  .tht-promo-card__body {
    padding: 1.1rem 1.1rem 1.25rem;
  }

  .tht-promo-card__title {
    font-size: 1.4rem;
  }
}

@media print {
  .tht-promo-bar,
  .tht-promo-box,
  .tht-promo-card {
    display: none !important;
  }
}
