/* Tidehaven wiki: a banner of water, one reading column on the sand, the index in a drawer. */

.main-nav a[aria-current="page"] { color: var(--gold-light); }

/* ---------- banner ---------- */
.wiki-hero { position: relative; z-index: 5; padding: 140px 0 120px; background: var(--deep); text-align: center; overflow: visible; }
.wiki-hero-media { position: absolute; inset: 0; overflow: hidden; }
.wiki-hero-media > img { width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.wiki-hero-media::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 90% at 50% 42%, rgba(6, 15, 28, 0.55), rgba(6, 15, 28, 0.88)), linear-gradient(0deg, var(--deep) 0, rgba(10, 24, 40, 0) 180px); }
.wiki-hero-inner { position: relative; z-index: 2; }
.wiki-hero h1 {
  margin: 14px 0 10px; font-size: clamp(2.8rem, 6vw, 4.6rem);
  background: linear-gradient(180deg, #fffaf4 0%, var(--gold-pale) 50%, var(--gold-h1) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wiki-hero p { max-width: 52ch; margin: 0 auto 30px; color: #d6dce8; font-size: 1.06rem; }
.wiki-hero .shore-below { z-index: 1; }

.wiki-search-wrap { position: relative; z-index: 6; max-width: 580px; margin: 0 auto; text-align: left; }
.wiki-search { --n: 10px; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 20px; background: rgba(4, 12, 22, 0.85); box-shadow: inset 0 0 0 1px rgba(var(--gold-h1-rgb), 0.35); transition: box-shadow 0.2s ease; }
.wiki-search:focus-within { box-shadow: inset 0 0 0 1px var(--gold-h1); }
.wiki-search svg { width: 18px; height: 18px; color: var(--gold-h1); flex-shrink: 0; }
.wiki-search input { flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent; font: 500 1rem var(--font-body); color: var(--ink); }
.wiki-search input::placeholder { color: var(--ink-dim); }
.wiki-search kbd { padding: 2px 8px; font: 700 0.75rem var(--font-body); color: var(--ink-dim); border: 1px solid var(--panel-line); border-radius: 3px; }
.wiki-search-results { --n: 10px; position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 440px; overflow-y: auto; padding: 8px; background: var(--sand-card); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4); }
.wiki-result { display: block; padding: 12px 14px; border-radius: 4px; color: var(--sand-ink); transition: background 0.15s ease; }
.wiki-result:hover, .wiki-result:focus-visible { background: rgba(var(--gold-rgb), 0.14); }
.wiki-result-title { display: flex; justify-content: space-between; gap: 12px; font: 700 1.15rem var(--font-display); }
.wiki-result-title em { font: normal 700 0.66rem var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-text); }
.wiki-result-text { display: block; margin-top: 4px; font-size: 0.86rem; color: var(--sand-ink-dim); }
.wiki-result mark { background: rgba(var(--gold-rgb), 0.3); color: var(--sand-ink); border-radius: 2px; }
.wiki-noresult { margin: 0; padding: 14px; color: var(--sand-ink-dim); }

/* ---------- the reading column ---------- */
.wiki-shell { padding: 70px 0 130px; }
.wiki-layout { max-width: 820px; }
.wiki-bar { position: sticky; top: 76px; z-index: 5; display: flex; margin-bottom: 26px; }
.wiki-drawer-btn { gap: 12px; background: var(--sand); }
.wiki-drawer-icon { display: grid; gap: 3px; width: 16px; }
.wiki-drawer-icon i { display: block; height: 2px; background: currentColor; border-radius: 1px; }
.wiki-drawer-icon i:nth-child(2) { width: 70%; }

.wiki-article { min-width: 0; }
.wiki-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font: 700 0.72rem var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text); }
.wiki-crumbs span { color: var(--sand-ink-dim); }
.wiki-body { color: #2c3a3c; font-size: 1.04rem; line-height: 1.78; }
.wiki-body h1 { font-size: clamp(2.6rem, 5vw, 3.6rem); color: var(--sand-ink); margin: 0 0 16px; }
.wiki-body h1 + p { font-size: 1.14rem; color: var(--sand-ink-dim); }
.wiki-body h2 { font-size: 2rem; color: var(--sand-ink); margin: 48px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--sand-line); scroll-margin-top: 140px; }
.wiki-body h3 { font-size: 1.45rem; color: var(--sand-ink); margin: 32px 0 8px; scroll-margin-top: 140px; }
.wiki-body p { margin: 0 0 16px; }
.wiki-body a { color: var(--gold-text); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(var(--gold-deep-rgb), 0.45); text-underline-offset: 3px; }
.wiki-body a:hover { color: var(--sand-ink); }
.wiki-body strong { color: var(--sand-ink); }
.wiki-body ul, .wiki-body ol { margin: 0 0 18px; padding-left: 22px; }
.wiki-body li { margin-bottom: 6px; }
.wiki-body ul { list-style: none; padding-left: 20px; }
.wiki-body ul > li { position: relative; }
.wiki-body ul > li::before { content: ""; position: absolute; left: -17px; top: 0.72em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.wiki-body ol li::marker { color: var(--gold-text); font-weight: 800; }
.wiki-body code { padding: 1px 6px; font: 0.88em ui-monospace, "Cascadia Code", Consolas, monospace; color: #6e2f1d; background: rgba(var(--gold-rgb), 0.14); border-radius: 3px; }
.wiki-body pre { padding: 16px 18px; overflow-x: auto; background: var(--deep); border-radius: 4px; }
.wiki-body pre code { padding: 0; background: none; color: var(--ink); }
.wiki-body kbd { padding: 1px 7px; font: 700 0.82em var(--font-body); border: 1px solid var(--sand-line); border-bottom-width: 2px; border-radius: 4px; background: var(--sand-card); }
.wiki-body img { max-width: 100%; height: auto; border-radius: 4px; }
.wiki-body hr { height: 1px; margin: 40px 0; border: none; background: linear-gradient(90deg, transparent, rgba(28, 43, 45, 0.3), transparent); }

.wiki-table { margin: 0 0 22px; overflow-x: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--sand-line); }
.wiki-body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.wiki-body th { padding: 12px 16px; text-align: left; font: 700 0.72rem var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-h1); background: var(--deep); }
.wiki-body td { padding: 12px 16px; border-top: 1px solid var(--sand-line); background: var(--sand-card); }
.wiki-body tr:nth-child(even) td { background: #f3ecdf; }
.wiki-body td img, .wiki-monogram { display: block; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--gold), 0 0 0 4px var(--sand-card), 0 0 0 5px rgba(28, 43, 45, 0.2); }
.wiki-monogram { display: inline-flex; align-items: center; justify-content: center; font: 700 1.3rem var(--font-display); color: var(--gold-h1); background: radial-gradient(circle at 40% 30%, #24507e, #081b30); }
.wiki-body td:first-child:has(img, .wiki-monogram) { width: 84px; }

.wiki-body blockquote { margin: 0 0 20px; padding: 14px 20px; border-left: 3px solid var(--gold); background: var(--sand-card); color: var(--sand-ink-dim); }
.wiki-callout { position: relative; padding: 16px 22px !important; border-radius: 0 6px 6px 0; }
.wiki-callout p:last-child { margin-bottom: 0; }
.wiki-callout-label { display: block; margin-bottom: 6px; font: 800 0.7rem var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; }
.wiki-callout--tip { border-left-color: var(--gold) !important; background: rgba(var(--gold-rgb), 0.12) !important; }
.wiki-callout--tip .wiki-callout-label { color: var(--gold-text); }
.wiki-callout--note { border-left-color: #3f7a80 !important; background: rgba(16, 38, 63, 0.08) !important; }
.wiki-callout--note .wiki-callout-label { color: #2d5f64; }
.wiki-callout--warning { border-left-color: #b4432a !important; background: rgba(180, 67, 42, 0.09) !important; }
.wiki-callout--warning .wiki-callout-label { color: #95321c; }
.wiki-callout--lore { border-left: none !important; background: var(--deep) !important; color: #d6dce8; font: italic 600 1.2rem/1.6 var(--font-display); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(var(--gold-h1-rgb), 0.3); }
.wiki-callout--lore .wiki-callout-label { color: var(--gold-h1); font-style: normal; }

.wiki-updated { margin: 36px 0 0; font-size: 0.82rem; color: var(--sand-ink-dim); }
.wiki-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 44px; }
.wiki-pager-link { --n: 10px; display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; font: 700 1.3rem var(--font-display); color: var(--sand-ink); background: var(--sand-card); transition: background-color 0.2s ease; -webkit-mask: radial-gradient(circle at 0 0, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 0 0 / 51% 51% no-repeat, radial-gradient(circle at 100% 0, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 100% 0 / 51% 51% no-repeat, radial-gradient(circle at 0 100%, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 0 100% / 51% 51% no-repeat, radial-gradient(circle at 100% 100%, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 100% 100% / 51% 51% no-repeat; mask: radial-gradient(circle at 0 0, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 0 0 / 51% 51% no-repeat, radial-gradient(circle at 100% 0, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 100% 0 / 51% 51% no-repeat, radial-gradient(circle at 0 100%, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 0 100% / 51% 51% no-repeat, radial-gradient(circle at 100% 100%, #0000 var(--n), #000 calc(var(--n) + 0.5px)) 100% 100% / 51% 51% no-repeat; }
.wiki-pager-link span { font: 700 0.68rem var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-text); }
.wiki-pager-link:hover { background: #fffaf2; }
.wiki-pager-next { text-align: right; }
.wiki-empty h1 { font-size: 2.2rem; color: var(--sand-ink); margin: 0 0 12px; }
.wiki-empty p { color: var(--sand-ink-dim); }

/* ---------- the drawer ---------- */
.wiki-drawer { position: fixed; inset: 0; z-index: 250; visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.45s; }
.wiki-drawer.is-open { visibility: visible; pointer-events: auto; transition: none; }
.wiki-drawer-backdrop { position: absolute; inset: 0; background: rgba(3, 18, 22, 0.62); opacity: 0; transition: opacity 0.35s ease; }
.wiki-drawer.is-open .wiki-drawer-backdrop { opacity: 1; }
.wiki-drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(380px, 88vw); overflow-y: auto; padding: 26px 30px 40px;
  background: var(--deep); color: var(--ink); box-shadow: 20px 0 50px rgba(0, 0, 0, 0.35);
  transform: translateX(-102%); transition: transform 0.45s var(--ease-out);
}
.wiki-drawer.is-open .wiki-drawer-panel { transform: none; }
.drawer-lock { overflow: hidden; }
.wiki-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.wiki-drawer-head .dl-close { position: static; }
.wiki-nav summary { display: none; }
.wiki-nav-group + .wiki-nav-group { margin-top: 24px; }
.wiki-nav h2 { margin: 0 0 8px; font: 700 0.72rem var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-h1); }
.wiki-nav ul { list-style: none; margin: 0; padding: 0; }
.wiki-nav a { position: relative; display: block; padding: 7px 0 7px 16px; font: 700 1.2rem var(--font-display); color: var(--ink-dim); transition: color 0.15s ease; }
.wiki-nav a:hover { color: var(--ink); }
.wiki-nav a.is-active { color: var(--ink); }
.wiki-nav a.is-active::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; background: var(--gold); transform: translateY(-50%) rotate(45deg); }
.wiki-toc:not(:empty) { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--panel-line); }
.wiki-toc h2 { margin: 0 0 8px; font: 700 0.72rem var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-h1); }
.wiki-toc ul { list-style: none; margin: 0; padding: 0; }
.wiki-toc a { display: block; padding: 5px 0; font-size: 0.9rem; color: var(--ink-dim); transition: color 0.15s ease; }
.wiki-toc .toc-h3 a { padding-left: 14px; font-size: 0.85rem; }
.wiki-toc a:hover, .wiki-toc a.is-active { color: var(--gold-light); }

@media (prefers-reduced-motion: reduce) {
  .wiki-drawer-panel, .wiki-drawer-backdrop { transition: none; }
}
@media (max-width: 640px) {
  .wiki-hero { padding: 110px 0 100px; }
  .wiki-search kbd { display: none; }
  .wiki-bar { top: 66px; }
  .wiki-pager { grid-template-columns: 1fr; }
}
