/**
 * Theme-specific component styles.
 * Colors come from tokens.css (light/sepia/night).
 */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-16);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--primary);
  border-radius: 999px; /* pill */
  border: 2px solid var(--primary);
  transition:
    background var(--motion),
    color var(--motion);
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.button--outline {
  color: var(--primary);
  background: transparent;
}

.button--outline:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.button--outline:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  padding: var(--space-24);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.paper {
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--space-32);
  min-height: 40vh;
}

.paper--lotus-corners {
  position: relative;
}

.paper--lotus-corners::before,
.paper--lotus-corners::after {
  position: absolute;
  width: 48px;
  height: 48px;
  content: '';
}

.paper--lotus-corners::before {
  top: var(--space-16);
  left: var(--space-16);
}

.paper--lotus-corners::after {
  bottom: var(--space-16);
  right: var(--space-16);
}

.reader-text {
  font-family: var(--font-body);
  font-size: var(--text-size-desktop);
  line-height: var(--line-height);
  color: var(--text);
}

.reader-text h1,
.reader-text h2,
.reader-text h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  margin-top: var(--space-32);
  margin-bottom: var(--space-16);
}

.reader-text h1 {
  font-size: 1.75rem;
}

.reader-text h2 {
  font-size: 1.5rem;
}

.reader-text h3 {
  font-size: 1.25rem;
}

.reader-text p {
  margin-bottom: var(--space-24);
}

.reader-text table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-24);
}

.reader-text table,
.reader-text th,
.reader-text td {
  border: 1px solid var(--muted);
}

.reader-text th,
.reader-text td {
  padding: var(--space-8) var(--space-12);
}

.reader-text img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-16) auto;
  border-radius: var(--radius);
}

.reader-text blockquote {
  margin: var(--space-24) 0;
  padding-left: var(--space-16);
  border-left: 3px solid var(--gold);
  color: var(--muted);
  font-style: italic;
}

.reader-text ul,
.reader-text ol {
  margin-left: var(--space-24);
  margin-bottom: var(--space-24);
}

.reader-text li {
  margin-bottom: var(--space-8);
}

.reader-text .center {
  text-align: center;
}

.reader-text a {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

.reader-text a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 0.875rem;
  color: var(--accent);
  background: rgba(122, 31, 43, 0.1);
  padding: var(--space-4) var(--space-12);
  border-radius: 999px;
  border: 1px solid var(--accent);
}

.tag a {
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}

.tag a:hover {
  text-decoration: underline;
}

.language-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.section-list {
  margin-top: var(--space-24);
  padding: var(--space-16);
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
}

.section-list h3 {
  font-size: 1rem;
  margin-bottom: var(--space-12);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-list ul {
  list-style: none;
  margin-left: 0;
}

.section-list li {
  margin-bottom: var(--space-8);
}

.section-list a {
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
  padding: var(--space-4) var(--space-8);
  border-radius: 6px;
  display: block;
}

.section-list a:hover {
  background: var(--bg);
  color: var(--primary);
}

.section-list a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.arrows {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-32);
  padding-top: var(--space-24);
  border-top: 1px solid var(--muted);
}

.arrow-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.arrow-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.arrow-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.arrow-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-16);
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: none;
}

.back-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.section-stepper {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-24);
}

.section-stepper .step-button {
  flex: 1;
  padding: var(--space-8);
  background: var(--paper);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  text-align: center;
}

.section-stepper .step-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.section-stepper .step-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.mandala {
  opacity: 0.05;
}

.diya-flicker {
  animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.6;
  }
}
