/* ==========================================================================
   1. GLOBAL RESET & THEME VARIABLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-color: #eef1f5;
  --shell-bg-top: #dce2ec;
  --shell-bg-bottom: #ffffff;
  --card-bg: #ffffff;
  --title-box-bg: #e2e7f0;
  --title-box-text: #1a1a1a;
  --text-main: #202122;
  --text-muted: #54595d;
  --border-color: #cbd2dc;
  --header-bg: #1a1a1a;
  --header-text: #ffffff;
  --control-bg: #2a2a2a;
  --control-border: #444444;
  --accent-color: #AB274F;
  --glow-color: rgba(171, 39, 79, 0.35);
}

[data-theme="dark"] {
  --bg-color: #0e1015;
  --shell-bg-top: #1b1e28;
  --shell-bg-bottom: #14161d;
  --card-bg: #1e222d;
  --title-box-bg: #282d3c;
  --title-box-text: #ffffff;
  --text-main: #e1e1e6;
  --text-muted: #9aa0a6;
  --border-color: #2e3444;
  --header-bg: #0d0d0f;
  --header-text: #e0e0e0;
  --control-bg: #26262e;
  --control-border: #4a4a56;
  --accent-color: #AB274F;
  --glow-color: rgba(171, 39, 79, 0.5);
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: Arial, sans-serif;
  line-height: 1.6;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   2. FLOATING OCTAGONAL HEADER
   ========================================================================== */
.header-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 1000;
  max-width: 1300px;
  margin: 1rem auto 0 auto;
  filter: drop-shadow(0 0 16px var(--glow-color));
}

.wiki-header {
  background-color: var(--accent-color);
  padding: 2px;
  clip-path: polygon(
    14px 0%, 
    calc(100% - 14px) 0%, 
    100% 14px, 
    100% calc(100% - 14px), 
    calc(100% - 14px) 100%, 
    14px 100%, 
    0% calc(100% - 14px), 
    0% 14px
  );
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--header-bg);
  color: var(--header-text);
  gap: 1rem;
  clip-path: polygon(
    13px 0%, 
    calc(100% - 13px) 0%, 
    100% 13px, 
    100% calc(100% - 13px), 
    calc(100% - 13px) 100%, 
    13px 100%, 
    0% calc(100% - 13px), 
    0% 13px
  );
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo a {
  color: var(--header-text);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.2rem;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  gap: 1rem;
}

.header-nav a {
  color: var(--header-text);
  opacity: 0.85;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.header-nav a:hover {
  opacity: 1;
  color: var(--accent-color);
}

.lang-select, .theme-toggle-btn, .search-bar {
  background-color: var(--control-bg);
  color: var(--header-text);
  border: 1px solid var(--control-border);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-size: 0.85rem;
  outline: none;
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.search-bar {
  width: 160px;
}

.search-bar::placeholder {
  color: #888888;
}

/* ==========================================================================
   3. OCTAGONAL SHELL COMPONENT
   ========================================================================== */
.main-shell-wrapper {
  max-width: 1300px;
  margin: 2rem auto 3rem auto;
  filter: drop-shadow(0 0 16px var(--glow-color));
}

.main-shell-border {
  width: 100%;
  background-color: var(--border-color);
  padding: 2px;
  clip-path: polygon(
    28px 0%, 
    calc(100% - 28px) 0%, 
    100% 28px, 
    100% calc(100% - 28px), 
    calc(100% - 28px) 100%, 
    28px 100%, 
    0% calc(100% - 28px), 
    0% 28px
  );
}

.main-shell {
  background: linear-gradient(180deg, var(--shell-bg-top) 0%, var(--shell-bg-top) 180px, var(--shell-bg-bottom) 180px);
  clip-path: polygon(
    26px 0%, 
    calc(100% - 26px) 0%, 
    100% 26px, 
    100% calc(100% - 26px), 
    calc(100% - 26px) 100%, 
    26px 100%, 
    0% calc(100% - 26px), 
    0% 26px
  );
}

/* ==========================================================================
   4. HOME PAGE SPECIFIC STYLES
   ========================================================================== */
.hero-banner-compact {
  padding: 3.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.hero-banner-compact h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.hero-banner-compact p {
  color: var(--text-muted);
  font-size: 1rem;
}

.home-container {
  padding: 1.75rem;
  width: 100%;
  margin: 0 auto;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.home-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* Sub-section Cards */
.portal-card, .featured-section, .activity-section {
  position: relative;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  overflow: hidden;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.portal-card::before, .featured-section::before, .activity-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(171, 39, 79, 0.2) 5%, 
    var(--accent-color) 17.5%, 
    var(--accent-color) 82.5%, 
    rgba(171, 39, 79, 0.2) 95%, 
    transparent 100%
  );
  clip-path: polygon(
    0% 0%, 
    100% 0%, 
    95% 36%, 
    90% 64%, 
    85% 84%, 
    80% 96%, 
    75% 100%, 
    25% 100%, 
    20% 96%, 
    15% 84%, 
    10% 64%, 
    5% 36%, 
    0% 0%
  );
  filter: drop-shadow(0 0 3px var(--accent-color));
  z-index: 3;
}

.portal-card::after, .featured-section::after, .activity-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 32px;
  background: radial-gradient(ellipse at top, var(--glow-color) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

.title-box {
  position: relative;
  z-index: 2;
  background-color: var(--title-box-bg);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.1rem;
  margin: -0.75rem -0.75rem 1.1rem -0.75rem;
  border-radius: 5px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.title-box h2, .title-box h3 {
  font-size: 1.05rem;
  color: var(--title-box-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.portal-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.portal-links, .activity-list {
  list-style: none;
}

.portal-links li {
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--border-color);
}

.portal-links li:last-child {
  border-bottom: none;
}

.portal-links a, .featured-box h4 a, .activity-list a, .read-more {
  color: var(--accent-color);
  text-decoration: none;
}

.portal-links a:hover, .activity-list a:hover {
  text-decoration: underline;
}

.featured-link {
  color: var(--text-main);
  text-decoration: none;
}

.featured-link:hover {
  color: var(--accent-color);
}

.read-more-btn {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
}

.read-more-btn:hover {
  text-decoration: underline;
}

.activity-list {
  font-size: 0.85rem;
}

.activity-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   ARTICLE PAGE FIXED SIDEBAR & STICKY HEADER (SCOPED)
   ========================================================================== */
.wiki-page-layout .left-column {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 280px;
  height: 100vh;
  max-height: 100vh;
  z-index: 1002;
  overflow-y: auto;
  background-color: var(--header-bg, #1a1a1a);
  border-right: 1px solid var(--border-color, #2a2a2a);
  transition: width 0.3s ease;
}

body:has(.wiki-page-layout) .header-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 1000;
  margin-top: 1rem;
  margin-right: 1.5rem;
  margin-bottom: 0;
  margin-left: calc(280px + 1.5rem);
  max-width: calc(100% - 280px - 3rem);
  width: auto;
  transition: margin-left 0.3s ease, max-width 0.3s ease;
}

/* ==========================================================================
   ARTICLE LAYOUT, DIVIDER & DYNAMIC RIGHT COLUMN
   ========================================================================== */
.wiki-page-layout .left-column {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  max-height: 100vh !important;
  width: 280px;
  z-index: 1002;
  overflow-y: auto;
  background-color: var(--header-bg, #0d0d0f);
  border-right: 1px solid var(--border-color);
}

.wiki-page-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) calc(410px * 0.9) !important;
  gap: 1.5rem;
  margin-left: 280px;
  width: calc(100% - 280px);
  padding: 1.5rem;
  box-sizing: border-box;
}

.wiki-page-layout .right-column {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 0 0 1.5rem !important;
  border-left: 1px solid var(--border-color);
  background-color: transparent !important;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wiki-page-layout .right-column .infobox,
.wiki-page-layout .right-column .references-box {
  width: 100%;
}

/* ==========================================================================
   COLLAPSED SIDEBAR STATE
   ========================================================================== */
.wiki-page-layout .left-column.collapsed {
  width: 60px;
}

.wiki-page-layout:has(.left-column.collapsed) {
  margin-left: 60px;
  width: calc(100% - 60px);
}

body:has(.left-column.collapsed) .header-wrapper {
  margin-left: calc(60px + 1.5rem);
  max-width: calc(100% - 60px - 3rem);
}

.left-column {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.left-column .sidebar-content {
  display: flex;
  flex-direction: column;
}

.left-column .wiki-footer {
  margin-top: 2rem; 
  padding-bottom: 1.5rem;
}

.left-column::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--accent-color) 50%, transparent 100%);
  box-shadow: 0 0 8px var(--glow-color);
}

.left-column.collapsed {
  width: 52px;
  min-width: 52px;
}

.left-column.collapsed .sidebar-header {
  justify-content: center;
  padding: 1rem 0.25rem;
}

.left-column.collapsed .logo {
  display: none;
}

.left-column.collapsed .sidebar-content {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem;
  border-bottom: 1px solid var(--control-border);
}

.sidebar-toggle-btn {
  background: var(--control-bg);
  color: var(--header-text);
  border: 1px solid var(--control-border);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.sidebar-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.control-row {
  display: flex;
  gap: 0.5rem;
}

.control-row select, .control-row button {
  flex: 1;
}

.sidebar-nav .nav-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.4rem;
}

.sidebar-nav a {
  color: var(--header-text);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
}

.sidebar-nav a:hover {
  opacity: 1;
  color: var(--accent-color);
}

.toc-box {
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 0.85rem;
}

.toc-box ul {
  list-style: none;
}

.toc-box li {
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.toc-box a {
  color: var(--header-text);
  text-decoration: none;
  opacity: 0.88;
}

.toc-box a:hover {
  color: var(--accent-color);
}

.middle-column {
  flex: 1;
  padding: 1rem 1.5rem;
  min-width: 0;
  background-color: var(--bg-color);
}

.article-banner h1 {
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.breadcrumbs a {
  color: var(--accent-color);
  text-decoration: none;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-section h2 {
  font-size: 1.35rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
  margin-bottom: 0.85rem;
}

.article-section p {
  margin-bottom: 0.9rem;
}

.article-section blockquote {
  border-left: 4px solid var(--accent-color);
  background: var(--card-bg);
  padding: 0.85rem 1.1rem;
  margin: 1rem 0;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

.article-section blockquote cite {
  display: block;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.article-list {
  margin-left: 1.25rem;
}

.article-list li {
  margin-bottom: 0.4rem;
}

.right-column {
  width: 320px;
  min-width: 320px;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background-color: var(--bg-color);
}

/* ==========================================================================
   6. ARTICLE CARDS
   ========================================================================== */
.infobox, .references-box {
  position: relative;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  overflow: hidden;
}

.infobox::before, .references-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(171, 39, 79, 0.2) 5%, 
    var(--accent-color) 17.5%, 
    var(--accent-color) 82.5%, 
    rgba(171, 39, 79, 0.2) 95%, 
    transparent 100%
  );
  clip-path: polygon(
    0% 0%, 
    100% 0%, 
    95% 36%, 
    90% 64%, 
    85% 84%, 
    80% 96%, 
    75% 100%, 
    25% 100%, 
    20% 96%, 
    15% 84%, 
    10% 64%, 
    5% 36%, 
    0% 0%
  );
  filter: drop-shadow(0 0 3px var(--accent-color));
  z-index: 3;
}

.infobox::after, .references-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 32px;
  background: radial-gradient(ellipse at top, var(--glow-color) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

.infobox-image {
  width: 100%;
  height: 130px;
  background-color: var(--title-box-bg);
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: bold;
}

.infobox-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.infobox-table th, .infobox-table td {
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.infobox-table tr:last-child th, .infobox-table tr:last-child td {
  border-bottom: none;
}

.infobox-table th {
  color: var(--text-muted);
  width: 40%;
}

.reference-links {
  list-style: none;
  font-size: 0.85rem;
}

.reference-links li {
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--border-color);
}

.reference-links li:last-child {
  border-bottom: none;
}

.reference-links a {
  color: var(--accent-color);
  text-decoration: none;
}

.reference-links a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   7. FOOTER STYLES
   ========================================================================== */
.wiki-footer {
  text-align: center;
  padding: 1.25rem;
  background-color: rgba(0, 0, 0, 0.12);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.left-column .wiki-footer {
  margin-top: auto;
  padding-top: 1rem;
  background-color: transparent;
  border-top: 1px solid var(--control-border);
  font-size: 0.75rem;
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1300px) {
  .header-wrapper, .main-shell-wrapper {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

@media (max-width: 1100px) {
  .wiki-page-layout {
    flex-direction: column;
  }

  .left-column, .left-column.collapsed, .right-column {
    width: 100%;
    min-width: 100%;
  }

  .left-column::after {
    display: none;
  }

  .home-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-wrapper, .main-shell-wrapper {
    margin: 0.5rem 0.5rem 1.5rem 0.5rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .header-left, .header-right {
    justify-content: space-between;
    width: 100%;
  }
}

/* ==========================================================================
   STORY GRID (4-COLUMN LAYOUT)
   ========================================================================== */
.story-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
  .story-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .story-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   STORY CARD SUB-SECTION TITLES
   ========================================================================== */
.sub-sections {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
}

.sub-section {
  padding: 0.45rem 0;
  border-top: 1px dotted var(--border-color);
}

.sub-section:first-child {
  border-top: 1px dashed var(--border-color);
}

.sub-section-title {
  font-size: 0.88rem;
  font-weight: bold;
  color: var(--text-main);
  letter-spacing: 0.3px;
  margin: 0;
}

/* ==========================================================================
   HEADER SCROLL TRANSITIONS & RIGHT ALIGNMENT
   ========================================================================== */
.header-wrapper {
  position: sticky;
  top: 1rem;
  z-index: 1000;
  max-width: 1300px;
  margin: 1rem auto 0 auto;
  display: flex;
  justify-content: flex-end;
  transition: margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wiki-header {
  width: 100%;
  background-color: var(--accent-color);
  padding: 2px;
  clip-path: polygon(
    14px 0%, calc(100% - 14px) 0%, 100% 14px, 100% calc(100% - 14px), 
    calc(100% - 14px) 100%, 14px 100%, 0% calc(100% - 14px), 0% 14px
  );
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--header-bg);
  color: var(--header-text);
  gap: 1rem;
  clip-path: polygon(
    13px 0%, calc(100% - 13px) 0%, 100% 13px, 100% calc(100% - 13px), 
    calc(100% - 13px) 100%, 13px 100%, 0% calc(100% - 13px), 0% 13px
  );
  transition: padding 0.4s ease, background-color 0.4s ease, opacity 0.4s ease;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: margin-right 0.35s ease;
}

.header-nav,
.lang-select,
.theme-toggle-btn {
  transition: opacity 0.25s ease, max-width 0.35s ease, margin 0.35s ease, padding 0.35s ease;
  max-width: 300px;
  opacity: 1;
  overflow: hidden;
  white-space: nowrap;
}

.search-bar {
  transition: width 0.35s ease;
}

/* ==========================================================================
   SCROLLED STATE
   ========================================================================== */
.header-wrapper.scrolled {
  margin-right: 1rem; 
  margin-left: auto;
}

.header-wrapper.scrolled .wiki-header {
  width: 410px;
}

.header-wrapper.scrolled .header-inner {
  padding: 0.4rem 1.25rem 0.4rem 1rem;
  background-color: rgba(26, 26, 26, 0.75);
  opacity: 0.88;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .header-wrapper.scrolled .header-inner {
  background-color: rgba(13, 13, 15, 0.75);
}

.header-wrapper.scrolled .header-nav,
.header-wrapper.scrolled .lang-select,
.header-wrapper.scrolled .theme-toggle-btn {
  opacity: 0;
  max-width: 0;
  padding: 0;
  margin: 0;
  border-width: 0;
  pointer-events: none;
}

.header-wrapper.scrolled .header-right {
  margin-right: 0.25rem;
}

.header-wrapper.scrolled .search-bar {
  width: 140px;
}

/* Gallery Shell Layout & Card Styling */
.article-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gallery-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--title-box-bg);
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-muted);
}

.gallery-item .caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.main-shell .article-section + .article-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-color);
}

.article-banner {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.infobox, .references-box, .notes-box {
  position: relative;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  overflow: hidden;
}

.infobox::before, .references-box::before, .notes-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(171, 39, 79, 0.2) 5%, 
    var(--accent-color) 17.5%, 
    var(--accent-color) 82.5%, 
    rgba(171, 39, 79, 0.2) 95%, 
    transparent 100%
  );
  clip-path: polygon(
    0% 0%, 100% 0%, 95% 36%, 90% 64%, 85% 84%, 80% 96%, 75% 100%, 
    25% 100%, 20% 96%, 15% 84%, 10% 64%, 5% 36%, 0% 0%
  );
  filter: drop-shadow(0 0 3px var(--accent-color));
  z-index: 3;
}

.infobox::after, .references-box::after, .notes-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 32px;
  background: radial-gradient(ellipse at top, var(--glow-color) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

.notes-list {
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.notes-list li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.notes-list li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   SIDEBAR BREADCRUMBS STYLES
   ========================================================================== */
.left-column .sidebar-breadcrumbs {
  margin-top: auto;
  padding: 0.75rem 0;
  border-top: 1px solid var(--control-border);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-wrap: break-word;
}

.left-column .sidebar-breadcrumbs a {
  color: var(--accent-color);
  text-decoration: none;
}

.left-column .sidebar-breadcrumbs a:hover {
  text-decoration: underline;
}

.left-column .sidebar-breadcrumbs span {
  color: var(--header-text);
  opacity: 0.85;
}

.left-column.collapsed .sidebar-breadcrumbs {
  display: none;
}

/* ==========================================================================
   CHARACTER/FACTION HERO BANNER
   ========================================================================== */
.hero-banner-card {
  position: relative;
  background: #0f1117;
  color: #ffffff;
  border-radius: 0px;
  padding: 2.25rem;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border-color, #2a2d3d);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.hero-banner-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  width: 100%;
}

.hero-category {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #8b92a5;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.6rem 0;
  line-height: 1.15;
}

.hero-description {
  font-size: 0.92rem;
  color: #a0a7b8;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.hero-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}

.badge-gold {
  background: rgba(255, 193, 7, 0.12);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.35);
}

.badge-accent {
  background: rgba(171, 39, 79, 0.25);
  color: #ff5286;
  border: 1px solid var(--accent-color, #AB274F);
}

.badge-dark {
  background: #1d212c;
  color: #c2c7d0;
  border: 1px solid #323849;
}

.hero-data-table {
  background: #141722;
  border: 1px solid #252a3a;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.hero-data-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #252a3a;
}

.hero-data-row:last-child {
  border-bottom: none;
}

.hero-data-cell {
  padding: 0.55rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-right: 1px solid #252a3a;
}

.hero-data-cell:last-child {
  border-right: none;
}

.data-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6c758d;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.data-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
}

.hero-timestamp {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6c758d;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .hero-data-row {
    grid-template-columns: 1fr;
  }
  .hero-data-cell {
    border-right: none;
    border-bottom: 1px solid #252a3a;
  }
  .hero-banner-art {
    display: none;
  }
}

/* ==========================================================================
   HERO BANNER ARTWORK
   ========================================================================== */
.hero-banner-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 50%, #000 85%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 50%, #000 85%);
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
  transform: translateX(245px);
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(90deg, #0f1117 0%, rgba(15, 17, 23, 0.25) 45%, transparent 100%),
    radial-gradient(circle at 85% 50%, rgba(171, 39, 79, 0.2) 0%, transparent 65%);
}

.hero-banner-card ~ .article-section {
  padding-top: 0.65rem;
  padding-left: 1.45rem;
  padding-right: 1.95rem;
  padding-bottom: 1.25rem;
}

/* ==========================================================================
   SHELL PORTAL CARD INTEGRATION
   ========================================================================== */
.main-shell.shell-content-padding {
  padding: 1.75rem;
}

.main-shell .portal-grid:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   PAGE-SPECIFIC EXTRACTED STYLES & SOLID DARK MODE
   ========================================================================== */
#further-reading a,
#related-stories a {
  color: var(--link-color, var(--accent-color, #2563eb));
}

.toc-box li.selected {
  background-color: rgba(37, 99, 235, 0.15);
  border-left: 3px solid var(--accent-color, #2563eb);
}

.toc-box li.selected a,
.toc-box li a.active {
  color: var(--accent-color, #2563eb) !important;
  font-weight: bold;
}

.image-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.image-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none !important;
  background: var(--card-bg, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.15));
  border-radius: 8px;
  overflow: hidden;
  padding-bottom: 0.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.image-button:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color, #2563eb);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-button .img-placeholder {
  width: 100%;
  height: 90px;
  background: rgba(37, 99, 235, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--accent-color, #2563eb);
  border-bottom: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

.image-button span {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-color, #1f2937);
  padding: 0 0.4rem;
}

/* Solid Dark Mode (No Transparency) */
[data-theme="dark"] .image-button {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .image-button .img-placeholder {
  background: #0f172a;
  color: #60a5fa;
  border-bottom-color: #334155;
}

[data-theme="dark"] .image-button span {
  color: #f3f4f6;
}

.shell-divider {
  border: 0;
  height: 1px;
  background: var(--border-color, rgba(0, 0, 0, 0.1));
  margin: 1.5rem 0;
}