/* ==========================================================================
   WIKI SUBDOMAIN SPECIFIC STYLES
   ========================================================================== */

/* Subdomain Community Banner */
.wiki-community-header {
  position: relative;
  background: linear-gradient(180deg, var(--theme-bg-tint) 0%, rgba(9, 11, 16, 0.95) 100%), var(--fd-bg-surface);
  border-bottom: 2px solid var(--theme-accent);
  margin-bottom: 2rem;
  overflow: hidden;
}

.wiki-banner-backdrop {
  height: 160px;
  background: var(--wiki-banner-grad, linear-gradient(135deg, #10141d 0%, #1a2233 100%));
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0 1.5rem 1rem 1.5rem;
}

.wiki-banner-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 11, 16, 0.9) 0%, transparent 80%);
}

.wiki-header-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 2;
  margin-top: -50px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1rem;
}

.wiki-identity {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
}

.wiki-avatar-box {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  background: var(--fd-bg-card);
  border: 3px solid var(--theme-accent);
  box-shadow: 0 8px 24px var(--theme-accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  flex-shrink: 0;
}

.wiki-titles {
  display: flex;
  flex-direction: column;
}

.wiki-wordmark {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.wiki-tagline {
  font-size: 0.85rem;
  color: var(--fd-text-secondary);
  margin-top: 0.25rem;
  max-width: 600px;
}

.wiki-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
}

.btn-wiki-action {
  background: var(--fd-bg-card);
  border: 1px solid var(--fd-border);
  color: var(--fd-text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-wiki-action:hover {
  background: var(--fd-bg-card-hover);
  border-color: var(--theme-accent);
  color: var(--theme-accent);
}

.btn-wiki-action.primary {
  background: var(--theme-accent);
  border-color: transparent;
  color: #ffffff;
}

.btn-wiki-action.primary:hover {
  filter: brightness(1.15);
}

/* Wiki Navigation Bar */
.wiki-subnav-bar {
  background: #090b10;
  border-top: 1px solid var(--fd-border);
}

.wiki-subnav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wiki-nav-tabs {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  overflow-x: auto;
}

.wiki-nav-tabs li a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fd-text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.wiki-nav-tabs li a:hover {
  color: #ffffff;
  border-bottom-color: var(--fd-border-light);
}

.wiki-nav-tabs li.active a {
  color: var(--theme-accent);
  border-bottom-color: var(--theme-accent);
}

/* ==========================================================================
   WIKI ARTICLE LAYOUT (2 COLUMNS)
   ========================================================================== */

.wiki-article-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: flex-start;
}

/* Breadcrumbs */
.wiki-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  color: var(--fd-text-muted);
  margin-bottom: 0.75rem;
}

.wiki-breadcrumbs a:hover {
  color: var(--theme-accent);
  text-decoration: underline;
}

/* Article Header */
.article-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--fd-border);
  padding-bottom: 1.25rem;
}

.article-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.article-title {
  font-size: 2.35rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.15;
}

.article-subtitle {
  font-size: 0.95rem;
  color: var(--theme-accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.775rem;
  color: var(--fd-text-muted);
}

.article-meta-bar span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Table of Contents */
.table-of-contents-box {
  background: var(--fd-bg-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0 2rem 0;
  max-width: 480px;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.toc-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fd-text-primary);
}

.toc-list {
  list-style: none;
  counter-reset: toc-counter;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-item {
  counter-increment: toc-counter;
  font-size: 0.825rem;
}

.toc-item a {
  color: var(--theme-accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.toc-item a::before {
  content: counter(toc-counter) ".";
  font-weight: 700;
  color: var(--fd-text-muted);
}

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

/* Article Body Typography */
.article-body-content {
  color: #e2e8f0;
  font-size: 0.975rem;
  line-height: 1.75;
}

.article-body-content p {
  margin-bottom: 1.25rem;
}

.article-body-content h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  margin: 2.25rem 0 1rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--fd-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-body-content h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  background-color: var(--theme-accent);
  border-radius: var(--radius-sm);
}

.article-body-content blockquote {
  background: var(--theme-bg-tint);
  border-left: 4px solid var(--theme-accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--fd-text-primary);
}

/* ==========================================================================
   AUTHENTIC FANDOM / MEDIAWIKI INFOBOX
   ========================================================================== */

.fandom-infobox {
  background: var(--fd-bg-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--header-height) + var(--sub-bar-height) + 1.5rem);
}

.infobox-title-bar {
  background: var(--theme-accent);
  color: #ffffff;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.infobox-badge {
  text-align: center;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--theme-accent);
  border-bottom: 1px solid var(--fd-border);
}

.infobox-image-preview {
  min-height: 140px;
  background: var(--fd-bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  border-bottom: 1px solid var(--fd-border);
  position: relative;
}

/* Character portrait image in infobox */
.infobox-char-img-wrap {
  border-bottom: 1px solid var(--fd-border);
  overflow: hidden;
}

.infobox-char-img-wrap img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.3s ease;
}

.infobox-char-img-wrap img:hover {
  transform: scale(1.03);
}

.infobox-caption {
  font-size: 0.75rem;
  color: var(--fd-text-muted);
  text-align: center;
  padding: 0.4rem 0.75rem;
  font-style: italic;
  border-bottom: 1px solid var(--fd-border);
}

.infobox-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.infobox-table tr {
  border-bottom: 1px solid var(--fd-border);
}

.infobox-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.infobox-label {
  padding: 0.6rem 0.85rem;
  color: var(--fd-text-muted);
  font-weight: 700;
  width: 40%;
  vertical-align: top;
  border-right: 1px solid var(--fd-border);
}

.infobox-value {
  padding: 0.6rem 0.85rem;
  color: var(--fd-text-primary);
  font-weight: 500;
  width: 60%;
}

/* ==========================================================================
   COMMENTS & DISCUSSION SECTION
   ========================================================================== */

.article-comments-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--fd-border);
}

.comment-input-box {
  background: var(--fd-bg-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.comment-input-box textarea {
  width: 100%;
  height: 80px;
  background: var(--fd-bg-input);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.85rem;
  color: #fff;
  resize: vertical;
  outline: none;
  margin-bottom: 0.75rem;
}

.comment-input-box textarea:focus {
  border-color: var(--theme-accent);
}

.comment-actions-bar {
  display: flex;
  justify-content: flex-end;
}

.comment-item {
  background: var(--fd-bg-surface);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 1rem;
}

.comment-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fd-bg-card-hover);
  border: 1px solid var(--fd-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.comment-author {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fd-text-primary);
}

.comment-time {
  font-size: 0.725rem;
  color: var(--fd-text-muted);
}

.comment-text {
  font-size: 0.85rem;
  color: var(--fd-text-secondary);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.comment-footer-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--fd-text-muted);
}

.comment-footer-actions button {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fd-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.comment-footer-actions button:hover {
  color: var(--theme-accent);
}

@media (max-width: 960px) {
  .wiki-article-grid {
    grid-template-columns: 1fr;
  }
  .fandom-infobox {
    position: static;
    max-width: 420px;
    margin: 1.5rem auto;
  }
  .wiki-header-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
