/* cro-dates-cta.v1.css: "Reserve this date" on the dates-and-fees tables (booking stream).
 * Brand red #A43C1F is the table header's own colour; the 10px radius and Manrope 600 are the
 * site's Elementor kit button (header "Apply Now"). White on #A43C1F is 6.5:1. */

/* The button, every width. Beats the page's own `.btn`, `.btn:hover` and `.table-row.featured .btn`. */
.yn-dates-table .table-row .btn.yn-dates-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid #A43C1F;
  border-radius: 10px;
  background-color: #A43C1F;
  color: #FFFFFF;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s;
}

.yn-dates-table .table-row .btn.yn-dates-cta:hover {
  border-color: #7F2D16;
  background-color: #7F2D16;
  color: #FFFFFF;
}

.yn-dates-table .table-row .btn.yn-dates-cta:focus-visible,
.yn-dates-help .yn-dates-wa:focus-visible {
  outline: 3px solid #1A1A1A;
  outline-offset: 2px;
}

/* Give the button column room for the longer label (5, 6 and 7 column tables; 5 once no-spots-left drops Availability). */
.yn-dates-table.yn-cols-5 .table-header,
.yn-dates-table.yn-cols-5 .table-row {
  grid-template-columns: 1.7fr 1fr 1.35fr 1.35fr 170px;
}

.yn-dates-table.yn-cols-6 .table-header,
.yn-dates-table.yn-cols-6 .table-row {
  grid-template-columns: 1.7fr 1fr 1.35fr 1.35fr 1fr 170px;
}

.yn-dates-table.yn-cols-7 .table-header,
.yn-dates-table.yn-cols-7 .table-row {
  grid-template-columns: 1.7fr 1fr 1.35fr 1.35fr 1.35fr 1fr 170px;
}

/* Wide screens: the page gives the table min-width 1200px, but the retreat pages seat it in a box about
 * 1120px wide at a 1280px window, so the 170px button column was cut off. Let the grid shrink to fit. */
@media (min-width: 1280px) {
  .training-table.yn-dates-table {
    min-width: 0;
  }
}

/* "Not sure which date? Ask us on WhatsApp" */
.yn-dates-help {
  margin: 8px 10px 0;
  color: #3A3A3A;
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4em;
  text-align: left;
}

.yn-dates-help .yn-dates-wa {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #A43C1F;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.yn-dates-help .yn-dates-wa:hover {
  color: #7F2D16;
}

/* Small screens and tablets: the 1200px table scrolls sideways and the button lives in the last
 * column, off screen. Stack each row into a card with the button full width at the bottom. */
@media (max-width: 1279px) {
  .training-table-wrapper:has(.yn-dates-table)::after {
    display: none;
  }

  .training-table.yn-dates-table {
    min-width: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .yn-dates-table .table-header {
    display: none;
  }

  .yn-dates-table .table-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 16px;
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid #E5E5E5;
    border-radius: 14px;
    text-align: left;
  }

  .yn-dates-table .table-row > div {
    flex: 1 1 100%;
    min-width: 0;
  }

  .yn-dates-table .table-row > div:empty {
    display: none;
  }

  .yn-dates-table .table-row > div:first-child {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35em;
  }

  .yn-dates-table .table-row > div:first-child .badge {
    margin: 6px 6px 0 0;
  }

  /* One line per price: "Non Residential ... €1400". */
  .yn-dates-table .table-row > div[data-yn-label] {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid #EEE;
    font-size: 15px;
    text-align: right;
  }

  .yn-dates-table .table-row > div[data-yn-label]::before {
    content: attr(data-yn-label);
    color: #5F5F5F;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3em;
    text-align: left;
  }

  .yn-dates-table .table-row .availability {
    font-size: 14px;
    text-align: left;
  }

  /* Undated card: the availability text repeats the button label ("Register interest"). */
  .yn-dates-table .table-row > div.yn-dates-dup {
    display: none;
  }

  .yn-dates-table .table-row > div:last-child {
    margin-top: 4px;
  }

  .yn-dates-table .table-row .btn.yn-dates-cta {
    display: flex;
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
}

/* Tablet and small laptop (the 1200px table does not fit): two cards per row. */
@media (min-width: 700px) and (max-width: 1279px) {
  .training-table.yn-dates-table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .yn-dates-table .table-row {
    margin-bottom: 0;
  }
}
