/* Single-column layout for Resources page
   This file scopes layout overrides to pages with class `aidc-resources-page`.
   It hides left panels and expands main content to full width while keeping
   a comfortable max-width for content.
*/

/* Ensure root flex column for sticky footer if page wrapper uses aidc-resources-page */
.aidc-resources-page body {
  min-height: calc(100vh / var(--zoom, 1));
}

/* Force main grid to a single column on Resources page */
.aidc-resources-page .main {
  grid-template-columns: 1fr !important;
}

/* Hide left navigation/filters for desktop resources view */
.aidc-resources-page .panel--left,
.aidc-resources-page .panel--center:nth-child(1),
.aidc-resources-page .rv2-sidebar,
.aidc-resources-page .tree-panel,
.aidc-resources-page .project-tree {
  display: none !important;
}

/* Expand center/main panel to use full width */
.aidc-resources-page .panel--center,
.aidc-resources-page .panel--right,
.aidc-resources-page main.aidc-layout,
.aidc-resources-page .rv2-layout {
  width: 100%;
  max-width: none; /* allow container to span full available width (gutters handled by rv2-layout padding) */
  margin: 0; /* align to viewport edges (padding on rv2-layout keeps 16px gutters) */
}

/* Horizontal padding: handled by #app — no additional gutters needed here. */
.aidc-resources-page main.rv2-layout {
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-width: 0; /* allow children to shrink correctly inside flex */
}

/* Slight padding adjustments for resources topbar & main area */
.aidc-resources-page .rv2-main {
  padding-left: 0;
  padding-right: 0;
}

/* Make the main panel the flex host for .aidc-scroll which handles actual scrolling.
   rv2-main itself must NOT overflow — scroll is delegated to .aidc-scroll child. */
.aidc-resources-page .rv2-main {
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0; /* footer is flex-pushed, no fixed-footer offset needed */
  min-height: 0; /* allow flex child to shrink so overflow works */
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* scroll is handled by .aidc-scroll inside */
}

/* Keep footer at bottom: anchor site root to column layout
   (#app height/min-height/overflow are set in resources.css to avoid cascade conflicts) */
.aidc-resources-page #app {
  display: flex;
  flex-direction: column;
}
/* .shell is flex column — .rv2-root must consume remaining space so footer
   stays at the bottom even when content is short. */
.aidc-resources-page .shell {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;          /* fill parent exactly — critical for footer sticking */
  padding-bottom: 0; /* remove default 26px to let footer sit flush */
  overflow: hidden;   /* prevent shell from overflowing — scroll is in .aidc-scroll */
}
.aidc-resources-page .rv2-root {
  flex: 1 1 0%;       /* grow to fill, basis 0 prevents content-based sizing */
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* Footer: pushed to bottom via flex layout.
   IMPORTANT: position:fixed does NOT work correctly on this page because
   core.css sets `html { zoom: 0.85 }` which creates a containing block in
   Chrome — making fixed elements anchor to the <html> box, not the viewport.
   Instead we rely on the flex chain: body > #app > .shell (flex-column) >
   [rv2-root flex:1] + [footer-wrapper flex-shrink:0]. */
.aidc-resources-page .shell > [data-include*="footer"] {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0 18px;
  background: var(--bg, #07040a);
  z-index: 100;
  position: relative;
}
.aidc-resources-page footer.footer {
  flex-shrink: 0;
  margin-top: 0;
}

/* Mobile: show sidebar as collapsible via existing controls (do not force hide) */
@media (max-width: 900px) {
  .aidc-resources-page .panel--left,
  .aidc-resources-page .rv2-sidebar { display: block !important; }
}
