/* THC Core: the site map as a page to explore (/sitemap/, [thc_sitemap]) and the favorite stars on its cells
   (1.15.0, thc-workboard WB-148). Colours come from the display tokens so Dark and High contrast follow the visitor's
   choice; literal fallbacks are the light palette. Text on an accent fill uses --thc-on-accent (house rule, WB-147). */

.thc-explore {
  --thc-x-canvas: var(--thc-canvas, #f7f1e4);
  --thc-x-raised: var(--thc-surface-raised, #fcf8ef);
  --thc-x-muted: var(--thc-surface-muted, #ece4d9);
  --thc-x-border: var(--thc-border, #d9d0bc);
  --thc-x-text: var(--thc-text, #332d25);
  --thc-x-deep: var(--thc-leaf-deep, #3f5c3b);
  --thc-x-on: var(--thc-on-accent, #fff);
  color: var(--thc-x-text);
  display: flex; flex-direction: column; gap: 1.5rem;
}
.thc-explore .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap;
}
.thc-explore ul { list-style: none; margin: 0; padding: 0; }
.thc-explore li { margin: 0; }

/* ---------- the top: lede, jump links, first stops ---------- */
.thc-explore__top { display: flex; flex-direction: column; gap: 1rem; }
.thc-explore__lede { margin: 0; font-family: var(--wp--preset--font-family--platypi, "Platypi", Georgia, serif); font-weight: 600; font-size: clamp(1.7rem, 4.5vw, 2.6rem); line-height: 1.1; color: var(--thc-x-text); }
.thc-explore__intro { margin: 0; font-size: 1.1rem; max-width: 60ch; color: var(--thc-x-text); }
.thc-explore__chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.thc-explore__chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; box-sizing: border-box;
  border: 1px solid var(--thc-x-deep); border-radius: 999px; background: var(--thc-x-raised); color: var(--thc-x-deep);
  font-weight: 600; font-size: .95rem; text-decoration: none;
}
.thc-explore__chip:hover { background: var(--thc-x-deep); color: var(--thc-x-on); }
.thc-explore__chip:focus-visible { outline: 3px solid var(--thc-x-deep); outline-offset: 2px; background: var(--thc-x-raised); color: var(--thc-x-deep); }
.thc-explore__chip--quiet { border-style: dashed; }
.thc-explore__star-hint { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .95rem; color: var(--thc-x-text); }
.thc-explore__star-hint[hidden] { display: none; }
.thc-explore__star-hint svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--thc-x-deep); }

.thc-explore__starts { display: flex; flex-direction: column; gap: .6rem; }
.thc-explore__starts-title { margin: 0; font-size: 1.25rem; color: var(--thc-x-text); }
.thc-explore__starts-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; }
.thc-explore__starts-list > li { display: flex; }
.thc-explore__start {
  display: flex; flex-direction: column; gap: .3rem; width: 100%; box-sizing: border-box; padding: 1.1rem 1.2rem;
  border-radius: 14px; background: var(--thc-x-deep); color: var(--thc-x-on); text-decoration: none;
}
.thc-explore__start:hover { background: var(--thc-x-deep); color: var(--thc-x-on); text-decoration: underline; }
.thc-explore__start:focus-visible { outline: 3px solid var(--thc-x-text); outline-offset: 2px; background: var(--thc-x-deep); color: var(--thc-x-on); }
.thc-explore__start-kicker { font-size: .82rem; font-weight: 600; color: var(--thc-x-on); }
.thc-explore__start-title { font-family: var(--wp--preset--font-family--platypi, "Platypi", Georgia, serif); font-weight: 600; font-size: 1.3rem; line-height: 1.2; color: var(--thc-x-on); }
.thc-explore__start-desc { font-size: .93rem; line-height: 1.45; color: var(--thc-x-on); }

/* ---------- the invitation to suggest a feature (1.15.1) ---------- */
.thc-explore__suggest {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  padding: 1rem 1.25rem; border: 2px solid var(--thc-x-deep); border-radius: 14px; background: var(--thc-x-raised); color: var(--thc-x-text);
}
.thc-explore__suggest-text { flex: 1 1 18rem; min-width: 0; }
.thc-explore__suggest-title { margin: 0 0 .2rem; font-size: 1.2rem; line-height: 1.25; color: var(--thc-x-text); }
.thc-explore__suggest p { margin: 0; font-size: .98rem; color: var(--thc-x-text); }

/* 1.15.3: the share bar closes the opening block; the wrap's own page margins are not wanted inside this page. */
.thc-explore__share.thc-share-wrap { margin: 0; padding: 0; }

/* ---------- one band per section ---------- */
.thc-explore__band {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.5rem 2.5rem;
  padding: 1.75rem 1.5rem; border: 1px solid var(--thc-x-border); border-radius: 18px;
  background: var(--thc-x-canvas); color: var(--thc-x-text); scroll-margin-top: 6rem;
}
.thc-explore__band--alt { background: var(--thc-x-raised); }
.thc-explore__side { flex: 1 1 14rem; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.thc-explore__main { flex: 999 1 32rem; min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.thc-explore__tile { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 14px; background: var(--thc-x-muted); color: var(--thc-x-deep); }
.thc-explore__tile svg { width: 28px; height: 28px; }
.thc-explore__title { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.15; color: var(--thc-x-text); scroll-margin-top: 6rem; }
.thc-explore__why { margin: 0; max-width: 36ch; color: var(--thc-x-text); }
.thc-explore__btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; box-sizing: border-box;
  border-radius: 10px; background: var(--thc-x-deep); color: var(--thc-x-on); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.thc-explore__btn:hover { background: var(--thc-x-deep); color: var(--thc-x-on); text-decoration: underline; }
.thc-explore__btn:focus-visible { outline: 3px solid var(--thc-x-text); outline-offset: 2px; background: var(--thc-x-deep); color: var(--thc-x-on); }

.thc-explore__group { display: flex; flex-direction: column; gap: .7rem; }
.thc-explore__group-title { margin: 0; font-size: 1.2rem; color: var(--thc-x-text); }
.thc-explore__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: .7rem; }

/* ---------- a cell: the whole card is the link; the star sits above it in the corner ---------- */
.thc-explore__cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  min-height: 44px; box-sizing: border-box; padding: .85rem 1rem;
  border: 1px solid var(--thc-x-border); border-radius: 12px; background: var(--thc-x-raised); color: var(--thc-x-text);
}
.thc-explore__band--alt .thc-explore__cell { background: var(--thc-x-canvas); }
/* 1.15.1: a cell with a star is never shorter than the star and its two margins, so a one-line cell (a shop category)
   holds the whole button. Keep this in step with .thc-fav-star's size and offsets below. */
.thc-explore__cell--star { padding-right: 3.6rem; min-height: calc(44px + .9rem); justify-content: center; }
.thc-explore__cell:hover, .thc-explore__cell:focus-within { border-color: var(--thc-x-deep); }
.thc-explore__link { color: var(--thc-x-deep); font-weight: 600; font-size: 1rem; line-height: 1.3; text-decoration: none; }
.thc-explore__link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.thc-explore__link:hover { color: var(--thc-x-deep); text-decoration: underline; }
.thc-explore__link:focus-visible { outline: none; color: var(--thc-x-deep); }
.thc-explore__link:focus-visible::after { outline: 3px solid var(--thc-x-deep); outline-offset: 2px; }
.thc-explore__desc { font-size: .92rem; line-height: 1.45; color: var(--thc-x-text); }
.thc-explore__tag {
  font-size: .75rem; font-weight: 600; line-height: 1; padding: .3rem .5rem; border-radius: 999px;
  border: 1px solid var(--thc-x-border); background: var(--thc-x-muted); color: var(--thc-x-text);
}

/* ---------- folded groups ---------- */
.thc-explore__fold { border: 1px dashed var(--thc-x-text); border-radius: 12px; padding: 0 1rem; color: var(--thc-x-text); }
.thc-explore__fold > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-height: 48px; padding: .3rem 0;
  cursor: pointer; list-style: none; color: var(--thc-x-text);
}
.thc-explore__fold > summary::-webkit-details-marker { display: none; }
.thc-explore__fold > summary::before {
  content: "+"; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--thc-x-deep); color: var(--thc-x-on); font-weight: 600; line-height: 1;
}
.thc-explore__fold[open] > summary::before { content: "\2212"; }
.thc-explore__fold > summary:focus-visible { outline: 3px solid var(--thc-x-deep); outline-offset: 2px; }
.thc-explore__fold-title { font-weight: 600; }
.thc-explore__fold-note { font-size: .9rem; }
.thc-explore__fold > .thc-explore__grid { padding: .2rem 0 1rem; }

/* ---------- the fine print ---------- */
.thc-explore__fine { display: flex; flex-direction: column; gap: .5rem; padding: 0 .25rem; }
.thc-explore__fine-title { margin: 0; font-size: 1.1rem; color: var(--thc-x-text); }
.thc-explore__fine-list { display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; }
.thc-explore__fine-list a { display: inline-flex; align-items: center; min-height: 44px; color: var(--thc-x-deep); font-weight: 600; }
.thc-explore__fine-list a:hover { color: var(--thc-x-deep); }

/* ---------- the favorite star (assets/thc-favs.js shows it and keeps it in step) ---------- */
.thc-fav-star {
  position: absolute; top: .45rem; right: .45rem; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; margin: 0;
  border: 1px solid var(--thc-x-border); border-radius: 50%; background: var(--thc-x-raised); color: var(--thc-x-deep);
  cursor: pointer; font: inherit;
}
.thc-fav-star[hidden] { display: none; }
.thc-fav-star svg { width: 20px; height: 20px; }
.thc-fav-star:hover { border-color: var(--thc-x-deep); background: var(--thc-x-muted); color: var(--thc-x-deep); }
.thc-fav-star:focus-visible { outline: 3px solid var(--thc-x-deep); outline-offset: 2px; }
.thc-fav-star[aria-pressed="true"] { border-color: var(--thc-x-deep); background: var(--thc-x-deep); color: var(--thc-x-on); }
.thc-fav-star[aria-pressed="true"] svg path { fill: currentColor; }
.thc-fav-star[aria-pressed="true"]:hover { background: var(--thc-x-deep); color: var(--thc-x-on); }
/* Favorites is full: greyed, but still a button, so a tap can say why and offer Manage favorites. */
.thc-fav-star.is-full { border-style: dashed; background: var(--thc-x-muted); color: var(--thc-x-text); opacity: .5; cursor: help; }
.thc-fav-star.is-full:hover, .thc-fav-star.is-full:focus-visible { opacity: 1; background: var(--thc-x-muted); color: var(--thc-x-text); }

.thc-fav-pop {
  position: absolute; top: 3.5rem; right: .45rem; z-index: 5; width: min(17rem, calc(100vw - 3rem)); box-sizing: border-box;
  padding: .8rem .9rem; border: 2px solid var(--thc-x-deep); border-radius: 12px; background: var(--thc-x-raised); color: var(--thc-x-text);
  box-shadow: var(--thc-shadow-lifted, 0 10px 28px rgba(0, 0, 0, .18)); font-size: .93rem; line-height: 1.4;
}
.thc-fav-pop p { margin: 0 0 .6rem; color: var(--thc-x-text); }
.thc-fav-pop__btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.thc-fav-pop__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 .9rem; box-sizing: border-box;
  border: 1px solid var(--thc-x-deep); border-radius: 10px; background: var(--thc-x-deep); color: var(--thc-x-on);
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
}
.thc-fav-pop__btn:hover { background: var(--thc-x-deep); color: var(--thc-x-on); text-decoration: underline; }
.thc-fav-pop__btn--quiet, .thc-fav-pop__btn--quiet:hover { background: var(--thc-x-raised); color: var(--thc-x-deep); }
.thc-fav-pop__btn:focus-visible { outline: 3px solid var(--thc-x-text); outline-offset: 2px; }

html[data-thc-contrast="high"] .thc-explore__band,
html[data-thc-contrast="high"] .thc-explore__cell,
html[data-thc-contrast="high"] .thc-fav-star { border-color: var(--thc-x-text); }

@media (max-width: 599px) {
  .thc-explore__band { padding: 1.25rem 1rem; }
  .thc-explore__grid { grid-template-columns: 1fr; }
}
@media print {
  .thc-fav-star, .thc-fav-pop, .thc-explore__star-hint { display: none !important; }
  .thc-explore__fold > .thc-explore__grid { display: grid; }
}
