/* ============================================
   Birkly Admin — Main content area (P56)
   ============================================ */

.main-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
  padding: var(--gutter);
  background: var(--bg);
  overflow-x: clip;
  overflow-y: visible;
}

/* Wide page children must not stretch the shell */
.main-content > * {
  max-width: 100%;
  min-width: 0;
}

.content-wrapper {
  width: 100%;
  min-width: 0;
  max-width: var(--page-max);
}

/* ============================================
   Section — a titled block inside a page
   ============================================ */
.section {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  min-width: 0;
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-width: 0;
}

.section__header h2 {
  margin: 0;
  font-size: var(--size-title-l);
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.section__body { min-width: 0; }

/* ============================================
   Vertical stack of panels — the default page body shape.
   Settings, account and the redirects panel all use this.
   ============================================ */
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  min-width: 0;
}

/* ============================================
   Editor layout — main column + aside
   ============================================ */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-6);
  align-items: start;
  min-width: 0;
}

.editor-main,
.editor-sidebar { min-width: 0; }

@media (min-width: 1024px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); }
}

@media (min-width: 1440px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
}

/* ============================================
   Plugin page — same chrome as a core page (brief §8.3)
   ============================================ */
.plugin-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  max-width: var(--page-max);
}
