/* 店頭レポート — the feed, the post page, the posting form.
   ---------------------------------------------------------------------------
   Loaded after stock.css, which already owns the pieces the three pages
   share with the map: .tcg-input (16px, so iOS does not zoom), the three
   .tcg-state buttons, .tcg-pill, .tcg-pick and the store rows. This sheet
   only adds what is new. */

/* --- the feed ------------------------------------------------------------ */

.tcg-shelfday {
  margin: var(--tcg-space-lg) 0 var(--tcg-space-xs);
  font-size: var(--tcg-fs-sm, 0.875rem);
  font-weight: 700;
  color: var(--tcg-color-text-muted);
  letter-spacing: 0.04em;
}

.tcg-shelflist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--tcg-color-border);
}

.tcg-shelfline { border-bottom: 1px solid var(--tcg-color-border); }

.tcg-shelfline__link {
  display: flex;
  align-items: center;
  gap: var(--tcg-space-sm);
  /* ≥ 44px tall: this is the one thing a reader taps on the page. */
  min-height: 48px;
  padding: var(--tcg-space-sm) var(--tcg-space-xs);
  color: var(--tcg-color-text);
  text-decoration: none;
}

.tcg-shelfline__link:hover .tcg-shelfline__store { text-decoration: underline; }

/* Two lines: the full date and time, then the store. */
.tcg-shelfline__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tcg-shelfline__time {
  color: var(--tcg-color-text-muted);
  font-size: var(--tcg-fs-sm, 0.875rem);
  font-variant-numeric: tabular-nums;
}

.tcg-shelfline__store { font-weight: 600; }

.tcg-shelfline__suffix { color: var(--tcg-color-text-muted); font-weight: 400; margin-left: 0.25em; }

/* --- the post page -------------------------------------------------------- */

.tcg-shelfpost__time {
  display: block;
  color: var(--tcg-color-text-muted);
  font-size: var(--tcg-fs-sm, 0.875rem);
}

.tcg-shelfpost__store {
  margin: var(--tcg-space-xs) 0 0;
  font-size: var(--tcg-fs-sm, 0.875rem);
  color: var(--tcg-color-text-muted);
}

.tcg-shelfpost__text {
  margin: var(--tcg-space-md) 0;
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-line;
}

.tcg-shelfitems {
  list-style: none;
  margin: var(--tcg-space-md) 0;
  padding: 0;
  display: grid;
  gap: var(--tcg-space-sm);
}

.tcg-shelfitem {
  padding: var(--tcg-space-sm) var(--tcg-space-md);
  background: var(--tcg-color-surface);
  border: 1px solid var(--tcg-color-border);
  border-radius: var(--tcg-radius-md, 10px);
}

.tcg-shelfitem__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tcg-space-xs) var(--tcg-space-sm);
  font-weight: 700;
}

.tcg-shelfitem__icon { font-size: 1.3rem; line-height: 1; }

.tcg-shelfitem__unit {
  font-size: var(--tcg-fs-xs, 0.75rem);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tcg-color-surface-2);
  color: var(--tcg-color-text-muted);
}

.tcg-shelfitem__limit {
  margin: var(--tcg-space-xs) 0 0;
  font-weight: 600;
}

.tcg-shelfitem__rule {
  margin: var(--tcg-space-xs) 0 0;
  font-size: var(--tcg-fs-sm, 0.875rem);
  color: var(--tcg-color-text-muted);
}

.tcg-members {
  margin: var(--tcg-space-lg) 0;
  padding: var(--tcg-space-md);
  background: var(--tcg-color-warn-bg);
  border: 1px solid var(--tcg-color-warn-bd);
  border-radius: var(--tcg-radius-md, 10px);
}

.tcg-members__title {
  margin: 0 0 var(--tcg-space-sm);
  font-size: 1rem;
}

.tcg-members__rule {
  margin: 0 0 var(--tcg-space-sm);
  font-size: var(--tcg-fs-sm, 0.875rem);
  line-height: 1.6;
}

.tcg-members__rule b {
  display: inline-block;
  margin-right: var(--tcg-space-xs);
  padding: 0 6px;
  border-radius: 4px;
  background: var(--tcg-color-surface);
  border: 1px solid var(--tcg-color-border);
  font-size: var(--tcg-fs-xs, 0.75rem);
}

.tcg-members__signup { margin: var(--tcg-space-sm) 0 0; }

.tcg-shelfpost__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tcg-space-sm);
  margin: var(--tcg-space-lg) 0;
}

.tcg-shelfpost__own {
  display: flex;
  gap: var(--tcg-space-sm);
  margin: var(--tcg-space-md) 0;
  padding-top: var(--tcg-space-md);
  border-top: 1px dashed var(--tcg-color-border);
}

/* --- the posting form ----------------------------------------------------- */

.tcg-shelfform input,
.tcg-shelfform select,
.tcg-shelfform textarea {
  /* The whole fix for 「remove the zoom thing」: nothing under 16px. */
  font-size: max(16px, 1rem);
}

.tcg-shelfform select {
  display: block;
  width: 100%;
  font: inherit;
  font-size: max(16px, 1rem);
  padding: var(--tcg-space-xs) var(--tcg-space-sm);
  border: 1px solid var(--tcg-color-border-strong);
  border-radius: var(--tcg-radius-sm, 6px);
  background: var(--tcg-color-surface);
  color: var(--tcg-color-text);
}

.tcg-shelfform__chosen {
  display: flex;
  align-items: center;
  gap: var(--tcg-space-sm);
  margin: var(--tcg-space-sm) 0;
  padding: var(--tcg-space-sm) var(--tcg-space-md);
  background: var(--tcg-color-brand-soft);
  border-radius: var(--tcg-radius-md, 10px);
  font-weight: 600;
}

.tcg-shelfform__chosen .tcg-btn { margin-left: auto; }

.tcg-shelfblock {
  margin: var(--tcg-space-sm) 0;
  padding: var(--tcg-space-sm) var(--tcg-space-md);
  background: var(--tcg-color-surface);
  border: 1px solid var(--tcg-color-border);
  border-radius: var(--tcg-radius-md, 10px);
}

.tcg-shelfblock__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--tcg-space-sm);
  margin-bottom: var(--tcg-space-sm);
}

.tcg-shelfblock__row--one { grid-template-columns: 1fr; }

.tcg-shelfblock__fixed {
  padding: var(--tcg-space-xs) 0;
  font-weight: 600;
}

.tcg-shelfblock .tcg-state.is-on { outline: 3px solid var(--tcg-color-focus); outline-offset: 2px; }

.tcg-shelfblock__remove { margin-top: var(--tcg-space-xs); }

/* 「前回の値」: filled from the last post, until touched. */
.tcg-shelfform .is-prefilled { background: var(--tcg-color-marker-yellow); }

.tcg-shelfform__hint {
  font-size: var(--tcg-fs-xs, 0.75rem);
  color: var(--tcg-color-text-muted);
}

.tcg-shelfform__members {
  display: flex;
  align-items: center;
  gap: var(--tcg-space-sm);
  margin: var(--tcg-space-md) 0;
  font-weight: 600;
}

.tcg-shelfform__members input { width: 22px; height: 22px; }

.tcg-shelfform__error {
  margin: var(--tcg-space-sm) 0;
  color: var(--tcg-color-urgent-fg);
  font-weight: 600;
}

.tcg-shelfform__error:empty { display: none; }

/* --- photos (2026-11-02) --------------------------------------------------- */

/* The feed line: the first photo, small, on the left. */
.tcg-shelfline__thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--tcg-radius-sm, 6px);
  align-self: center;
}

/* The post page, X-style: one wide; two side by side; three as one tall
   on the left and two stacked; four (or more) as a 2×2, the fourth tile
   carrying 「+N」. Tiles past the fourth stay in the markup for the viewer
   and are hidden here. */
.tcg-shelfphotos {
  list-style: none;
  margin: var(--tcg-space-md) 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border-radius: var(--tcg-radius-md, 10px);
  overflow: hidden;
}

.tcg-shelfphotos--1 { grid-template-columns: 1fr; }

.tcg-shelfphotos--3 .tcg-shelfphotos__item:first-child { grid-row: span 2; }

.tcg-shelfphotos__item { position: relative; min-height: 0; }

.tcg-shelfphotos__item:nth-child(n + 5) { display: none; }

.tcg-shelfphotos__item a {
  display: block;
  height: 100%;
  background: var(--tcg-color-surface-2);
}

.tcg-shelfphotos__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcg-shelfphotos--1 .tcg-shelfphotos__img { height: auto; max-height: 80vh; object-fit: contain; }

.tcg-shelfphotos:not(.tcg-shelfphotos--1) .tcg-shelfphotos__item a { aspect-ratio: 1; }

.tcg-shelfphotos--3 .tcg-shelfphotos__item:first-child a { aspect-ratio: auto; height: 100%; }

.tcg-shelfphotos__item--more::after {
  content: attr(data-more);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  pointer-events: none;
}

/* --- the viewer ---------------------------------------------------------- */

.tcg-lightbox {
  position: fixed;
  inset: 0;
  z-index: calc(var(--tcg-z-overlay) + 10);
  background: #000;
  color: #fff;
  /* No native scroll or pinch inside; the script owns every gesture. */
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}

.tcg-lightbox[hidden] { display: none; }

body.tcg-lightbox-open { overflow: hidden; }

.tcg-lightbox__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.tcg-lightbox__track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.tcg-lightbox__slide {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  display: grid;
  /* minmax(0, 1fr), not auto: an auto track grows to the photo, so the
     image's max-height: 100% resolved to its own height and a tall photo
     overflowed a PC screen (owner, 2026-11-02). A definite track makes
     100% mean the screen. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
}

.tcg-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  will-change: transform;
  transform-origin: center center;
}

.tcg-lightbox__btn {
  position: absolute;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 26px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
}

.tcg-lightbox__btn:disabled { opacity: 0.25; cursor: default; }

.tcg-lightbox__close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }

.tcg-lightbox__prev,
.tcg-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.tcg-lightbox__prev { left: 8px; }
.tcg-lightbox__next { right: 8px; }

.tcg-lightbox__count {
  position: absolute;
  z-index: 1;
  top: calc(22px + env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--tcg-fs-sm, 0.875rem);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.tcg-lightbox.is-zoomed .tcg-lightbox__prev,
.tcg-lightbox.is-zoomed .tcg-lightbox__next { display: none; }

/* The form: picked photos as a row of squares, each with a remove button. */
.tcg-photos {
  list-style: none;
  margin: 0 0 var(--tcg-space-sm);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--tcg-space-xs);
}

.tcg-photos:empty { display: none; }

.tcg-photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--tcg-radius-sm, 6px);
  overflow: hidden;
  background: var(--tcg-color-surface-2);
}

.tcg-photo__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tcg-photo.is-uploading .tcg-photo__img { opacity: 0.5; }

.tcg-photo.is-failed { outline: 2px solid var(--tcg-color-urgent-fg); }

.tcg-photo__state {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2px 4px;
  font-size: var(--tcg-fs-xs, 0.75rem);
  line-height: 1.3;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
}

.tcg-photo__state:empty { display: none; }

.tcg-photo__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
}

.tcg-photos__add { cursor: pointer; }

.tcg-step__sub {
  margin-left: var(--tcg-space-xs);
  font-size: var(--tcg-fs-xs, 0.75rem);
  font-weight: 400;
  color: var(--tcg-color-text-muted);
}
