/* ================================================
   FRIENDSHIP SMP - Static Site Styles
   ================================================ */

/* Color Palette - CSS Variables */
:root {
  --bg: #F5F1EB;
  --paper: #FFFEF9;
  --border: #2C2C2C;
  --border-light: #888888;
  --text: #1A1A1A;
  --text-muted: #666666;
  --link: #1A1A1A;
  --highlight: #EDEAE4;
}

body.dark {
  --bg: #1A1A1A;
  --paper: #242424;
  --border: #E8E8E8;
  --border-light: #666666;
  --text: #E8E8E8;
  --text-muted: #999999;
  --link: #E8E8E8;
  --highlight: #2E2E2E;
}

/* ================================================
   Global Styles
   ================================================ */

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

body {
  min-height: 100vh;
  background: var(--bg);
  background-image: url('../assets/dithered-sky.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: monospace;
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.dark {
  background-image: url('../assets/dithered-sky-dark.webp');
}

body.reading-page {
  justify-content: flex-start;
  padding: 0;
  background: var(--paper);
  background-image: none;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ================================================
   Page Wrappers
   ================================================ */

.page-wrapper {
  width: 800px;
  height: 600px;
  background: var(--bg);
  padding: 20px;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.scrollable-page-wrapper {
  width: 800px;
  min-height: 600px;
  background: var(--bg);
  padding: 20px;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 14px;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ================================================
   ASCII Header
   ================================================ */

.ascii-header {
  margin: 0 0 12px 0;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  color: var(--text);
  white-space: pre;
}

/* ================================================
   Navigation
   ================================================ */

.nav {
  text-align: center;
  margin-bottom: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: bold;
}

.nav a[aria-current="page"] {
  text-decoration: underline;
}

.nav .separator {
  color: var(--border-light);
}

.nav .dark-toggle {
  color: var(--text-muted);
  cursor: pointer;
}

/* ================================================
   Footer
   ================================================ */

.footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ================================================
   Content Box
   ================================================ */

.content-box {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 16px;
  flex: 1;
  overflow: hidden;
}

.content-box.scrollable {
  overflow: auto;
}

.box-header {
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 8px;
  margin-bottom: 12px;
  font-weight: bold;
}

.box-header-with-back {
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* ================================================
   Homepage
   ================================================ */

.home-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.welcome-box {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.welcome-text {
  margin: 0 0 12px 0;
  line-height: 1.6;
  flex-shrink: 0;
}

.ascii-book {
  margin: 0 0 12px 0;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--highlight);
  padding: 8px;
  overflow: hidden;
  flex-shrink: 0;
  white-space: pre;
}

.notice-box {
  font-size: 12px;
  padding: 8px;
  border: 1px dashed var(--border-light);
  flex-shrink: 0;
}

.notice-box .icon {
  color: var(--text-muted);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.latest-box {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 10px;
  flex: 1;
  overflow: hidden;
}

.latest-header {
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 12px;
}

.latest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
}

.latest-list li {
  padding: 3px 0;
  border-bottom: 1px dotted var(--border-light);
}

.latest-list li:last-child {
  border-bottom: none;
}

.latest-list .date {
  color: var(--text-muted);
}

.status-box {
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 10px;
  flex-shrink: 0;
}

.status-content {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
}

.status-content .date {
  color: var(--text);
}

/* ================================================
   Chapters / Season Selector
   ================================================ */

.intro-text {
  margin: 0 0 16px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.section-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.section-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text);
}

.section-card.coming-soon {
  opacity: 0.6;
  cursor: default;
}

.section-card:not(.coming-soon):hover {
  background: var(--highlight);
  border-color: var(--border);
}

.section-card-title {
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card-badge {
  font-size: 10px;
  color: var(--text-muted);
}

.section-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-left: 12px;
}

/* ================================================
   Chapter Grid
   ================================================ */

.chapter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 13px;
}

.chapter-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 10px;
  text-decoration: none;
  color: var(--text);
}

.chapter-card:hover {
  background: var(--highlight);
  border-color: var(--border);
}

.chapter-card-title {
  font-weight: bold;
}

.chapter-card-quote {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================================================
   Coming Soon Pages
   ================================================ */

.coming-soon-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-muted);
}

.coming-soon-ascii {
  font-size: 11px;
  margin-bottom: 16px;
  text-align: center;
  white-space: pre;
}

.coming-soon-text {
  font-size: 13px;
  text-align: center;
}

.coming-soon-text small {
  font-size: 11px;
}

/* ================================================
   Wiki Page
   ================================================ */

.character-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  font-size: 12px;
  margin-bottom: 16px;
}

.character-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  padding: 8px;
  text-decoration: none;
  color: var(--text);
  text-align: center;
}

.character-card:hover {
  background: var(--highlight);
  border-color: var(--border);
}

.character-name {
  font-weight: bold;
}

.character-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.locations-section {
  border-top: 1px dashed var(--border-light);
  padding-top: 12px;
  font-size: 12px;
}

.locations-title {
  font-weight: bold;
  margin-bottom: 8px;
}

.locations-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.location-tag {
  background: var(--highlight);
  border: 1px solid var(--border-light);
  padding: 4px 8px;
  font-size: 11px;
}

/* ================================================
   Sitemap Page
   ================================================ */

.sitemap-tree {
  font-size: 12px;
  line-height: 1.8;
  margin: 0;
  color: var(--text);
  flex: 1;
  white-space: pre;
}

/* ================================================
   Chapter Reading Page
   ================================================ */

.chapter-page {
  width: 100%;
  max-width: 800px;
  min-height: 100vh;
  background: var(--paper);
  font-family: monospace;
  font-size: 14px;
  color: var(--text);
}

.chapter-header {
  background: var(--bg);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.chapter-header-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.chapter-header-title {
  font-weight: bold;
}

.chapter-header-nav {
  display: flex;
  gap: 12px;
}

.chapter-header-nav .disabled {
  color: var(--border-light);
}

.chapter-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.chapter-title-section {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border-light);
}

.chapter-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.chapter-title {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: normal;
  margin: 0 0 8px 0;
  color: var(--text);
}

.chapter-subtitle {
  font-style: italic;
  color: var(--text-muted);
}

.story-text {
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
}

.story-text p {
  margin-bottom: 1.5em;
  text-indent: 2em;
}

.scene-break {
  text-align: center;
  margin: 2.5em 0;
  color: var(--text-muted);
  font-family: monospace;
  letter-spacing: 0.3em;
}

.story-continues {
  font-family: monospace;
  font-size: 13px;
  text-align: center;
  color: var(--text-muted);
  margin: 2em 0;
  padding: 1em;
  background: var(--bg);
}

.chapter-footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
  font-size: 12px;
}

.chapter-footer .disabled {
  color: var(--border-light);
}

.chapter-footer-button {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 16px;
  color: var(--text);
  text-decoration: none;
}

.chapter-footer-button:hover {
  background: var(--highlight);
}
