/* Page shell: the header/main/footer skeleton every template extends via base.html. */
@layer layout {
  .page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-line);
  }

  .brand {
    font-size: var(--font-size-lg);
    font-weight: 700;
    text-decoration: none;
    color: var(--color-ink);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
  }

  .brand__logo {
    width: var(--size-brand-logo);
    height: var(--size-brand-logo);
  }

  /* Outer <main>: fills the flex column (header/main/footer), no width cap
     of its own — the landing page's wide sections (main_top block) and the
     narrow wizard/admin content (.page-main below) each set their own
     max-width inside it. */
  .page-main-shell {
    flex: 1;
    width: 100%;
  }

  .page-main {
    width: 100%;
    max-width: var(--content-max-width);
    margin-inline: auto;
    padding: var(--space-5);
  }

  /* Landing-only sections (hero, example gallery, style showcase — plan D27)
     that use the wider measure than the wizard below them (DESIGN.md). */
  .landing-wide {
    width: 100%;
    max-width: var(--content-max-width-wide);
    margin-inline: auto;
    padding-inline: var(--space-5);
  }

  .stack[data-gap="loose"] > * + * {
    margin-top: var(--space-8);
  }

  .page-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-line);
    font-size: var(--font-size-sm);
    color: var(--color-ink-soft);
  }

  /* Vertical rhythm between a page's top-level sections; not for spacing
     inside a component (that belongs in the component's own rule). */
  .stack > * + * {
    margin-top: var(--space-5);
  }

  /* Breakpoints are fixed values, not tokens: @media conditions can't read
     custom properties. 768px is this project's only breakpoint until the
     design pass (step 13) introduces more. */
  @media (min-width: 768px) {
    .page-main {
      padding: var(--space-6) var(--space-5);
    }
  }
}
