/* ==========================================================================
   The subject library hub in site v5 (noteviewer/templates/noteviewer/subject_resources.html): every subject's
   /resources/ page, a module's own page and the empty hub. A light opening (site.css .hero-light), the library as
   white cards on a mist band, the course and the syllabus on white. Built from site.css tokens and components;
   only what the hub adds is here. The notebook's login gate and Premium dialog are drawn by their own sheets and are
   not restyled here.
   ========================================================================== */

/* a subject's name and code: smaller than a page title, so a long name (AP Physics C: Electricity and Magnetism) holds
   two lines at most */
.hub-title {
  font-size: clamp(36px, 4.7vw, 66px);
}

/* the trail is the study pages' own markup (class nb-breadcrumb kept for anything that finds it). With a dialog on the
   page the notebook's component sheet is loaded and draws that class in capitals with its own dots; the page's trail
   is the site's */
.crumbs.nb-breadcrumb ol {
  align-items: normal;
  gap: 4px 0;
}
.crumbs.nb-breadcrumb li {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}
/* the site's separator, restated over the component sheet's dot (both end the crumb before them, so a wrapped trail
   never opens a line with one) */
.crumbs.nb-breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 10px;
  color: inherit;
  opacity: 0.5;
}
.crumbs.nb-breadcrumb a,
.crumbs.nb-breadcrumb a:hover,
.crumbs.nb-breadcrumb [data-ui-current="page"] {
  color: inherit;
}
.crumbs.nb-breadcrumb a {
  padding: 0;
  margin-inline: 0;
  border-radius: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.crumbs.nb-breadcrumb a:hover {
  text-decoration-thickness: 2px;
}

/* the title's code stays on the line with the word before it, and in the title's own colour (owner rule) */
.hub-code {
  white-space: nowrap;
}

/* with a dialog on the page the notebook's light tokens put a paper ground on <html> (html.theme-light, set by
   hub-dialogs.js); the page keeps its own */
html.theme-light {
  background-color: var(--snow);
}

/* the two dialogs (the notebook's login gate and Premium dialog, not restyled): on the study pages the notebook's base
   type (notebook-typography.css) gives their native buttons, fields and labels a face, and the field none of the
   v5 field's minimum height. Those pages' sheet is global and is not loaded here, so the same base, for the dialogs only
   and at the same (no) weight, and the v5 field's own minimum height taken off their fields. */
:where(dialog.nb-gate) :is(input, select, textarea) {
  font: var(--nb-type-ui);
}
:where(dialog.nb-gate) button {
  font: var(--nb-type-control);
}
:where(dialog.nb-gate) label {
  font: var(--nb-type-label);
}
dialog.nb-gate .nb-input {
  min-height: 0;
}
dialog.nb-gate .nb-gate-or {
  line-height: 1.6;
}
/* the Premium dialog's price lines were drawn against the study pages' paragraph (a 1.6 line under the figure and a bottom
   margin under the remark and the tax note), which a v5 page does not have */
dialog.nb-gate--premium .nb-gate-price > p:first-child {
  line-height: 1.6;
}
dialog.nb-gate--premium .nb-gate-price .nb-price-per {
  margin-bottom: 15px;
}
dialog.nb-gate--premium .nb-gate-price .nb-price-tax {
  margin-bottom: 13px;
}

/* ---------- the bands: tighter than the site's page-length bands, the page is a place to choose from ---------- */
.hub-lib {
  padding-bottom: clamp(56px, 7vw, 96px);
}
.hub-landing {
  padding: clamp(56px, 7vw, 96px) 0;
}

/* ---------- sections: a small heading, its one line, then what it holds ---------- */
.hub-sec + .hub-sec,
:is(.hub-mods, .hub-library) + :is(.hub-library, .hub-tutor, .hub-tip) {
  margin-top: clamp(44px, 5.4vw, 72px);
}
.hub-tutor + .hub-tip {
  margin-top: 28px;
}
.hub-sec-head {
  display: grid;
  gap: 6px;
  max-width: 40em;
  margin-bottom: clamp(18px, 2vw, 26px);
}
.hub-sec-title {
  font-size: clamp(24px, 2.3vw, 31px);
  line-height: 1.1;
  letter-spacing: -0.024em;
}
.hub-sec-desc {
  font-size: 17.5px;
  line-height: 1.5;
}

/* ---------- the library's cards ---------- */
.hub-cards {
  display: grid;
  gap: 14px;
}
@media (min-width: 640px) {
  .hub-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* on a tablet a section of three has its first card across the top and the other two side by side */
@media (min-width: 640px) and (max-width: 979px) {
  .hub-cards--n3 > li:first-child {
    grid-column: 1 / -1;
  }
  .hub-cards--n3 > li:first-child .hub-card {
    min-height: 0;
  }
}
@media (min-width: 980px) {
  .hub-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.hub-cards > li {
  display: flex;
}
.hub-card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 248px;
  padding: clamp(22px, 2.3vw, 30px);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 2px 4px 12px rgb(11 13 18 / 0.06);
  transition:
    box-shadow 0.3s var(--ease),
    transform 0.3s var(--ease);
}
a.hub-card:hover,
a.hub-card:focus-visible {
  box-shadow: 2px 6px 18px rgb(11 13 18 / 0.13);
  transform: scale(1.01);
}
.hub-card.is-soon {
  box-shadow: inset 0 0 0 1px var(--line);
}
@media (max-width: 639px) {
  .hub-card {
    min-height: 0;
  }
  .hub-icon {
    margin-bottom: 18px;
  }
  .hub-card-foot {
    padding-top: 18px;
  }
}
.hub-icon {
  display: block;
  width: 34px;
  height: 34px;
  margin-bottom: clamp(22px, 2.6vw, 34px);
}
.hub-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.hub-card-title {
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 650;
  font-stretch: 104%;
  line-height: 1.05;
  letter-spacing: -0.028em;
}
.hub-card-desc {
  max-width: 22em;
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.45;
}
.hub-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
}
.hub-facts {
  font-size: 15px;
  font-weight: 550;
  line-height: 1.4;
}
/* the way in, small and ink; the lead card (Notes) carries the page's one blue */
.hub-go {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  transition:
    background-color 0.2s,
    box-shadow 0.2s,
    color 0.2s;
}
.hub-go svg {
  width: 18px;
  height: 18px;
}
a.hub-card:hover .hub-go,
a.hub-card:focus-visible .hub-go {
  background: var(--ink);
  box-shadow: none;
  color: #fff;
}
.hub-card.is-lead .hub-go {
  background: var(--blue);
  box-shadow: none;
  color: #fff;
}
a.hub-card.is-lead:hover .hub-go,
a.hub-card.is-lead:focus-visible .hub-go {
  background: var(--blue-hover);
}

/* a card that is not there yet: a plain block in a quiet ink that keeps AA contrast (#6e6e73 is 5:1 on white,
   4.6:1 on the mist band), never a fade */
.hub-card.is-soon {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: #6e6e73;
  cursor: default;
}
.hub-soon {
  font-size: 15px;
  font-weight: 600;
  color: #6e6e73;
}

/* ---------- a module subject's families: the modules as rows, with their counts ---------- */
.hub-mod-list .row-link {
  min-height: 64px;
}
.hub-mod-list .row-link .row-meta {
  font-size: 15px;
}

/* ---------- the tutor link and the tip, under the cards ---------- */
.hub-tutor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 17px;
  font-weight: 550;
}
.hub-tutor-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.hub-tip {
  max-width: 44em;
  font-size: 16.5px;
  line-height: 1.5;
}
.hub-tip strong {
  margin-right: 6px;
  font-weight: 650;
}

/* ---------- the course ---------- */
.hub-course-body {
  display: grid;
  gap: 14px;
  max-width: 44em;
}
.hub-course-line {
  font-size: 17.5px;
  line-height: 1.55;
}
.hub-course-line.is-lead {
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
}
.hub-spec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.hub-spec svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.hub-host {
  white-space: nowrap;
}
.hub-join {
  display: grid;
  gap: 14px;
  justify-items: start;
  margin-top: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ---------- the syllabus: every chapter a heading with its id, every topic a plain link ---------- */
.hub-syl-mod {
  margin: clamp(36px, 4vw, 52px) 0 4px;
  padding-top: 22px;
  border-top: 1.5px solid var(--ink);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.026em;
}
.hub-syl-mod:first-child {
  margin-top: 0;
}
.hub-syl-code {
  white-space: nowrap;
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: 0;
}
.hub-chapters {
  display: grid;
  gap: clamp(28px, 3vw, 40px) clamp(32px, 4vw, 64px);
  margin-top: 22px;
}
@media (min-width: 720px) {
  .hub-chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1160px) {
  .hub-chapters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.hub-ch-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5em;
  padding-bottom: 10px;
  font-size: 19px;
  font-weight: 650;
  font-stretch: 104%;
  line-height: 1.25;
  letter-spacing: -0.014em;
  scroll-margin-top: calc(var(--gn-h) + 16px);
}
.hub-num {
  font-variant-numeric: tabular-nums;
}
.hub-topics a {
  display: flex;
  gap: 0.6em;
  align-items: baseline;
  min-height: 44px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 16.5px;
  line-height: 1.35;
  transition: color 0.15s;
}
.hub-topics .hub-num {
  flex: none;
  min-width: 2.6em;
  font-weight: 600;
}
.hub-topics a:hover,
.hub-topics a:focus-visible {
  color: var(--blue-text);
}
.hub-topics li:last-child a {
  border-bottom: 1px solid var(--line);
}

/* ---------- a hub with nothing published: one honest line and the way to what is ready ---------- */
.hub-empty-in {
  display: grid;
  gap: 18px;
  justify-items: start;
  max-width: 34em;
  padding-bottom: clamp(24px, 6vw, 96px);
}
.hub-empty-in .btn {
  margin-top: 6px;
  white-space: normal;
  height: auto;
  min-height: 56px;
  padding-block: 14px;
  text-align: center;
}
.hub-empty-note {
  font-size: 17px;
}

/* ---------- the subject's own colour (site v5, second pass): its cover beside the title, the same object the board
   pages show beside its name, and its library's icons in its hue; the one blue stays the action's ---------- */
.hub-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 36px);
}
.hub-head-text {
  display: grid;
  gap: clamp(12px, 1.6vw, 18px);
  min-width: 0;
}
.hub-head .cover-hero {
  transform: rotate(-3deg);
}
html.motion .hub-head .cover-hero {
  animation: hub-cover-in 0.9s var(--ease) 0.1s both;
}
@keyframes hub-cover-in {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) rotate(-8deg);
  }
}
.hub-lib[data-hue] .hub-icon {
  color: var(--hue);
}
@media (max-width: 559px) {
  .hub-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .hub-head .cover-hero {
    width: 112px;
    min-height: 132px;
  }
  .hub-head .cover-hero .cover-name {
    font-size: 14px;
  }
  .hub-head .cover-hero .cover-code {
    font-size: 12px;
  }
}
.hub-lib[data-hue] .is-soon .hub-icon {
  color: #6e6e73;
}
