/* ==========================================================================
   Main Layout & Editorial Viewport Architecture
   ========================================================================== */

html, body {
  min-height: 100vh;
  width: 100%;
  position: static;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
}

/* Application Stage (takes all remaining viewport space beneath header) */
.app-stage {
  flex: 1;
  width: 100%;
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  flex-direction: column;
  position: relative;
}

.container-app {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* App Views (Hero and Facet Pages) */
.app-view {
  width: 100%;
  min-height: calc(100vh - var(--navbar-height));
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding-block: var(--space-8);
}

.app-view.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .container-app {
    padding-inline: var(--space-4);
    padding-block: var(--space-4);
  }

  .app-view {
    padding-block: var(--space-4);
  }
}

/* Accessibility: Visually Hidden but Screen-Reader Accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Accessible Skip Link */
.skip-to-content {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 9999;
  background: var(--color-accent-black);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--transition-fast);
}

.skip-to-content:focus {
  transform: translateY(0);
}

