/* static/css/02_shell.css
   Chrome layout only.
   Owns:
   - app shell layout
   - topbar container geometry
   - sidebar geometry
   - main content layout
   - right feed drawer geometry

   DOES NOT own button/icon/card styling.
*/

:root {
  --nav-h: 56px;
  --sidebar-w: 260px;
  --content-pad: 18px;
}

/* layout safety */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; }

/* App shell: column (topbar + body) */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

/* Topbar shell container */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;

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

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

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

  background: linear-gradient(180deg, var(--bg-elevated), var(--surface));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

/* Under the fixed topbar */
.shell-body {
  flex: 1;
  display: flex;
  align-items: stretch;
  padding-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
}

/* Sidebar: pinned under nav */
.shell-body > .sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);

  height: calc(100vh - var(--nav-h));
  position: sticky;
  top: var(--nav-h);
  overflow: auto;

  padding: 12px 8px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

/* Main content */
.shell-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--content-pad);
}

/* 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) {
  .shell-body {
    display: block;
    padding-top: var(--nav-h);
  }

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

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