/* THC Gear: "Build Your Field Gear Checklist" ([thc_gear_checklist]).
   Colours are the theme's tokens (--thc-*, then --wp--preset--color--*, then the brand literals), so THC Core's
   Display switch flips them for Dark (html[data-thc-theme="dark"]) and High contrast (html[data-thc-contrast="high"])
   with no rules of our own; the few literals (buttons on the leaf colour, the warning box) are restated for Dark.
   Fonts come from the theme (Platypi for headings, Fira Sans for text); nothing is loaded here.
   Phone first: one column, tap targets at least 44px, no horizontal scroll at 360px. No floating, fixed or sticky
   elements. Sizes in rem/em so Core's text-size switch carries through. Printing: see the end of this file. */

.thc-gear {
  --g-canvas: var(--thc-canvas, var(--wp--preset--color--base, #f7f1e4));
  --g-raised: var(--thc-surface-raised, var(--wp--preset--color--accent-5, #fcf8ef));
  --g-muted: var(--thc-surface-muted, var(--wp--preset--color--accent-4, #ece4d9));
  --g-border: var(--thc-border, var(--wp--preset--color--accent-6, #d9d0bc));
  --g-text: var(--thc-text, var(--wp--preset--color--contrast, #332d25));
  --g-leaf: var(--thc-leaf, var(--wp--preset--color--accent-1, #5e7d53));
  --g-deep: var(--thc-leaf-deep, var(--wp--preset--color--accent-3, #3f5c3b));
  --g-stroke: var(--thc-control-stroke, var(--wp--preset--color--control-stroke, #8a7f66));
  --g-error: var(--thc-error, #a13d2d);
  --g-on-leaf: #ffffff;
  --g-warn-bg: #fbf1e3;
  --g-warn-line: #e4a96a;
  --g-head: var(--wp--preset--font-family--platypi, "THC Platypi", Georgia, serif);
  --g-radius: var(--thc-radius-md, 10px);
  color: var(--g-text);
  overflow-wrap: anywhere;
  margin-block: .5rem 0;
}
:root[data-thc-theme="dark"] .thc-gear { --g-on-leaf: #15130f; --g-warn-bg: #2c241b; --g-warn-line: #c98b4c; }
:root[data-thc-contrast="high"] .thc-gear { --g-warn-bg: #ffffff; --g-warn-line: #000000; }
:root[data-thc-contrast="high"][data-thc-theme="dark"] .thc-gear { --g-warn-bg: #000000; --g-warn-line: #ffffff; --g-on-leaf: #000000; }

.thc-gear *, .thc-gear *::before, .thc-gear *::after { box-sizing: border-box; }
.thc-gear [hidden] { display: none !important; }
:where(.thc-gear) :where(button, input, select) { font: inherit; color: inherit; }
.thc-gear :focus-visible { outline: 3px solid var(--g-leaf); outline-offset: 2px; }
.thc-gear__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; }

/* Plain list (no JavaScript); hidden once the tool has started. */
.thc-gear.has-js .thc-gear__static { display: none; }
.thc-gear__nojs { font-weight: 600; background: var(--g-muted); border-radius: var(--g-radius); padding: .75rem 1rem; }
.thc-gear__sgroup { margin-block: 1rem; break-inside: avoid; }
.thc-gear__sgroup-h { font-family: var(--g-head); font-size: 1.25rem; margin: 0 0 .25rem; }
.thc-gear__checks { list-style: none; margin: 0 0 .5rem; padding: 0; }
.thc-gear__checks li { display: grid; grid-template-columns: 1.1em 1fr; column-gap: .6em; align-items: start; padding: .2rem 0; }
.thc-gear__box { width: 1em; height: 1em; margin-top: .2em; border: 2px solid currentColor; border-radius: 3px; }
.thc-gear__checks .thc-gear__tip { grid-column: 2; }

/* ---------- layout ---------- */
.thc-gear__cols { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .thc-gear__cols { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
}
.thc-gear__main, .thc-gear__side { display: grid; gap: 1.25rem; min-width: 0; align-content: start; }
.thc-gear__step { background: var(--g-raised); border: 1px solid var(--g-border); border-radius: var(--thc-radius-lg, 16px); padding: 1rem; min-width: 0; }
@media (min-width: 600px) { .thc-gear__step { padding: 1.25rem 1.5rem; } }
.thc-gear__h { display: flex; align-items: center; gap: .6rem; font-family: var(--g-head); font-size: clamp(1.35rem, 1.2rem + .6vw, 1.7rem); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
.thc-gear__num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.75em; height: 1.75em; border-radius: 999px; background: var(--g-leaf); color: var(--g-on-leaf); font-size: .8em; font-weight: 700; letter-spacing: 0; }
.thc-gear__lead { margin: 0 0 .75rem; }
.thc-gear__hint { margin: .25rem 0 .5rem; font-size: .92rem; }

/* ---------- filters (chips are real checkboxes) ---------- */
.thc-gear__set { border: 0; margin: 0 0 .9rem; padding: 0; min-width: 0; }
.thc-gear__legend { font-weight: 600; padding: 0; margin: 0 0 .4rem; }
.thc-gear__chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.thc-gear__chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .9rem .4rem .7rem; border: 1px solid var(--g-stroke); border-radius: 999px; background: var(--g-canvas); cursor: pointer; line-height: 1.25; max-width: 100%; }
.thc-gear__chip input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--g-leaf); }
.thc-gear__chip:has(input:checked) { background: var(--g-muted); border-color: var(--g-leaf); box-shadow: inset 0 0 0 1px var(--g-leaf); font-weight: 600; }
.thc-gear__chip:has(input:focus-visible) { outline: 3px solid var(--g-leaf); outline-offset: 2px; }
.thc-gear__chip input:focus-visible { outline: none; }

/* ---------- buttons ---------- */
.thc-gear__btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: .5em 1.15em; border-radius: 999px; border: 1px solid var(--g-leaf); background: var(--g-leaf); color: var(--g-on-leaf); font-weight: 600; cursor: pointer; line-height: 1.2; max-width: 100%; }
.thc-gear__btn:hover { background: var(--g-deep); border-color: var(--g-deep); }
.thc-gear__btn--ghost { background: transparent; color: var(--g-deep); border-color: var(--g-stroke); }
.thc-gear__btn--ghost:hover { background: var(--g-muted); color: var(--g-deep); border-color: var(--g-stroke); }
.thc-gear__btn--wide { width: 100%; margin-top: .5rem; }
.thc-gear__link { background: none; border: 0; padding: .5rem .25rem; min-height: 44px; color: var(--g-deep); font-weight: 600; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.thc-gear__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.thc-gear__msg { margin: .5rem 0 0; min-height: 0; }
.thc-gear__msg:empty { display: none; }
.thc-gear__msg.is-error { color: var(--g-error); font-weight: 600; }

/* Show everything switch: a real checkbox drawn as a switch. */
.thc-gear__switch { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; cursor: pointer; font-weight: 600; }
.thc-gear__switch input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 2.75rem; height: 1.6rem; margin: 0; border-radius: 999px; border: 2px solid var(--g-stroke); background: var(--g-muted); cursor: pointer; }
.thc-gear__switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.6rem - 8px); height: calc(1.6rem - 8px); border-radius: 50%; background: var(--g-stroke); }
.thc-gear__switch input:checked { background: var(--g-leaf); border-color: var(--g-leaf); }
.thc-gear__switch input:checked::after { left: auto; right: 2px; background: var(--g-on-leaf); }
@media (prefers-reduced-motion: no-preference) {
  .thc-gear__switch input::after { transition: left .15s ease, right .15s ease; }
}

/* ---------- suggestions ---------- */
.thc-gear__sugg { margin-top: .75rem; display: grid; gap: .6rem; }
.thc-gear__grp { border: 1px solid var(--g-border); border-radius: var(--g-radius); background: var(--g-canvas); }
.thc-gear__grp-sum { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; min-height: 48px; padding: .5rem 1rem .5rem 2.4rem; cursor: pointer; list-style: none; position: relative; }
.thc-gear__grp-sum::-webkit-details-marker { display: none; }
.thc-gear__grp-sum::before { content: ""; position: absolute; left: 1rem; top: 50%; width: .55rem; height: .55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); }
.thc-gear__grp:not([open]) > .thc-gear__grp-sum::before { transform: translateY(-50%) rotate(-45deg); }
.thc-gear__grp-h { font-family: var(--g-head); font-size: 1.1rem; margin: 0; line-height: 1.2; }
.thc-gear__grp-meta { font-size: .88rem; color: var(--g-deep); font-weight: 600; }
.thc-gear__grp > :not(summary) { margin-inline: 1rem; }
.thc-gear__grp > :last-child { margin-bottom: .75rem; }
.thc-gear__band { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-deep); margin-block: .5rem .1rem; }
.thc-gear__band--x { color: var(--g-text); opacity: .85; }
.thc-gear__none { margin-block: .25rem .75rem; font-size: .92rem; }
.thc-gear__items, .thc-gear__litems { list-style: none; margin: 0; padding: 0; }
.thc-gear__item { display: flex; align-items: flex-start; gap: .7rem; min-height: 44px; padding: .55rem .25rem; cursor: pointer; border-top: 1px solid var(--g-border); }
.thc-gear__items li:first-child .thc-gear__item { border-top: 0; }
.thc-gear__item input, .thc-gear__check input { flex: none; width: 1.3rem; height: 1.3rem; margin: .1rem 0 0; accent-color: var(--g-leaf); }
.thc-gear__item-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.thc-gear__name { line-height: 1.3; }
.thc-gear__tip { font-size: .9rem; line-height: 1.4; opacity: .9; }
.thc-gear__item:has(input:checked) .thc-gear__name { font-weight: 600; }

/* Leave these at home */
.thc-gear__leave { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--g-warn-line); border-left-width: 6px; border-radius: var(--g-radius); background: var(--g-warn-bg); }
.thc-gear__leave-h { font-family: var(--g-head); font-size: 1.15rem; margin: 0 0 .35rem; }
.thc-gear__leave p { margin: 0 0 .35rem; }
.thc-gear__leave p:last-child { margin-bottom: 0; }
.thc-gear__leave-items { font-weight: 600; }

/* ---------- your own items ---------- */
.thc-gear__field { display: grid; gap: .35rem; margin-bottom: .75rem; min-width: 0; }
.thc-gear__field--row { grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 480px) { .thc-gear__field--row { grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; } .thc-gear__field--row > .thc-gear__field { margin-bottom: 0; } }
.thc-gear__label { font-weight: 600; }
.thc-gear__input, .thc-gear__select { width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--g-stroke); border-radius: var(--thc-radius-sm, 6px); background: var(--g-canvas); color: var(--g-text); }
.thc-gear__input[aria-invalid="true"] { border-color: var(--g-error); box-shadow: 0 0 0 1px var(--g-error); }
.thc-gear__note { margin: 0; font-size: .92rem; line-height: 1.45; }
.thc-gear__check { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; cursor: pointer; }
.thc-gear__check input { margin: 0; }

/* ---------- My list ---------- */
.thc-gear__mylist-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.thc-gear__count { margin: 0 0 .5rem; font-weight: 700; color: var(--g-deep); }
.thc-gear__modes { display: inline-flex; border: 1px solid var(--g-stroke); border-radius: 999px; padding: 3px; margin-bottom: .75rem; background: var(--g-canvas); }
.thc-gear__mode { min-height: 44px; min-width: 5.5rem; padding: .35rem 1rem; border: 0; border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; }
.thc-gear__mode[aria-pressed="true"] { background: var(--g-leaf); color: var(--g-on-leaf); }
.thc-gear__packbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.thc-gear__packed { margin: 0; font-weight: 600; }
.thc-gear__list:focus { outline: none; }
.thc-gear__list:focus-visible { outline: 3px solid var(--g-leaf); outline-offset: 4px; }
.thc-gear__empty { margin: .25rem 0; padding: .9rem 1rem; border: 1px dashed var(--g-stroke); border-radius: var(--g-radius); }
.thc-gear__lgroup-h { font-family: var(--g-head); font-size: 1.05rem; margin: .85rem 0 .2rem; }
.thc-gear__lgroup-h:first-child, .thc-gear__hint + .thc-gear__lgroup-h { margin-top: .25rem; }
.thc-gear__lrow { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; border-top: 1px solid var(--g-border); }
.thc-gear__litems li:first-child { border-top: 0; }
.thc-gear__lrow > .thc-gear__item-text { padding-block: .4rem; }
.thc-gear__tag { font-size: .78rem; font-weight: 600; color: var(--g-deep); }
.thc-gear__remove { flex: none; min-height: 44px; min-width: 44px; padding: .3rem .8rem; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--g-deep); font-weight: 600; text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.thc-gear__remove:hover { background: var(--g-muted); }
/* Pack mode: large tick boxes. */
.thc-gear__pack { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 52px; padding: .45rem .1rem; cursor: pointer; }
.thc-gear__pack input { flex: none; width: 1.75rem; height: 1.75rem; margin: 0; accent-color: var(--g-leaf); }
.thc-gear__pack:has(input:checked) .thc-gear__name { text-decoration: line-through; text-decoration-thickness: .08em; opacity: .75; }

/* Keep it */
.thc-gear__saved { margin: 0 0 .5rem; font-weight: 600; }
.thc-gear__saved.is-ok { color: var(--g-deep); }
.thc-gear__saved.is-ok::before { content: ""; display: inline-block; width: .45em; height: .8em; margin-right: .55em; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translateY(-.1em) rotate(45deg); }
.thc-gear__saved.is-off { font-weight: 400; font-size: .92rem; }
.thc-gear__cols-set { margin-top: .5rem; }

/* ---------- the printed sheet (built by the script, only ever shown on paper) ---------- */
.thc-gear-sheet { display: none; }

@media print {
  /* Margins come in two layers (0.1.1): the page's own margin, plus padding on the sheet itself, so a print box set to
     "Margins: None" or "Minimum" still leaves a margin. The left and right padding repeat on every page; the top
     padding repeats too where the browser supports box-decoration-break on printed pages. */
  @page { margin: 10mm 10mm 12mm; }
  /* Only the sheet prints: the site header, footer, top bar, Display button, the tool's own controls, everything. */
  html.thc-gear-printing body > *:not(.thc-gear-sheet) { display: none !important; }
  html.thc-gear-printing, html.thc-gear-printing body { background: #fff !important; color: #332d25 !important; margin: 0 !important; padding: 0 !important; }
  /* The site's colours, fixed (not the visitor's dark or high-contrast display choice): text #332d25, deep leaf
     #3f5c3b for headings and rules, border #d9d0bc. White paper, no filled areas, so it prints well in black and white. */
  .thc-gear-sheet { display: block; padding: 8mm 8mm 6mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; color: #332d25; background: #fff; font: 11pt/1.35 "THC Fira Sans", "Fira Sans", "Segoe UI", Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .thc-gear-sheet * { color: #332d25 !important; background: transparent !important; }
  .thc-gear-sheet .thc-gear__sheet-title, .thc-gear-sheet .thc-gear__sheet-h { color: #3f5c3b !important; }
  .thc-gear__sheet-brand { display: flex; align-items: center; margin: 0 0 8pt; padding-bottom: 6pt; border-bottom: .75pt solid #d9d0bc; }
  .thc-gear__sheet-logo { display: block; width: auto; max-width: 60mm; height: 15mm; object-fit: contain; object-position: left center; }
  .thc-gear__sheet-site { font: 600 12pt/1.2 "THC Platypi", Platypi, Georgia, serif; }
  .thc-gear__sheet-title { font: 600 20pt/1.15 "THC Platypi", Platypi, Georgia, serif; margin: 0 0 2pt; letter-spacing: 0; }
  .thc-gear__sheet-meta { margin: 0 0 10pt; font-size: 9.5pt; }
  .thc-gear-sheet--2 .thc-gear__sheet-groups { column-count: 2; column-gap: 12mm; }
  .thc-gear__sheet-group { margin: 0 0 9pt; }
  .thc-gear__sheet-h { font: 600 12.5pt/1.2 "THC Platypi", Platypi, Georgia, serif; margin: 0 0 3pt; padding-bottom: 2pt; border-bottom: 1pt solid #3f5c3b; break-after: avoid; }
  .thc-gear__sheet-items { list-style: none; margin: 0; padding: 0; }
  .thc-gear__sheet-items li { display: flex; align-items: flex-start; gap: 7pt; padding: 3pt 0; break-inside: avoid; }
  .thc-gear__sheet-box { flex: none; width: 11pt; height: 11pt; margin-top: 1pt; border: 1.2pt solid #3f5c3b; border-radius: 2pt; }
  .thc-gear__sheet-text { display: flex; flex-direction: column; }
  .thc-gear__sheet-tip { font-size: 9pt; font-style: italic; }
  .thc-gear__sheet-foot { margin: 14pt 0 0; padding-top: 4pt; border-top: .75pt solid #d9d0bc; font-size: 9pt; }

  /* Printing without the script (or before it starts): the plain list only, without the tool's notes. */
  .thc-gear__nojs, .thc-gear__app { display: none !important; }
  .thc-gear__checks li { break-inside: avoid; }
}
