/* CareNote Training — shared stylesheet */

:root {
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(120deg,#fdf8ef 0%,#faf3e3 55%,#f6ecd8 100%);
  background-attachment: fixed;
  color: #17142e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  --accent: #5b4ee0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

a { color: #5b4ee0; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #5b4ee0;
  outline-offset: 2px;
}

/* ---------- header ---------- */

.site-header {
  padding: 20px 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: Charter, Georgia, "Iowan Old Style", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1d1a3a;
}

.wordmark img { display: block; border-radius: 6px; }
.wordmark__text span { color: #8b7ae8; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: #4b4668;
  font-size: .95rem;
  font-weight: 600;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover { color: #1d1a3a; }
.site-nav a[aria-current="page"] {
  color: #1d1a3a;
  border-bottom-color: var(--accent);
}

/* ---------- kicker / headings ---------- */

.kicker {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .72rem;
  font-weight: 600;
  color: #4b4668;
  margin: 0 0 14px;
}

.display {
  font-family: Charter, Georgia, "Iowan Old Style", serif;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.08;
  margin: 0 0 18px;
  color: #1d1a3a;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.display em {
  font-style: italic;
  color: #5b4ee0;
}

h2, h3 { font-family: Charter, Georgia, "Iowan Old Style", serif; color: #1d1a3a; }

/* ---------- hero ---------- */

.hero { padding: 56px 0 40px; }
.hero--audience { padding-bottom: 32px; }

.hero__sub {
  max-width: 46ch;
  font-size: 1.1rem;
  color: #4b4668;
  margin: 0 0 8px;
}

.hero__meta {
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  margin: 12px 0 0;
}

/* ---------- role grid (index) ---------- */

.role-grid {
  list-style: none;
  margin: 8px 0 64px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.role-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(30,20,80,.12);
  border-left: 8px solid var(--accent);
  overflow: hidden;
}

.role-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.role-card__cover {
  display: block;
  width: 100%;
  height: auto; /* the height="720" attribute otherwise wins over aspect-ratio */
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.role-card__body { padding: 22px 24px 26px; }

.role-card__body .kicker { color: var(--accent); margin-bottom: 8px; }

.role-card__meta {
  margin: 0 0 10px;
  font-size: .85rem;
  font-weight: 600;
  color: #4b4668;
}

.role-card__desc {
  margin: 0 0 16px;
  color: #17142e;
}

.role-card__cta {
  font-weight: 700;
  color: var(--accent);
}

.role-card__link:hover .role-card__cta,
.role-card__link:focus-visible .role-card__cta { text-decoration: underline; }

/* ---------- episode list ---------- */

.episode-list {
  list-style: none;
  margin: 8px 0 64px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.episode-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(30,20,80,.12);
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
}

.episode-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #1d1a3a;
  aspect-ratio: 16 / 9;
}

.episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: .92;
  transition: opacity .15s ease, transform .2s ease;
}

.episode-thumb:hover img,
.episode-thumb:focus-visible img { opacity: 1; transform: scale(1.02); }

.episode-thumb__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(29,26,58,.55);
  display: flex;
}

.episode-thumb__play::after {
  content: "";
  margin: auto;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  transform: translateX(2px);
}

.episode-thumb__duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(23,20,46,.82);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .75rem;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: .02em;
}

.episode-body { padding: 20px 24px; }

.episode-number {
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
}

.episode-number__total { color: #4b4668; font-weight: 600; }

.episode-title { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.35; }

.episode-title__link {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-family: Charter, Georgia, "Iowan Old Style", serif;
  color: #1d1a3a;
  text-align: left;
  cursor: pointer;
}

.episode-title__link:hover { color: var(--accent); }

.episode-details summary {
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  list-style: none;
}

.episode-details summary::-webkit-details-marker { display: none; }

.episode-details summary::before {
  content: "\25B8";
  display: inline-block;
  margin-right: 6px;
  transition: transform .15s ease;
}

.episode-details[open] summary::before { transform: rotate(90deg); }

.episode-blurb {
  color: #4b4668;
  margin: 12px 0 16px;
  font-size: .95rem;
}

/* signature element: chapter scrubber */

.scrubber {
  position: relative;
  height: 14px;
  margin: 4px 0 10px;
}

.scrubber__track {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e7e1f5;
  border-radius: 2px;
}

.scrubber__tick {
  position: absolute;
  top: 2px;
  width: 2px;
  height: 10px;
  background: var(--accent);
  border-radius: 1px;
}

.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.chapter-list li {
  display: flex;
  gap: 10px;
  font-size: .85rem;
}

.chapter-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  min-width: 3.4em;
}

.chapter-title { color: #4b4668; }

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23,20,46,.78);
}

.modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0,0,0,.4);
  max-width: 920px;
  width: 100%;
  padding: 18px;
}

.modal__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #1d1a3a;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal__title {
  margin: 4px 8px 12px;
  font-weight: 700;
  font-family: Charter, Georgia, "Iowan Old Style", serif;
  color: #1d1a3a;
  padding-right: 24px;
}

.modal__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.modal__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

body.modal-open { overflow: hidden; }

/* ---------- footer ---------- */

.site-footer {
  padding: 36px 0 56px;
  border-top: 1px solid rgba(29,26,58,.08);
  margin-top: 24px;
}

.site-footer p {
  margin: 0;
  font-size: .85rem;
  color: #4b4668;
}

.site-footer a { color: #4b4668; font-weight: 600; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .role-grid { grid-template-columns: 1fr; }
  .episode-card { grid-template-columns: 1fr; }
  .episode-thumb__duration { font-size: .72rem; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
