/* Library Page Component */
.library-page {
  max-width: 900px;
  margin: 0 auto;
}

.library-page__intro {
  margin-bottom: var(--size-7);
  font-size: var(--font-size-2);
  color: var(--text-2);
}

.library-page__about {
  margin-top: var(--size-8);
  padding-top: var(--size-6);
  border-top: 1px solid var(--surface-3);
}

.library-page__about h2 {
  color: var(--text-1);
  margin-bottom: var(--size-4);
}

.library-page__about p {
  margin-bottom: var(--size-4);
}

.library-page__empty {
  text-align: center;
  padding: var(--size-8) var(--size-4);
  color: var(--text-2);
}

/* Library Topic Page Component */
.library-topic {
  max-width: 1000px;
  margin: 0 auto;
}

.library-topic__hero {
  margin-bottom: var(--size-8);
  padding: var(--size-6) 0;
}

.library-topic__hero-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--size-8);
  align-items: start;
}

.library-topic__cover {
  text-align: center;
}

.library-topic__cover-image {
  width: auto;
  height: auto;
  max-width: 300px;
  max-height: 450px;
  object-fit: contain;
  border-radius: var(--radius-3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.library-topic__cover-placeholder {
  width: 300px;
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--link-color), var(--link-hover-color));
  border-radius: var(--radius-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--font-size-2);
  font-weight: var(--font-weight-6);
  text-align: center;
  padding: var(--size-4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.library-topic__details {
  text-align: left;
}

.library-topic__title {
  font-size: var(--font-size-fluid-2);
  margin-bottom: var(--size-3);
  color: var(--text-1);
  font-weight: var(--font-weight-7);
  line-height: var(--font-lineheight-1);
}

.library-topic__subtitle {
  font-size: var(--font-size-2);
  color: var(--text-2);
  font-style: italic;
  margin-bottom: var(--size-5);
  line-height: var(--font-lineheight-3);
}

.library-topic__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-4);
  font-size: var(--font-size-0);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: var(--font-weight-5);
}

.library-topic__genre,
.library-topic__pages,
.library-topic__date {
  padding: var(--size-1) var(--size-3);
  background: var(--surface-2);
  border-radius: var(--radius-round);  /* Full rounded corners for MD3 tags */
  border: none;  /* MD3 tags typically don't have borders */
  color: var(--text-2);
  font-size: var(--font-size-0);
  font-weight: var(--font-weight-5);
}

.library-topic__summary {
  margin-bottom: var(--size-8);
  padding: var(--size-6);
  background: var(--surface-2);
  border-radius: var(--radius-3);
  border: 1px solid var(--surface-3);
}

.library-topic__summary h2 {
  margin-top: 0;
  margin-bottom: var(--size-4);
  font-size: var(--font-size-3);
}

.library-topic__summary-text {
  font-size: var(--font-size-2);
  line-height: var(--font-lineheight-4);
  color: var(--text-1);
}

.library-topic__content {
  margin-bottom: var(--size-8);
  font-size: var(--font-size-2);
  line-height: var(--font-lineheight-4);
}

.library-topic__toc {
  margin-bottom: var(--size-8);
}

.library-topic__toc h2 {
  margin-bottom: var(--size-5);
  font-size: var(--font-size-3);
}

.library-topic__chapter-list {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;

}

.library-topic__chapter-item {
  margin-bottom: var(--size-3);
  width: 100%;
  max-width: 100%;
}

.library-topic__chapter-link {
  display: flex;
  align-items: center;
  gap: var(--size-4);
  padding: var(--size-4);
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-2);
  text-decoration: none;
  color: var(--text-1);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.library-topic__chapter-link:hover {
  background: var(--surface-3);
  border-color: var(--surface-4);
  text-decoration: none;
  color: var(--text-1);
}

.library-topic__chapter-number {
  font-size: var(--font-size-0);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: var(--font-weight-5);
  min-width: 80px;
}

.library-topic__chapter-title {
  font-size: var(--font-size-1);
  color: var(--text-1);
  font-weight: var(--font-weight-5);
}

.library-topic__no-chapters {
  color: var(--text-2);
  font-style: italic;
  text-align: center;
  padding: var(--size-6);
}

.library-topic__navigation {
  text-align: center;
  padding-top: var(--size-6);
  border-top: 1px solid var(--surface-3);
}

.library-topic__back-link {
  color: var(--link-color);
  text-decoration: none;
  font-weight: var(--font-weight-5);
}

.library-topic__back-link:hover {
  text-decoration: underline;
}

/* Library Note Component */
.library-note {
  max-width: var(--size-content-3);
  margin: 0 auto;
}

.library-note__breadcrumb {
  margin-bottom: var(--size-6);
  font-size: var(--font-size-1);
  color: var(--text-2);
  text-align: center;
}

.library-note__breadcrumb-link {
  color: var(--link-color);
  text-decoration: none;
}

.library-note__breadcrumb-link:hover {
  text-decoration: underline;
}

.library-note__breadcrumb-separator {
  margin: 0 var(--size-2);
}

.library-note__breadcrumb-current {
  color: var(--text-1);
  font-weight: var(--font-weight-5);
}

.library-note__header {
  margin-bottom: var(--size-7);
  text-align: center;
}

.library-note__number {
  font-size: var(--font-size-0);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: var(--font-weight-5);
  margin-bottom: var(--size-2);
}

.library-note__title {
  font-size: var(--font-size-fluid-2);
  margin: 0;
  color: var(--text-1);
  font-weight: var(--font-weight-7);
  line-height: var(--font-lineheight-1);
}

.library-note__content {
  margin-bottom: var(--size-8);
}

.library-note__navigation {
  margin-top: var(--size-8);
  padding-top: var(--size-6);
  border-top: 1px solid var(--surface-3);
}

.library-note__nav-links {
  display: flex;
  justify-content: space-between;
  gap: var(--size-4);
  margin-bottom: var(--size-5);
}

.library-note__nav-link {
  flex: 1;
  display: block;
  padding: var(--size-4);
  background: var(--surface-2);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-2);
  text-decoration: none;
  color: var(--text-1);
  font-weight: var(--font-weight-5);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.library-note__nav-link:hover {
  background: var(--surface-3);
  border-color: var(--surface-4);
  text-decoration: none;
  color: var(--text-1);
}

.library-note__nav-link--prev {
  text-align: left;
}

.library-note__nav-link--next {
  text-align: right;
}

.library-note__back-to-book {
  text-align: center;
}

.library-note__book-link {
  color: var(--link-color);
  text-decoration: none;
  font-weight: var(--font-weight-5);
}

.library-note__book-link:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 800px) {
  .library-topic__hero-content {
    grid-template-columns: 1fr;
    gap: var(--size-6);
    text-align: center;
  }
  
  .library-topic__cover-placeholder,
  .library-topic__cover-image {
    max-width: 250px;
    max-height: 375px;
    margin: 0 auto;
  }
  
  .library-topic__details {
    text-align: center;
  }
  
  .library-topic__meta {
    justify-content: center;
  }
  
  .library-note__nav-links {
    flex-direction: column;
  }
  
  .library-note__nav-link--prev,
  .library-note__nav-link--next {
    text-align: center;
  }
}