/* /learn reference library — index (/learn) and one guide (/learn/:slug)
   Built on the landing design language (styles.css): Inter, #424242 ink,
   #d7d7d7 hairlines, the cyan→pink→orange gradient, .box / .gradient-box.
   This file loads before styles.css (header.html pulls styles.css in <body>),
   so anything the global `*` reset forces (line-height:1, list-style:none,
   text-decoration:none) is re-asserted here with !important, the same way
   airdrop.css does it. Page wrappers must be <div>, never bare elements —
   styles.css has bare-tag selectors (header{position:absolute}) that bite. */

.lrn-section {
  padding: 150px 0 96px;
}

@media (max-width: 1024px) {
  .lrn-section .container {
    width: 100%;
    padding: 0 20px;
  }
}

/* ---------- shared bits ---------- */
.lrn-readmeta {
  font-size: 12px;
  color: #9e9e9e;
  font-variant-numeric: tabular-nums;
}

/* ---------- index: header ---------- */
.lrn-head {
  text-align: center;
  max-width: 660px;
  margin: 0 auto 40px;
}

.lrn-head h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2 !important;
  color: #2f2f2f;
  background-image: linear-gradient(90deg, #2f2f2f, #5b5b5b 50%, #2f2f2f);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lrn-head h1 .h1-gradient {
  background-image: linear-gradient(139deg, #1fd2ff, #fd71ff 48%, #ff9b3f);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lrn-head p {
  margin-top: 14px;
  font-size: 13.5px;
  color: #424242;
  line-height: 1.7 !important;
}

/* ---------- index: category filter ---------- */
.lrn-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 44px;
}

.lrn-cat {
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  /* 2px on both states so toggling active doesn't shift the row */
  border: 2px solid #e2e2e2;
  color: #424242;
  background: #fff;
  cursor: pointer;
}

/* active chip = the "Открыть трекер" button look: white interior, 2px gradient
   edge, the landing's .get-app shadow */
.lrn-cat[aria-pressed="true"] {
  border-color: transparent;
  color: #424242;
  font-weight: 600;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(154deg, #1fd2ff, #fd71ff 50%, #ff9b3f) border-box;
  box-shadow: 0 0 10px rgb(0 0 0 / 73%);
}

/* ---------- index: grid ---------- */
.lrn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.lrn-card {
  display: flex;
  flex-direction: column;
  padding: 20px 20px 16px;
  border-radius: 16px;
  transition: box-shadow 0.12s linear, transform 0.12s linear;
}

.lrn-card:hover {
  box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
  transform: translateY(-2px);
}

.lrn-card h3 {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4 !important;
  color: #2f2f2f;
  margin-bottom: 8px;
}

.lrn-card p {
  font-size: 12.5px;
  color: #616161;
  line-height: 1.62 !important;
  margin-bottom: 15px;
  flex: 1;
}

.lrn-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #ececec;
}

.lrn-card-foot .lrn-readmeta {
  font-size: 11.5px;
}

.lrn-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1f9ad6;
}

.lrn-more svg {
  width: 13px;
  height: 13px;
}

.lrn-empty {
  color: #616161;
  font-size: 14px;
  text-align: center;
  padding: 48px 0 64px;
}

/* ---------- article ---------- */
.lrn-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: #9e9e9e;
  margin-bottom: 22px;
}

.lrn-crumb a {
  color: #616161;
}

.lrn-crumb a:hover {
  color: #000;
}

.lrn-art-head {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.lrn-art-head h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.22 !important;
  color: #2f2f2f;
}

.lrn-art-head .lrn-sub {
  margin-top: 16px;
  font-size: 14.5px;
  color: #616161;
  line-height: 1.65 !important;
}

.lrn-art-meta {
  margin-top: 18px;
  font-size: 12.5px;
  color: #9e9e9e;
}

.lrn-cover {
  max-width: 980px;
  margin: 0 auto 44px;
  border-radius: 20px;
  overflow: hidden;
}

.lrn-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.lrn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}

/* ---------- article: prose ---------- */
.lrn-prose {
  max-width: 65ch;
  color: #424242;
  font-size: 15px;
}

.lrn-prose p {
  margin: 0 0 16px;
  line-height: 1.72 !important;
}

.lrn-prose h2 {
  font-size: 21px;
  font-weight: 700;
  color: #2f2f2f;
  line-height: 1.3 !important;
  margin: 38px 0 12px;
}

.lrn-prose h3 {
  font-size: 16.5px;
  font-weight: 600;
  color: #2f2f2f;
  line-height: 1.35 !important;
  margin: 26px 0 8px;
}

.lrn-prose ul,
.lrn-prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
  list-style: revert !important;
}

.lrn-prose li {
  list-style: revert !important;
  line-height: 1.65 !important;
  margin-bottom: 7px;
}

.lrn-prose li::marker {
  color: #9e9e9e;
}

.lrn-prose a {
  color: #1f9ad6;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.lrn-prose strong,
.lrn-prose b {
  color: #2f2f2f;
  font-weight: 600;
}

.lrn-prose blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  border: 1px solid #ececec;
  border-left: 3px solid #1fd2ff;
  border-radius: 10px;
  background: #fbfdfe;
  color: #616161;
  font-size: 13.5px;
  line-height: 1.65 !important;
}

.lrn-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 8px 0 16px;
}

.lrn-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: #f2f2f2;
  padding: 2px 5px;
  border-radius: 5px;
}

/* ---------- article: sidebar ---------- */
.lrn-aside {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lrn-toc .lrn-label,
.lrn-glance .lrn-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9e9e9e;
  margin-bottom: 12px;
}

.lrn-toc ol {
  margin: 0;
  padding: 0;
  list-style: none !important;
  counter-reset: t;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lrn-toc li {
  list-style: none !important;
  counter-increment: t;
}

.lrn-toc a {
  display: flex;
  gap: 10px;
  padding: 7px 0 7px 14px;
  font-size: 12.5px;
  line-height: 1.45 !important;
  color: #616161;
  border-left: 2px solid #ececec;
}

.lrn-toc a::before {
  content: counter(t, decimal-leading-zero);
  color: #9e9e9e;
  font-weight: 600;
}

.lrn-toc a:hover {
  color: #000;
}

.lrn-toc a.active {
  color: #2f2f2f;
  font-weight: 600;
  border-left-color: #fd71ff;
}

.lrn-glance {
  padding: 18px 20px;
}

.lrn-cta {
  padding: 20px;
  text-align: center;
}

/* direct child only — must not reach the button's own <p> inside .gradient-container */
.lrn-cta > p {
  font-size: 12.5px;
  color: #616161;
  line-height: 1.6 !important;
  margin: 0 0 14px;
}

.lrn-cta .gradient-box {
  display: block;
  width: 100%;
}

.lrn-cta .gradient-container {
  width: 100%;
  padding: 11px;
}

.lrn-cta .gradient-container p {
  margin: 0 !important;
  font-size: 14px;
  font-weight: 600;
  color: #424242;
  line-height: 1.2 !important;
}

/* ---------- article: related ---------- */
.lrn-related {
  max-width: 1080px;
  margin: 60px auto 0;
}

.lrn-related .lrn-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9e9e9e;
  margin-bottom: 20px;
}

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

.lrn-related-grid a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 2px solid transparent;
  border-radius: 14px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(154deg, #1fd2ff, #fd71ff 50%, #ff9b3f) border-box;
  box-shadow: 0 0 10px rgb(0 0 0 / 73%);
  transition: box-shadow 0.12s linear;
}

.lrn-related-grid a:hover {
  box-shadow: 0 0 10px rgb(0 0 0 / 25%);
}

.lrn-related-grid span.t {
  font-size: 13.5px;
  font-weight: 600;
  color: #2f2f2f;
  line-height: 1.4 !important;
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .lrn-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lrn-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .lrn-aside {
    position: static;
  }

  .lrn-toc {
    display: none;
  }

  .lrn-related-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lrn-section {
    padding: 130px 0 72px;
  }
}

@media (max-width: 560px) {
  .lrn-grid,
  .lrn-related-grid {
    grid-template-columns: 1fr;
  }

  .lrn-head h1,
  .lrn-art-head h1 {
    font-size: 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lrn-card {
    transition: none;
  }
}
