/* Device tabs: a reusable switcher for showing the same screenshot on different
   devices (iPhone / iPad / iPhone Duo, etc). Pairs with shared/device-tabs.js,
   which also picks a default tab based on the visitor's own device.
   Relies on each app's own .device/.iphone/.ipad frame rules (app.css); this
   file only adds the tab UI and the frame sizes it introduces (e.g. the fold). */

.device-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.device-tab-buttons {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--bg-secondary);
}
.device-tab-buttons button {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
}
.device-tab-buttons button[aria-selected="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.device-tab-panel[hidden] { display: none; }

/* An active tab panel is an explicit choice, so its device frame should always
   show regardless of viewport width. This overrides app.css's .ipad, which
   otherwise defaults to display:none below 744px — a rule meant for the old
   side-by-side (non-tabbed) layout where the iPhone frame alone covered
   mobile widths, not for a panel the visitor picked on purpose. */
.device-tab-panel .ipad { display: block; }

/* Foldable iPhone: shown closed (cover screen) and open (unfolded) side by side. */
.duo-devices {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  flex-wrap: wrap;
  padding: 40px 0 64px;
}
.device.duo-closed {
  width: min(170px, 46vw);
  border-radius: 34px;
}
.device.duo-closed img { aspect-ratio: 1398 / 2034; border-radius: 26px; }
.device.duo-open {
  width: min(320px, 88vw);
  border-radius: 24px;
}
.device.duo-open img { aspect-ratio: 2853 / 2007; border-radius: 16px; }

@media (min-width: 744px) {
  .device.duo-closed { width: 220px; }
  .device.duo-open { width: 460px; }
}
@media (min-width: 1100px) {
  .device.duo-closed { width: 240px; }
  .device.duo-open { width: 520px; }
}

/* A device tab with no screenshots yet (e.g. a page that hasn't shot its
   iPhone Duo set). Roughly matches a device frame's footprint so switching
   tabs doesn't jolt the layout. */
.device-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(320px, 88vw);
  padding: 56px 28px;
  border: 2px dashed var(--separator);
  border-radius: 24px;
  color: var(--text-secondary);
  text-align: center;
}
.device-placeholder svg {
  width: 32px;
  height: 32px;
  flex: none;
}
.device-placeholder p { margin: 0; }
