/* ==========================================================================
   specs.css — tech-specs panels, tabs and photo
   Split out of the original components.css; load order is preserved
   exactly, because several rules here depend on source order.
   ========================================================================== */

/* ---- Tech specs (three states, Figma 636:1899 / 2029 / 2049) ----
   One row: collapsed tabs, the shared photo, then the expanded panel.
   main.js sets `order` so the photo always sits right before the open panel. */
.specs-photo {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--specs-h);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  background: var(--grey-050);
  overflow: hidden;
}
.specs-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* fill, never letterboxed */
}

.spec-item {
  position: relative;
  flex: 0 0 80px;                 /* collapsed tab */
  height: var(--specs-h);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  background: var(--white);
  overflow: hidden;
  transition:
    flex-basis 1s cubic-bezier(0.32, 0, 0.12, 1),   /* soft, unhurried */
    background 0.6s var(--ease);
}
.spec-item.is-active {
  flex: 0 0 424px;                /* expanded panel */
  background: var(--grey-050);
  border-radius: var(--radius-lg);
}
.spec-item:not(.is-active):hover { background: var(--grey-050); }

/* Head — the whole tab is the hit area when collapsed */
.spec-head {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  text-align: left;
  padding: 27px;
}
.spec-num {
  position: absolute;
  top: 27px;
  font-size: 32px;
  color: var(--grey-300);
  transition: all 0.4s var(--ease);
}
.spec-name {
  position: absolute;
  font-size: 24px;
  transition: font-size 0.6s var(--ease), transform 0.6s var(--ease);
  color: var(--black);
  text-transform: capitalize;
  white-space: nowrap;
  transition: font-size 0.4s var(--ease);
}

/* Collapsed: number centred at top, label rotated up from the bottom */
.spec-item:not(.is-active) .spec-num {
  left: 50%;
  transform: translateX(-50%);
}
.spec-item:not(.is-active) .spec-name {
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
  writing-mode: vertical-rl;
}

/* Expanded: title left, number right */
.spec-item.is-active .spec-num { right: 27px; }
.spec-item.is-active .spec-name {
  top: 31px;
  left: 27px;
  font-size: 32px;
  font-weight: var(--w-medium);
  max-width: 320px;
  white-space: normal;
}

.spec-body {
  position: absolute;
  transform: translateY(14px);
  left: 27px;
  right: 27px;
  bottom: 27px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: flex-start;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.45s var(--ease),
    transform 0.55s var(--ease),
    visibility 0.45s;
}
.spec-item.is-active .spec-body {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0.42s;      /* lets the panel finish widening first */
}
.spec-body p {
  font-size: 20px;
  line-height: 28px;
  color: var(--text-muted-2);
  max-width: 366px;
}

