/* Swipe-mode styles for the home feed (js/screens/feed.js) + the shared
   List | Swipe segmented toggle. Mobile-first; every color reads the theme
   tokens in app.css — no literal hues beyond rgba shadow/gradient work. */

/* ----------------------------------------------------- feed buttons */
/* Base for the feed's compact buttons (list "more", swipe quick actions,
   retry states). Page-context colors here; .sw-actions overrides below
   restyle them for use OVER artwork. */
.tgs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
}
.tgs-btn:active { opacity: .85; }
.tgs-btn:disabled { opacity: .5; cursor: default; }
.tgs-btn.blood { background: var(--blood); color: rgba(255, 255, 255, .96); }
.tgs-btn.ghost { background: transparent; color: var(--bone); border: 1.5px solid var(--line); }

/* ------------------------------------------------ segmented mode toggle */
.tgs-seg {
  display: inline-flex; flex: none; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--ground-2);
}
.tgs-seg button {
  padding: 7px 14px; border-radius: 999px; line-height: 1;
  font-size: 12.5px; font-weight: 700; color: var(--bone-soft);
  transition: background .15s ease, color .15s ease;
}
.tgs-seg button.on { background: var(--blood); color: rgba(255, 255, 255, .96); }

/* --------------------------------------------------------- swipe shell */
/* Fills the #screen area (the screen gets .noscroll while Swipe is live).
   PadLaser look: ONE full-bleed art card inset on the bright page — the cover
   IS the screen, info rides ON the image, controls float as dark pills. */
.tgs-swipewrap { position: absolute; inset: 0; overflow: hidden; background: var(--ground); }

/* Floating top bar: genre chips (scroll sideways) + the mode toggle. Dark
   glass pills OVER the artwork, PadLaser-style — no scrim band. */
.sw-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 16px 16px 8px;
}
.sw-chips {
  flex: 1; min-width: 0; display: flex; gap: 6px;
  overflow-x: auto; padding: 2px; scrollbar-width: none;
}
.sw-chips::-webkit-scrollbar { display: none; }
.sw-chip {
  flex: none; border: 1px solid rgba(243, 239, 226, .16); border-radius: 999px;
  padding: 6px 13px; font-size: 12px; font-weight: 700; white-space: nowrap;
  color: #f3efe2; background: rgba(10, 13, 9, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sw-chip.on { background: var(--blood); border-color: var(--blood); color: rgba(255, 255, 255, .96); }
.sw-seg {
  background: rgba(10, 13, 9, .55); border-color: rgba(243, 239, 226, .16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.sw-seg button { color: rgba(243, 239, 226, .75); }
.sw-seg button.on { color: rgba(255, 255, 255, .96); }

/* --------------------------------------------------------------- deck */
.sw-deck {
  position: absolute; inset: 0;
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
/* The card: inset with rounded corners on the bright page, art edge-to-edge
   inside it — exactly the PadLaser home card. */
.sw-card {
  position: absolute; inset: 8px;
  border-radius: 20px; overflow: hidden;
  background: #0a0d09;
  box-shadow: 0 8px 20px rgba(46, 42, 25, .3), 0 22px 52px rgba(46, 42, 25, .28);
  will-change: transform, opacity;
}

/* Cover art FULL-BLEED. The blurred copy paints the whole card so nothing is
   ever letterboxed empty; the cover itself fills by cover-fit on phones and
   drops to contain on wide screens so title art never crops off. */
.sw-art { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.sw-blur {
  position: absolute; inset: -8%; width: 116%; height: 116%;
  object-fit: cover; filter: blur(34px) saturate(.9) brightness(.7); opacity: .9;
  pointer-events: none;
}
.sw-cover {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none; -webkit-user-drag: none;
}
@media (min-width: 900px) { .sw-cover { object-fit: contain; } }

/* Bottom overlay panel ON the artwork: dark photo-gradient, light lettering —
   the PadLaser price block. Colors are over-image literals, theme-independent. */
.sw-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 88px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(5, 7, 4, 0) 0%, rgba(5, 7, 4, .62) 45%, rgba(5, 7, 4, .9) 100%);
}
.sw-chipline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sw-serieschip {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 11px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  background: var(--blood); color: rgba(255, 255, 255, .96);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sw-count { flex: none; font-size: 11.5px; font-weight: 700; color: rgba(243, 239, 226, .7); }
.sw-title {
  font-family: var(--serif); font-weight: 700; line-height: 1.2;
  font-size: clamp(22px, 5.8vw, 30px); color: #f3efe2; margin: 8px 0 2px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
}
.sw-author { color: #cfc7ae; font-size: 13.5px; }
.sw-price { color: #a9c47f; font-weight: 800; font-size: 16px; margin-top: 4px; }
.sw-actions { display: flex; gap: 10px; margin-top: 12px; }
.sw-actions .tgs-btn { flex: 1; justify-content: center; }

/* Desktop chevrons: a compass cluster on the right edge. ▲▼ walk the books
   in this series, ◀▶ change series. Hidden where touch is the pointer. */
.sw-nav {
  position: absolute; right: 12px; top: 42%; transform: translateY(-50%); z-index: 5;
  display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 34px);
  gap: 2px; pointer-events: none;
}
.sw-nav button {
  pointer-events: auto; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  color: #f3efe2; background: rgba(10, 13, 9, .55);
  border: 1px solid rgba(243, 239, 226, .18);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.sw-nav button:hover:not(:disabled) { color: #a9c47f; border-color: #a9c47f; }
.sw-nav button:disabled { opacity: .3; cursor: default; }
.sw-nav .up { grid-column: 2; grid-row: 1; }
.sw-nav .left { grid-column: 1; grid-row: 2; }
.sw-nav .right { grid-column: 3; grid-row: 2; }
.sw-nav .down { grid-column: 2; grid-row: 3; }
@media (hover: none), (pointer: coarse) { .sw-nav { display: none; } }

/* Loading / empty / failure states inside the deck (over the dark card). */
.sw-state {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 40px 28px;
  color: #cfc7ae; font-size: 15px; line-height: 1.6;
}

/* ---------------------------------------------------------- motion */
/* Entry: the new card continues the travel direction it was swiped in. */
@keyframes sw-in-up { from { transform: translateY(56px); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes sw-in-down { from { transform: translateY(-56px); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes sw-in-left { from { transform: translateX(56px); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes sw-in-right { from { transform: translateX(-56px); opacity: .25; } to { transform: none; opacity: 1; } }
.sw-card.in-up { animation: sw-in-up .22s ease; }
.sw-card.in-down { animation: sw-in-down .22s ease; }
.sw-card.in-left { animation: sw-in-left .22s ease; }
.sw-card.in-right { animation: sw-in-right .22s ease; }

/* Rubber-band spring at the ends of a series / of the shelf. */
@keyframes sw-spring-up { 0% { transform: none; } 35% { transform: translateY(-20px); } 70% { transform: translateY(5px); } 100% { transform: none; } }
@keyframes sw-spring-down { 0% { transform: none; } 35% { transform: translateY(20px); } 70% { transform: translateY(-5px); } 100% { transform: none; } }
@keyframes sw-spring-left { 0% { transform: none; } 35% { transform: translateX(-20px); } 70% { transform: translateX(5px); } 100% { transform: none; } }
@keyframes sw-spring-right { 0% { transform: none; } 35% { transform: translateX(20px); } 70% { transform: translateX(-5px); } 100% { transform: none; } }
.sw-card.spring-up { animation: sw-spring-up .4s ease; }
.sw-card.spring-down { animation: sw-spring-down .4s ease; }
.sw-card.spring-left { animation: sw-spring-left .4s ease; }
.sw-card.spring-right { animation: sw-spring-right .4s ease; }

/* Reduced motion: instant snaps, no follows, no springs (JS checks too). */
@media (prefers-reduced-motion: reduce) {
  .sw-card { animation: none !important; transition: none !important; }
}

/* --------------------------------------------------------- wide screens */
@media (min-width: 720px) {
  .sw-card { inset: 12px; border-radius: 24px; }
  .sw-info { padding-left: 24px; padding-right: 24px; }
}

/* Quick actions over the artwork: solid moss primary + glass ghost secondary
   (PadLaser's "View details" / "Make an offer" pairing). */
.sw-actions .tgs-btn,
.sw-actions button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
}
.sw-actions .tgs-btn.blood { background: var(--blood); color: rgba(255, 255, 255, .96); }
.sw-actions .tgs-btn.ghost {
  background: rgba(10, 13, 9, .45); color: #f3efe2;
  border: 1.5px solid rgba(243, 239, 226, .35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
