/* The same card rules serve the homepage block and administrator previews. */
.rw-live-show-block {
  width: 100%;
  container-type: inline-size;
  font-family: asap, sans-serif;
  font-style: normal;
  font-weight: 400;
}

.rw-live-show-block:empty {
  display: none;
}

.rw-live-show-empty {
  padding: 2rem;
  border: 1px dashed #8c8f94;
}

.rw-live-show-block .rw_livenow {
  /* Blend into the page until artwork analysis supplies the final panel palette. */
  --rw-live-colour: #f2f2ef;
  --rw-live-text: #114552;
  align-items: flex-start;
  display: flex;
  gap: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--rw-live-colour);
  box-shadow: 0 2px 8px rgba(4, 30, 40, 0.16);
}

.rw-live-show-block .rw_livenow_content {
  box-sizing: border-box;
  flex: 1 1 60%;
  order: 2;
  padding: clamp(24px, 3.2vw, 42px);
  color: var(--rw-live-text);
}

.rw-live-show-block .tribe-common,
.rw-live-show-block .tribe-common-b2,
.rw-live-show-block h2,
.rw-live-show-block h3,
.rw-live-show-block h4,
.rw-live-show-block a,
.rw-live-show-block time,
.rw-live-show-block .rw_description {
  color: inherit !important;
  font-family: inherit !important;
}

/* Keep the plugin's card typography ahead of The Events Calendar heading rules. */
.rw-live-show-block .wp-block-columns.rw_livenow .tribe-common-h6.livenow {
  margin: 0 0 10px;
  font-size: 36px !important;
  font-weight: 600;
  line-height: 1.2;
  text-transform: uppercase;
}

.rw-live-show-block .wp-block-columns.rw_livenow .tribe-common-h6.rw_showname {
  margin: 0;
  font-size: 24px !important;
  font-weight: 600;
  line-height: 1.25;
}

.rw-live-show-block .rw_showname a {
  text-decoration: none;
}

/* Use explicit spacing so calendar defaults cannot open up the compact card. */
.rw-live-show-block .tribe-common-b2 {
  margin: 0 0 14px;
}

.rw-live-show-block time {
  display: block;
  font-size: 16px;
  line-height: 1.4;
}

.rw-live-show-block .rw_description {
  margin-top: 15px;
  font-size: 17px;
  line-height: 1.5;
}

.rw-live-show-block .rw_description p {
  margin: 0 0 1em;
  font-size: inherit;
  line-height: inherit;
}

.rw-live-show-block .rw_description > *:first-child {
  margin-top: 0;
}

.rw-live-show-block .rw_description > *:last-child {
  margin-bottom: 0;
}

.rw-live-show-block .rw_description_more {
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.rw-live-show-block .rw_resident_context {
  /* Give presenter context a clearer pause after the show description. */
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.45;
}

.rw-live-show-block .rw_resident_context[hidden] {
  display: none !important;
}

.rw-live-show-block .rw_resident_context h4 {
  /* Keep the shared campaign eyebrow legible at the requested display size. */
  margin: 0 0 12px !important;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rw-live-show-block .rw_resident_context p {
  margin: 4px 0 0;
}

.rw-live-show-block .rw_resident_context a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.rw-live-show-block .wp-block-column.rw_currentshow_image {
  align-self: flex-start;
  aspect-ratio: 1 / 1;
  /* WordPress gives columns flex-grow at wide viewports, so cap artwork independently. */
  flex: 0 0 clamp(280px, 42%, 400px) !important;
  margin: clamp(24px, 3.2vw, 42px);
  max-width: 400px;
  min-height: 0;
  order: 1;
  padding: 0;
  background-color: var(--rw-live-colour);
  /* Let unused image space merge into the text panel on wide cards. */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* All artwork uses the same restrained square frame, regardless of source proportions. */
.rw-live-show-block .rw_livenow[data-rw-artwork-shape="square"] {
  display: flex;
}

.rw-live-show-block [data-rw-artwork-shape="square"] .rw_livenow_content {
  display: flex;
  flex-basis: 56%;
  flex-direction: column;
  justify-content: center;
  /* Keep text-led cards within the square artwork height where practical. */
  padding-block: 30px;
}

.rw-live-show-block [data-rw-artwork-shape="square"] .rw_currentshow_image {
  min-height: 0;
}

.rw-live-show-block [data-rw-artwork-shape="extra-wide"] .rw_livenow_content {
  flex-basis: 55%;
}

/* Wide/photo artwork can fill the panel; poster artwork remains fully visible. */
.rw-live-show-block [data-rw-artwork-desktop="cover"] .rw_currentshow_image {
  background-position: center;
  background-size: cover;
}

.rw-live-show-block [data-rw-artwork-desktop="contain"] .rw_currentshow_image {
  background-position: center;
  background-size: contain;
}

/* Respond to the card width so admin previews and the homepage behave identically. */
@container (max-width: 1000px) {
  .rw-live-show-block .rw_livenow_content {
    padding: 28px;
  }

  .rw-live-show-block [data-rw-artwork-shape="square"] .rw_livenow_content {
    flex-basis: 53%;
  }

  .rw-live-show-block [data-rw-artwork-shape="square"] .rw_currentshow_image {
    min-height: 0;
  }
}

@container (max-width: 820px) {
  .rw-live-show-block .rw_livenow_content {
    padding: 24px;
  }
}

/* The preview grid changes scale, never component behaviour or markup. */
.rw-live-show-preview-grid {
  --rw-live-preview-width: 1120px;
  display: grid;
  gap: 30px;
  margin-top: 20px;
}

.rw-live-show-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 720px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  background: #fff;
}

.rw-live-show-preview-toolbar select {
  min-width: 250px;
}

.rw-live-show-preview-toolbar .description {
  flex-basis: 100%;
  margin: 0;
}

.rw-live-show-preview-item {
  box-sizing: border-box;
  width: min(100%, calc(var(--rw-live-preview-width) + 40px));
  padding: 20px;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  background: #fff;
}

.rw-live-show-preview-item > h2,
.rw-live-show-preview-item > p {
  margin: 0 0 10px;
}

/* Keep the compact two-column card until a genuinely narrow phone layout. */
@container (max-width: 620px) {
  .rw-live-show-block .rw_livenow {
    flex-direction: column;
  }

  .rw-live-show-block .rw_livenow[data-rw-artwork-shape="square"] {
    display: flex;
  }

  .rw-live-show-block .rw_livenow_content,
  .rw-live-show-block .rw_currentshow_image {
    flex-basis: auto !important;
    margin-left: 20px;
    margin-right: 20px;
  }

  .rw-live-show-block [data-rw-artwork-shape="extra-wide"] .rw_livenow_content,
  .rw-live-show-block [data-rw-artwork-shape="extra-wide"] .rw_currentshow_image,
  .rw-live-show-block [data-rw-artwork-shape="square"] .rw_livenow_content,
  .rw-live-show-block [data-rw-artwork-shape="square"] .rw_currentshow_image {
    flex-basis: auto;
    width: 100%;
  }

  .rw-live-show-block [data-rw-artwork-shape="square"] .rw_livenow_content {
    justify-content: flex-start;
    padding: 20px;
  }

  .rw-live-show-block .rw_livenow_content {
    margin: 0;
    order: 1;
    padding: 20px !important;
    width: 100%;
  }

  .rw-live-show-block .rw_currentshow_image {
    margin: 0 20px 20px;
    order: 2;
    min-height: min(75vw, 380px);
    background-position: center;
  }

  .rw-live-show-block .wp-block-column.rw_currentshow_image {
    /* Retain the inset square when the information and artwork stack on phones. */
    flex: 0 0 auto !important;
    max-width: calc(100% - 40px);
    width: calc(100% - 40px);
  }

  .rw-live-show-block [data-rw-artwork-shape="square"] .rw_currentshow_image {
    /* Square uploads should use the full card width on phones. */
    aspect-ratio: 1 / 1;
    max-width: none;
    min-height: 0;
  }

  .rw-live-show-block [data-rw-artwork-mobile="cover"] .rw_currentshow_image {
    background-size: cover;
  }

  .rw-live-show-block [data-rw-artwork-mobile="contain"] .rw_currentshow_image {
    background-size: contain;
  }
}
