/*
  Tab 07 — Stacked Layer Tabs — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy index.html,
  this file, and script.js into any project as-is.
*/

:root {
  --card-accent: #39ff14;
  --card-fg: oklch(0.24 0.02 60);
  --card-muted: oklch(0.52 0.02 60);
  --card-border: oklch(0.86 0.02 60);
  --card-paper: oklch(0.97 0.015 75);
  --card-paper-muted: oklch(0.9 0.018 70);
}

.deck-tabs {
  container-type: inline-size;
  width: 100%;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.deck-tabs__deck {
  display: flex;
}

.deck-tabs__tab {
  --offset: 4px;
  position: relative;
  border: none;
  border-radius: 0.75rem 0.75rem 0 0;
  background-color: var(--card-paper-muted);
  padding: 0.625rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--card-muted);
  cursor: pointer;
  outline: none;
  transform: translateY(calc(var(--depth) * var(--offset)));
  box-shadow: 0 calc(2px + var(--depth) * 1px) 10px -6px oklch(0.24 0.02 60 / calc(30% - var(--depth) * 8%));
  transition:
    transform 220ms cubic-bezier(0.32, 0.72, 0, 1),
    background-color 200ms ease-out,
    color 200ms ease-out,
    box-shadow 220ms ease-out;
}

.deck-tabs__tab + .deck-tabs__tab {
  margin-left: -0.5rem;
}

.deck-tabs__tab:hover {
  color: var(--card-fg);
}

.deck-tabs__tab--active {
  background-color: var(--card-paper);
  color: var(--card-fg);
}

.deck-tabs__tab:focus-visible {
  outline: 2px solid var(--card-accent);
  outline-offset: 2px;
}

/* Narrow widths: compress the fan to a smaller residual offset rather
   than flattening the deck concept away entirely. */
@container (max-width: 22rem) {
  .deck-tabs__tab {
    --offset: 2px;
  }

  .deck-tabs__tab + .deck-tabs__tab {
    margin-left: -0.25rem;
  }
}

.deck-tabs__stage {
  position: relative;
  border-radius: 0 0.75rem 0.75rem 0.75rem;
  background-color: var(--card-paper);
  padding: 1.25rem;
}

.deck-tabs__panel {
  display: flex;
  min-height: 13rem;
  align-items: center;
  justify-content: center;
  animation: deck-tabs-panel-in 260ms ease-out both;
}

/* An author-origin `display` declaration always beats the UA stylesheet's
   `[hidden]{display:none}`, regardless of specificity — an explicit
   override is required whenever a panel sets its own `display`. */
.deck-tabs__panel[hidden] {
  display: none;
}

@keyframes deck-tabs-panel-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.deck-tabs__panel img {
  max-height: 13rem;
  width: 100%;
  border-radius: 0.5rem;
  object-fit: cover;
}

.deck-tabs__panel pre {
  margin: 0;
  width: 100%;
  overflow-x: auto;
  border-radius: 0.5rem;
  background-color: oklch(0.145 0 0);
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: oklch(0.85 0 0);
}

.deck-tabs__specs {
  margin: 0;
  width: 100%;
}

.deck-tabs__specs > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.625rem;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
}

.deck-tabs__specs dt {
  color: var(--card-muted);
}

.deck-tabs__specs dd {
  margin: 0;
  font-weight: 500;
  color: var(--card-fg);
}

@media (prefers-reduced-motion: reduce) {
  .deck-tabs__tab {
    transition: none;
  }

  .deck-tabs__panel {
    animation: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, oklch(0.94 0.02 75), oklch(0.9 0.02 70));
}
.tab07-layout {
  display: flex;
  min-height: 18rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2.5rem;
}
.tab07-layout__panel {
  width: 100%;
  max-width: 26rem;
}
