/* ============================================================
   Saved page — extends today.css. Adds filter chips + lightbox
   + a 2-row card layout (thumb on top, content below).
   ============================================================ */

/* type-filter chips above the grid */
.filter-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 18px;
  padding-bottom: 6px;
}
.filter-chips::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all .12s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.filter-chip:active { transform: scale(0.96); }
.filter-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.filter-chip .count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  opacity: 0.7;
}

/* override today.css saved-grid for the saved tab — single column on phone, 2 col on tablet */
.saved-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 600px) {
  .saved-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
}

/* Saved cards on this page have a thumb-button + body section */
.saved {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.saved-thumb-btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: var(--rule);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.saved-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s ease;
}
.saved-thumb-btn:active img { transform: scale(0.98); }

.saved-body-wrap { position: relative; }
.saved-body {
  display: block;
  padding: 14px 44px 14px 14px;       /* extra right padding for the ⋯ */
  text-decoration: none;
  color: inherit;
}
a.saved-body:hover, a.saved-body:focus { background: rgba(160, 74, 37, 0.04); }

.saved-edit {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* ============================================================
   Lightbox — full-screen image overlay
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: grid;
  place-items: center;
  z-index: 1000;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
/* `display: grid` would otherwise override the [hidden] attribute */
.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* allow native iOS pinch-zoom on the image */
  touch-action: pinch-zoom;
}

#lightbox-close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  font-weight: 300;
}
#lightbox-close:active { transform: scale(0.92); }
