/* Tales from Nowhere Wiki - Fan Wiki Stylesheet */
/* Inspired by Fandom/Wikipedia aesthetic */

:root {
  --wiki-bg: #f5f7f7;
  --wiki-content-bg: #ffffff;
  --wiki-border: #9db5b2;
  --wiki-link: #0d7377;
  --wiki-link-visited: #065a5c;
  --wiki-link-hover: #14919b;
  --wiki-header-bg: #14213d;
  --wiki-header-accent: #0d7377;
  --wiki-text: #1a2634;
  --wiki-text-muted: #5a6872;
  --wiki-highlight: #fff3cd;
  --wiki-spoiler-bg: #1a3a3a;
  --wiki-stub-bg: #fff8e7;
  --wiki-theory-bg: #e8f4f4;
  --wiki-warning-bg: #ffebee;
  --wiki-infobox-header: #14213d;
  --wiki-toc-bg: #f0f5f5;
  --wiki-accent: #e07b39;
  --wiki-accent-light: #f4a261;
  --wiki-teal: #0d7377;
  --wiki-teal-dark: #065a5c;
  --wiki-teal-light: #14919b;
  --font-serif: 'Linux Libertine', 'Georgia', 'Times', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Lato', 'Helvetica', 'Arial', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--wiki-text);
  background-color: var(--wiki-bg);
}

/* Header */
.wiki-header {
  background: linear-gradient(135deg, var(--wiki-header-bg) 0%, var(--wiki-header-accent) 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.wiki-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.logo-icon {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.logo-tagline {
  font-size: 0.7rem;
  opacity: 0.8;
  display: block;
  letter-spacing: 1px;
}

/* Search */
.search-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  width: 280px;
  font-size: 14px;
  background: rgba(255,255,255,0.9);
}

.search-box:focus {
  outline: 2px solid var(--wiki-accent);
}

.search-btn {
  padding: 8px 16px;
  background: var(--wiki-accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--wiki-accent-light);
}

/* Navigation */
.main-nav {
  background: rgba(0,0,0,0.2);
  padding: 0 20px;
}

.nav-list {
  display: flex;
  list-style: none;
  max-width: 1400px;
  margin: 0 auto;
  gap: 0;
}

.nav-list li {
  position: relative;
}

.nav-list a {
  display: block;
  padding: 12px 18px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.nav-list a:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-list .dropdown-content {
  display: none;
  position: absolute;
  background: var(--wiki-header-bg);
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1001;
  border-radius: 0 0 4px 4px;
}

.nav-list li:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dropdown-content a:last-child {
  border-bottom: none;
}

/* Main Layout */
.wiki-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  gap: 20px;
}

/* Sidebar */
.wiki-sidebar {
  width: 220px;
  flex-shrink: 0;
}

.sidebar-section {
  background: var(--wiki-content-bg);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  margin-bottom: 15px;
  overflow: hidden;
}

.sidebar-header {
  background: var(--wiki-header-bg);
  color: #fff;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: bold;
}

.sidebar-content {
  padding: 10px 12px;
}

.sidebar-content ul {
  list-style: none;
}

.sidebar-content li {
  padding: 4px 0;
}

.sidebar-content a {
  color: var(--wiki-link);
  text-decoration: none;
  font-size: 13px;
}

.sidebar-content a:hover {
  text-decoration: underline;
}

/* Main Content */
.wiki-content {
  flex: 1;
  min-width: 0;
  background: var(--wiki-content-bg);
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  padding: 20px 30px;
}

/* Page Title */
.page-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: normal;
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

/* Article metadata */
.page-meta {
  font-size: 12px;
  color: var(--wiki-text-muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

/* Infobox */
.infobox {
  float: right;
  width: 280px;
  margin: 0 0 15px 20px;
  border: 1px solid var(--wiki-border);
  border-collapse: collapse;
  font-size: 13px;
  background: var(--wiki-content-bg);
}

.infobox-title {
  background: var(--wiki-infobox-header);
  color: #fff;
  padding: 10px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Hide image placeholders - uncomment when real images are added */
.infobox-image {
  display: none;
}

.infobox-image img {
  max-width: 100%;
  height: auto;
}

.infobox-image-placeholder {
  display: none;
}

.infobox-caption {
  display: none;
}

.infobox th, .infobox td {
  padding: 8px 10px;
  border: 1px solid var(--wiki-border);
  vertical-align: top;
}

.infobox th {
  background: #f8f9fa;
  text-align: left;
  width: 35%;
  font-weight: 600;
}

.infobox-section {
  background: #e8e8e8;
  text-align: center;
  font-weight: bold;
  padding: 6px !important;
}

/* Table of Contents */
.toc {
  background: var(--wiki-toc-bg);
  border: 1px solid var(--wiki-border);
  padding: 15px 20px;
  margin: 20px 0;
  display: inline-block;
  min-width: 250px;
  max-width: 400px;
}

.toc-title {
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
}

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

.toc-list li {
  counter-increment: toc-counter;
  padding: 3px 0;
}

.toc-list li::before {
  content: counter(toc-counter) ". ";
  color: var(--wiki-text-muted);
}

.toc-list a {
  color: var(--wiki-link);
  text-decoration: none;
}

.toc-list a:hover {
  text-decoration: underline;
}

.toc-list ul {
  list-style: none;
  margin-left: 20px;
  counter-reset: toc-sub-counter;
}

.toc-list ul li {
  counter-increment: toc-sub-counter;
}

.toc-list ul li::before {
  content: counter(toc-counter) "." counter(toc-sub-counter) " ";
}

/* Headings */
.wiki-content h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: normal;
  border-bottom: 1px solid var(--wiki-border);
  padding-bottom: 5px;
  margin: 25px 0 15px 0;
}

.wiki-content h3 {
  font-size: 1.2rem;
  margin: 20px 0 10px 0;
}

.wiki-content h4 {
  font-size: 1rem;
  font-weight: bold;
  margin: 15px 0 8px 0;
}

/* Paragraphs and text */
.wiki-content p {
  margin-bottom: 15px;
}

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

.wiki-content a:visited {
  color: var(--wiki-link-visited);
}

.wiki-content a:hover {
  text-decoration: underline;
}

.wiki-content a.redlink {
  color: #ba0000;
}

/* Lists */
.wiki-content ul, .wiki-content ol {
  margin: 10px 0 15px 25px;
}

.wiki-content li {
  margin-bottom: 5px;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--wiki-accent);
  margin: 15px 0;
  padding: 10px 20px;
  background: #f9f9f9;
  font-style: italic;
}

blockquote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--wiki-text-muted);
}

/* Special boxes */
.notice-box {
  padding: 15px 20px;
  margin: 15px 0;
  border-radius: 4px;
  border-left: 4px solid;
}

.stub-notice {
  background: var(--wiki-stub-bg);
  border-color: #ffc107;
}

.spoiler-warning {
  background: var(--wiki-warning-bg);
  border-color: #dc3545;
}

.theory-box {
  background: var(--wiki-theory-bg);
  border-color: var(--wiki-teal);
}

.cancelled-notice {
  background: #f5f5f5;
  border-color: #6c757d;
}

.notice-box strong {
  display: block;
  margin-bottom: 5px;
}

/* Fan theory section */
.fan-theory {
  background: var(--wiki-theory-bg);
  border: 1px solid #a8d5d8;
  border-radius: 4px;
  padding: 15px;
  margin: 15px 0;
}

.fan-theory-header {
  font-weight: bold;
  color: var(--wiki-teal-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.theory-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e2e3e5;
  color: #383d41;
}

.theory-status.popular {
  background: #d4edda;
  color: #155724;
}

.theory-status.debunked {
  background: #f8d7da;
  color: #721c24;
}

.theory-status.confirmed {
  background: #c8e6e7;
  color: var(--wiki-teal-dark);
}

/* Discussion/comments section */
.discussion-section {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 20px 0;
  padding: 15px;
}

.discussion-header {
  font-weight: bold;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.discussion-comment {
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.discussion-comment:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 5px;
}

.comment-user {
  font-weight: bold;
  color: var(--wiki-link);
}

.comment-date {
  font-size: 11px;
  color: var(--wiki-text-muted);
}

.comment-body {
  font-size: 13px;
  line-height: 1.5;
}

.comment-reply {
  margin-left: 30px;
  padding-left: 10px;
  border-left: 2px solid #ddd;
}

/* Episode table */
.episode-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 13px;
}

.episode-table th {
  background: var(--wiki-header-bg);
  color: #fff;
  padding: 10px;
  text-align: left;
  font-weight: 600;
}

.episode-table td {
  padding: 10px;
  border: 1px solid var(--wiki-border);
  vertical-align: top;
}

.episode-table tr:nth-child(even) {
  background: #f8f9fa;
}

.episode-table tr:hover {
  background: #f0f0f0;
}

.episode-number {
  text-align: center;
  font-weight: bold;
  width: 50px;
}

/* Character grid */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.character-card {
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}

.character-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Hide character card image placeholders */
.character-card-image {
  display: none;
}

.character-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.character-card-info {
  padding: 12px;
}

.character-card-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.character-card-name a {
  color: var(--wiki-text);
  text-decoration: none;
}

.character-card-name a:hover {
  color: var(--wiki-link);
}

.character-card-role {
  font-size: 12px;
  color: var(--wiki-text-muted);
}

/* Gallery */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 15px 0;
}

.gallery-item {
  width: 150px;
  text-align: center;
}

/* Hide gallery image placeholders */
.gallery-image {
  display: none;
}

.gallery-caption {
  font-size: 11px;
  margin-top: 5px;
  color: var(--wiki-text-muted);
}

/* Quotes */
.quote-box {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 15px 20px;
  margin: 15px 0;
  position: relative;
}

.quote-box::before {
  content: '"';
  font-size: 48px;
  color: #ddd;
  position: absolute;
  top: -10px;
  left: 10px;
  font-family: Georgia, serif;
}

.quote-text {
  font-style: italic;
  padding-left: 30px;
}

.quote-attribution {
  text-align: right;
  margin-top: 10px;
  font-size: 12px;
  color: var(--wiki-text-muted);
}

/* Trivia */
.trivia-section ul {
  list-style: none;
  margin-left: 0;
}

.trivia-section li {
  padding: 8px 0 8px 25px;
  position: relative;
  border-bottom: 1px solid #f0f0f0;
}

.trivia-section li::before {
  content: "~";
  position: absolute;
  left: 5px;
  color: var(--wiki-accent);
  font-weight: bold;
}

/* Categories */
.categories {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid var(--wiki-border);
  font-size: 12px;
}

.categories-label {
  font-weight: bold;
  margin-right: 10px;
}

.categories a {
  color: var(--wiki-link);
  text-decoration: none;
  margin-right: 8px;
}

.categories a::before {
  content: "| ";
  color: var(--wiki-text-muted);
}

.categories a:first-of-type::before {
  content: "";
}

/* Edit timestamp */
.last-edited {
  font-size: 11px;
  color: var(--wiki-text-muted);
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

/* Footer */
.wiki-footer {
  background: var(--wiki-header-bg);
  color: rgba(255,255,255,0.8);
  padding: 30px 20px;
  margin-top: 30px;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  margin-right: 20px;
  font-size: 13px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-stats {
  font-size: 12px;
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 1024px) {
  .wiki-container {
    flex-direction: column;
  }

  .wiki-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
  }

  .sidebar-section {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
  }

  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 20px 0;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    gap: 15px;
  }

  .search-box {
    width: 100%;
  }

  .nav-list {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-list a {
    padding: 10px 12px;
    font-size: 12px;
  }

  .wiki-content {
    padding: 15px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .toc {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 1.2rem;
  }

  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item {
    width: 100px;
  }

  .gallery-image {
    width: 100px;
    height: 80px;
  }
}

/* Special page styles */
.homepage-hero {
  background: url('../images/banner-header.png') center center / cover no-repeat;
  color: #fff;
  padding: 80px 40px;
  border-radius: 8px;
  margin-bottom: 25px;
  text-align: center;
  position: relative;
}

.homepage-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(20,33,61,0.75) 0%, rgba(13,115,119,0.5) 100%);
  border-radius: 8px;
}

.homepage-hero > * {
  position: relative;
  z-index: 1;
}

.homepage-hero h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.homepage-hero .tagline {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 20px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.homepage-hero .show-info {
  font-size: 0.9rem;
  opacity: 0.85;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.homepage-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.homepage-section {
  background: #fff;
  border: 1px solid var(--wiki-border);
  border-radius: 4px;
  padding: 20px;
}

.homepage-section h2 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--wiki-accent);
}

/* Search results */
.search-results {
  list-style: none;
}

.search-result-item {
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.search-result-title {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.search-result-snippet {
  font-size: 13px;
  color: var(--wiki-text-muted);
}

.search-highlight {
  background: #fff3cd;
  padding: 0 2px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--wiki-teal);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wiki-accent);
  border: 2px solid #fff;
}

.timeline-date {
  font-weight: bold;
  color: var(--wiki-teal-dark);
  margin-bottom: 5px;
}

.timeline-content {
  background: #f8f9fa;
  padding: 10px 15px;
  border-radius: 4px;
  border-left: 3px solid var(--wiki-teal);
}

/* Relationship chart */
.relationship-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.relationship-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e9ecef;
}

.relationship-type.ally { background: #d4edda; color: #155724; }
.relationship-type.family { background: #c8e6e7; color: var(--wiki-teal-dark); }
.relationship-type.romantic { background: #fde5d8; color: #9c4a1a; }
.relationship-type.enemy { background: #f5c6cb; color: #721c24; }
.relationship-type.complicated { background: #fff3cd; color: #856404; }

/* Fan Prose Recap Section */
.prose-recap {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid #2d2d44;
  border-radius: 8px;
  padding: 30px;
  margin: 25px 0;
  color: #e8e8e8;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
  position: relative;
}

.prose-recap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--wiki-teal) 0%, var(--wiki-accent) 50%, var(--wiki-teal) 100%);
  border-radius: 8px 8px 0 0;
}

.prose-recap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #2d2d44;
}

.prose-recap-title {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: bold;
  color: var(--wiki-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.prose-recap-author {
  font-family: var(--font-sans);
  font-size: 12px;
  color: #8a8a9a;
  font-style: italic;
}

.prose-recap p {
  margin-bottom: 18px;
  text-indent: 1.5em;
}

.prose-recap p:first-of-type {
  text-indent: 0;
}

.prose-recap p:first-of-type::first-letter {
  font-size: 3em;
  float: left;
  line-height: 0.8;
  margin: 5px 10px 0 0;
  color: var(--wiki-accent);
  font-weight: bold;
}

.prose-recap .scene-break {
  text-align: center;
  margin: 25px 0;
  color: #4a4a6a;
  letter-spacing: 8px;
}

.prose-recap em {
  color: #a8d5d8;
}

.prose-recap strong {
  color: var(--wiki-accent-light);
  font-weight: normal;
}

.prose-recap .dialogue {
  color: #c8c8d8;
  font-style: italic;
}

.prose-recap-footer {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #2d2d44;
  font-family: var(--font-sans);
  font-size: 12px;
  color: #6a6a7a;
  text-align: center;
}

.prose-recap-footer a {
  color: var(--wiki-teal-light);
}

/* Review Quotes Section */
.review-quotes {
  margin: 20px 0;
}

.review-quote {
  background: #f9f9f9;
  border-left: 4px solid var(--wiki-teal);
  padding: 15px 20px;
  margin: 15px 0;
  border-radius: 0 4px 4px 0;
}

.review-quote:nth-child(even) {
  border-left-color: var(--wiki-accent);
}

.review-text {
  font-style: italic;
  line-height: 1.7;
  color: var(--wiki-text);
  margin: 0 0 10px 0;
}

.review-text em {
  font-style: normal;
  color: var(--wiki-teal-dark);
}

.review-source {
  font-size: 13px;
  color: var(--wiki-text-muted);
  margin: 0;
  text-align: right;
}

.review-source em {
  font-style: italic;
}
