/* static/css/devices_page.css */

.page-title {
  margin: 0 0 8px 0;
  font-size: 31px;
  font-weight: 600;
  color: var(--text);
}

.page-desc {
  margin: 0 0 18px 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

/* ---- ruled list, not cards ---- */

.dev-list {
  border-top: 1px solid var(--line);
}

.dev-row {
  border-bottom: 1px solid var(--line);
}

.dev-heading {
  margin: 0;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
}

/* ---- row header (a real button, so keyboard + SR work for free) ---- */

.dev-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  width: 100%;
  padding: 20px 10px;
  background: none;
  border: 0;
  border-radius: 12px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
  transition: color 900ms ease;
}

.dev-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dev-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 2.6;
  color: var(--muted);
}

.dev-text {
  display: block;
  min-width: 0;
}

.dev-name {
  display: block;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.dev-summary {
  display: block;
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---- + / - morph: only the vertical bar rotates, so the glyphs stay
   visually continuous through the transition ---- */

.dev-sign {
  position: relative;
  display: block;
  width: 11px;
  height: 11px;
  margin-top: 14px;
  color: var(--muted);
  transition: color 200ms ease, transform 420ms cubic-bezier(.32, .72, 0, 1);
}

.dev-sign span {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  border-radius: 1px;
  background: currentColor;
  transform: translateY(-50%);
  transition: transform 420ms cubic-bezier(.32, .72, 0, 1);
}

.dev-sign span:last-child {
  transform: translateY(-50%) rotate(90deg);
}

.dev-head:hover .dev-sign {
  color: var(--accent);
}

.dev-row.is-open .dev-sign {
  color: var(--accent);
  transform: rotate(180deg);
}

.dev-row.is-open .dev-sign span:last-child {
  transform: translateY(-50%) rotate(0deg);
}

/* ---- expanding panel ----
   grid-template-rows 0fr -> 1fr animates the real intrinsic height and works
   in every current browser (unlike height:auto via interpolate-size, which is
   still Chromium-only). The inner element needs min-height:0 because grid
   items default to min-height:auto and refuse to shrink below content height.
   All padding lives on .dev-panel-body so the collapsed row has zero height. */

.dev-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 420ms cubic-bezier(.32, .72, 0, 1),
    opacity 260ms ease;
}

.dev-row.is-open .dev-panel {
  grid-template-rows: 1fr;
  opacity: 1;
}

.dev-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.dev-panel-body {
  display: grid;
  gap: 22px;
  padding: 4px 10px 26px 60px;
}

.dev-row.has-photo .dev-panel-body {
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
}

/* ---- media slot / carousel ----
   The track is moved with translateX inside an overflow:hidden viewport --
   deliberately NOT a scroll container. A nested scroller with scroll-snap
   fights the parent's grid-template-rows collapse and kills the row
   animation. Flex stretches every slide to the tallest one, so the panel
   height is stable across slides without forcing a fixed aspect ratio -- which
   means each photo keeps its natural proportions and its own rounded corners. */

.dev-media {
  position: relative;
}

.dev-viewport {
  overflow: hidden;
  border-radius: 10px;
  /* Scope layout/paint work to this box so the row's height animation does not
     re-lay-out or repaint the photos on every frame. */
  contain: layout paint;
}

.dev-track {
  display: flex;
  align-items: flex-start;
  transition: transform 420ms cubic-bezier(.32, .72, 0, 1);
}

.dev-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.dev-photo {
  display: block;
  /* width/height attrs are on the tag for the intrinsic ratio only -- these
     keep the photo fluid. */
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: none;
  user-select: none;
}

/* arrows: hidden until the row is hovered or something inside is focused */

.dev-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0 0 2px 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font: 400 17px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
  opacity: 0;
  transition: opacity 200ms ease, color 200ms ease, border-color 200ms ease;
}

.dev-arrow-prev { left: 6px; }
.dev-arrow-next { right: 6px; }

.dev-media:hover .dev-arrow,
.dev-media:focus-within .dev-arrow { opacity: 1; }

.dev-arrow:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.dev-arrow:focus-visible {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dev-arrow[disabled] {
  opacity: 0;
  pointer-events: none;
}

/* dots */

.dev-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.dev-dot {
  width: 5px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
  transition: background-color 220ms ease, transform 220ms ease;
}

.dev-dot:hover { background: var(--muted); }

.dev-dot.is-active {
  background: var(--accent);
  transform: scale(1.35);
}

.dev-dot:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- spec grid ---- */

.dev-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 24px;
  margin: 0;
}

.dev-spec dt {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dev-spec dd {
  margin: 6px 0 0 0;
  font-size: 14px;
  color: var(--text);
}

/* ---- responsive ---- */

@media (max-width: 640px) {
  .dev-head {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px 6px;
  }

  .dev-name { font-size: 22px; }
  .dev-summary { font-size: 13.5px; }

  .dev-row.has-photo .dev-panel-body,
  .dev-panel-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 4px 6px 22px 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dev-panel,
  .dev-sign,
  .dev-sign span,
  .dev-head,
  .dev-dot,
  .dev-arrow {
    transition-duration: 1ms;
  }

  .dev-track { transition-duration: 1ms; }
}
