/* ==========================================================================
   Connect agenda
   After the schedule on evenco.framer.website, in the style of the speakers module:
   a two-line title (the second line magenta), then one block per part of the day: a
   coloured bar with the title over a white card with a photo and a short text. While you
   scroll, each block sticks below the menu and the next one slides over it. A magenta
   button below links to the full programme.
   ========================================================================== */

.cag {
  --cag-accent: #ec008c;
  --cag-bg: #f1f4f9;                 /* Mavim mist, like the speakers module */
  --cag-ink: #000000;
  --cag-muted: #505356;              /* Mavim graphite */
  --cag-card: #ffffff;
  --cag-card-line: rgba(68, 68, 68, 0.12);
  --cag-tile: #e3e8f1;               /* photo placeholder */
  --cag-shadow: 0 11px 30px rgba(102, 102, 102, 0.2); /* Mavim card shadow */

  /* The three line colours of the Connect illustration, one per bar. */
  --cag-magenta: #ec008c;
  --cag-blauw: #6f8cd9;
  --cag-violet: #8d74ff;

  /* Connect grid: the same values in every Connect module. */
  --cag-max: var(--connect-max, 1200px);
  --cag-gutter: var(--connect-gutter, clamp(20px, 5vw, 64px));
  --cag-space: var(--connect-space, clamp(56px, 5.5vw, 80px));
  --cag-head-gap: var(--connect-head-gap, clamp(32px, 3.5vw, 48px));
  --cag-h2: var(--connect-h2, clamp(2.5rem, 1.75rem + 2.4vw, 4rem));
  --cag-lead: var(--connect-lead, clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem));

  /* Where a block sticks: right below the menu (module.js measures it; this is the
     fallback for the Connect menu of 84px under the countdown bar). */
  --cag-top: calc(var(--mcd-offset, 0px) + 84px + 24px);
  --cag-gap: 40px;                   /* between the blocks, as in the example */

  position: relative;
  isolation: isolate; /* keeps the module's layers inside, so the site menu stays on top */
  container: cag / inline-size;
  padding: var(--cag-space) 0;
  background: var(--cag-bg);
  color: var(--cag-ink);
  font-family: "Amiko", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-margin-top: 110px;          /* the theme has no anchor offset of its own */
}

.cag--wit {
  --cag-bg: #ffffff;
  --cag-tile: #f1f4f9;
}

.cag--donker {
  --cag-bg: #03060c;
  --cag-ink: #ffffff;
  --cag-muted: #b9bfcc;
  --cag-card: #0d1120;
  --cag-card-line: rgba(255, 255, 255, 0.08);
  --cag-tile: #161c30;
  --cag-shadow: 0 11px 30px rgba(0, 0, 0, 0.45);
}

/* Full width: as wide as the page, whatever column the module sits in.
   --cag-vw is the page width without the scrollbar (set by module.js). */
.cag--bleed {
  width: 100vw;
  width: var(--cag-vw, 100vw);
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-left: calc(50% - var(--cag-vw, 100vw) / 2);
  margin-right: 0;
}

.cag,
.cag *,
.cag *::before,
.cag *::after {
  box-sizing: border-box;
}

.cag ::selection {
  background: var(--cag-accent);
  color: #fff;
}

.cag__inner {
  max-width: calc(var(--cag-max) + 2 * var(--cag-gutter));
  margin: 0 auto;
  padding: 0 var(--cag-gutter);
  container: cag-inner / inline-size;
}

/* Mavim fonts, also when the site's theme forces its own (the Connect theme sets Poppins,
   with !important). */
.cag .cag__title,
.cag .cag__bar {
  font-family: "Allerta", sans-serif !important;
  font-weight: 400 !important;
}

.cag .cag__intro,
.cag .cag__text,
.cag .cag__btn,
.cag .cag__hint {
  font-family: "Amiko", sans-serif !important;
}

/* --- Title, as in the speakers module ---------------------------------------
   --cag-title-w is the title width in em (module.html), so both lines fit on a phone. */

.cag__head {
  --cag-fs: min(var(--cag-h2), calc(94cqw / var(--cag-title-w, 8)));
  max-width: 100%;
}

.cag .cag__title {
  margin: 0;
  padding: 0;
  font-size: var(--cag-fs);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--cag-ink);
}

.cag__line {
  display: block;
  width: fit-content;
  padding: 0.04em 0 0.16em;
  white-space: nowrap;
}

.cag__line--2 {
  margin-top: -0.15em;
  color: var(--cag-accent);
}

.cag .cag__intro {
  max-width: 40rem;
  margin: 20px 0 0;
  padding: 0;
  font-size: var(--cag-lead);
  line-height: 1.55;
  color: var(--cag-muted);
}

/* --- Blocks ---------------------------------------------------------------------- */

.cag .cag__list {
  display: flex;
  flex-direction: column;
  gap: var(--cag-gap);
  margin: var(--cag-head-gap) 0 0;
  padding: 0;
  list-style: none;
}

.cag .cag__block {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--cag-bg);         /* covers the block below while they stack */
}

.cag .cag__block::before,
.cag .cag__block::marker {
  content: none;
}

/* Stacking: every block sticks at the same height and the next one slides over it.
   module.js makes sure the theme lets position: sticky work (see there). */
.cag--stack .cag__block {
  position: sticky;
  top: var(--cag-top);
  z-index: calc(var(--i, 0) + 1);
}

/* The coloured bar with the title. */
.cag .cag__bar {
  display: flex;
  align-items: center;
  min-height: 60px;
  margin: 0;
  padding: 14px clamp(20px, 2.5vw, 30px);
  border-radius: 9px;
  background: var(--cag-bar, var(--cag-magenta));
  font-size: clamp(1.25rem, 1rem + 0.7vw, 1.625rem);
  font-style: normal;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  color: #fff;
}

.cag__block--magenta { --cag-bar: var(--cag-magenta); }
.cag__block--blauw { --cag-bar: var(--cag-blauw); }
.cag__block--violet { --cag-bar: var(--cag-violet); }

/* The card: photo on the left, text on the right; stacked on phones. */
.cag__card {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 8px;
  min-height: clamp(260px, 24vw, 320px);
  padding: 8px;
  border: 1px solid var(--cag-card-line);
  border-radius: 9px;
  background: var(--cag-card);
  box-shadow: var(--cag-shadow);
}

.cag__card--text {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}

.cag__photo {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  border-radius: 5px;
  background: var(--cag-tile);
}

.cag .cag__photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
}

.cag__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 3vw, 40px);
}

/* Optional bold heading above the text (Amiko Bold, like the speaker names). */
.cag .cag__heading {
  max-width: 34rem;
  margin: 0 0 10px;
  padding: 0;
  font-family: "Amiko", sans-serif !important;
  font-size: clamp(1.1875rem, 1rem + 0.55vw, 1.5rem);
  font-style: normal;
  font-weight: 700 !important;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cag-ink);
}

.cag .cag__text {
  max-width: 34rem;
  margin: 0;
  padding: 0;
  font-size: var(--cag-lead);
  line-height: 1.6;
  color: var(--cag-ink);
}

/* Tablets: still side by side, with a little less room around the text. */
@container cag-inner (max-width: 899px) {
  .cag__card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    min-height: 240px;
  }

  .cag__body {
    padding: 20px 16px;
  }
}

/* Phones: photo above the text, low and wide, so a block fits below the menu. */
@container cag-inner (max-width: 599px) {
  .cag__card {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .cag__photo {
    min-height: 0;
    aspect-ratio: 2 / 1;
  }

  .cag__body {
    padding: 14px 10px 10px;
  }

  .cag .cag__text {
    font-size: 1rem;
    line-height: 1.55;
  }

  .cag .cag__heading {
    margin-bottom: 6px;
    font-size: 1.125rem;
  }

  .cag .cag__bar {
    min-height: 52px;
  }
}

/* A block taller than the space below the menu would be cut off while it sticks, so
   module.js turns the stacking off then (very low screens, long texts). */
.cag--stack.is-unstacked .cag__block {
  position: relative;
  top: auto;
}

/* --- Button: the same magenta button as the speakers module ------------------------ */

.cag__actions {
  display: flex;
  margin-top: clamp(32px, 4vw, 48px);
}

.cag .cag__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 16px 32px;
  border: 1px solid var(--cag-accent);
  border-radius: 3px;
  background: var(--cag-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-decoration: none;
  text-transform: none;
  transition: background-color 0.15s linear, border-color 0.15s linear, transform 0.15s linear;
}

.cag .cag__btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s linear;
}

.cag .cag__btn:hover,
.cag .cag__btn:focus-visible {
  border-color: #999;
  background: #999;
  color: #fff;
  text-decoration: none;
  transform: scale(1.05);
}

.cag .cag__btn:hover svg {
  transform: translateX(3px);
}

.cag .cag__btn:focus-visible {
  outline: 2px solid var(--cag-ink);
  outline-offset: 3px;
}

@container cag-inner (max-width: 479px) {
  .cag__actions .cag__btn {
    width: 100%;
  }
}

.cag .cag__hint {
  margin: var(--cag-head-gap) 0 0;
  padding: 10px 14px;
  border: 1px dashed var(--cag-accent);
  border-radius: 9px;
  font-size: 13px;
  color: var(--cag-muted);
}

/* The theme sets html and body to overflow-x: hidden, which turns off position: sticky.
   module.js adds this class to swap it for clip: it still clips sideways, but keeps
   sticky working. Browsers without clip simply show the blocks one under the other. */
@supports (overflow: clip) {
  html.cag-sticky,
  html.cag-sticky body {
    overflow-x: clip;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cag .cag__btn,
  .cag .cag__btn svg {
    transition: none;
  }

  .cag .cag__btn:hover,
  .cag .cag__btn:focus-visible,
  .cag .cag__btn:hover svg {
    transform: none;
  }
}