/*
 * EAM Course Materials — custom page styles.
 * Rendered by [eam_course_materials]; everything scoped under .eam-cm.
 * Uses site brand tokens (var(--global-*)) with mockup fallbacks.
 * The gated download rows reuse member-resources.css (.eam-course-entry__resource*).
 */

.eam-cm {
  /* break out of the theme content container to a full-bleed band */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  font-family: var(--global-body-font-family, "Roboto", sans-serif);
  color: var(--global-palette3, #1d1d1d);
  line-height: 1.55;
}

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

/* Same content box as the Kadence rows and the footer (x=84 at 1440). */
.eam-cm-wrap {
  max-width: var(--global-content-width, 1320px);
  margin: 0 auto;
  padding: 0 var(--global-content-edge-padding, 1.5rem);
}

.eam-cm-eyebrow {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Kadence gives #primary.content-area a 2rem (phone) / 3rem (tablet) top
 * margin, which showed as a light strip above the dark hero, under the white
 * logo of the see-through header. Zero it so the hero starts at y=0, as on the
 * Activities (314) and Awards (371) pages. */
.page-id-1536 #primary.content-area { margin-top: 0; }

/* ---------- hero (dark image bg keeps the transparent header readable) ---------- */
/* The see-through header sits on top of this hero (144px tall on desktop,
 * 78-88px below 1081px), so the hero's own top padding has to clear it, the
 * same clearance as .eam-act-hero. With 3rem the "Member resources" pill sat
 * inside the header band, next to the nav items. */
.eam-cm-hero {
  display: flex;
  align-items: flex-end;
  min-height: 420px;
  padding: 172px 0 2.6rem;
  color: #fff;
  /* The hand, pen and light bulb in this photo ran through the header links
   * and behind the white intro text; a firmer overlay keeps both readable. */
  background:
    linear-gradient(180deg, rgba(26, 32, 44, .74) 0%, rgba(26, 32, 44, .58) 55%, rgba(26, 32, 44, .86) 100%),
    url("/wp-content/uploads/2026/01/book-with-light.jpg") center / cover no-repeat;
}

/* The hero is a flex row, so its wrap shrank to the text (a 580px box
 * centred on the page) while the text inside it was left-aligned: the title
 * started 300px right of the tabs and cards below. Full content width. */
.eam-cm-hero > .eam-cm-wrap { width: 100%; }

.eam-cm-hero .eam-cm-eyebrow {
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .18);
  padding: .45rem .85rem;
  border-radius: 999px;
  margin-bottom: .85rem;
}

/* Two classes: the theme's h1 rule added an 86px top margin between the
 * eyebrow pill and the title (the Activities hero has none). */
.eam-cm .eam-cm-hero__title {
  margin: 0 0 .55rem;
  font-family: var(--global-heading-font-family, "Frank Ruhl Libre", Georgia, serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #fff;
}

.eam-cm-hero__lede {
  margin: 0;
  max-width: 56ch;
  font-size: 1.05rem;
  opacity: .95;
}

@media (max-width: 1080px) {
  .eam-cm-hero { min-height: 340px; padding-top: 116px; }
}

/* ---------- toolbar: tabs + search ---------- */
.eam-cm-toolbar {
  background: var(--global-palette9, #fff);
  border-bottom: 1px solid #e4e7e6;
  position: sticky;
  top: 0;
  z-index: 5;
}

.eam-cm-toolbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.eam-cm-tabs { display: flex; gap: 1.6rem; flex-wrap: wrap; }

.eam-cm-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 1.05rem 0;
  font: 600 1rem/1 var(--global-body-font-family, "Roboto", sans-serif);
  color: #5b6160;
  cursor: pointer;
}
.eam-cm-tab:hover { color: var(--global-palette1, #5a64ad); }
.eam-cm-tab.is-active {
  color: var(--global-palette3, #1d1d1d);
  border-bottom-color: var(--global-palette1, #5a64ad);
}

.eam-cm-search {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex: 1;
  max-width: 420px;
  min-width: 220px;
  border: 1px solid #e4e7e6;
  border-radius: 8px;
  padding: .6rem .9rem;
  color: #5b6160;
}
.eam-cm-search svg { width: 18px; height: 18px; flex: none; }
.eam-cm-search input {
  border: 0;
  outline: 0;
  background: transparent;
  flex: 1;
  font: 400 .95rem/1 var(--global-body-font-family, "Roboto", sans-serif);
  color: var(--global-palette3, #1d1d1d);
}

/* ---------- featured ---------- */
.eam-cm-featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  min-height: 330px;
  margin: 2.6rem 0 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 38px rgba(20, 24, 50, .12);
}
.eam-cm-featured__img { background: #d9dee2 center / cover no-repeat; min-height: 220px; }
.eam-cm-featured__panel {
  background: var(--global-palette1, #5a64ad);
  color: #fff;
  padding: 2.4rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eam-cm-featured__panel .eam-cm-eyebrow { opacity: .85; margin-bottom: 1rem; }
/* Two classes so the theme's global heading colour (near-black, about 3:1 on
 * the indigo panel) cannot win over the panel's white text. */
.eam-cm .eam-cm-featured__title {
  margin: 0 0 .8rem;
  font-family: var(--global-heading-font-family, "Frank Ruhl Libre", Georgia, serif);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  line-height: 1.12;
  font-weight: 700;
  color: #fff;
  overflow-wrap: break-word;
}
.eam-cm-featured__lede { margin: 0 0 1.1rem; max-width: 46ch; opacity: .94; }
.eam-cm-featured__meta { font-weight: 700; font-size: .9rem; opacity: .95; }

/* Phones: stack the featured card (photo on top at a fixed height, then the
 * full-width text panel). The two-column grid left the panel ~130px wide, so
 * the title broke mid-word and the card grew to ~780px. */
@media (max-width: 700px) {
  .eam-cm-featured {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    margin-top: 1.8rem;
  }
  .eam-cm-featured__img { min-height: 0; height: 190px; }
  .eam-cm-featured__panel { padding: 1.6rem 1.4rem 1.8rem; }
  .eam-cm-featured__lede { max-width: none; }
}

/* ---------- grid head ---------- */
.eam-cm-grid-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--global-palette3, #1d1d1d);
  padding-bottom: .7rem;
  margin: 2.6rem 0 1.6rem;
}
.eam-cm-grid-head h2 {
  margin: 0;
  font-family: var(--global-heading-font-family, "Frank Ruhl Libre", Georgia, serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  letter-spacing: -.01em;
}
.eam-cm-count { color: var(--global-palette1, #5a64ad); font-size: .85rem; letter-spacing: .04em; font-weight: 600; }

.eam-cm-empty {
  background: #f4f5f8;
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  color: #3a3f3e;
}

/* ---------- image-led card grid ---------- */
.eam-cm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.7rem 1.6rem;
  align-items: stretch;
}
@media (max-width: 900px) { .eam-cm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .eam-cm-grid { grid-template-columns: 1fr; } }

.eam-cm-card {
  display: flex;
  flex-direction: column;
  background: var(--global-palette9, #fff);
  border: 1px solid #e4e7e6;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.eam-cm-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20, 24, 50, .14); }

.eam-cm-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #d9dee2 center / cover no-repeat;
}

/* Branded tile for courses without a cover image (see template mark). */
.eam-cm-card__thumb--brand,
.eam-cm-featured__img--brand {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--global-palette1, #5a64ad) 0%, #4a548f 100%);
  color: rgba(255, 255, 255, .92);
}
.eam-cm-mark { display: block; width: 46%; max-width: 160px; color: inherit; }
.eam-cm-mark svg { display: block; width: 100%; height: auto; }
.eam-cm-featured__img--brand .eam-cm-mark { width: 38%; }
.eam-cm-badge {
  position: absolute;
  top: .7rem;
  left: .7rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(29, 29, 44, .82);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .4rem .6rem;
  border-radius: 6px;
}
.eam-cm-badge svg { width: 11px; height: 11px; }

.eam-cm-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.2rem 1.25rem 1.4rem; }
.eam-cm-kicker {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--global-palette1, #5a64ad);
  margin-bottom: .5rem;
}
.eam-cm-card__title {
  margin: 0 0 .4rem;
  font-family: var(--global-heading-font-family, "Frank Ruhl Libre", Georgia, serif);
  font-size: 1.22rem;
  line-height: 1.2;
  font-weight: 700;
}
.eam-cm-card__instructor { font-weight: 700; font-size: .88rem; margin-bottom: .55rem; }
.eam-cm-card__desc { margin: 0 0 1rem; font-size: .92rem; color: #5b6160; }

.eam-cm-card__materials { margin-top: auto; }
.eam-cm-card__matlabel {
  padding-top: 1rem;
  border-top: 1px solid rgba(29, 29, 29, .12);
  margin-bottom: .2rem;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--global-palette1, #5a64ad);
}

/* ---------- CTA ---------- */
.eam-cm-cta {
  background: var(--global-palette1, #5a64ad);
  color: #fff;
  border-radius: 20px;
  text-align: center;
  padding: 2.8rem 1.5rem;
  margin: 3rem 0 4rem;
}
/* Two classes for the same reason as the featured title: white on indigo. */
.eam-cm .eam-cm-cta h2 {
  color: #fff;
  margin: 0 0 .5rem;
  font-family: var(--global-heading-font-family, "Frank Ruhl Libre", Georgia, serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.14;
  font-weight: 500;
}
.eam-cm-cta p { max-width: 46ch; margin: 0 auto 1.4rem; opacity: .94; }
.eam-cm-cta__btns { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.eam-cm-btn {
  display: inline-block;
  font: 600 .95rem/1 var(--global-body-font-family, "Roboto", sans-serif);
  padding: .85rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
}
.eam-cm-btn--solid { background: #fff; color: #303a8c; }
.eam-cm-btn--solid:hover { background: #e6e9f5; }
.eam-cm-btn--outline { border: 1px solid rgba(255, 255, 255, .7); color: #fff; }
.eam-cm-btn--outline:hover { background: rgba(255, 255, 255, .12); }

/* keep the reused download rows tidy inside cards */
.eam-cm-card .eam-course-entry__resources { margin-top: .2rem; }
