/* Course tiles (listing.php) and course listings (templates/archive-courses.php).
 * Same palette and type as the course page. Tiles: flyer image, what and
 * where, next class, class times, price, one action; the whole tile is the
 * link. Grid: 1 column on phones, 2 from 640px, 3 from 1024px. */

.ares-list,
.ares-tiles {
  --t-navy-900: #002f4f;
  --t-navy: #1d506d;
  --t-blue: #048bce;
  --t-blue-dark: #0373ab;
  --t-blue-50: #eef7fc;
  --t-gold: #f7c500;
  --t-ink: #1f2933;
  --t-muted: #52606d;
  --t-line: #dfe5ec;
  --t-surface: #f5f7fa;
  --t-gutter: 16px;
  font-family: Montserrat, Arial, sans-serif;
  color: var(--t-ink);
}
@media (min-width: 768px) { .ares-list { --t-gutter: 24px; } }
.ares-list *, .ares-list *::before, .ares-list *::after,
.ares-tiles *, .ares-tiles *::before, .ares-tiles *::after { box-sizing: border-box; }

/* ---- Listing page -------------------------------------------------------- */
.ares-list__wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--t-gutter); }
.ares-list__band {
  padding: 32px 0 30px;
  background-color: #002f4f;
  background-image: linear-gradient(135deg, #002f4f 0%, #1d506d 100%);
  color: #fff;
}
.ares-list .ares-list__eyebrow { margin: 0 0 8px; color: var(--t-gold); font-size: 13px; font-weight: 700; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; }
.ares-list .ares-list__title { margin: 0; padding: 0; color: #fff !important; font-family: inherit; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; text-transform: none; }
.ares-list .ares-list__intro { max-width: 720px; margin: 12px 0 0; color: rgba(255, 255, 255, .86); font-size: 16px; line-height: 1.55; }
@media (min-width: 768px) {
  .ares-list__band { padding: 48px 0 44px; }
  .ares-list .ares-list__title { font-size: 38px; }
  .ares-list .ares-list__intro { font-size: 17px; }
}
.ares-list__main { padding-top: 24px; padding-bottom: 64px; }
@media (min-width: 768px) { .ares-list__main { padding-top: 32px; padding-bottom: 80px; } }

/* Filters */
.ares-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0 0 28px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--t-line);
  border-radius: 14px;
}
.ares-filters__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ares-list .ares-chip {
  min-height: 40px;
  margin: 0;
  padding: 8px 16px;
  border: 1.5px solid #c9d2dc;
  border-radius: 999px;
  background: #fff;
  color: var(--t-ink);
  font: 600 14px/1.2 Montserrat, Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.ares-list .ares-chip:hover { border-color: var(--t-blue); }
.ares-list .ares-chip[aria-pressed="true"] { background: var(--t-navy); border-color: var(--t-navy); color: #fff; }
.ares-list .ares-chip:focus-visible { outline: 3px solid rgba(4, 139, 206, .4); outline-offset: 2px; }
.ares-filters__search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 360px;
  margin: 0;
}
.ares-filters__search .ares-course__icon { position: absolute; left: 12px; color: var(--t-muted); pointer-events: none; }
.ares-list .ares-filters__search input {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 12px 8px 40px;
  border: 1.5px solid #c9d2dc;
  border-radius: 999px;
  background: #fff;
  color: var(--t-ink);
  font: 400 16px/1.3 Montserrat, Arial, sans-serif;
  box-shadow: none;
}
.ares-list .ares-filters__search input:focus { border-color: var(--t-blue); outline: 3px solid rgba(4, 139, 206, .25); }
.ares-list .ares-filters__count { margin: 0 0 0 auto; color: var(--t-muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
@media (max-width: 639px) {
  .ares-filters__search { max-width: none; flex-basis: 100%; }
  .ares-list .ares-filters__count { margin-left: 0; }
}

/* Sections */
.ares-list__section + .ares-list__section { margin-top: 40px; }
.ares-list__section[hidden] { display: none; }
.ares-list .ares-list__h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  color: var(--t-navy-900);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: none;
}
.ares-list__n {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  color: var(--t-muted);
  font-size: 13px;
  font-weight: 600;
}
.ares-list__none { margin: 8px 0 0; padding: 28px; border: 1px dashed #c9d2dc; border-radius: 14px; text-align: center; }
.ares-list__none[hidden] { display: none; }
.ares-list__none p { margin: 0 0 12px; color: var(--t-muted); font-size: 16px; }
.ares-list .ares-list__empty { color: var(--t-muted); font-size: 16px; }
.ares-list__help {
  margin-top: 40px;
  padding: 18px 20px;
  background: var(--t-surface);
  border: 1px solid var(--t-line);
  border-radius: 14px;
}
.ares-list .ares-list__help p { margin: 0; color: var(--t-ink); font-size: 15px; line-height: 1.5; }
.ares-list .ares-list__help a, .ares-list .ares-list__empty a { color: var(--t-navy); font-weight: 700; text-decoration: none; white-space: nowrap; }

/* ---- Tiles -------------------------------------------------------------- */
.ares-tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 0;
}
@media (min-width: 640px) { .ares-list .ares-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .ares-list .ares-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
.ares-tiles--single { display: block; height: 100%; margin: 0 0 24px; }

.ares-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--t-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.ares-tile[hidden] { display: none; }
.ares-tile:hover { border-color: #b9dcf0; box-shadow: 0 10px 28px rgba(16, 24, 40, .12); transform: translateY(-2px); }
.ares-tile:focus-within { border-color: var(--t-blue); box-shadow: 0 0 0 3px rgba(4, 139, 206, .3); }

.ares-tile__media {
  position: relative;
  aspect-ratio: 768 / 533; /* the course flyers */
  background: var(--t-surface);
  border-bottom: 1px solid var(--t-line);
  overflow: hidden;
}
.ares-tiles .ares-tile__media img,
.ares-tiles .ares-tile__img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  margin: 0;
  object-fit: cover;
  border-radius: 0;
  transition: transform .4s ease;
}
.ares-tile:hover .ares-tile__img { transform: scale(1.03); }
.ares-tile__noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #002f4f 0%, #1d506d 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.ares-tile__body { display: flex; flex: 1; flex-direction: column; padding: 16px 18px 18px; }
.ares-tiles .ares-tile__kind {
  align-self: flex-start;
  margin: 0 0 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--t-blue-50);
  color: var(--t-navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.4;
}
.ares-tile--main .ares-tile__kind { background: var(--t-gold); color: var(--t-navy-900); }
.ares-tiles .ares-tile__title {
  margin: 0;
  padding: 0;
  color: var(--t-navy-900);
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.005em;
  min-height: 0 !important;
  text-transform: none;
}
.ares-tiles .ares-tile__link { color: inherit !important; text-decoration: none !important; }
/* The whole tile is the link */
.ares-tile__link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.ares-tile__link:focus { outline: none; }
.ares-tiles .ares-tile__sub { margin: 4px 0 0; color: var(--t-muted); font-size: 14px; line-height: 1.4; }
.ares-tiles .ares-tile__when {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--t-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.ares-tile__when .ares-course__icon { flex: none; color: var(--t-blue); }
.ares-tiles .ares-tile__times { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.ares-tiles .ares-tile__times li {
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--t-line);
  border-radius: 999px;
  background: var(--t-surface);
  color: var(--t-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  list-style: none;
}
.ares-tiles .ares-tile__times li::before { content: none; }
.ares-tile__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
}
.ares-tiles .ares-tile__price { margin: 0; color: var(--t-navy-900); font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.ares-tile__price s { color: var(--t-muted); font-size: 14px; font-weight: 500; }
.ares-tile__cta {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--t-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color .15s ease;
}
.ares-tile:hover .ares-tile__cta { background: var(--t-blue-dark); }
.ares-tile__cta::after { content: "\2192"; margin-left: 8px; }
.ares-tile__foot .ares-tile__cta:only-child { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  .ares-tile, .ares-tile__img, .ares-tile__cta, .ares-list .ares-chip { transition: none; }
  .ares-tile:hover, .ares-tile:hover .ares-tile__img { transform: none; }
}

/* The flyers are PNGs with transparent margins (more at the bottom); show
 * each whole, centred on white, instead of cropping it. */
.ares-tile__media { background: #fff; padding: 12px 12px 4px; }
.ares-tiles .ares-tile__media img,
.ares-tiles .ares-tile__img { object-fit: contain; object-position: 50% 30%; }

/* Phones: one swipeable row of filter chips instead of two rows. */
@media (max-width: 639px) {
  .ares-filters { padding: 12px; }
  .ares-filters__chips {
    flex-wrap: nowrap;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .ares-filters__chips::-webkit-scrollbar { display: none; }
  .ares-list .ares-chip { flex: none; }
}
/* Section count sits after the heading text, even when the heading wraps. */
.ares-list .ares-list__h2 { display: block; }
.ares-list__n { display: inline-block; margin-left: 6px; vertical-align: 3px; line-height: 1.4; }

/* Tiles placed in page-builder columns (Online Courses, Exam Prep): same
 * height across a row. */
.vc_row:has(.ares-tiles--single) { display: flex; flex-wrap: wrap; }
.vc_row:has(.ares-tiles--single)::before,
.vc_row:has(.ares-tiles--single)::after { display: none; }
.vc_row:has(.ares-tiles--single) > .wpb_column { float: none; display: flex; }
.vc_row:has(.ares-tiles--single) > .wpb_column > .vc_column-inner { display: flex; flex: 1; flex-direction: column; width: 100%; }
.vc_row:has(.ares-tiles--single) > .wpb_column > .vc_column-inner > .wpb_wrapper { display: flex; flex: 1; flex-direction: column; }
.wpb_wrapper > .ares-tiles--single { flex: 1; height: auto; }
