/* Discovery surfaces: full artwork, a restrained glass caption, shared channel rails. */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}
.category-home .category-grid {
  display: grid;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: clamp(215px, 20vw, 280px);
  gap: 14px;
  margin: 0;
  padding: 4px 4px 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 4px;
  scrollbar-width: thin;
  scrollbar-color: #ffffff25 transparent;
}
.category-tile,
.category-home .category-tile {
  position: relative;
  display: block;
  flex: none;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  min-height: 194px;
  aspect-ratio: 1.25;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff1c;
  border-radius: 16px;
  background: #1c1c1c;
  color: #fff;
  text-align: left;
  scroll-snap-align: start;
  transition: border-color 160ms ease;
}
.category-tile>.category-cover {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--category-focal-point, 50% 40%);
  opacity: 1;
  transition: transform 220ms ease;
}
.category-tile:after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #08080800 20%, #0808080d 45%, #08080866 100%);
}
.category-tile .category-glass {
  position: absolute;
  inset: auto 9px 9px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  min-height: 78px;
  padding: 14px 35px 14px 15px;
  border: 1px solid #ffffff30;
  border-radius: 10px;
  background: #121212a8;
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  box-shadow: inset 0 1px 0 #ffffff0c;
}
.category-tile .category-glass strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  color: #fff;
  font-family: 'Public Sans', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.45px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 4px #0007;
}
.category-tile .category-glass .category-count {
  display: block;
  max-width: 100%;
  margin: 0;
  color: #f0ebea;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 400;
  white-space: normal;
}
.category-glass>.category-symbol { display: none; }
.category-glass>.icon { position: absolute; top: 50%; right: 11px; width: 16px; height: 16px; transform: translateY(-50%); color: #eee; }
.category-tile>.category-symbol {
  position: absolute;
  left: 13px;
  top: 13px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid #ffffff2b;
  border-radius: 50%;
  background: #13131370;
  color: #f5f5f5;
  backdrop-filter: blur(8px);
}
.category-tile>.category-symbol .icon { width: 18px; height: 18px; }
.category-tile>.icon,
.category-home .category-tile>.icon {
  position: absolute;
  right: 13px;
  top: 13px;
  z-index: 1;
  display: block;
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 3px #000a);
}
.category-tile:hover,
.category-home .category-tile:hover { border-color: #ffffff70; background: #1c1c1c; }
.category-tile:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-color: #fff; }
.category-tile[aria-pressed="true"] { border-color: #e8a39e; }
.category-tile[aria-pressed="true"] .category-glass { border-color: #d46d66; background: #421f1fce; }

/* Channels use the same full-width rails as the homepage, not a nested grid. */
.channel-page,
.page.channel-page {
  width: 100%;
  min-width: 0;
  min-height: 70vh;
  margin: 0;
  padding: 0 0 36px;
}
.channel-page .hero,
.hero.channel-hero {
  height: clamp(480px, 40vw, 620px);
  min-height: 0;
  margin-top: 10px;
  margin-bottom: 28px;
}
.channel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 28px;
  margin: 26px var(--gutter) 20px;
}
.channel-heading>div { min-width: 0; }
.channel-heading h1,
.channel-heading h2 {
  margin: 0;
  color: #f7f4f2;
  font-family: 'Public Sans', sans-serif;
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.9px;
  text-wrap: balance;
}
.channel-heading>h1,
.channel-heading>h2 { flex: 1 1 100%; }
.channel-heading p { max-width: 72ch; margin: 11px 0 0; color: #c5bfbd; font-size: 14px; line-height: 1.6; }
.channel-heading>p { flex: 1 1 480px; margin: 0; }
.channel-heading>.btn { flex: 0 0 auto; min-height: 42px; font-size: 12px; }
.channel-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 0 22px;
  padding: 4px var(--gutter) 11px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #ffffff25 transparent;
  scroll-padding-inline: var(--gutter);
}
.channel-nav>a,
.channel-nav>button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 41px;
  padding: 10px 18px;
  border: 1px solid #ffffff35;
  border-radius: 24px;
  background: #ffffff03;
  color: #e8e5e3;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.channel-nav>.active,
.channel-nav>[aria-current="page"],
.channel-nav>[aria-pressed="true"] { border-color: #f1eeeb; background: #f1eeeb; color: #161616; }
.channel-nav>a:hover,
.channel-nav>button:hover { border-color: #fff; }
.channel-nav>:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.channel-nav .icon { width: 16px; height: 16px; }
.channel-heading>.channel-nav { flex: 1 1 100%; width: 100%; margin: 0; padding: 4px 2px 10px; scroll-padding-inline: 2px; }
.channel-toolbar,
.filters.channel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  margin: 0 var(--gutter) 27px;
  padding: 0;
}
.channel-toolbar .search-box { display: flex; flex: 1 1 240px; min-width: 190px; min-height: 44px; margin: 0; padding: 0 13px; border: 1px solid #ffffff20; border-radius: 8px; background: #1c1c1c; }
.channel-toolbar .search-box input { width: 100%; min-width: 0; min-height: 42px; padding: 10px 0; background: transparent; color: #f5f5f5; font-size: 14px; }
.channel-toolbar .search-box input::placeholder { color: #b8b6bc; opacity: 1; }
.channel-toolbar .search-box .icon { flex: 0 0 18px; width: 18px; height: 18px; color: #bcbcbc; }
.channel-toolbar select { flex: 0 1 190px; width: auto; min-width: 130px; max-width: 220px; min-height: 44px; margin: 0; padding: 10px 30px 10px 13px; border: 1px solid #ffffff20; border-radius: 8px; background-color: #1c1c1c; color: #e9e5e3; font-size: 12px; }
.channel-toolbar .search-box:focus-within { border-color: #fff; outline: 2px solid #fff; outline-offset: 2px; }
.channel-toolbar select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.channel-toolbar .catalog-filter-details { flex: 0 0 auto; min-width: 0; }
.channel-toolbar .catalog-filter-details>summary { width: fit-content; min-height: 44px; padding: 12px 16px; border: 1px solid #ffffff28; border-radius: 8px; background: #1c1c1c; color: #e9e5e3; cursor: pointer; font-size: 12px; line-height: 1.5; }
.channel-toolbar .catalog-filter-details>summary:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.channel-toolbar .catalog-filter-details[open] { flex: 1 1 100%; }
.channel-toolbar .catalog-filter-details[open]>summary { margin-bottom: 12px; }
.channel-toolbar .catalog-filter-details .filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.channel-toolbar .catalog-filter-details .btn { min-height: 44px; padding: 10px 14px; font-size: 12px; }
.channel-content { width: 100%; min-width: 0; padding-bottom: 18px; }
.channel-content .rail-section { margin-top: 28px; }
.channel-content>.rail-section:first-child { margin-top: 20px; }
.channel-content>.results-note,
.channel-content>.selected-category { margin: 8px var(--gutter) 18px; }
.channel-content>.empty { margin: 20px var(--gutter) 32px; }
.channel-page .category-group { margin: 34px var(--gutter) 38px; }
.channel-page .category-group>h2 { margin-bottom: 16px; font-family: 'Public Sans', sans-serif; font-size: 24px; font-weight: 600; line-height: 1.25; }
.channel-page .category-guide { margin: 18px var(--gutter) 26px; padding: 17px 0; }
.channel-page .theme-grid { min-width: 0; }

/* The only visible carousel control is a centered set of keyboard-ready dashes. */
.hero .hero-carousel-controls {
  left: 50%;
  right: auto;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: calc(100% - 40px);
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}
.hero .hero-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0; }
.hero .hero-pagination button { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 44px; min-height: 44px; padding: 0 3px; border: 0; border-radius: 6px; background: transparent; }
.hero .hero-pagination button span { display: block; width: 19px; height: 3px; border-radius: 3px; background: #ffffff85; }
.hero .hero-pagination button[aria-current="true"] span { width: 24px; height: 3px; background: #fff; }
.hero .hero-pagination button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

@media (hover: hover) and (pointer: fine) {
  .category-tile:hover>.category-cover { transform: scale(1.035); }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
  .category-home .category-grid { grid-template-columns: none; grid-auto-columns: 225px; }
  .category-tile .category-glass { padding: 12px 32px 12px 12px; }
  .category-tile .category-glass strong { font-size: 18px; }
  .channel-toolbar .search-box { flex-basis: 100%; }
  .channel-toolbar select { flex: 1 1 150px; max-width: none; }
}

@media (max-width: 720px) {
  .category-grid,
  .category-home .category-grid {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 172px;
    gap: 11px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 13px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .category-grid::-webkit-scrollbar { display: none; }
  .category-tile,
  .category-home .category-tile { width: 172px; min-height: 190px; aspect-ratio: auto; padding: 0; border-radius: 14px; }
  .category-tile .category-glass { inset: auto 7px 7px; min-height: 78px; gap: 6px; padding: 11px 29px 11px 11px; border-radius: 8px; }
  .category-tile .category-glass strong { font-size: 17px; line-height: 1.2; white-space: normal; }
  .category-tile .category-glass .category-count { font-size: 11px; line-height: 1.4; }
  .category-tile>.category-symbol { top: 11px; left: 11px; width: 30px; height: 30px; }
  .category-tile>.category-symbol .icon { width: 16px; height: 16px; }
  .category-tile>.icon,
  .category-home .category-tile>.icon { top: 13px; right: 10px; width: 19px; height: 19px; }
  .category-home .section-head h2 { font-size: 20px; line-height: 1.3; }
  .category-home .section-head { margin-bottom: 11px; }
  .channel-page,
  .page.channel-page { padding: 0 0 22px; }
  .channel-page .hero,
  .hero.channel-hero { height: 520px; margin-top: 10px; margin-bottom: 23px; }
  .channel-heading { align-items: flex-start; gap: 15px; margin: 23px var(--gutter) 17px; }
  .channel-heading h1,
  .channel-heading h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.65px; }
  .channel-heading p { margin-top: 9px; font-size: 13px; line-height: 1.6; }
  .channel-heading>.btn { min-height: 44px; }
  .channel-nav { gap: 7px; margin-bottom: 16px; padding-bottom: 10px; scrollbar-width: none; }
  .channel-nav>a,
  .channel-nav>button { min-height: 44px; padding: 10px 16px; font-size: 12px; }
  .channel-toolbar,
  .filters.channel-toolbar { gap: 8px; margin-bottom: 22px; }
  .channel-toolbar .search-box { flex: 1 1 100%; min-width: 0; min-height: 46px; }
  .channel-toolbar .search-box input { font-size: 16px; min-height: 44px; }
  .channel-toolbar select { flex: 1 1 calc(50% - 4px); width: calc(50% - 4px); min-width: 0; max-width: calc(50% - 4px); min-height: 44px; padding-left: 10px; font-size: 14px; }
  .channel-toolbar .catalog-filter-details { flex: 1 1 100%; }
  .channel-toolbar .catalog-filter-details>summary { width: 100%; font-size: 13px; }
  .channel-toolbar .catalog-filter-details .filters { gap: 8px; }
  .channel-content .rail-section { margin-top: 24px; }
  .channel-content>.rail-section:first-child { margin-top: 18px; }
  .channel-page .category-group { margin-top: 27px; margin-bottom: 26px; }
  .channel-page .category-group>h2 { font-size: 21px; margin-bottom: 11px; }
  .channel-page .category-guide { margin-top: 16px; margin-bottom: 18px; padding: 14px 0; }
  .hero .hero-carousel-controls { bottom: 10px; }
  .hero .hero-pagination { gap: 3px; }
  .hero .hero-pagination button { flex-basis: 29px; width: 29px; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .category-tile .category-glass { background: #151515e8; }
}

@media (prefers-reduced-motion: reduce) {
  .category-tile,
  .category-home .category-tile,
  .category-tile>.category-cover { transition: none; }
  .category-tile:hover>.category-cover { transform: none; }
}

@media (forced-colors: active) {
  .category-tile .category-glass { background: Canvas; color: CanvasText; border-color: CanvasText; backdrop-filter: none; }
  .category-tile .category-glass strong,
  .category-tile .category-glass .category-count { color: CanvasText; text-shadow: none; }
  .channel-nav>.active,
  .channel-nav>[aria-current="page"],
  .channel-nav>[aria-pressed="true"] { outline: 2px solid Highlight; }
  .hero .hero-pagination button span { background: CanvasText; }
  .hero .hero-pagination button[aria-current="true"] { outline: 2px solid Highlight; }
}

/* External lessons have their own player and honest completion control. */
.lesson-player{display:block;width:100%;aspect-ratio:16/9;border:0;background:#000;border-radius:10px;margin-block:24px;}
.lesson-actions,.ebook-tools{display:flex;align-items:center;flex-wrap:wrap;gap:14px;margin-block:22px;}
.ebook-tools details{font-size:13px;line-height:1.6;max-width:48ch;}
.ebook-tools summary{cursor:pointer;min-height:44px;display:flex;align-items:center;text-decoration:underline;text-underline-offset:4px;}
.ebook-tools p{font-family:'Public Sans',sans-serif;font-size:14px!important;line-height:1.6;}
.ebook-tools a:not(.btn){text-decoration:underline;}
.hero h1.hero-title-lesson{font-family:'Public Sans',sans-serif;font-weight:700;letter-spacing:-.035em;font-size:clamp(32px,4.2vw,62px);line-height:1.05;}
.hero h1.hero-title-podcast{font-family:'Curcio Cormorant Garamond',serif;font-weight:600;font-style:italic;}
@media(max-width:720px){.hero h1.hero-title-lesson{font-size:36px;}.lesson-actions{align-items:stretch;flex-direction:column;}.ebook-tools{align-items:flex-start;flex-direction:column;}}

/* Historical covers retain their native detail; the cinematic backdrop is 6000px. */
.hero-feature-cover{position:absolute;z-index:1;right:7%;top:10%;width:auto;max-width:30%;height:auto;max-height:68%;object-fit:contain;border-radius:4px;box-shadow:0 18px 48px #0008;}
.hero-feature-cover.lesson-cover{width:min(30%,480px);top:23%;}
.hero:has(.hero-feature-cover) .hero-copy{max-width:56%;}
.hero h1.hero-title-ebook{font-family:'Curcio Cormorant Garamond',serif;font-size:clamp(36px,4.2vw,64px);line-height:1.03;}
@media(max-width:720px){.hero-feature-cover{right:22px;top:24px;max-width:40%;max-height:120px;}.hero-feature-cover.lesson-cover{width:42%;max-width:160px;top:35px;}.hero:has(.hero-feature-cover) .hero-copy{max-width:100%;}.hero:has(.hero-feature-cover) .hero-description{max-width:100%;}.hero h1.hero-title-ebook{font-size:32px;}}
