.texts-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  min-height: calc(100vh - 180px);
}

.texts-sidebar {
  position: sticky;
  top: 110px;
  align-self: start;
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.texts-mobile-toggle {
  display: none;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  text-align: left;
  color: rgba(0,0,0,0.8);
  cursor: pointer;
  margin-bottom: 14px;
}

.texts-sidebar-inner {
  border-right: 1px solid rgba(0,0,0,0.08);
  padding-right: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.text-link {
  position: relative;
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  padding: 10px 0 14px;
  cursor: pointer;
  color: rgba(0,0,0,0.55);
  transition: color .2s ease;
}

.text-link:hover {
  color: rgba(0,0,0,0.88);
}

.text-link.active {
  color: rgba(0,0,0,0.96);
}

.text-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 4px;
  width: 42px;
  height: 1px;
  background: rgba(0,0,0,0.62);
}

.text-link-author {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.text-link.active .text-link-author {
  opacity: 1;
}

.text-link-title {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.45;
}

.texts-reader {
  min-width: 0;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding-right: 18px;
  scrollbar-width: thin;
}

.text-article {
  max-width: 820px;
}

.text-article h2 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 300;
  line-height: 1.1;
  color: rgba(0,0,0,0.86);
}

.text-author {
  margin: 0 0 30px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.52);
}

.text-body {
  max-width: 760px;
  font-size: 15px;
  line-height: 1.82;
  color: rgba(0,0,0,0.78);
}

.text-body p {
  margin: 0 0 18px;
}

.text-body h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 300;
  line-height: 1.1;
  color: rgba(0,0,0,0.88);
}

.text-body h2 {
  margin: 28px 0 12px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  color: rgba(0,0,0,0.84);
}

.text-body h3 {
  margin: 24px 0 10px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(0,0,0,0.82);
}

.text-body em {
  font-style: italic;
}

.text-body strong {
  font-weight: 600;
}

.text-body blockquote {
  margin: 0 0 22px;
  padding-left: 18px;
  border-left: 1px solid rgba(0,0,0,0.12);
  color: rgba(0,0,0,0.68);
}

.text-body hr {
  border: 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 30px 0;
}

.text-body ul,
.text-body ol {
  margin: 0 0 18px 20px;
}

.text-body li {
  margin-bottom: 8px;
}

@media (max-width: 980px) {
  .texts-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: auto;
  }

  .texts-sidebar {
    position: relative;
    top: 0;
    max-height: none;
  }

  .texts-mobile-toggle {
    display: block;
  }

  .texts-sidebar-inner {
    display: none;
    border-right: 0;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-right: 0;
    padding-top: 12px;
    max-height: none;
    overflow: visible;
  }

  .texts-sidebar-inner.open {
    display: flex;
  }

  .texts-reader {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}