/* ===================================================================
   HELIX Design System — Layout Styles
   6 archétypes : centered, sidebar, retro, fullscreen, mobile, carousel
   =================================================================== */

/* -- Layout: Centered Card ----------------------------------------- */
.layout-centered {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

.centered-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* -- Layout: Sidebar + Main ---------------------------------------- */
.layout-sidebar {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  min-height: 100vh;
}

.sidebar-nav {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
}

.sidebar-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* -- Layout: 3-Column Retro ---------------------------------------- */
.layout-retro {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.retro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.retro-header__brand {
  flex-shrink: 0;
}

.retro-header__title h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.retro-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.retro-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  flex: 1;
  overflow: hidden;
}

.retro-brief {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.retro-main {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 24px;
}

.retro-sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}

.retro-input {
  padding: 12px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

/* -- Layout: Fullscreen App ---------------------------------------- */
.layout-fullscreen {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.fullscreen-topbar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.fullscreen-topbar__brand {
  flex-shrink: 0;
  margin-right: 16px;
}

.fullscreen-topbar__title {
  flex: 1;
}

.fullscreen-topbar__title h1 {
  font-size: 1rem;
  font-weight: 500;
}

.fullscreen-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fullscreen-body {
  flex: 1;
  overflow: hidden;
  display: flex;
}

/* -- Layout: Mobile Shell ------------------------------------------ */
.layout-mobile {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

.mobile-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mobile-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mobile-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.mobile-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* -- Layout: Carousel ---------------------------------------------- */
.layout-carousel {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  height: 100vh;
  overflow: hidden;
}

.carousel-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.carousel-track {
  flex: 1;
  display: flex;
  overflow: hidden;
  width: 100vw;
}

.carousel-track > * {
  min-width: 100vw;
  flex-shrink: 0;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px;
  flex-shrink: 0;
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.carousel-dot--active {
  background: var(--teal);
  transform: scale(1.3);
}

.carousel-actions {
  display: flex;
  gap: 8px;
}

/* -- Shared: HELIX back link --------------------------------------- */
.helix-back {
  color: var(--teal);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity var(--transition);
}

.helix-back:hover {
  opacity: 0.8;
}

/* -- Responsive: Retro → stacked on narrow screens ----------------- */
@media (max-width: 900px) {
  .retro-layout {
    grid-template-columns: 1fr;
  }
  .retro-brief,
  .retro-sidebar {
    display: none;
  }
}

/* -- Responsive: Sidebar → overlay on narrow screens --------------- */
@media (max-width: 768px) {
  .sidebar-nav {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: left var(--transition);
  }
  .sidebar-nav.open {
    left: 0;
  }
}
