/* public/styles/showcase.css — owned by views/showcase.js. Shared styles live in base.css (do not edit base.css from a view).
   Every selector is prefixed with .showcase… so nothing leaks into other views. */

/* Sizing knobs: calendar cell / sticky name column / compressed thumb. Phone values at the bottom. */
.showcase { --cal-cell: 72px; --cal-name: 160px; --cmp-cell: 84px; }

/* ------------------------------------------------------------
   Header: title, mode tabs, controls
   ------------------------------------------------------------ */
.showcase-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.showcase-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.showcase-title { min-width: 0; }
.showcase-subtitle { font-size: 0.85rem; margin-top: 2px; }
.showcase-tabs .tab { min-height: 40px; }                 /* comfortable thumb targets */
.showcase-controls { display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap; }
.showcase-control { display: inline-flex; align-items: center; gap: 8px; }
.showcase-control-label { font-size: 0.85rem; color: var(--muted); }
.showcase-controls .chip-radio { min-height: 40px; min-width: 44px; justify-content: center; }

/* ------------------------------------------------------------
   Tile mode — square posters, N per row (data-cols), phones cap the effective columns
   ------------------------------------------------------------ */
.showcase-tiles { display: grid; gap: 14px; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); }
.showcase-tiles[data-cols="3"] { --cols: 3; gap: 18px; }
.showcase-tiles[data-cols="5"] { --cols: 5; }
.showcase-tiles[data-cols="7"] { --cols: 7; gap: 10px; }
.showcase-tiles[data-cols="9"] { --cols: 9; gap: 8px; }
.showcase-tile { display: block; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--radius); }
.showcase-tile:hover { text-decoration: none; }
.showcase-tile:hover .photo-tile { transform: translateY(-1px); box-shadow: var(--shadow); }
.showcase-tile .photo-tile { transition: transform 0.12s ease, box-shadow 0.12s ease; }
.showcase-tile .photo-tile-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; padding: 0 2px; }
.showcase-tiles[data-cols="7"] .photo-tile-label,
.showcase-tiles[data-cols="9"] .photo-tile-label { font-size: 0.72rem; }
.showcase-tiles[data-cols="9"] .photo-tile-corner { font-size: 0.7rem; }
.showcase-tile.is-dead .photo-tile-img { filter: grayscale(0.7); opacity: 0.85; }
.showcase-tile .badge { font-size: 0.8rem; }

/* ------------------------------------------------------------
   List mode — poster left, essentials right
   ------------------------------------------------------------ */
.showcase-list { display: flex; flex-direction: column; gap: 10px; }
.showcase-list-row { display: flex; gap: 14px; align-items: flex-start; color: inherit; text-decoration: none; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.showcase-list-row:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(31,42,34,0.06), 0 10px 24px rgba(31,42,34,0.10); }
.showcase-list-poster { flex: 0 0 120px; width: 120px; }
.showcase-list-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }   /* long unbroken names/summaries wrap instead of widening the page (phone) */
.showcase-list-name { font-size: 1.15rem; line-height: 1.25; }
.showcase-list-sci { font-size: 0.88rem; }
.showcase-unsure { font-style: normal; font-weight: 600; color: var(--warn); cursor: help; }
.showcase-dead { font-size: 0.85em; }
.showcase-list-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 2px; }
.showcase-list-age { font-size: 0.85rem; color: var(--ink); font-weight: 500; }
.showcase-list-summary {
  margin: 3px 0 0; font-size: 0.9rem; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;   /* ~2 lines */
}
.showcase-list-meta { font-size: 0.75rem; margin-top: 2px; }

/* ------------------------------------------------------------
   Event / log markers (shared by all modes)
   ------------------------------------------------------------ */
.showcase-marks { display: inline-flex; align-items: center; gap: 1px; font-size: 0.72rem; line-height: 1; }
.showcase-mark { cursor: pointer; line-height: 1; }
.showcase-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
.showcase-mark-more { font-size: 0.62rem; font-weight: 600; color: var(--ink); background: rgba(255,255,255,0.85); border-radius: 6px; padding: 0 3px; }

/* ------------------------------------------------------------
   Calendar mode (Chronology A) — spreadsheet-style grid in its own scroll box so the header row
   and the name column can both stick. Rows are flex lines of fixed-width cells (no grid auto-placement surprises).
   ------------------------------------------------------------ */
.showcase-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin: 0 0 8px; font-size: 0.75rem; }
.showcase-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.showcase-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); font-style: normal; }
.showcase-swatch.is-carry { background: linear-gradient(135deg, #c9c2b0, var(--cell-nophoto)); opacity: 0.7; }
.showcase-swatch-badge { width: auto; height: 16px; padding: 0 5px; border: 0; border-radius: 8px; background: rgba(31,42,34,0.78); color: #fff; font-size: 0.6rem; font-weight: 600; line-height: 16px; }
.showcase-swatch-emoji { font-size: 0.8rem; line-height: 1; }

.showcase-cal-scroll {
  overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  max-height: calc(100vh - var(--nav-h) - 130px); max-height: calc(100dvh - var(--nav-h) - 130px); min-height: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.showcase-cal-head { position: sticky; top: 0; z-index: 3; width: max-content; min-width: 100%; background: var(--surface); border-bottom: 1px solid var(--line); }
.showcase-cal-years, .showcase-cal-months, .showcase-cal-row { display: flex; width: max-content; min-width: 100%; }
.showcase-cal-corner {
  position: sticky; left: 0; z-index: 4; flex: 0 0 var(--cal-name); width: var(--cal-name);
  background: var(--surface); border-right: 1px solid var(--line);
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 3px 8px 0;
}
.showcase-cal-year { flex: 0 0 auto; height: 20px; font-size: 0.74rem; font-weight: 700; color: var(--ink); padding: 3px 6px 0; border-left: 2px solid var(--line); line-height: 1.2; overflow: hidden; white-space: nowrap; }
.showcase-cal-month { flex: 0 0 var(--cal-cell); width: var(--cal-cell); height: 24px; font-size: 0.7rem; color: var(--muted); text-align: center; line-height: 24px; white-space: nowrap; overflow: hidden; }
.showcase-cal-month.is-year-start { border-left: 2px solid var(--line); font-weight: 600; color: var(--ink); }
.showcase-cal-month.is-current { color: var(--accent-ink); font-weight: 700; background: var(--accent-soft); border-radius: 4px 4px 0 0; }
.showcase-cal-row { height: var(--cal-cell); }
.showcase-cal-row:nth-child(even) { background: rgba(246, 244, 238, 0.6); }   /* zebra helps the eye track a long row */
.showcase-cal-name {
  position: sticky; left: 0; z-index: 2; flex: 0 0 var(--cal-name); width: var(--cal-name); height: 100%;
  display: flex; align-items: center; padding: 0 8px; background: var(--surface); border-right: 1px solid var(--line);
  box-shadow: 4px 0 8px -6px rgba(31,42,34,0.25); font-size: 0.82rem; font-weight: 500; color: var(--ink); text-decoration: none; line-height: 1.2;
}
.showcase-cal-name:hover { text-decoration: none; background: var(--accent-soft); }
.showcase-cal-name > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.showcase-cal-cell {
  position: relative; flex: 0 0 auto; display: block;
  width: calc(var(--cal-cell) - 2px); height: calc(var(--cal-cell) - 2px); margin: 1px;   /* 2px gaps via 1px margins */
  border-radius: 4px; overflow: hidden; text-decoration: none;
}
.showcase-cal-cell.is-year-start { box-shadow: -2px 0 0 0 var(--line); }              /* year boundary line down the column */
.showcase-cal-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.showcase-cal-cell.is-photo { background: var(--line); }
.showcase-cal-cell.is-photo:hover, .showcase-cal-cell.is-photo:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.showcase-cal-cell.is-carry { background: var(--cell-nophoto); }
.showcase-cal-cell.is-carry img { opacity: 0.5; filter: grayscale(0.55) saturate(0.7); }   /* faded so real photos stand out */
.showcase-cal-cell.is-carry:hover, .showcase-cal-cell.is-carry:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.showcase-cal-cell.is-carry:hover img { opacity: 0.85; filter: none; }
.showcase-cal-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: rgba(31,42,34,0.78); color: #fff; font-size: 0.6rem; font-weight: 600; line-height: 16px; text-align: center;
}
.showcase-cal-cell .showcase-marks { position: absolute; left: 2px; bottom: 2px; background: rgba(255,255,255,0.82); border-radius: 4px; padding: 1px 2px; font-size: 0.68rem; }

/* ------------------------------------------------------------
   Compressed mode (Chronology B) — one shared horizontal scroll, sticky names, photos in order
   ------------------------------------------------------------ */
.showcase-cmp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.showcase-cmp-row { display: flex; align-items: stretch; width: max-content; min-width: 100%; border-bottom: 1px solid var(--line); }
.showcase-cmp-row:last-child { border-bottom: 0; }
.showcase-cmp-row:nth-child(even) { background: rgba(246, 244, 238, 0.6); }
.showcase-cmp-name {
  position: sticky; left: 0; z-index: 2; flex: 0 0 var(--cal-name); width: var(--cal-name);
  display: flex; align-items: center; padding: 8px; background: var(--surface); border-right: 1px solid var(--line);
  box-shadow: 4px 0 8px -6px rgba(31,42,34,0.25); font-size: 0.85rem; font-weight: 500; color: var(--ink); text-decoration: none; line-height: 1.2;
}
.showcase-cmp-name:hover { text-decoration: none; background: var(--accent-soft); }
.showcase-cmp-name > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.showcase-cmp-items { display: flex; align-items: flex-start; gap: 4px; padding: 6px 10px; }
.showcase-cmp-item { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 0 0 auto; width: var(--cmp-cell); color: inherit; text-decoration: none; }
.showcase-cmp-item:hover { text-decoration: none; }
.showcase-cmp-thumb { position: relative; display: block; width: var(--cmp-cell); height: var(--cmp-cell); border-radius: 6px; overflow: hidden; background: var(--line); }
.showcase-cmp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.showcase-cmp-item:hover .showcase-cmp-thumb, .showcase-cmp-item:focus-visible .showcase-cmp-thumb { outline: 2px solid var(--accent); outline-offset: -2px; }
.showcase-cmp-date { font-size: 0.68rem; color: var(--muted); white-space: nowrap; line-height: 1.2; }
.showcase-cmp-marks { min-height: 12px; }
.showcase-cmp-empty { padding: 10px 12px; font-size: 0.85rem; align-self: center; }

/* ------------------------------------------------------------
   Phone (≤640px)
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .showcase { --cal-cell: 56px; --cal-name: 110px; --cmp-cell: 62px; }
  .showcase-controls { gap: 2px 14px; }
  .showcase-tiles { gap: 8px; }
  .showcase-tiles[data-cols="3"] { gap: 10px; }
  .showcase-tiles[data-cols="5"] { --cols: 3; gap: 10px; }                 /* 3 or 5 chosen → 3 across */
  .showcase-tiles[data-cols="7"], .showcase-tiles[data-cols="9"] { --cols: 5; gap: 6px; }   /* 7 or 9 chosen → 5 across */
  .showcase-tiles[data-cols="7"] .photo-tile-label, .showcase-tiles[data-cols="9"] .photo-tile-label { font-size: 0.62rem; }
  .showcase-tiles[data-cols="7"] .photo-tile-corner, .showcase-tiles[data-cols="9"] .photo-tile-corner { font-size: 0.62rem; }
  .showcase-tiles[data-cols="7"] .badge, .showcase-tiles[data-cols="9"] .badge { top: 3px; right: 3px; height: 18px; min-width: 18px; font-size: 0.7rem; }
  .showcase-list-row { gap: 10px; }
  .showcase-list-poster { flex-basis: 88px; width: 88px; }
  .showcase-list-name { font-size: 1.02rem; }
  .showcase-list-summary { font-size: 0.85rem; }
  .showcase-cal-scroll { max-height: calc(100vh - var(--nav-h) - 110px); max-height: calc(100dvh - var(--nav-h) - 110px); }
  .showcase-cal-month { font-size: 0.64rem; }
  .showcase-cal-name { font-size: 0.76rem; padding: 0 6px; }
  .showcase-cal-cell .showcase-marks { font-size: 0.6rem; padding: 1px; }
  .showcase-cal-badge { min-width: 14px; height: 14px; font-size: 0.55rem; line-height: 14px; padding: 0 3px; }
  .showcase-cmp-name { font-size: 0.78rem; padding: 6px; }
  .showcase-cmp-items { padding: 5px 8px; }
}
