/* =========================================================
   layout-lorewalker.css
   Lorewalker Archives home + kingdom layout, nav, overlays
   ========================================================= */

/* Layout-scoped variables */
:root {
  --home-nav-width: 260px;
  --home-nav-border: rgba(255, 255, 255, 0.08);
  --home-nav-sub-border: rgba(255, 255, 255, 0.12);
}

/* =========================================
   Pillar Overlay (shared modal)
   ========================================= */

 [data-pillar-overlay] {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 4000;
}

[data-pillar-overlay].detail-hidden {
  display: none;
}

.pillar-overlay-backdrop {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
}

.pillar-overlay-inner {
  position: relative;
  width: min(960px, 100%);
  max-height: min(80vh, 620px);
  padding: 1.4rem 1.5rem;
  border-radius: 3px;
  background:
    radial-gradient(circle at 0 0, rgba(213, 128, 255, 0.14), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(95, 213, 178, 0.10), transparent 55%),
    #120d20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pillar-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.pillar-overlay-title {
  font-family: "Cinzel", "Georgia", serif;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5f0ff;
  margin-bottom: 0.2rem;
}

.pillar-overlay-subtitle {
  font-family: "Merriweather", "Georgia", serif;
  font-size: 0.85rem;
  color: rgba(229, 216, 255, 0.8);
}

/* Overlay header: keep title for accessibility, hide visually */
.pillar-overlay-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Subtitle not currently needed, hide completely */
.pillar-overlay-subtitle {
  display: none;
}

.pillar-overlay-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(4, 2, 12, 0.85);
  color: #f5f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.pillar-overlay-close-btn:hover {
  background: rgba(164, 82, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.pillar-overlay-body {
  flex: 1;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding-right: 0.3rem;
}

.pillar-overlay-body::-webkit-scrollbar {
  width: 6px;
}

.pillar-overlay-body::-webkit-scrollbar-track {
  background: rgba(5, 3, 12, 0.85);
}

.pillar-overlay-body::-webkit-scrollbar-thumb {
  background: rgba(213, 128, 255, 0.75);
  border-radius: 3px;
}

.pillar-overlay-footer-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: rgba(208, 197, 239, 0.78);
}

/* =========================================
   Home layout (Lorewalker Archives shell)
   ========================================= */

/* Root shell around the whole home view inside page shell */
.home-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.75rem 1.75rem 3.25rem;
  border-radius: 3px;
}

/* Hero section */
.home-hero {
  margin-bottom: 1.75rem;
  padding-top: 0.25rem;
}

.home-title {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.4rem 0;
}

.home-lede {
  margin: 0 0 1.25rem 0;
  color: var(--rhome-text-muted);
  max-width: 48rem;
  font-size: 0.96rem;
  line-height: 1.5;
}

.home-divider {
  border: 0;
  border-top: 1px solid var(--hero-accent, var(--shell-border));
  margin: 0 0 1.5rem 0;
}

/* =========================================
   Layout – nav + grid
   ========================================= */

.home-layout {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.home-content {
  position: relative;
  background: rgba(15, 10, 26, 0.94);
  border-radius: 3px;
  padding: 1.75rem 2rem 2.4rem;
  box-shadow:
    0 0.9rem 2.4rem rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(0, 0, 0, 0.75);
  border: 1px solid var(--shell-border, rgba(164, 82, 255, 0.4));
}

.home-banner {
  height: 120px;
  border-radius: 3px;
  margin-bottom: 1.25rem;
  background: radial-gradient(circle at top left,
              var(--shell-glow, rgba(164, 82, 255, 0.25)),
              rgba(7, 5, 16, 0.95));
  position: relative;
  overflow: hidden;
}

.lw-banner {
  margin-bottom: 0.75rem;
}

.home-nav {
  margin: 0 0 1rem 0;
  margin-bottom: 1rem;
}

.home-nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0;
  margin: 0;
}

.home-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  line-height: 1.2;
  border-radius: 3px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;

  color: var(--rhome-text-muted);
  border: 1px solid transparent;
  background: transparent;

  transition:
    color 120ms ease-out,
    border-color 120ms ease-out,
    background-color 120ms ease-out;
}

.home-nav-link:hover {
  color: var(--rhome-parchment);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(42, 31, 60, 0.7);
}

.home-nav-link.is-active,
.home-nav-link.is-ancestor {
  border-radius: 3px;
  border: 1px solid var(--nav-active-border, rgba(164, 82, 255, 0.4));
  background: var(--nav-active-bg, rgba(42, 31, 60, 0.85));
  color: var(--nav-active-text, var(--rhome-parchment));
}

.lw-breadcrumbs li::after {
  content: "›";
  opacity: 0.5;
  margin-left: 0.35rem;
}

.lw-breadcrumbs li:last-child::after {
  content: "";
}

.lw-breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.home-nav .lw-breadcrumbs {
  width: 100%;
  align-items: center;
}

.lw-breadcrumbs a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.lw-breadcrumbs a:hover {
  border-bottom-color: currentColor;
}

.lw-breadcrumbs li[aria-current="page"] {
  opacity: 0.9;
  font-weight: 600;
}

/* =========================================
   Sibling Sub-Navigation
   ========================================= */

.home-subnav {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--lw-font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-subnav-link {
  text-decoration: none;
  opacity: 0.8;
  border-bottom: 1px solid transparent;
}

.home-subnav-link:hover {
  opacity: 1;
  border-bottom-color: currentColor;
}

.home-subnav-link.is-active {
  opacity: 1;
  font-weight: 600;
  border-bottom-color: currentColor;
}

.home-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.home-nav-primary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.home-nav-secondary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .home-nav-secondary {
    flex-wrap: wrap;
    white-space: normal;
  }
}

.home-nav-item {
  margin: 0;
}

.home-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  line-height: 1.2;
  border-radius: 3px;
  text-decoration: none;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
  font-size: 0.82rem;
  color: var(--home-muted);
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.home-nav-link.nav-root {
  border-radius: 3px;
  border: 1px solid var(--home-accent);
  color: var(--home-accent);
}

.home-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--home-text);
}

.home-nav-pill {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--home-muted);
}

.home-nav-link.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--home-accent);
}

.home-nav-link.is-ancestor {
  background: rgba(255, 255, 255, 0.04);
}

.home-nav-toggle {
  display: none; /* placeholder for future mobile */
}

/* Subnav (child links under an ancestor) */
.home-nav-sub {
  list-style: none;
  margin: 0.15rem 0 0.45rem 0.35rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--home-nav-sub-border);
}

.home-nav-sub-item {
  margin: 0.05rem 0;
}

.home-nav-sub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
  font-size: 0.8rem;
  color: var(--home-muted);
  padding: 0.15rem 0;
}

.home-nav-sub-link:hover {
  color: var(--home-text);
}

@media (max-width: 960px) {
  .home-nav {
    position: relative;
    top: 0;
    width: 100%;
    min-width: 0;
  }
}

/* Right grid column */
.home-grid-shell {
  margin-top: var(--lw-space-3, 0.75rem);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--lw-space-6, 1.5rem);
}

.home-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.home-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  padding: var(--lw-space-4, 1rem);
  border-radius: 3px;

  background: var(--home-card, var(--rhome-surface));
  box-shadow: 0 0.15rem 0.4rem rgba(0, 0, 0, 0.7);

  text-decoration: none;
  color: inherit;
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));

  transition:
    transform 120ms ease-out,
    box-shadow 120ms ease-out,
    border-color 120ms ease-out,
    background-color 120ms ease-out;
}

.home-card:hover,
.home-card:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.6rem rgba(0, 0, 0, 0.9);
  border-color: var(--card-border, rgba(164, 82, 255, 0.7));
  outline: none;
  background: var(--rhome-surface-soft);
}

.home-card-title,
.home-card > h2 {
  display: inline-flex;
  align-items: center;

  padding: 0.25rem 0.75rem;
  border-radius: 3px; /* 1px radius as agreed */

  background: var(--card-accent-bg, var(--rhome-surface-contrast));
  color: var(--card-accent-text, var(--rhome-parchment));

  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;

  margin: 0 0 0.75rem 0;
}

.home-card-summary {
  margin: 0 0 0.75rem 0;
  color: var(--rhome-text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.home-cta {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rhome-primary);
}

.home-cta::after {
  content: " ↗";
  opacity: 0.7;
  font-size: 0.75rem;
}

.home-card:hover .home-cta {
  color: #e6b5ff;
}

/* =========================================
   Kingdom view tweaks
   ========================================= */

/* =========================================
   Home pills (neutral base)
   ========================================= */

/* Container for multiple pills (optional) */
.home-pill-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

/* Clean, minimal pill label: no background oval */
.home-pill {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.22rem 0.5rem;
  border-radius: 3px;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--home-muted);
}

/* Color accents for generic home usage.
   On kingdom-specific pages, theme-kingdom.css overrides these. */
.home-pill.gold {
  color: #f1d48a;
}

.home-pill.mint {
  color: #88e0c0;
}

.home-pill.lilac {
  color: #d5b1ff;
}

.home-pill.amber {
  color: #ffbe7a;
}

/* =========================================
   Content list bullets (Lorewalker default)
   ========================================= */

/* Scope: only lists inside home/overview content, not nav lists */
body.lw-site .lw-card ul,
body.lw-site .home-card ul,
body.lw-site .kingdom-overview ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

body.lw-site .lw-card ul li,
body.lw-site .home-card ul li,
body.lw-site .kingdom-overview ul li {
  position: relative;
  padding-left: 1.35rem;   /* room for custom bullet */
  margin-bottom: 0.25rem;
}

body.lw-site .lw-card ul li::before,
body.lw-site .home-card ul li::before,
body.lw-site .kingdom-overview ul li::before {
  content: "◆";            /* Lorewalker-wide default symbol */
  position: absolute;
  left: 0;
  top: 0.4em;
  font-size: 0.65rem;
  line-height: 1;
  color: var(--home-accent);
  text-shadow: 0 0 4px rgba(164, 82, 255, 0.45);
}

/* =========================================
   NPC Layout / Tag Styles
   ========================================= */

.npc-shell {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 3px;
  background: var(--npc-surface, var(--rhome-surface-soft));
  border: 1px solid var(--npc-border, rgba(255, 255, 255, 0.16));
  box-shadow: 0 0.7rem 1.8rem rgba(0, 0, 0, 0.9);
}

.npc-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.npc-name-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  background: var(--npc-pill-bg, var(--rhome-surface-contrast));
  color: var(--npc-pill-text, var(--rhome-parchment));
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.npc-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.npc-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--rhome-text-muted);
}

.npc-body {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--rhome-text-main);
}

.npc-tags {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.npc-tag {
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--npc-tag-text, var(--rhome-parchment));
  background: var(--npc-tag-bg, transparent);
}

.npc-aside {
  font-size: 0.85rem;
  color: var(--rhome-text-muted);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 1rem;
}
