/* ================================
   Expanded Structures Wiki CSS
   Deep Blue Sky × Void Purple
   (shared styling for ALL pages)
================================ */

/* ===== Tokens ===== */
:root{
  --candy: #ff4fd8;
  --candy2:#ffb3f1;

  --bg0:#030616;
  --bg1:#050a1f;
  --bg2:#070d28;

  --bg-stars-url: url("/assets/stars.webp");

  --moon:#cdd6f4;
  --void:#7a5cff;
  --void2:#3a2a7a;

  --ink: rgba(246,248,255,.92);
  --muted: rgba(246,248,255,.66);

  /* Tuned to match homepage “glass” */
  --panelA: rgba(255,255,255,.06);
  --panelB: rgba(255,255,255,.025);

  --stroke: rgba(205,214,244,.14);
  --stroke-strong: rgba(122,92,255,.32);

  --radius:18px;
  --shadow:0 18px 50px rgba(0,0,0,.35);

  --max:1180px;
  --pad:22px;

  --banner-h: 0px; /* set to 44px only on pages that have the fixed WIP banner */
}

/* ===== Base ===== */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  padding-top: var(--banner-h);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* ==========================================================
   ETHER VIBE (GLOBAL) — match the homepage atmosphere
   ONLY place where bg pseudos are defined.
========================================================== */

/* Base void gradients (under everything) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events:none;
  background:
    radial-gradient(1200px 800px at 60% -10%, rgba(205,214,244,.08), transparent 60%),
    radial-gradient(1100px 900px at 30% 120%, rgba(122,92,255,.10), transparent 65%),
    linear-gradient(180deg, var(--bg0), var(--bg2));
}

/* Stars ONLY (quieter, less “space”) */
body::after{
  content:"";
  position: fixed;
  inset:-10%;
  z-index: -2;
  pointer-events:none;
  background-image: var(--bg-stars-url);
  background-size: cover;
  background-position: center;
  opacity: .18;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.03);
}

/* Purple nebula / ether glow (above stars, below content) */
html::after{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events:none;

  background:
    radial-gradient(1000px 800px at 18% 22%, rgba(160,110,255,.80), transparent 62%),
    radial-gradient(900px 700px  at 82% 65%, rgba(120,80,255,.70), transparent 64%),
    radial-gradient(900px 700px  at 50% 55%, rgba(255,79,216,.10), transparent 68%),
    radial-gradient(circle at 50% 55%, transparent 55%, rgba(0,0,0,.62) 100%);

  mix-blend-mode: screen;
  opacity: .60; /* “ethereal” knob */
}

/* ===== Typography ===== */
h1,h2,h3{ margin:0; line-height:1.08; }

h1{
  font-family: "Cormorant Garamond", Cinzel, serif;
  font-size: clamp(34px, 4.8vw, 58px);
  letter-spacing:.4px;
  text-shadow: 0 0 26px rgba(122,92,255,.18);
}

.muted{ color: var(--muted); }

/* ===== Links ===== */
a{
  color: rgba(205,214,244,.92);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover{ color: rgba(255,179,241,.95); }
a:focus-visible{
  outline: 2px solid rgba(122,92,255,.55);
  outline-offset: 3px;
  border-radius: 10px;
}

/* If something explicitly wants “nav links” underlined, use .navlinks */
.navlinks a{
  text-decoration: underline;
  text-decoration-color: rgba(205,214,244,.28);
}
.navlinks a:hover{
  text-decoration-color: rgba(255,79,216,.55);
}

/* ===== Layout wrappers ===== */
.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px var(--pad) 64px;
}

/* Many wiki templates use #content or main */
main, #content, .content{
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px var(--pad) 64px;
}

/* If .content is used as the article body inside .page */
.page .content{
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ==============================
   Internal page header spacing
============================== */
.siteHeader .wrap.headerRow{
  padding: 34px var(--pad) 14px;
}
.siteHeader .wrap.topNav{
  padding: 0 var(--pad) 18px;
  margin-top: 0;
}

/* ===== Header meta line ===== */
.meta{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing:.22px;
}
.sigil{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.95), var(--void));
  box-shadow: 0 0 16px rgba(122,92,255,.55);
}

/* ==========================================================
   GLASS SURFACES — matches homepage (this fixes your “flat 80%”
   look on category pages)
========================================================== */

.panel,
.card{
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position:relative;
  overflow:hidden;
}

/* Soft internal bloom (the “ether” part) */
.panel::before,
.card::before{
  content:"";
  position:absolute;
  left: -40px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  background:
    radial-gradient(circle at 30% 70%, rgba(122,92,255,.18), transparent 60%),
    radial-gradient(circle at 55% 45%, rgba(205,214,244,.08), transparent 62%);
  filter: blur(10px);
  opacity:.85;
  pointer-events:none;
}

/* Bottom glow hairline (homepage signature) */
.panel::after,
.card::after{
  content:"";
  position:absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 1px;
  background:
    linear-gradient(90deg,
      transparent,
      rgba(205,214,244,.14),
      rgba(122,92,255,.40),
      rgba(255,79,216,.28),
      rgba(205,214,244,.14),
      transparent
    );
  box-shadow: 0 0 18px rgba(122,92,255,.14);
  opacity:.92;
  pointer-events:none;
}

/* Panel (big containers like category page list) */
.panel{
  margin-top: 18px;
  padding: 18px;
  background:
    radial-gradient(700px 280px at 20% 10%, rgba(122,92,255,.18), transparent 60%),
    linear-gradient(180deg, var(--panelA), var(--panelB));
}

/* Card */
.card{
  padding: 16px 16px 14px;
  text-decoration:none;
  color: var(--ink);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  background:
    radial-gradient(600px 220px at 20% 15%, rgba(122,92,255,.12), transparent 60%),
    linear-gradient(180deg, var(--panelA), var(--panelB));
}

.card:hover{
  transform: translateY(-2px);
  border-color: rgba(122,92,255,.32);
  box-shadow: 0 0 30px rgba(122,92,255,.12), inset 0 0 0 1px rgba(255,255,255,.02);
}

.cardTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  position:relative;
  z-index:1;
}

.cardTitle{
  margin:0;
  font-family: Cinzel, serif;
  font-weight: 800;
  letter-spacing:.35px;
  font-size: 15px;
}

.cardDesc{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height:1.45;
  position:relative;
  z-index:1;
  max-width: 56ch;
}

.glyph{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,.12), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.18));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.03),
    0 0 18px rgba(122,92,255,.12);
  font-size: 18px;
  position: relative;
  overflow:hidden;
}

/* ===== Buttons ===== */
.btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  text-decoration:none;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 14px;

  border: 1px solid var(--stroke);
  background:
    radial-gradient(120px 60px at 20% 0%, rgba(255,255,255,.12), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.12));

  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
  position:relative;
  overflow:hidden;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(122,92,255,.34);
  box-shadow: 0 0 26px rgba(122,92,255,.16), inset 0 0 0 1px rgba(255,255,255,.03);
  filter: saturate(1.05);
}
.btn.primary{
  border-color: rgba(122,92,255,.50);
  background:
    radial-gradient(140px 70px at 20% 0%, rgba(255,255,255,.14), transparent 70%),
    linear-gradient(180deg, rgba(122,92,255,.26), rgba(0,0,0,.14));
  box-shadow: 0 0 30px rgba(122,92,255,.18), inset 0 0 0 1px rgba(255,255,255,.03);
}

/* ================= Navigation Pills ================= */
.topNav{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.navLink{
  display:inline-flex;
  align-items:center;

  font-weight:800;
  font-size:13px;
  letter-spacing:.15px;
  color:rgba(246,248,255,.88);
  text-decoration:none;

  padding:8px 12px;
  border-radius:999px;

  border:1px solid var(--stroke);
  background:rgba(5,8,22,.38);

  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);

  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.navLink:hover{
  transform:translateY(-1px);
  border-color:rgba(122,92,255,.38);
  box-shadow:0 0 18px rgba(122,92,255,.16);
  background:rgba(10,14,34,.46);
}

.navLink.active{
  border-color:rgba(122,92,255,.56);
  background:rgba(122,92,255,.16);
  box-shadow:0 0 22px rgba(122,92,255,.22);
}

/* If your internal templates wrap the nav in .siteHeader, keep it strong */
.siteHeader .topNav{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.siteHeader .topNav .navLink{ display:inline-flex; }

/* ===== Grids ===== */
.grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

/* Auto grid for category pages */
.gridAuto{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(320px,360px));
  gap:14px;
  justify-content:start;
  align-items:start;
}
.gridAuto .card{
  max-width:360px;
  width:100%;
}

/* Default cards in 12-col grid */
.card{ grid-column: span 4; }

/* ===== Footer (match homepage footer inside wrap) ===== */
.footer, footer{
  /* behave like .wrap */
  max-width: var(--max);
  margin: 22px auto 0;
  width: 100%;
  padding: 16px var(--pad) 18px;   /* bottom padding prevents “clipped” look */

  border-top: 1px solid rgba(205,214,244,.10);
  color: rgba(246,248,255,.52);
  font-size: 12px;
  line-height: 1.35;

  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap: 10px;
  flex-wrap:wrap;
}

/* small screens: don’t force the right side to the edge */
@media (max-width: 640px){
  .footer, footer{
    justify-content:flex-start;
  }
}

/* optional: extra breathing room at the bottom of every page */
body{ padding-bottom: 18px; }

/* ===== Responsive ===== */
@media(max-width:980px){
  .card{ grid-column: span 6; }
}
@media(max-width:640px){
  .card{ grid-column: span 12; }
  :root{ --banner-h: 56px; }
}

/* ===============================
   ADMIN: Inputs + Editor
================================ */

.inputField{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;

  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);

  color: rgba(246,248,255,.92);
  font-size: 14px;

  outline: none;
  transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}
.inputField::placeholder{ color: rgba(255,255,255,.35); }
.inputField:focus{
  border-color: rgba(122,92,255,.6);
  box-shadow:
    0 0 0 1px rgba(122,92,255,.5),
    0 0 18px rgba(122,92,255,.25);
  background: rgba(0,0,0,.35);
}

/* Selects (Firefox-safe) */
select.inputField{
  appearance: auto;
  -moz-appearance: menulist;
  background-color: rgba(0,0,0,.25);
}
select.inputField option,
select.inputField optgroup{
  color: #111;
  background: #fff;
}
#category option,
#category optgroup{
  color:#111 !important;
  background:#fff !important;
}
#category{ color-scheme: dark; }

/* Editor */
.editorWrap{ display:grid; gap: 10px; }
.editorBar{ display:flex; flex-wrap:wrap; gap:8px; }

.editor{
  min-height: 240px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.16);
  color: rgba(246,248,255,.90);
  outline: none;
}
.editor:focus{
  border-color: rgba(122,92,255,.42);
  box-shadow: 0 0 0 3px rgba(122,92,255,.12);
}
.editorHelp{ color: rgba(246,248,255,.55); font-size: 12px; }

.twoCol{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 980px){
  .twoCol{ grid-template-columns: 1fr; }
}

/* Toolbar buttons (scoped) */
.editorWrap .editorBar button,
.editorWrap .editorBar .editorBtn{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  border: 1px solid var(--stroke);
  background: rgba(5,8,22,.35);
  color: rgba(246,248,255,.88);

  font: inherit;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;

  padding: 8px 10px;
  border-radius: 12px;

  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.editorWrap .editorBar button:hover,
.editorWrap .editorBar .editorBtn:hover{
  border-color: rgba(122,92,255,.38);
  box-shadow: 0 0 18px rgba(122,92,255,.12), inset 0 0 0 1px rgba(255,255,255,.02);
  background: rgba(10,14,34,.42);
}
.editorWrap .editorBar button:focus-visible,
.editorWrap .editorBar .editorBtn:focus-visible{
  outline: none;
  border-color: rgba(122,92,255,.55);
  box-shadow: 0 0 0 3px rgba(122,92,255,.14);
}

/* ==========================================================
   ARTICLE LAYOUT ("regular wiki" feel)
========================================================== */

.wikiLayout{ display:grid; gap: 14px; align-items:start; }

/* Default: just the article */
.wikiLayout{ grid-template-columns: 1fr; grid-template-areas: "main"; }
.wikiMain{ grid-area: main; }

/* TOC only */
.wikiLayout.hasToc:not(.hasInfobox){
  grid-template-columns: 1fr 260px;
  grid-template-areas: "main toc";
}

/* Infobox only */
.wikiLayout.hasInfobox:not(.hasToc){
  grid-template-columns: 320px 1fr;
  grid-template-areas: "info main";
}

/* Both */
.wikiLayout.hasInfobox.hasToc{
  grid-template-columns: 320px 1fr 260px;
  grid-template-areas: "info main toc";
}

.wikiSideLeft{ grid-area: info; }
.wikiSideRight{ grid-area: toc; }

/* Sticky side panels (desktop) */
.infobox,
.toc{
  position: sticky;
  top: calc(var(--banner-h) + 14px);
}

/* Infobox */
.infoboxTitle{
  font-family: Cinzel, serif;
  font-weight: 800;
  letter-spacing: .25px;
  font-size: 14px;
  margin: 0 0 10px;
  color: rgba(246,248,255,.88);
}
.infoboxFigure{ margin: 0 0 12px; }
/* Clickable square thumbnail */
.infoboxImageLink{
  display:block;
  border-radius: 14px;
  overflow:hidden;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.18);
}

.infoboxImageLink img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display:block;
}

/* subtle hover */
.infoboxImageLink:hover{
  border-color: rgba(122,92,255,.38);
  box-shadow: 0 0 18px rgba(122,92,255,.12);
}
.infoboxFigure figcaption{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(246,248,255,.60);
  line-height: 1.35;
}
.infoboxGrid{
  margin: 0;
  display:grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.infoboxGrid dt{
  font-size: 11px;
  letter-spacing: .18px;
  text-transform: uppercase;
  color: rgba(246,248,255,.56);
}
.infoboxGrid dd{
  margin: -4px 0 0;
  font-size: 12.5px;
  color: rgba(246,248,255,.86);
  line-height: 1.35;
}

/* TOC */
.tocTitle{
  font-family: Cinzel, serif;
  font-weight: 800;
  letter-spacing: .25px;
  font-size: 13px;
  margin: 0 0 10px;
  color: rgba(246,248,255,.86);
}
.tocList{
  margin: 0;
  padding-left: 18px;
  display:grid;
  gap: 6px;
}
.tocList a{ color: rgba(205,214,244,.92); text-decoration: none; }
.tocList a:hover{ color: rgba(255,179,241,.95); }
.tocL3{ margin-left: 10px; list-style-type: circle; }

/* Article typography */
.wikiContent{
  line-height: 1.75;
  color: rgba(246,248,255,.90);
}
.wikiContent p{ margin: 0 0 12px; }
.wikiContent h2,
.wikiContent h3,
.wikiContent h4{
  font-family: Cinzel, serif;
  letter-spacing: .25px;
  margin: 20px 0 10px;
}

.wikiContent h2{ font-size: 18px; }
.wikiContent h3{ font-size: 15px; opacity: .92; }
/* H4 = visual biome item */
.wikiContent h4{
  font-family: Cinzel, serif;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: .18px;

  margin: 14px 0 6px;
  padding-left: 18px;
  position: relative;
  opacity: .92;
}

.wikiContent h4::before{
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  opacity: .65;
}

/* Anything directly after H4 (p OR div OR list) aligns with it */
.wikiContent h4 + *{
  margin-left: 18px;
}

.wikiContent hr{
  border: 0;
  height: 1px;
  margin: 18px 0;
  background: linear-gradient(90deg, transparent, rgba(205,214,244,.14), rgba(122,92,255,.30), rgba(205,214,244,.14), transparent);
}

.wikiContent ul,
.wikiContent ol{
  margin: 0 0 12px;
  padding-left: 22px;
}
.wikiContent li{ margin: 6px 0; }

.wikiContent code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .92em;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color: rgba(246,248,255,.90);
}

.wikiContent pre{
  overflow:auto;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.wikiContent pre code{
  border: 0;
  background: transparent;
  padding: 0;
}

.wikiContent blockquote{
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 3px solid rgba(122,92,255,.42);
  background: rgba(5,8,22,.35);
  border-radius: 14px;
  color: rgba(246,248,255,.78);
}

/* Responsive: stack sidebars */
@media (max-width: 980px){
  .wikiLayout.hasInfobox.hasToc{
    grid-template-columns: 1fr;
    grid-template-areas: "info" "toc" "main";
  }
  .wikiLayout.hasInfobox:not(.hasToc){
    grid-template-columns: 1fr;
    grid-template-areas: "info" "main";
  }
  .wikiLayout.hasToc:not(.hasInfobox){
    grid-template-columns: 1fr;
    grid-template-areas: "toc" "main";
  }
  .infobox,
  .toc{ position: static; }
}