/* static/css/02_shell.css
   Chrome layout only.
   Wiki-style Akoma shell: fixed left rail, compact top search bar,
   dark glass surfaces, and a soft green page glow.
*/

:root {
  --nav-h: 50px;
  --sidebar-w: 244px;
  --content-pad: 44px;

  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius: 7px;
  --radius-lg: 10px;
}

/* layout safety */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(900px 380px at 52% 0%, var(--wiki-glow), transparent 68%),
    linear-gradient(180deg, #151916 0%, var(--bg) 26%, var(--bg) 100%);
}

/* App shell: fixed sidebar + topbar + content */
.shell {
  min-height: 100vh;
  background:
    radial-gradient(860px 340px at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 68%),
    linear-gradient(180deg, rgba(255,255,255,0.012), transparent 160px),
    var(--bg);
  color: var(--text);
}

/* Topbar shell container */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;

  height: var(--nav-h);
  z-index: 2500;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 0 28px;
  box-sizing: border-box;

  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

/* Akoma logo / brand lives in the left rail, like a wiki skin. */
.topbar__brandwrap {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2600;

  width: var(--sidebar-w);
  height: var(--nav-h);

  display: flex;
  align-items: center;
  padding: 0 14px;
  overflow: hidden;

  background: linear-gradient(180deg, #15181b, #121417);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.topbar__brand {
  height: var(--nav-h);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  overflow: visible;
}

.topbar__logo {
  width: 132px;
  height: 44px;
  display: block;
  object-fit: contain;
  object-position: left center;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

/* Under the fixed topbar */
.shell-body {
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* Sidebar: pinned left rail under the brand */
.shell-body > .sidebar {
  position: fixed;
  top: var(--nav-h);
  bottom: 0;
  left: 0;
  z-index: 1200;

  width: var(--sidebar-w);
  height: auto;
  overflow: auto;

  padding: 14px 10px 28px;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, #14171a 0%, #111315 100%);
  scrollbar-color: var(--surface-2) transparent;
}

/* Main content */
.shell-main {
  min-width: 0;
  margin-left: var(--sidebar-w);
  padding: 58px var(--content-pad) 88px;
}

/* topbar utility slots */
.topbar__spacer {
  margin-left: auto;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.topbar__right > * {
  flex: 0 0 auto;
}

/* accessibility helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* -------------------- Right feed drawer -------------------- */

.feed-panel-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.feed-panel {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  width: min(360px, 92vw);
  height: calc(100vh - var(--nav-h));
  transform: translateX(100%);
  transition: transform 180ms ease;
  z-index: 41;
  pointer-events: none;
}

.feed-panel--open {
  transform: translateX(0);
  pointer-events: auto;
}

.feed-panel--closed {
  transform: translateX(100%);
  pointer-events: none;
}

.feed-panel__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elevated), var(--surface));
}

.feed-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.feed-panel__title {
  margin: 0;
}

.feed-panel__subtitle {
  margin: var(--space-1) 0 0;
}

.feed-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--space-4);
}

/* Mobile: sidebar becomes top section */
@media (max-width: 900px) {
  :root {
    --nav-h: 56px;
    --sidebar-w: 100%;
    --content-pad: 18px;
  }

  .topbar {
    left: 0;
    padding: 0 14px;
  }

  .topbar__brandwrap {
    position: relative;
    width: auto;
    height: var(--nav-h);
    padding: 0;
    border: 0;
    background: transparent;
  }

  .topbar__brand {
    width: 80px;
  }

  .topbar__logo {
    width: 72px;
    height: 40px;
  }

  .shell-body {
    display: block;
    padding-top: var(--nav-h);
  }

  .shell-body > .sidebar {
    width: 100%;
    position: relative;
    top: 0;
    bottom: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .shell-main {
    margin-left: 0;
    padding: 22px var(--content-pad) 48px;
  }

  .feed-panel {
    width: min(100vw, 420px);
  }
}
