.study-library .subpage {
  max-width: 1120px;
  padding-block: 0 56px;
}

.study-library header nav [aria-current="page"] {
  color: #245842;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.study-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4.5vw, 56px);
  padding: clamp(30px, 5vw, 70px) 0;
  border-bottom: 1px solid #d7e0d9;
}

.study-intro { container-type: inline-size; }

.study-hero h1,
.study-article h1 {
  margin: 8px 0 20px;
  font-size: clamp(2.25rem, 6.5vw, 4.7rem);
  line-height: 1.04;
  letter-spacing: -.06em;
  color: #142f29;
}

.study-hero h1 span,
.study-hero h1 em,
.study-article h1 em { display: block; }

.study-hero h1 em,
.study-article h1 em {
  font-family: Georgia, serif;
  font-weight: 400;
  color: #2c674f;
  letter-spacing: -.06em;
}

.study-hero h1 em {
  /* Scale the compound word to the available column, including at intermediate desktop widths. */
  font-size: clamp(1.8rem, 8vw, 4.25rem);
  font-size: clamp(1.8rem, 10.6cqi, 4.25rem);
  white-space: nowrap;
  overflow-wrap: normal;
}

.study-hero p:not(.study-tag),
.study-lead {
  max-width: 43ch;
  color: #465c53;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.55;
}

.study-hero .study-subtitle:not(.study-tag) {
  margin: 0 0 5px;
  color: #245842;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 750;
}
.study-subtitle + p { margin: 0; }

.study-tag {
  font-size: .77rem;
  letter-spacing: .075em;
  text-transform: uppercase;
  font-weight: 750;
  color: #446b57;
  margin: 0;
}

.study-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 23px;
}

.study-feature {
  min-width: 0;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid #cddcce;
  border-radius: 20px;
  background-color: #e8f0e3;
  background-image: linear-gradient(#244b3610 1px, transparent 1px),
    linear-gradient(90deg, #244b3610 1px, transparent 1px);
  background-size: 24px 24px;
}

.study-feature h2 {
  margin: 8px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: -.04em;
}

.study-feature a, .study-heading a, .study-card a,
.study-actions > a:not(.button), .study-footnote a {
  color: #245842;
  text-underline-offset: .2em;
  font-weight: 700;
}

.study-section {
  padding: clamp(29px, 4.3vw, 55px) 0;
  border-bottom: 1px solid #d7e0d9;
}

.study-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 19px;
}

.study-heading h2,
.study-section h2 {
  margin: 5px 0 0;
  font-size: clamp(27px, 4.6vw, 43px);
  line-height: 1.13;
  letter-spacing: -.045em;
}

.study-heading p:not(.study-tag) { margin: 0; color: #496056; }

.study-filter {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 17px;
  padding: 13px;
  border: 1px solid #d7e0d9;
  border-radius: 14px;
  background: #eff4ed;
}

.study-filter[hidden], .study-card[hidden] { display: none; }
.study-filter label { flex: 1 1 180px; min-width: 0; font-size: .9rem; font-weight: 650; }
.study-filter input, .study-filter select {
  display: block;
  width: 100%;
  min-height: 45px;
  margin-top: 4px;
  padding: 8px 11px;
  border: 1px solid #8ba699;
  border-radius: 8px;
  background: #fff;
  color: #142f29;
  font: inherit;
}
#study-count { margin: 3px 5px 7px; min-width: 8ch; }

.study-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.study-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 19px;
  border: 1px solid #d7e0d9;
  border-radius: 15px;
  background: #fff;
}

.study-card .study-tag { font-size: .74rem; line-height: 1.35; letter-spacing: .025em; text-transform: none; }
.study-card h3 { margin: 8px 0 7px; font-size: 1.22rem; line-height: 1.25; letter-spacing: -.02em; }
.study-card p:not(.study-tag) { margin: 0 0 11px; color: #40584e; }
.study-details { margin-top: auto; }
.study-details details { margin: 0; border: 0; border-top: 1px solid #e0e8e2; border-radius: 0; }
.study-details details p { padding: 0; font-size: .94rem; }
.study-details summary, .study-archives summary { padding: 9px 0; color: #235b45; font-weight: 700; cursor: pointer; }
.study-math {
  max-width: 100%;
  overflow-x: auto;
  color: #142f29;
}
.study-math .katex-display {
  width: max-content;
  min-width: 100%;
  margin: 0;
}
.study-feature-math {
  margin: 15px 0 8px;
  padding: 6px 0;
  font-size: clamp(16px, 2vw, 23px);
}
.study-problem-math {
  margin-bottom: 11px;
  padding: 5px 0 9px;
}
.study-answer-math {
  margin: 2px 0 6px;
  padding: 12px 5px;
  border: 1px solid #dfebe2;
  border-radius: 9px;
  background: #f2f7f3;
  font-size: clamp(.86rem, 1.45vw, 1rem);
}
.study-archive-intro { margin: 0 0 16px; max-width: 69ch; color: #40584e; }
.study-years {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(51px, 1fr));
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.study-years a {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 7px;
  background: #eff4ed;
  color: #245842;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.study-years a:hover { background: #dceadd; text-decoration: underline; }
.study-years a[aria-current] { background: #235b45; color: #fff; }
.study-year-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.study-year, .study-dates {
  margin: 0;
  border: 1px solid #d7e0d9;
  border-radius: 11px;
  background: #fff;
}
.study-year > summary {
  display: grid;
  grid-template-columns: 3.8rem minmax(0, 1fr) 1em;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  cursor: pointer;
  font-size: clamp(.94rem, 2.1vw, 1.02rem);
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
}
.study-year > summary::-webkit-details-marker { display: none; }
.study-year > summary::after {
  content: "+" / "";
  font-size: 1.2em;
  color: #376d55;
  text-align: center;
}
.study-year[open] > summary { border-bottom: 1px solid #d7e0d9; }
.study-year[open] > summary::after { content: "−" / ""; }
.study-year:target { border-color: #719585; }
.study-year-number { color: #376d55; font-variant-numeric: tabular-nums; }
.study-year-body {
  max-width: 740px;
  padding: 17px clamp(14px, 3vw, 28px);
}
.study-year-body .study-year-note {
  margin: 0;
  color: #476c59;
  font-size: .82rem;
  font-weight: 700;
}
.study-year-body h3 {
  margin: 4px 0 9px;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  line-height: 1.22;
  letter-spacing: -.025em;
}
.study-year-body p { margin: 0 0 12px; color: #40584e; }
.study-year-body .study-math { font-size: clamp(.86rem, 2vw, 1.07rem); }
.study-dates { margin-top: 22px; padding: 9px 15px; }
.study-dates > summary { cursor: pointer; color: #245842; font-weight: 700; }
.study-dates .study-footnote { margin-bottom: 4px; }
.study-archives details { margin: 7px 0; padding: 2px 16px; border: 1px solid #d7e0d9; border-radius: 12px; }
.study-archives span { margin-left: .6em; color: #4c6e61; font-size: .9rem; font-weight: 500; }
.study-archives ul { columns: 3; margin: 0 0 14px; padding-left: 20px; }
.study-archives li { break-inside: avoid; margin-bottom: 4px; }
.study-article { max-width: 880px; margin: 25px auto 60px; }
.study-article h2 { margin: 32px 0 10px; font-size: clamp(24px, 4vw, 35px); line-height: 1.2; }
.study-article > p:not(.study-tag) { max-width: 66ch; }
.study-steps { padding-left: 22px; }
.study-steps li { padding: 12px 5px; border-top: 1px solid #d7e0d9; }
.study-steps h3, .study-steps p { margin: 0 0 5px; }
.study-news { margin: 35px 0; padding: 23px; border-radius: 16px; background: #e8f0e3; }
.study-news h2 { margin: 0; font-size: clamp(23px, 4vw, 35px); }

@media (min-width: 900px) {
  .study-hero { grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr); }
}
@media (max-width: 979px) {
  .study-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .study-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 559px) {
  .study-archives ul { columns: 2; }
  .study-card { padding: 16px; }
  .study-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .study-filter label { flex-basis: 100%; }
  .study-hero .study-feature p:not(.study-tag) { font-size: 16px; }
}
@media (max-width: 480px) {
  .study-library header nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px 7px;
    width: 100%;
  }
  .study-library header nav a { justify-content: flex-start; min-height: 37px; white-space: normal; }
  .study-library header nav .nav-try { justify-content: center; padding: 6px; }
}
