/* ==========================================================================
   Room for Hebrew – course details page (one page per course or club)

   Four bands, top to bottom, each full width:
   1. Main band       – label, title, format tags, short description, levels.
   2. Details band    – price, location, duration, sessions, group size: icon, small
                        title above, value below.
   3. How it works    – "Flexible schedule" and three short steps. There are
                        no fixed schedules: the visitor says in the form
                        which day and time they prefer.
   4. Body            – description and the WhatsApp question on the left, the
                        sign-up form on the right (stacked on mobile).

   The form card is the dark blue of the contact section and looks the same
   in both themes. Its fields repeat the contact form's look (css/home.css).
   ========================================================================== */

/* The bands run edge to edge, so the page has no side padding or gaps */
.course-main {
  gap: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   1. Main band
   -------------------------------------------------------------------------- */
.course-hero {
  padding: var(--space-l) var(--page-inline-padding) var(--space-2xl);
  background-color: var(--color-bg-tint);
}

/* Plain stacked blocks: the switch button floats right (first in the
   markup), so it sits level with the label and takes no part in the space
   between label and title. The first line of the title runs beside it. */
.course-hero__inner {
  display: flow-root;
}

.course-hero__kind,
.course-hero__title,
.course-hero__rest {
  max-width: 42rem;
}

.course-hero__title,
.course-hero__rest {
  margin-top: var(--space-s);
}

/* Left-aligned, with lines short enough to read comfortably */
.course-hero__rest {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-s);
}

.course-switch {
  float: right;
  margin-left: var(--space-s);
}

/* Small Course / Club label with its icon, as on the home page cards */
.course-hero__kind {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-label);
  color: var(--color-text-muted);
}

.course-hero__kind .icon {
  color: var(--color-accent);
}

.course-hero__title {
  font-size: var(--font-size-section-title);
  font-weight: 800;
}

/* Format tags (In person / Online): the same look as on the home page cards */
.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: 0;
  list-style: none;
}

.course-tag {
  padding: 0.125rem 0.625rem;
  font-size: var(--font-size-label);
  font-weight: 700;
  color: var(--color-accent);
  background-color: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border-radius: var(--radius-pill);
}

.course-hero__text {
  font-size: var(--font-size-lead);
  color: var(--color-text-muted);
}

/* The levels and the "?" button on one line, centred on each other */
.course-hero__level {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.course-hero__level-label {
  font-weight: 700;
  color: var(--color-heading);
}

/* --------------------------------------------------------------------------
   2. Details band
   Mobile: two columns; price, location and group size take the full width
   (.fact--wide), duration and sessions sit side by side. Tablet: one column per fact, as
   many as fit. Desktop: one row, first fact at the left edge, last at the right.
   -------------------------------------------------------------------------- */
.facts {
  padding: var(--space-l) var(--page-inline-padding);
  background-color: var(--color-bg);
  border-block: var(--divider-width) solid var(--color-border);
}

.facts__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-l) var(--space-m);
  margin: 0;
}

.fact--wide {
  grid-column: 1 / -1;
}

/* One fact: icon, title, then the value, centred */
.fact {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: var(--space-xs);
  text-align: center;
}

/* Icon above the small title */
.fact__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.fact__label .icon {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-accent);
}

.fact__title {
  font-size: var(--font-size-label);
  color: var(--color-text-muted);
}

.fact__value {
  margin: 0;
}

/* A value in several lines, one under the other (the location of a course
   held both in person and online, until the visitor chooses a format) */
.fact__value--stacked {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fact__main {
  font-weight: 700;
}

/* Crossed-out original price, in a quieter colour */
.fact__was {
  color: var(--color-text-muted);
  text-decoration-color: var(--color-text-muted);
}

/* Discount label after a discounted price, the same look as the home page
   cards' discount label */
.fact__discount {
  display: inline-block;
  padding: 0.125rem 0.625rem;
  font-size: var(--font-size-label);
  font-weight: 700;
  color: var(--color-on-strong);
  background: var(--fill-strong);
  border-radius: var(--radius-pill);
}

/* "Final price" note on its own line under the price */
.fact__note {
  display: block;
  font-size: var(--font-size-label);
  color: var(--color-text-muted);
}

@media (min-width: 40em) {
  .facts__list {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }

  .fact--wide {
    grid-column: auto;
  }
}

/* Desktop: one row, the first fact at the left edge and the last at the
   right edge, the rest spread evenly between them */
@media (min-width: 64em) {
  .facts__list {
    display: flex;
    justify-content: space-between;
    gap: var(--space-m);
  }

  .fact--wide {
    grid-column: auto;
  }
}

/* --------------------------------------------------------------------------
   3. How it works
   A title and three short steps, in the page's own text style. On mobile the
   steps are stacked; from 768px they sit side by side.
   -------------------------------------------------------------------------- */
.schedule {
  padding: var(--space-l) var(--page-inline-padding);
  background-color: var(--color-bg-tint);
}

.schedule h2 {
  margin-bottom: var(--space-s);
}

.steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-s) var(--space-m);
  background-color: var(--color-card);
  border: var(--divider-width) solid var(--color-border);
  border-radius: var(--radius-control);
}

/* The step number, so the order is not carried by colour alone */
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  font-weight: 700;
  color: var(--color-bg);
  background-color: var(--color-accent);
  border-radius: 50%;
}

@media (min-width: 48em) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   4. Body: description + WhatsApp question, and the sign-up form
   -------------------------------------------------------------------------- */
.course-body {
  /* The form card's inner padding. The description column uses it too when
     the two sit side by side, so the two titles are on one line. */
  --course-card-padding: var(--space-l);

  padding: var(--space-2xl) var(--page-inline-padding);
  background-color: var(--color-bg-soft);
}

.course-body__inner {
  display: grid;
  gap: var(--space-2xl);
}

.course-body__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  max-width: 65ch;
}

/* The WhatsApp question: a short line and an outlined button, set off from
   the description by a thin rule */
.course-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s) var(--space-m);
  padding-top: var(--space-m);
  border-top: var(--divider-width) solid var(--color-border);
}

/* From 768px: description on the left, form on the right. On desktop the
   form is wide enough for two columns of fields, so it is shorter, and the
   description is narrower (and taller). */
@media (min-width: 48em) {
  .course-body__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
    align-items: start;
  }

  .course-body__text {
    padding-top: var(--course-card-padding);
  }
}

@media (min-width: 64em) {
  .course-body__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 40rem);
  }
}

/* --------------------------------------------------------------------------
   Popups on this page: the same quiet title as the home page's popups.
   (Popups that open beside their button: css/base.css, js/popup-anchor.js.)
   -------------------------------------------------------------------------- */
.popup__title {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
}

/* --------------------------------------------------------------------------
   Switch course popup: the list of all courses and clubs
   -------------------------------------------------------------------------- */
.course-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.course-list ul {
  padding: 0;
  list-style: none;
}

/* Group titles ("Courses", "Clubs"): labels, not links. The same look as
   the labels in the home page's filter popup. */
.course-list__group {
  margin-top: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--font-size-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.course-list a,
.course-list [aria-current] {
  display: block;
  padding: var(--space-xs) var(--space-s);
  border-left: 4px solid transparent;
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.course-list a {
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

@media (hover: hover) {
  .course-list a:hover {
    text-decoration: underline;
  }
}

/* The course you are on: bold, a light background and a bar on its left
   edge (not colour alone), and not a link */
.course-list [aria-current] {
  font-weight: 700;
  background-color: var(--color-bg-tint);
  border-left-color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Sign-up form (js/apply.js)
   Top to bottom: your details (with the format, for a course held both ways,
   and the preferred time), a rule, price and coupon, the payment notice, the
   two confirmations, the button.
   From 1024px the details sit in two columns, so the form is shorter. Price
   and coupon sit side by side from 640px.
   -------------------------------------------------------------------------- */

/* The card. color-scheme makes the browser's own parts (the check boxes, the
   level list) dark to match. */
.apply {
  /* Every label row has this height, so fields in a row line up even when
     one label has the "?" button after it */
  --apply-label-height: 2rem;

  /* How much a switched-off dropdown fades */
  --disabled-opacity: 0.45;

  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  padding: var(--course-card-padding);
  color: var(--white);
  color-scheme: dark;
  background-color: var(--navy);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

/* The form stays hidden until js/apply.js shows it */
.apply[hidden] {
  display: none;
}

.apply__title {
  color: var(--white);
}

/* A thin rule: the money part (price, coupon) starts below it */
.apply__rule {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: var(--divider-width) solid color-mix(in srgb, var(--white) 25%, transparent);
}

/* A group of fields: stacked on mobile and tablet, two columns on desktop */
.apply__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* One field with its label */
.apply__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

/* The label line of a field: same height everywhere */
.apply__label,
.apply__label-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: var(--apply-label-height);
  font-size: var(--font-size-label);
  color: var(--color-on-dark-muted);
}

/* A short note after a label, quieter than the label ("in your time zone") */
.apply__label-note {
  font-weight: 400;
  color: color-mix(in srgb, var(--white) 60%, transparent);
}

/* The red star that marks a required field; the "required" attribute is
   what screen readers get */
.apply__required {
  color: var(--error-on-dark);
}

/* The "?" button on the dark card: a lighter colour than on the page */
.apply .info-button {
  color: var(--sky);
}

@media (hover: hover) {
  .apply .info-button:hover {
    background-color: color-mix(in srgb, var(--white) 12%, transparent);
  }
}

/* Text fields and the level list, on a slightly lighter fill, with a border
   clear enough against the dark blue (3:1 or better). */
.apply__input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem var(--space-s);
  font: inherit;
  color: var(--white);
  background-color: color-mix(in srgb, var(--white) 8%, transparent);
  border: var(--divider-width) solid color-mix(in srgb, var(--white) 50%, transparent);
  border-radius: var(--radius-control);
}

.apply__input[aria-invalid="true"] {
  border-color: var(--error-on-dark);
}

.apply__error {
  font-size: var(--font-size-label);
  color: var(--error-on-dark);
}

/* The level list: a button that looks like the text fields, with the site's
   arrow (js/select.js builds it; the list itself is .select-list below) */
.apply__select {
  position: relative;
}

.apply__select button {
  display: block;
  text-align: left;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* A dropdown that has nothing chosen yet shows its word ("Day") quieter than
   a real choice. 55% white keeps the 4.5:1 contrast on the form's navy. */
.apply__select button.is-placeholder {
  color: color-mix(in srgb, var(--white) 55%, transparent);
}

/* A switched-off dropdown, and its arrow, look switched off */
.apply__select button:disabled {
  opacity: var(--disabled-opacity);
  cursor: not-allowed;
}

.apply__select:has(button:disabled) .icon {
  opacity: var(--disabled-opacity);
}

.apply__select .icon {
  position: absolute;
  top: 50%;
  right: var(--space-s);
  transform: translateY(-50%);
  pointer-events: none;
}

/* The preferred time: the day and the part of the day, one under the other on
   mobile and side by side from 640px, then the "not sure yet" box. The space
   between all of them is the container's gap. */
.apply__stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  min-width: 0;
}

.apply__pick {
  display: grid;
  gap: var(--space-xs);
}

@media (min-width: 40em) {
  .apply__pick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Price to pay and coupon: one column on mobile, two side by side from
   640px. Both have a label line and then a box of the same height. */
.apply__money {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-s) var(--space-m);
}

@media (min-width: 40em) {
  .apply__money {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The price: a box like the coupon field's, without a border */
.apply__price-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-xs);
  min-height: 2.75rem;
  padding: 0.5rem var(--space-s);
  background-color: color-mix(in srgb, var(--white) 8%, transparent);
  border-radius: var(--radius-control);
}

.apply__price-was {
  color: var(--color-on-dark-muted);
}

/* Coupon: the field and a square arrow button on one line, the result under them */
.apply__coupon {
  display: flex;
  gap: var(--space-xs);
}

.apply__coupon .apply__input {
  flex: 1 1 auto;
  min-width: 0;
}

.apply__redeem {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--white);
  background: none;
  border: var(--divider-width) solid color-mix(in srgb, var(--white) 50%, transparent);
  border-radius: var(--radius-control);
  cursor: pointer;
}

@media (hover: hover) {
  .apply__redeem:hover {
    background-color: color-mix(in srgb, var(--white) 12%, transparent);
  }
}

.apply__redeem[aria-disabled="true"],
.apply__submit[aria-disabled="true"] {
  opacity: 0.6;
  cursor: default;
}

.apply__coupon-status {
  font-size: var(--font-size-label);
  color: var(--color-on-dark-muted);
}

.apply__coupon-status[data-state="valid"] {
  color: var(--success-on-dark);
}

.apply__coupon-status[data-state="error"] {
  color: var(--error-on-dark);
}

/* The notice ("payment request will be sent..."): a boxed panel with an icon
   and a bar on its left. If more notices are added, they share the panel,
   with a thin line between them. */
.apply__notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: var(--space-m);
  background-color: color-mix(in srgb, var(--white) 12%, transparent);
  border-left: 4px solid var(--sky);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
}

.apply__note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
}

.apply__note + .apply__note {
  padding-top: var(--space-s);
  border-top: var(--divider-width) solid color-mix(in srgb, var(--white) 25%, transparent);
}

.apply__note .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.125rem;
  color: var(--sky);
}

/* Agreement check box: the box on the left, the text and its links beside it */
.apply__check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-s);
}

.apply__check input {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.125rem 0 0;
  accent-color: var(--sky);
}

/* Button (as wide as its text) and the result of sending, centred */
.apply__send {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.apply__status,
.apply__failure {
  text-align: center;
}

.apply__status {
  color: var(--color-on-dark-muted);
}

.apply__status.is-success {
  color: var(--success-on-dark);
}

.apply__failure {
  color: var(--error-on-dark);
}

/* Desktop: the details in two columns (name and email, phone and level) */
@media (min-width: 64em) {
  .apply__group--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-s) var(--space-m);
  }

  /* The preferred time takes the full width, under the other fields */
  .apply__group--grid > .apply__stack {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------------------------
   Dropdown list (js/select.js): a small popup in the site's own colours,
   under its button and as wide as it. Hidden until the script has set its
   place. The chosen level is bold (that is its only mark); a level the
   course is not for has a grey fill and lighter grey text and cannot be
   chosen.
   -------------------------------------------------------------------------- */
.select-list {
  inset: auto;
  top: var(--select-top);
  left: var(--select-left);
  width: var(--select-width);
  margin: 0;
  padding: var(--space-xs);
  list-style: none;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: var(--divider-width) solid var(--color-border);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-card);
}

.select-list:not(.is-placed) {
  visibility: hidden;
}

.select-list__option {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 var(--space-s);
  border-radius: var(--radius-control);
  cursor: pointer;
}

.select-list__option + .select-list__option {
  margin-top: 0.125rem;
}

.select-list__option.is-active {
  background-color: var(--color-bg-tint);
}

.select-list__option[aria-selected="true"] {
  font-weight: 700;
}

.select-list__option[aria-disabled="true"] {
  color: color-mix(in srgb, var(--color-text) 45%, transparent);
  background-color: var(--color-border);
  cursor: not-allowed;
}
