/* ============================================================
   FIND MORE GALLERIES — the pages behind each dashboard's "Find More …" link:
   a list of what someone else keeps, each row saving into your own.
   ============================================================ */
.gallery-page { margin: 0 auto; }
.gallery-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2rem; }
.gallery-back { color: var(--text-3); font-size: var(--fs-13); text-decoration: none; }
.gallery-back:hover { color: var(--text-1); }
.gallery-title { margin: 0; color: var(--text-1); font-size: var(--fs-20); font-weight: 700; }
/* What the gallery is for, under its heading; a progress bar after it keeps its own room. */
.gallery-subtitle { margin: -0.5rem 0 1.25rem; color: var(--text-3); font-size: var(--fs-13); }
.gallery-page .gallery-subtitle + .gallery-progress { margin-top: 0; }
.gallery-empty { padding: 4rem 0; color: var(--text-3); text-align: center; }
.gallery-empty i { display: block; margin-bottom: 1rem; font-size: 2rem; opacity: 0.4; }
.gallery-empty p { margin: 0; font-size: var(--fs-14); }
.gallery-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
/* A gallery in sections (Tasks: Bucket List, Habits): a heading over each list, the
   second one set off from the list above it. */
.gallery-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  color: var(--text-2);
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  scroll-margin-top: 24px;
}
.gallery-section-title i { color: var(--text-3); font-size: var(--fs-12); }
.gallery-section-count { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.gallery-list + .gallery-section-title,
.gallery-more + .gallery-section-title { margin-top: 2rem; }
/* A long section's tail (Sources: past the first ten). The summary goes once it's open,
   so the extra rows simply carry on the list. */
.gallery-more > summary {
  list-style: none;
  cursor: pointer;
}
.gallery-more > summary::-webkit-details-marker { display: none; }
.gallery-more > summary:hover { color: var(--text-1); }
.gallery-more[open] > summary { display: none; }
.gallery-more > .gallery-list { margin-top: 0.5rem; }
/* A section's foot (shared/gallery_section): a line and a button to somewhere related. */
.gallery-section-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 1.25rem 0 0; color: var(--text-3); font-size: var(--fs-13); }
.gallery-section-foot .find-surprise { margin-left: 0; }
.gallery-note { margin: 2.5rem 0 0; color: var(--text-3); font-size: var(--fs-11); line-height: 1.5; }
.gallery-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface-card);
  background-image: var(--sheen);
}
/* A card in a colour (Find More Rules: its area's): a thin edge and a faint wash of it,
   the way a rule's row on the rules page carries its category's colour. */
.gallery-item.has-accent {
  box-shadow: inset 3px 0 0 var(--item-accent);
  background-color: color-mix(in srgb, var(--item-accent) 7%, var(--surface-card));
}
/* On a shelf of photos (Find More Tasks' habits) the cards have no padding to keep an edge
   off the text, so the colour is a bar along the bottom of the photo instead. */
.gallery-list.is-shelf .gallery-item.has-accent { box-shadow: none; background-color: transparent; }
/* A section's "Show all" breakdown (more_sections:), opened, replaces its few picks. */
.gallery-section-body:has(> .gallery-more-sections[open]) > .gallery-section-picks { display: none; }
.gallery-more-sections > .gallery-section { margin-top: 1.25rem; }
h3.gallery-section-title { font-size: var(--fs-12); }
.gallery-list.is-shelf .gallery-item.has-accent .gallery-item-image { border-bottom: 3px solid var(--item-accent); }
/* A poster or cover (Find More Sources). A blank one holds the space for an item without. */
.gallery-item-image {
  flex-shrink: 0;
  width: 2.75rem;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--border);
}
.gallery-item-text { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; min-width: 0; }
.gallery-item-title { color: var(--text-1); font-size: var(--fs-14); line-height: 1.5; }
.gallery-item-meta { color: var(--text-3); font-size: var(--fs-11); }
/* Fills itself in from a connected service (Find More Trackers' Steps). */
.gallery-item-auto { margin-left: 0.4rem; color: var(--accent); font-size: var(--fs-11); cursor: help; }
/* A short name over the item's text (Find More Notes: "Policy positions" over its question). */
.gallery-item-heading { color: var(--text-1); font-size: var(--fs-14); font-weight: 700; line-height: 1.3; }
.gallery-item-heading + .gallery-item-title { color: var(--text-2); font-size: var(--fs-13); }
.gallery-saved { flex-shrink: 0; padding: 0.3rem 0.75rem; color: var(--text-3); font-size: var(--fs-12); font-weight: 600; }
.gallery-save {
  flex-shrink: 0;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
}
.gallery-save:hover { filter: brightness(1.2); }
/* Quiet until the card it saves is in hand: a dozen solid green buttons outshouted the
   quotes. It lights green on the card's hover, as it always did on its own. */
.inspiration-card:hover .gallery-save,
.gallery-save:hover,
.gallery-save:focus-visible { border-color: #2a6a3a; background: #1a3a2a; color: #4ade80; }
@media (hover: none) { .gallery-save { border-color: #2a6a3a; color: #4ade80; } }
.gallery-actions { display: flex; flex-shrink: 0; gap: 0.4rem; }
.gallery-save-form { display: contents; }
button.gallery-save { font-family: inherit; cursor: pointer; }
/* A gallery that is a set to complete (Journals' questions): how many are done, and a bar
   that fills as they are — the pull to finish the set. Green once it's full. */
.gallery-progress { display: flex; align-items: center; gap: 0.75rem; margin: -1rem 0 1.25rem; }
.gallery-progress-count { flex-shrink: 0; color: var(--text-3); font-size: var(--fs-12); font-weight: 600; font-variant-numeric: tabular-nums; }
.gallery-progress-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.gallery-progress-bar > span { display: block; height: 100%; border-radius: inherit; background: #4ade80; transition: width var(--dur-fast) ease; }
.gallery-progress.is-complete .gallery-progress-count { color: #4ade80; }
/* Done, with what was made to show for it: the question is ticked off, and the badge opens
   the answer. Quieter than an open item, so what's left stands out. */
.gallery-item.is-done { border-color: rgba(74, 222, 128, 0.22); }
.gallery-item.is-done .gallery-item-title { color: var(--text-2); }
.gallery-done {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  color: #4ade80;
  font-size: var(--fs-12);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.gallery-done:hover { background: rgba(74, 222, 128, 0.08); }
@media (max-width: 600px) { .gallery-page { padding: 1.5rem 1rem; } }

/* ---- Find More galleries: one family ---- */
/* The wide photo shelves (Tasks, Trackers, the Library's videos) as cards, the way Find More
   Things has them: the photo edge to edge across the top, the words and Save padded under it. */
.gallery-list.is-shelf.is-wide > .gallery-item {
  gap: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background-color: var(--surface-card); background-image: var(--sheen);
}
.gallery-list.is-shelf.is-wide .gallery-item-image { border-radius: 0; }
.gallery-list.is-shelf.is-wide .gallery-item-text { padding: 10px 14px 0; }
.gallery-list.is-shelf.is-wide .gallery-actions,
.gallery-list.is-shelf.is-wide .gallery-saved,
.gallery-list.is-shelf.is-wide .gallery-done { margin: 10px 14px 12px; }
/* Save at the card's bottom right, where Things, Rules, and Inspirations have it, rather
   than the covers shelf's left. */
.gallery-list.is-shelf.is-wide :is(.gallery-actions, .gallery-saved, .gallery-done) { align-self: flex-end; }

/* A section that would have covers but has none to show: a compact grid of names. */
.gallery-list.is-text-only { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }

/* "Show 51 more": a button you can see, not a faint line. */
.gallery-more > summary {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 14px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--text-2); font-size: var(--fs-13); font-weight: 500;
}
.gallery-more > summary:hover { background: rgba(255, 255, 255, 0.05); }

/* A section's pointer somewhere related (Tasks' "…like a boat? Find More Things"): a small
   card closing the section rather than a loose line between two. */
.gallery-section-foot {
  padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  justify-content: space-between;
}

/* Find More Inspirations at the galleries' width, its filters a row until "More filters". */
.insp-page.insp-gallery { max-width: 1040px; padding: 2rem 24px 72px; }
.insp-gallery-tags.is-collapsible:not(.is-open) { max-height: 26px; overflow: hidden; }
.insp-gallery-tags.is-collapsible { margin-bottom: 6px; }
.insp-gallery-tags-toggle {
  margin: 0 0 1.25rem; padding: 2px 0; border: none; background: none; cursor: pointer;
  color: var(--text-3); font: inherit; font-size: var(--fs-12); text-decoration: underline;
  text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
.insp-gallery-tags-toggle:hover { color: var(--text-1); }

/* A Find More idea already saved: a quieter card and a green tick (shared/_gallery_item). */
.gallery-saved { display: inline-flex; align-items: center; gap: 6px; }
.gallery-saved i { color: var(--accent, #22c55e); }
.gallery-saved { color: var(--text-2); }

/* Videos: wider 16:9 thumbnails, so fewer to a row, and the channel stays under each. */
.gallery-list.is-shelf.is-wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery-list.is-shelf.is-wide .gallery-item-image { aspect-ratio: 16 / 9; box-shadow: none; }
@media (max-width: 640px) {
  .gallery-list.is-shelf.is-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-list.is-shelf.is-wide .gallery-item-meta { display: block; }
}

/* The way back on a line of its own above the title, as the task page's back arrow and
   crumbs sit, rather than squeezed against the heading. */
.gallery-head { flex-wrap: wrap; row-gap: 6px; }
.gallery-head > .gallery-back { flex: 0 0 100%; display: inline-flex; align-items: center; gap: 6px; width: max-content; }

/* Section headings in normal case at the subtitle's size, the count beside them in grey,
   as Sources' subject tabs carry theirs, rather than small spaced capitals. */
.gallery-section-title { color: var(--text-1); font-size: var(--fs-15); letter-spacing: 0; text-transform: none; }
.gallery-section-title .gallery-section-count { color: var(--text-3); font-size: var(--fs-13); font-weight: 500; }
.gallery-section-title .gallery-section-count::before { content: '· '; }
