/* LGBT Novel — wiki-style: light, high-contrast, readable */

:root {
  --wiki-bg: #ffffff;
  --wiki-bg-soft: #f6f8fa;
  --wiki-bg-muted: #eaecf0;
  --wiki-text: #202122;
  --wiki-text-muted: #54595d;
  --wiki-link: #3366cc;
  --wiki-link-hover: #2a4b8d;
  --wiki-border: #a2a9b1;
  --wiki-border-light: #c8ccd1;
  --wiki-accent: #36c;
  --wiki-accent-bg: #eaf3ff;
  --wiki-radius: 2px;
  --wiki-max: 1160px;
  --wiki-font: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wiki-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

html,
body {
  background: var(--wiki-bg-soft);
  color: var(--wiki-text);
}

body {
  font-family: var(--wiki-font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Header / nav (wiki top bar) ── */
.atlas-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--wiki-bg);
  border-bottom: 1px solid var(--wiki-border-light);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.atlas-nav {
  max-width: var(--wiki-max);
  margin: 0 auto;
  padding: 0.65rem 1rem;
}

.atlas-nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.atlas-brand {
  color: var(--wiki-text);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.atlas-brand:hover {
  color: var(--wiki-link);
}

.atlas-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.atlas-menu-link {
  color: var(--wiki-link);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.9375rem;
  border-radius: var(--wiki-radius);
}

.atlas-menu-link:hover {
  background: var(--wiki-accent-bg);
  color: var(--wiki-link-hover);
  text-decoration: underline;
}

.atlas-nav-toggle {
  display: none;
  border: 1px solid var(--wiki-border-light);
  background: var(--wiki-bg);
  color: var(--wiki-text);
  border-radius: var(--wiki-radius);
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.875rem;
}

/* ── Main layout ── */
.atlas-main {
  max-width: var(--wiki-max);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Wiki hero (homepage) ── */
.atlas-wiki-hero {
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border-light);
  border-radius: var(--wiki-radius);
  padding: 2rem 1.5rem;
  margin: 1.25rem 0 1.5rem;
  text-align: center;
}

.atlas-wiki-hero .atlas-kicker {
  color: var(--wiki-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
}

.atlas-wiki-hero h1 {
  font-family: var(--wiki-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  color: var(--wiki-text);
  line-height: 1.25;
  margin: 0 0 1rem;
}

.atlas-wiki-hero .atlas-lead {
  font-size: 1.0625rem;
  color: var(--wiki-text-muted);
  line-height: 1.7;
  max-width: 42rem;
  margin: 0 auto 1.5rem;
}

.atlas-wiki-hero .atlas-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* ── Sections ── */
.atlas-section {
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border-light);
  border-radius: var(--wiki-radius);
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
}

.atlas-section-alt {
  background: var(--wiki-bg-soft);
}

.atlas-section-title {
  font-family: var(--wiki-serif);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--wiki-text);
  margin: 0 0 0.5rem;
  border-bottom: 1px solid var(--wiki-border-light);
  padding-bottom: 0.35rem;
}

.atlas-section-desc {
  color: var(--wiki-text-muted);
  font-size: 0.9375rem;
  margin: 0 0 1.25rem;
}

/* ── Cards (wiki infobox style) ── */
.atlas-card {
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border-light);
  border-radius: var(--wiki-radius);
  box-shadow: none;
}

.atlas-hero {
  padding: 1.25rem 1.5rem;
  border-radius: var(--wiki-radius);
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border-light);
}

.atlas-kicker {
  margin: 0 0 0.35rem;
  color: var(--wiki-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  font-weight: 600;
}

.atlas-content-card {
  padding: 1rem 1.1rem;
}

.atlas-content-card h2 {
  margin-top: 0.2rem;
  font-size: 1.0625rem;
}

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

.atlas-content-card h2 a:hover {
  text-decoration: underline;
}

/* ── Buttons (wiki: flat, clear) ── */
.atlas-button-primary {
  display: inline-block;
  background: var(--wiki-link);
  color: #fff !important;
  text-decoration: none;
  border-radius: var(--wiki-radius);
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid var(--wiki-link);
  box-shadow: none;
}

.atlas-button-primary:hover {
  background: var(--wiki-link-hover);
  border-color: var(--wiki-link-hover);
  color: #fff !important;
  transform: none;
}

.atlas-button-outline {
  display: inline-block;
  border: 1px solid var(--wiki-border);
  color: var(--wiki-text);
  text-decoration: none;
  border-radius: var(--wiki-radius);
  padding: 0.5rem 0.9rem;
  background: var(--wiki-bg);
  font-size: 0.9375rem;
}

.atlas-button-outline:hover {
  background: var(--wiki-bg-soft);
  border-color: var(--wiki-link);
  color: var(--wiki-link);
}

/* ── Typography ── */
a {
  color: var(--wiki-link);
}

a:hover {
  color: var(--wiki-link-hover);
}

h1, h2, h3, h4 {
  color: var(--wiki-text);
  font-family: var(--wiki-serif);
  font-weight: 600;
  letter-spacing: normal;
}

.atlas-prose {
  max-width: 70ch;
  margin: 0 auto;
  font-size: 1rem;
  color: var(--wiki-text);
}

.atlas-prose.mid-gray,
.mid-gray.atlas-prose {
  color: var(--wiki-text);
}

article header .tracked,
article header aside {
  color: var(--wiki-text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}

article h1.athelas,
article h1.dark-gray {
  color: var(--wiki-text) !important;
  border-bottom: 1px solid var(--wiki-border-light);
  padding-bottom: 0.35rem;
  font-family: var(--wiki-serif);
}

.atlas-prose p,
.atlas-prose li {
  line-height: 1.75;
}

/* Wiki-style article body (trope pages etc.) */
.nested-copy-line-height,
.lh-copy {
  color: var(--wiki-text);
}

.nested-copy-line-height h1,
.lh-copy h1 {
  color: var(--wiki-text) !important;
  border-bottom: 1px solid var(--wiki-border-light);
  padding-bottom: 0.25rem;
}

.nested-copy-line-height a,
.lh-copy a,
.nested-links a {
  color: var(--wiki-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nested-copy-line-height a:hover,
.lh-copy a:hover {
  color: var(--wiki-link-hover);
}

/* Override Tachyons low-contrast on homepage */
.mid-gray,
.gray {
  color: var(--wiki-text-muted) !important;
}

.dark-gray {
  color: var(--wiki-text) !important;
}

.dark-blue,
.link.dark-blue {
  color: var(--wiki-link) !important;
}

/* Remove old dark hero override */
.bg-near-black.white.pv5.pv6-l.ph3.ph5-l.tc {
  background: var(--wiki-bg) !important;
  color: var(--wiki-text) !important;
  border: 1px solid var(--wiki-border-light);
  border-radius: var(--wiki-radius);
}

.bg-near-black.white h1,
.bg-near-black.white p {
  color: var(--wiki-text) !important;
}

.bg-near-black .white-80 {
  color: var(--wiki-text-muted) !important;
}

.bg-near-black .light-red {
  color: var(--wiki-text-muted) !important;
}

/* Cards from theme */
.bg-white.br2.shadow-4,
.bg-near-white.br2.shadow-4,
.bg-white.br2.pa3.h-100.shadow-1 {
  border-radius: var(--wiki-radius);
  border: 1px solid var(--wiki-border-light);
  box-shadow: none;
  background: var(--wiki-bg);
}

/* ── Footer (light wiki) ── */
.atlas-footer {
  margin-top: 2rem;
  background: var(--wiki-bg);
  color: var(--wiki-text-muted);
  border-top: 1px solid var(--wiki-border-light);
}

.atlas-footer a {
  color: var(--wiki-link);
}

.atlas-footer a:hover {
  color: var(--wiki-link-hover);
}

.atlas-footer .white-70,
.atlas-footer .white-60,
.atlas-footer .white-50,
.atlas-footer .white-90,
.atlas-footer .hover-white {
  color: var(--wiki-text-muted) !important;
}

.atlas-footer .hover-white:hover {
  color: var(--wiki-link) !important;
}

.atlas-footer .b--white-20 {
  border-color: var(--wiki-border-light) !important;
}

.atlas-footer-inner {
  max-width: var(--wiki-max);
  margin: 0 auto;
}

/* ── Layout helpers ── */
@media (min-width: 60em) {
  .atlas-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.5rem;
    align-items: start;
  }
}

.atlas-sidebar {
  position: sticky;
  top: 4.5rem;
}

.atlas-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--wiki-radius);
  border: 1px solid var(--wiki-border-light);
  background: var(--wiki-bg-soft);
  color: var(--wiki-text);
  font-size: 0.8125rem;
}

/* ── Affiliate blocks ── */
.atlas-affiliate-cta {
  border-radius: var(--wiki-radius);
  border: 1px solid #a3c9ff;
  background: var(--wiki-accent-bg);
}

.atlas-affiliate-note {
  border: 1px solid var(--wiki-border-light);
  background: var(--wiki-bg-soft);
  color: var(--wiki-text);
}

/* ── Sticky bar ── */
.atlas-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--wiki-bg);
  border-top: 1px solid var(--wiki-border);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-safe, 0px));
}

.atlas-sticky-inner {
  max-width: var(--wiki-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.atlas-sticky-text {
  color: var(--wiki-text-muted);
  max-width: 40ch;
}

.atlas-sticky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.atlas-sticky-btn {
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
}

body.has-sticky-affiliate {
  padding-bottom: 4.5rem;
}

/* ── Wiki list links on homepage ── */
.atlas-wiki-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.atlas-wiki-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--wiki-bg-muted);
}

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

.atlas-wiki-list a {
  color: var(--wiki-link);
  text-decoration: none;
  font-size: 0.9375rem;
}

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

/* ── Mobile ── */
@media (max-width: 768px) {
  .atlas-nav-toggle {
    display: inline-block;
  }

  .atlas-nav-panel {
    display: none;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--wiki-border-light);
    margin-top: 0.5rem;
  }

  .atlas-nav-panel.is-open {
    display: block;
  }

  .atlas-menu {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .atlas-menu-link {
    display: block;
    padding: 0.5rem 0;
  }

  .atlas-layout {
    display: block;
  }

  .atlas-sidebar {
    position: static;
    margin-top: 1rem;
  }

  .atlas-wiki-hero {
    padding: 1.25rem 1rem;
  }

  .atlas-sticky-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .atlas-sticky-actions {
    width: 100%;
  }

  .atlas-sticky-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* ── Wiki article pages (A+ unified layout) ── */
.wiki-article {
  color: var(--wiki-text);
}

.wiki-breadcrumb {
  margin-bottom: 1rem;
}

.wiki-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--wiki-text-muted);
}

.wiki-breadcrumb-list li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: var(--wiki-border);
}

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

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

.wiki-article-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--wiki-border-light);
}

.wiki-article-title {
  font-family: var(--wiki-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--wiki-text);
  margin: 0.35rem 0 0.75rem;
}

.wiki-article-lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--wiki-text-muted);
  margin: 0 0 0.75rem;
  max-width: 65ch;
}

.wiki-meta {
  color: var(--wiki-text-muted);
}

.wiki-meta-sep {
  margin: 0 0.35rem;
}

.wiki-prose h2 {
  font-family: var(--wiki-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--wiki-bg-muted);
  color: var(--wiki-text);
}

.wiki-prose h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--wiki-text);
}

.wiki-prose blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--wiki-link);
  background: var(--wiki-bg-soft);
  color: var(--wiki-text-muted);
}

.wiki-section-hero {
  max-width: var(--wiki-max);
  margin: 0 auto 1.25rem;
  padding: 1.5rem 1.25rem;
  background: var(--wiki-bg);
  border: 1px solid var(--wiki-border-light);
  border-radius: var(--wiki-radius);
}

.wiki-section-hero-title {
  font-family: var(--wiki-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0.5rem 0 0.75rem;
  color: var(--wiki-text);
}

.wiki-section-hero-desc {
  font-size: 1rem;
  color: var(--wiki-text-muted);
  margin: 0 0 0.75rem;
  max-width: 65ch;
}

.wiki-section-hero-body {
  font-size: 0.9375rem;
  color: var(--wiki-text-muted);
  max-width: 70ch;
}

.wiki-see-also {
  border-top: 1px solid var(--wiki-border-light);
  padding-top: 1.25rem;
}

.wiki-see-also-title,
.wiki-subsection-title {
  font-family: var(--wiki-serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--wiki-text);
}

.wiki-see-also-list,
.wiki-infobox-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-see-also-list li,
.wiki-infobox-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--wiki-bg-muted);
}

.wiki-see-also-list li:last-child,
.wiki-infobox-list li:last-child {
  border-bottom: none;
}

.wiki-infobox-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wiki-text-muted);
  margin: 0 0 0.35rem;
}

.wiki-infobox-value {
  color: var(--wiki-text);
}

.wiki-quick-pick {
  border-bottom: 1px solid var(--wiki-bg-muted);
}

.wiki-quick-pick:last-of-type {
  border-bottom: none;
}

.wiki-subsection {
  margin-top: 2rem;
}

/* Neutralize Ananke dark header leakage on 404 / legacy pages */
header .bg-black,
header > div.bg-black {
  background: var(--wiki-bg) !important;
  border-bottom: 1px solid var(--wiki-border-light);
}

header .bg-black .atlas-brand,
header .bg-black .atlas-menu-link {
  color: var(--wiki-link) !important;
}

header .bg-black .atlas-brand:hover {
  color: var(--wiki-link-hover) !important;
}

/* Wiki 404 */
.wiki-article .wiki-prose p {
  margin-top: 1rem;
}

@media (min-width: 60em) {
  .wiki-article-main {
    min-width: 0;
  }
}
