/* ============================================
   Theosis Library — Stylesheet
   ============================================ */

/* --- Reset & Base --- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: Georgia, 'Times New Roman', Times, serif;
  color: #2a2a2a;
  background-color: #faf8f4;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout --- */

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Typography --- */

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: normal;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #8b7355;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

a:hover {
  border-bottom-color: #8b7355;
}

blockquote {
  border-left: 3px solid #8b7355;
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #555;
}

sup {
  font-size: 0.75em;
  line-height: 0;
}

sup a {
  border-bottom: none;
  font-weight: bold;
}

/* --- Header / Navigation --- */

.site-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid #e0dcd4;
  margin-bottom: 2.5rem;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-title {
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 600;
}

.site-title a {
  color: #2a2a2a;
  border-bottom: none;
}

.site-title a:hover {
  color: #8b7355;
}

.site-nav {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
}

.site-nav a {
  color: #666;
  margin-left: 1.5rem;
  letter-spacing: 0.02em;
}

.site-nav a:hover {
  color: #8b7355;
}

/* --- Hero / Mission Statement --- */

.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 1.6rem;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.hero-body {
  text-align: left;
  max-width: 680px;
  margin: 0 auto;
}

/* --- Sections --- */

section {
  margin-bottom: 3rem;
}

section > h2:first-child {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e0dcd4;
}

/* --- Library Listing --- */

.text-list {
  list-style: none;
}

.text-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e8e5de;
}

.text-item:last-child {
  border-bottom: none;
}

.text-item h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.text-item h3 a {
  color: #2a2a2a;
}

.text-item h3 a:hover {
  color: #8b7355;
  border-bottom-color: #8b7355;
}

.text-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.4rem;
}

.text-description {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.4rem;
}

.text-themes {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  color: #999;
}

.text-themes span {
  display: inline-block;
  background: #eeebe4;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  margin-right: 0.3em;
  margin-bottom: 0.3em;
}

/* --- Translation Page --- */

.translation-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e0dcd4;
}

.translation-header h1 {
  margin-bottom: 0.25rem;
}

.translation-header .original-title {
  font-style: italic;
  color: #888;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.translation-header .author {
  font-size: 1rem;
  color: #555;
}

.translation-header .source {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
}

.introduction {
  margin-bottom: 2.5rem;
}

.translation-body .section-block {
  margin-bottom: 2rem;
}

.translation-body .section-ref {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  color: #999;
  display: block;
  margin-bottom: 0.25rem;
}

.original-term {
  font-style: italic;
  color: #6b5a42;
}

/* --- Translator's Notes --- */

.notes-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0dcd4;
}

.notes-section h2 {
  margin-top: 0;
}

.notes-list {
  list-style: none;
  counter-reset: notes;
}

.notes-list li {
  counter-increment: notes;
  margin-bottom: 1rem;
  padding-left: 2rem;
  position: relative;
  font-size: 0.9rem;
}

.notes-list li::before {
  content: counter(notes) ".";
  position: absolute;
  left: 0;
  color: #8b7355;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
}

/* --- Source / Cross-References --- */

.source-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8e5de;
  font-size: 0.9rem;
}

.source-section h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

.source-section ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.source-section li {
  margin-bottom: 0.5rem;
}

/* --- Search --- */

.search-container {
  margin-bottom: 2rem;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  border: 1px solid #d4d0c8;
  border-radius: 4px;
  background: #fff;
  color: #2a2a2a;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: #8b7355;
}

.search-input::placeholder {
  color: #aaa;
}

.search-results-info {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 1rem;
  display: none;
}

/* --- About Page --- */

.about-section {
  margin-bottom: 2.5rem;
}

.about-section h2 {
  margin-top: 0;
}

.methodology-steps {
  list-style: decimal;
  padding-left: 1.5rem;
}

.methodology-steps li {
  margin-bottom: 0.75rem;
}

/* --- Footer --- */

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid #e0dcd4;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: #999;
}

.site-footer a {
  color: #8b7355;
}

/* --- Utility --- */

.era-group {
  margin-bottom: 2rem;
}

.era-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b7355;
  margin-bottom: 0.5rem;
}

.status-badge {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  margin-left: 0.5em;
}

.status-badge--queued {
  background: #f0ece4;
  color: #999;
}

.status-badge--published {
  background: #e8ead4;
  color: #6b7a4a;
}

/* --- Responsive --- */

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .site-nav a {
    margin-left: 0;
    margin-right: 1.25rem;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  h1 {
    font-size: 1.6rem;
  }

  .container {
    padding: 0 1rem;
  }
}
