/* ============================================================
   SPAXZYTE - SHARED THEME STYLESHEET
   Edit this single file to update ALL pages site-wide.

   Layout model
     - Wide screens (>= 1280px): the navigation panel is always
       visible. There is no retract control at all.
     - Narrower screens: the top bar shows the brand emblem and a
       menu toggle; the panel slides in over the page.
     - Pages are normally full-page embeds, so the content area is
       never boxed into a fixed-width column.

   Surfaces
     - Panel: always light brand blue (#b5dfff), near-black text.
     - Content: follows the theme, dark by default.
   Typeface: Open Sans, the face used by the brand reference.
   ============================================================ */

:root {
  /* --- navigation panel (theme independent) --- */
  --panel-bg:        #b5dfff;
  --panel-text:      #1c1c1c;
  --panel-active:    #0d5c93;
  --panel-text-dim:  #4a6b85;
  --panel-divider:   rgba(28, 28, 28, 0.14);

  --accent:          #3a96dd;
  --accent-soft:     rgba(58, 150, 221, 0.14);

  /* --- content area --- */
  --bg:              #0a0a0a;
  --bg-alt:          #141414;
  --bg-card:         #1a1a1a;
  --border:          #262626;
  --border-light:    #404040;
  --text:            #ffffff;
  --text-muted:      #a3a3a3;
  --text-dim:        #737373;

  --sidebar-w:       300px;
  --panel-pad-x:     32px;
  --topbar-h:        68px;
  --ease:            cubic-bezier(0.16, 1, 0.3, 1);
}

html.light {
  --bg:              #ffffff;
  --bg-alt:          #f5f5f5;
  --bg-card:         #f5f5f5;
  --border:          #e5e5e5;
  --border-light:    #d4d4d4;
  --text:            #0a0a0a;
  --text-muted:      #525252;
  --text-dim:        #737373;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   TOP BAR - only exists below the wide breakpoint.
   Holds the brand emblem (a home link) and the menu toggle.
   ============================================================ */
.mobile-topbar { display: none; }

.topbar-left {
  display: flex;
  align-items: center;
}

/* --- brand emblem: white on the dark theme, blue on the light one,
       cross-fading on hover so either reads on either surface --- */
.topbar-logo {
  position: relative;
  display: block;
  width: 40px;
  height: 40px;
  margin-right: 14px;
  flex-shrink: 0;
  text-decoration: none;
  transform-origin: center;
  transition: transform 0.28s var(--ease), opacity 0.24s ease,
              width 0.34s var(--ease), margin-right 0.34s var(--ease);
}
.topbar-logo:hover { transform: scale(1.14); }

.topbar-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s var(--ease);
}
.topbar-logo .logo-for-dark  { opacity: 1; }
.topbar-logo .logo-for-light { opacity: 0; }

.topbar-logo:hover .logo-for-dark  { opacity: 0; }
.topbar-logo:hover .logo-for-light { opacity: 1; }

html.light .topbar-logo .logo-for-dark  { opacity: 0; }
html.light .topbar-logo .logo-for-light { opacity: 1; }
html.light .topbar-logo:hover .logo-for-dark  { opacity: 1; }
html.light .topbar-logo:hover .logo-for-light { opacity: 0; }

/* --- menu toggle: transparent, swells and recolours on hover --- */
.nav-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transform-origin: center;
  transition: transform 0.28s var(--ease), color 0.22s ease;
}
.nav-toggle:hover {
  transform: scale(1.16);
  color: var(--accent);
}
.nav-toggle svg { display: block; }

/* the three bars fold into a close cross while the panel is open */
.nav-toggle .bar {
  transform-box: view-box;
  transform-origin: 50% 50%;
  transition: transform 0.32s var(--ease), opacity 0.18s ease;
}
html.nav-open .nav-toggle .bar-1 { transform: translateY(6px) rotate(45deg); }
html.nav-open .nav-toggle .bar-2 { opacity: 0; }
html.nav-open .nav-toggle .bar-3 { transform: translateY(-6px) rotate(-45deg); }

/* while the panel is open the toggle sits on the blue panel, so it
   borrows the panel palette to stay legible */
html.nav-open .nav-toggle { color: var(--panel-text); }

/* the emblem gives way to the panel's own wordmark when the panel is open,
   collapsing its space so the toggle slides to the edge the panel came from */
html.nav-open .topbar-logo {
  opacity: 0;
  pointer-events: none;
  width: 0;
  margin-right: 0;
  transform: scale(0.85);
}

/* ============================================================
   NAVIGATION PANEL
   ============================================================ */
.app-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  background: var(--panel-bg);
  color: var(--panel-text);
  padding: 32px var(--panel-pad-x) 24px;
  z-index: 100;
  overflow-y: auto;
  /* the hover swell must never open a horizontal scrollbar */
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.app-sidebar::-webkit-scrollbar { width: 8px; }
.app-sidebar::-webkit-scrollbar-track { background: transparent; }
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(28, 28, 28, 0.18);
  border-radius: 8px;
}
.app-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(28, 28, 28, 0.32); }

/* --- brand: the LL PRIME wordmark, linked home --- */
.brand-logo {
  display: block;
  text-decoration: none;
  color: var(--panel-text);
  transition: opacity 0.22s ease;
}
.brand-logo:hover { opacity: 0.78; }

/* LL PRIME carries 3.64% transparent padding on its left edge, which would
   leave the wordmark sitting right of the nav column. Pull it back so the
   first glyph lines up with the menu text. */
.brand-wordmark {
  display: block;
  width: 100%;
  max-width: 190px;
  height: auto;
  margin-left: -7px;
}

/* One rhythm for the whole panel: a single --nav-gap drives the list, and the
   space above the first item is the only place that differs. */
.sidebar-header { margin-bottom: 36px; }

.sidebar-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.sidebar-nav-item {
  /* block + fit-content keeps every row exactly one line box tall, so the
     list pitch is identical whether the row is a link or the group toggle */
  display: block;
  width: fit-content;
  max-width: 100%;
  color: var(--panel-text);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.014em;
  text-transform: uppercase;
  /* long labels ellipsise rather than wrap; the full text stays in the title attribute */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* grows from the left edge so the swell never looks like it is drifting */
  transform-origin: left center;
  transition: color 0.2s ease, transform 0.26s var(--ease), font-weight 0.2s ease;
}

.sidebar-nav-item:hover {
  color: var(--accent);
  transform: scale(1.055);
}

/* the highlight is the text itself - no underline, no marker element */
.sidebar-nav-item.active {
  color: var(--panel-active);
  font-weight: 700;
}

/* --- collapsible directory group: chevron outdented to the left --- */
.nav-group { position: relative; }

.nav-group-toggle {
  position: relative;
  /* matches .sidebar-nav-item exactly, so both rows measure identically */
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--panel-text);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.014em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transform-origin: left center;
  transition: color 0.2s ease, transform 0.26s var(--ease);
}
.nav-group-toggle:hover {
  color: var(--accent);
  transform: scale(1.055);
}
/* the group only borrows the active look when one of its children is current */
.nav-group-toggle.has-active {
  color: var(--panel-active);
  font-weight: 700;
}

.nav-chev {
  position: absolute;
  left: -19px;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  transition: transform 0.28s var(--ease);
}
.nav-group-toggle[aria-expanded="true"] .nav-chev { transform: translateY(-50%) rotate(180deg); }

/* --- sub pages ---
   The gap above the sub-list lives on an element inside the clipped box, so a
   closed group stays exactly 0px tall and never doubles the list gap. */
.nav-sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--ease);
}
.nav-sub.open { grid-template-rows: 1fr; }
.nav-sub-inner { overflow: hidden; min-height: 0; }

.nav-sublinks {
  padding-top: 15px;
  padding-left: 15px;
  gap: 12px;
}

.nav-subitem {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.014em;
}
.nav-subitem.active { font-weight: 700; }

/* --- panel footer --- */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--panel-divider);
}

.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid var(--panel-divider);
  color: var(--panel-text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.22s var(--ease);
}
.sidebar-theme-toggle:hover { background: rgba(255, 255, 255, 0.68); transform: translateY(-1px); }

.sidebar-note {
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  color: var(--panel-text-dim);
  text-align: center;
  text-transform: uppercase;
}

/* --- scrim, narrow screens only --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ============================================================
   CONTENT COLUMN - full page, never boxed
   ============================================================ */
.app-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 26px 34px 30px;
  gap: 14px;
}

.breadcrumb {
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .crumb-sep { padding: 0 8px; opacity: 0.5; }
.breadcrumb .crumb-current { color: var(--text-muted); }

.page-title {
  font-size: 1.35rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ------------------------------------------------------------
   EMBED SLOT - fills the remaining height, because pages are
   normally full-page embeds. Set data-embed-type="url" or "html"
   once the block is filled in and the dashed styling drops away.
   ------------------------------------------------------------ */
.embed-slot {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 420px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.embed-slot.empty { border: 1px dashed var(--border-light); }

.slot-label {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 0 20px;
}

.slot-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  text-align: center;
}
.slot-stack .slot-label { padding: 0; }

.embed-slot:not(.empty) {
  display: block;
  background: #000000;
  border-style: solid;
}

/* Positioned rather than relying on height:100%. A percentage height does not
   reliably resolve against a flex-sized parent, and the iframe then silently
   falls back to the browser default of 150px tall. */
.embed-slot iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ------------------------------------------------------------
   FULL-BLEED PAGES
   When a page carries an embed, the embed IS the page: no
   breadcrumb, no heading, no footer, no padding, no frame.
   The heading and breadcrumb stay in the document so screen
   readers and search engines still get them, but they are taken
   out of the visual flow entirely.
   ------------------------------------------------------------ */
body.has-embed .page-body {
  padding: 0;
  gap: 0;
}

body.has-embed .breadcrumb,
body.has-embed .page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body.has-embed .site-footer { display: none; }

body.has-embed .embed-slot {
  border: 0;
  border-radius: 0;
  min-height: 0;
}

body.has-embed .embed-slot iframe { min-height: 0; }

/* ============================================================
   SHARED BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.btn:hover { border-color: var(--border-light); }
.btn-accent { border-color: var(--accent); color: var(--accent); }
.btn-accent:hover { background: var(--accent-soft); }

/* ============================================================
   SHARED FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 34px;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ============================================================
   RESPONSIVE
   Wider than the breakpoint: the panel simply lives in the flow.
   At and below it: the panel leaves, the top bar arrives.
   ============================================================ */
@media (max-width: 1279px) {
  body { flex-direction: column; }

  .mobile-topbar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    padding: 0 18px;
    align-items: center;
    background: transparent;
    z-index: 300;
    pointer-events: none;
    transition: padding-left 0.34s var(--ease);
  }
  .mobile-topbar .topbar-left { pointer-events: auto; }

  /* the toggle lands exactly where the panel's own content begins */
  html.nav-open .mobile-topbar { padding-left: var(--panel-pad-x); }

  .app-main { padding-top: var(--topbar-h); }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    padding-top: calc(var(--topbar-h) + 6px);
    transform: translateX(-100%);
    transition: transform 0.38s var(--ease);
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.28);
    z-index: 200;
  }
  .app-sidebar.open { transform: none; }

  .sidebar-overlay { display: block; }
  .sidebar-overlay.active { opacity: 1; pointer-events: auto; }

  .page-body { padding: 18px 18px 24px; }
  .page-title { font-size: 1.15rem; }
  .embed-slot { min-height: 320px; }
  .site-footer { padding: 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
