/* CME Program - the timetable ([cme_timetable]).
   STRUCTURE and sizes live here; a site adapts the look by setting the variables below on .cmep in its
   own stylesheet (the defaults are the COMy design). Fonts are the site's own: everything inherits the
   page font, only the italic accent has a variable.

   Desktop: a sticky day navigation (280) + 60 + the days. Up to 1100: the days only, with a floating
   day bar at the foot of the screen. Each day = a head (label, title, note) and one board of rows:
   the time in its own 120px column, the content beside it - nothing can wrap under the time. */

.cmep,
.cmep-dock {
  --cmep-accent: #660D51;        /* times, labels, the active day */
  --cmep-accent-2: #EB5938;      /* symposium times, special rows */
  --cmep-tint: #F2E7F5;          /* session rows, the active day, tags */
  --cmep-tint-2: #FDF7FF;        /* special rows, the hovered day */
  --cmep-warm: #FCEEE4;          /* symposium rows */
  --cmep-quiet: #F5F4F6;         /* break rows */
  --cmep-ink: #252231;           /* titles */
  --cmep-ink-2: #272931;         /* day names */
  --cmep-meta: #5E5F7A;          /* dates, breaks, notes */
  --cmep-line: #D9D8E4;          /* the board's border */
  --cmep-hair: #EFEFF6;          /* the day bar's border */
  --cmep-surface: #FFFFFF;
  --cmep-font-accent: "Playfair Display", Georgia, "Times New Roman", serif; /* the date, a tag's note */
  --cmep-sticky-top: 96px;       /* where the navigation sticks (under a fixed header) */
  --cmep-anchor-offset: 100px;   /* where a day lands when its link is used */
  --cmep-ease: cubic-bezier(.22, 1, .36, 1);
}
/* (the day bar is moved to the end of the page by the script, so it carries the variables too:
   a site that changes them sets them on ".cmep, .cmep-dock") */

.cmep {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  column-gap: 60px;
  align-items: start;
  width: 100%;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  color: var(--cmep-ink);
}
.cmep,
.cmep *,
.cmep *::before,
.cmep *::after {
  box-sizing: border-box;
}

/* ---- Day navigation (desktop) ---- */
.cmep .cmep-side {
  position: sticky;
  top: var(--cmep-sticky-top);
  min-width: 0;
}
.cmep .cmep-nav__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cmep .cmep-nav__day {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cmep .cmep-nav__day::before {
  content: none;
}
.cmep .cmep-nav__link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "num num" "name date";
  align-items: end;
  column-gap: 12px;
  padding: 14px 18px;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: none;
  transition: background-color .25s var(--cmep-ease);
}
.cmep .cmep-nav__num {
  grid-area: num;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  line-height: 18px;
  color: var(--cmep-meta);
  transition: color .25s var(--cmep-ease);
}
.cmep .cmep-nav__name {
  grid-area: name;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  color: var(--cmep-ink-2);
  transition: color .25s var(--cmep-ease);
}
.cmep .cmep-nav__date {
  grid-area: date;
  font-size: 14px;
  line-height: 22px;
  color: var(--cmep-meta);
}
.cmep .cmep-nav__link:hover {
  background: var(--cmep-tint-2);
}
.cmep .cmep-nav__link.is-active {
  background: var(--cmep-tint);
}
.cmep .cmep-nav__link.is-active .cmep-nav__num,
.cmep .cmep-nav__link.is-active .cmep-nav__name {
  color: var(--cmep-accent);
}
.cmep .cmep-nav__link:focus-visible,
.cmep-dock .cmep-dock__link:focus-visible {
  outline: 2px solid var(--cmep-accent);
  outline-offset: 2px;
}

/* ---- Days ---- */
.cmep .cmep-days {
  display: flex;
  flex-direction: column;
  gap: 80px;
  min-width: 0;
}
.cmep .cmep-day {
  min-width: 0;
  scroll-margin-top: var(--cmep-anchor-offset);
}
/* a jump to a FAR day (timetable.js): the days fade out, the page steps to the day, they fade back in -
   instead of a very long, very fast scroll. --cmep-dir is 1 going down the page, -1 going up. */
.cmep .cmep-days {
  transition: opacity .38s ease-out, transform .5s var(--cmep-ease);
}
.cmep .cmep-days.is-leaving {
  opacity: 0;
  transform: translateY(calc(var(--cmep-dir, 1) * -12px));
  transition: opacity .16s ease-in, transform .16s ease-in;
}
.cmep .cmep-days.is-arriving {
  opacity: 0;
  transform: translateY(calc(var(--cmep-dir, 1) * 16px));
  transition: none;
}
.cmep .cmep-day__head {
  margin: 0 0 24px;
}
.cmep .cmep-eyebrow {
  margin: 0 0 6px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  line-height: 18px;
  color: var(--cmep-accent);
}
.cmep .cmep-day__title {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 28px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cmep-ink-2);
}
.cmep .cmep-day__title em {
  font-family: var(--cmep-font-accent);
  font-style: italic;
  font-weight: 400;
  line-height: inherit;
  color: var(--cmep-accent);
}
.cmep .cmep-day__meta {
  margin: 8px 0 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cmep-meta);
}

/* ---- Tags (the video series pill, "Online only") ---- */
.cmep .cmep-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: 100px;
  background: var(--cmep-tint);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  color: var(--cmep-accent);
}
.cmep .cmep-tag em {
  font-family: var(--cmep-font-accent);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  color: inherit;
}
.cmep .cmep-tag .cmep-icon,
.cmep .cmep-tag i {
  flex: none;
  width: 14px;
  height: 14px;
  font-size: 14px;
  line-height: 1;
}
.cmep .cmep-day__title .cmep-tag {
  position: relative;
  top: -4px;
  margin-left: 12px;
}

/* ---- The board and its rows ---- */
.cmep .cmep-board {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--cmep-line);
  border-radius: 24px;
  background: var(--cmep-surface);
}
.cmep .cmep-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 24px;
  align-items: start;
  padding: 14px 20px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cmep-ink);
}
.cmep .cmep-row__time {
  padding-top: 2px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--cmep-accent);
}
.cmep .cmep-row__body {
  min-width: 0;
}
.cmep .cmep-row__eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  line-height: 18px;
  color: var(--cmep-accent);
}
.cmep .cmep-row__title {
  display: block;
  font-weight: 600;
  color: var(--cmep-ink);
}
.cmep .cmep-row__title em,
.cmep .cmep-row__label em {
  font-family: inherit;
  font-style: italic;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

/* sessions: the time stands on the label's line */
.cmep .cmep-row--session,
.cmep .cmep-row--video {
  background: var(--cmep-tint);
}
.cmep .cmep-row--session.cmep-row--numbered .cmep-row__time {
  padding-top: 0;
  line-height: 18px;
}
/* video sessions: the label and the pill share a line (the pill wraps under the label when it must),
   the title has its own line 2 under them */
.cmep .cmep-row--video .cmep-row__time {
  padding-top: 0;
  line-height: 26px;
}
.cmep .cmep-row--video .cmep-row__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
}
.cmep .cmep-row--video .cmep-row__eyebrow {
  line-height: 24px;
}
.cmep .cmep-row--video .cmep-tag {
  background: var(--cmep-surface);
}
.cmep .cmep-row--video .cmep-row__title {
  flex: 0 0 100%;
  margin-top: 2px;
}

.cmep .cmep-row--symposium {
  background: var(--cmep-warm);
}
.cmep .cmep-row--symposium .cmep-row__time {
  color: var(--cmep-accent-2);
}

/* slim rows: breaks and special moments */
.cmep .cmep-row--break,
.cmep .cmep-row--special {
  align-items: center;
  padding: 10px 20px;
  font-size: 15px;
}
.cmep .cmep-row--break .cmep-row__time,
.cmep .cmep-row--special .cmep-row__time {
  padding-top: 0;
}
.cmep .cmep-row--break .cmep-row__body,
.cmep .cmep-row--special .cmep-row__body {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmep .cmep-row--break {
  background: var(--cmep-quiet);
  color: var(--cmep-meta);
}
.cmep .cmep-row--break .cmep-row__time {
  font-weight: 400;
  color: var(--cmep-meta);
}
.cmep .cmep-row--break .cmep-icon,
.cmep .cmep-row--break i {
  flex: none;
  width: 18px;
  height: 18px;
  font-size: 18px;
  line-height: 1;
}
.cmep .cmep-row--special {
  background: var(--cmep-tint-2);
  font-weight: 600;
  color: var(--cmep-accent-2);
}

/* ---- Day bar (tablets and phones): slides in while the timetable is on screen ---- */
.cmep-dock {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 50;
  display: none;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--cmep-hair);
  border-radius: 100px;
  background: var(--cmep-surface);
  box-shadow: 0 12px 32px rgba(86, 77, 95, .14);
  transform: translateY(calc(100% + 40px));
  transition: transform .5s var(--cmep-ease);
}
.cmep-dock.is-visible {
  transform: none;
}
.cmep-dock .cmep-dock__link {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: var(--cmep-ink-2);
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s var(--cmep-ease), color .25s var(--cmep-ease);
}
.cmep-dock .cmep-dock__link b {
  font-weight: 600;
  color: inherit;
}
.cmep-dock .cmep-dock__link.is-active,
.cmep-dock .cmep-dock__link.is-active:hover {
  background: var(--cmep-accent);
  color: var(--cmep-surface);
}

/* ---- Notes for editors ---- */
.cmep-preview-note,
.cmep-empty {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid #DBA617;
  border-radius: 12px;
  background: #FCF9E8;
  font-size: 14px;
  line-height: 1.5;
  color: #3C3A30;
}

/* ---- Small laptops: a narrower navigation ---- */
@media (max-width: 1279px) {
  .cmep {
    grid-template-columns: 240px minmax(0, 1fr);
    column-gap: 40px;
  }
}

/* ---- Tablets and phones: the days only + the day bar ---- */
@media (max-width: 1100px) {
  .cmep {
    grid-template-columns: minmax(0, 1fr);
  }
  .cmep .cmep-side {
    display: none;
  }
  .cmep-dock {
    display: flex;
  }
}

/* ---- Phones: tall rows stack (the time on its own line), slim rows keep the time beside the label ---- */
@media (max-width: 767px) {
  .cmep .cmep-days {
    gap: 64px;
  }
  .cmep .cmep-day__title {
    font-size: 24px;
  }
  .cmep .cmep-day__title .cmep-tag {
    top: -3px;
    margin-left: 8px;
  }
  .cmep .cmep-day__meta {
    font-size: 14px;
  }
  .cmep .cmep-board {
    padding: 6px;
    border-radius: 20px;
  }
  .cmep .cmep-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
    padding: 12px 16px;
    border-radius: 14px;
  }
  .cmep .cmep-row__time {
    padding-top: 0;
    font-size: 13px;
  }
  .cmep .cmep-row--video .cmep-row__time {
    line-height: 1.6;
  }
  .cmep .cmep-row--break,
  .cmep .cmep-row--special {
    grid-template-columns: 76px minmax(0, 1fr);
    column-gap: 12px;
    padding: 10px 16px;
    font-size: 14px;
  }
  .cmep-dock {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cmep *,
  .cmep-dock,
  .cmep-dock * {
    transition: none !important;
  }
}
