/* Modal / Overlay Components */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay--active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  background-color: var(--paper-aged);
  padding: var(--space-xl);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay--active .modal {
  transform: scale(1);
}

.modal__header {
  margin-bottom: var(--space-lg);
}

.modal__title {
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-lg);
  color: var(--ink-dark);
  margin: 0;
}

.modal__body {
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--ink-dark);
  margin-bottom: var(--space-lg);
}

.modal__footer {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
}

/* Table of Contents Overlay */
.toc-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  background-color: var(--paper-warm);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.2);
  padding: var(--space-xl);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1001;
  overflow-y: auto;
}

.toc-overlay--active {
  transform: translateX(0);
}

.toc-overlay__title {
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-lg);
  color: var(--ink-dark);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--sepia-line);
  padding-bottom: var(--space-sm);
}

.toc-overlay__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-overlay__item {
  margin-bottom: var(--space-md);
}

.toc-overlay__link {
  font-family: 'EB Garamond', 'Libre Baskerville', serif;
  font-size: var(--text-md);
  color: var(--ink-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.toc-overlay__link:hover {
  border-bottom-color: var(--sepia-line);
}

.toc-overlay__link-text {
  flex: 1;
}

.toc-overlay__bookmark {
  width: 16px;
  height: 16px;
  margin-left: var(--space-sm);
  opacity: 0.8;
  flex-shrink: 0;
}

.toc-overlay__bookmark svg {
  width: 100%;
  height: 100%;
  stroke: var(--accent-sepia);
  fill: none;
  stroke-width: 2;
}

