/**
 * Identify an Unknown Mushroom (/identify-a-mushroom/)
 * Template: page-identify-a-mushroom.php · Script: js/identify-tool/identify-tool.js
 * Colors fall back to the Forayz token values when tokens.css isn't loaded on the page.
 */
.idt-page {
  --idt-forest: var(--forest-700, #2d5e47);
  --idt-forest-dark: var(--forest-900, #1b3a2d);
  --idt-forest-tint: var(--forest-50, #f2f8f5);
  --idt-forest-line: var(--forest-200, #c2dfd0);
  --idt-bark: var(--bark-700, #6b4a2e);
  --idt-bark-tint: var(--bark-50, #faf6f1);
  --idt-line: var(--bark-200, #e8d5bf);
  --idt-chant: var(--chant-500, #d98b3a);
  --idt-chant-tint: var(--chant-100, #fcf0e2);
  --idt-ink: #24201c;
  --idt-muted: #6b6259;
  --idt-stop: #a3301f;
  --idt-stop-tint: #fbece8;
  --idt-warn: #8a5208;
  --idt-warn-tint: #fdf3e3;
  --idt-top: calc(var(--wp-admin--admin-bar--height, 0px) + 16px);

  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 56px;
  color: var(--idt-ink);
  line-height: 1.5;
}
.idt-page * {
  box-sizing: border-box;
}
.idt-page i {
  font-style: italic;
}

.idt-intro {
  max-width: 46rem;
  margin-bottom: 28px;
}
.idt-intro h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 10px;
  color: var(--idt-forest-dark);
}
.idt-intro p {
  font-size: 1.08rem;
  margin: 0 0 8px;
}
.idt-intro .idt-small {
  font-size: 0.95rem;
  color: var(--idt-muted);
}

.idt-h2 {
  font-size: 1.5rem;
  margin: 40px 0 6px;
  color: var(--idt-forest-dark);
}
.idt-sub {
  margin: 0 0 16px;
  color: var(--idt-muted);
}

/* The eight-step flow */
.idt-steps {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 10px;
  counter-reset: idts;
}
.idt-steps li {
  counter-increment: idts;
  background: var(--idt-bark-tint);
  border: 1px solid var(--idt-line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.96rem;
}
.idt-steps li b {
  display: block;
  font-size: 1.04rem;
  margin-bottom: 2px;
  color: var(--idt-forest-dark);
}
.idt-steps li b::before {
  content: counter(idts) '. ';
  color: var(--idt-chant);
}
.idt-steps li.is-new {
  background: var(--idt-chant-tint);
  border-color: var(--idt-chant);
}

/* Tool layout: questions left, live guide right */
.idt-tool-wrap {
  margin-top: 8px;
}
.idt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.idt-form {
  display: grid;
  gap: 12px;
}

.idt-card {
  background: #fff;
  border: 1px solid var(--idt-line);
  border-radius: 12px;
  padding: 14px 16px 16px;
}
.idt-card.is-done {
  border-color: var(--idt-forest-line);
}
.idt-card-head {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}
.idt-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--idt-bark-tint);
  color: var(--idt-bark);
  border: 1px solid var(--idt-line);
}
.idt-card.is-done .idt-num {
  background: var(--idt-forest);
  border-color: var(--idt-forest);
  color: #fff;
}
.idt-card-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: var(--idt-ink);
}
.idt-hint {
  display: block;
  margin: 2px 0 0;
  font-size: 0.92rem;
  color: var(--idt-muted);
  font-weight: 400;
}
.idt-field + .idt-field {
  margin-top: 12px;
}
.idt-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--idt-muted);
  margin-bottom: 6px;
}

.idt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.idt-chip {
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.2;
  cursor: pointer;
  background: #fff;
  color: var(--idt-ink);
  border: 1px solid #cfc3b4;
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px;
}
.idt-chip:hover {
  border-color: var(--idt-forest);
}
.idt-chip[aria-pressed='true'] {
  background: var(--idt-forest);
  border-color: var(--idt-forest);
  color: #fff;
  font-weight: 600;
}
.idt-chip[aria-pressed='true']::before {
  content: '✓ ';
}
.idt-chip:focus-visible,
.idt-btn:focus-visible,
.idt-unique textarea:focus-visible {
  outline: 3px solid var(--idt-chant);
  outline-offset: 2px;
}

/* Optional "hoping to eat it?" card: visibly different from the specimen questions */
.idt-prefs {
  display: grid;
  gap: 4px;
  background: var(--idt-chant-tint);
  border: 1px dashed var(--idt-chant);
}
.idt-tag {
  justify-self: start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--idt-warn);
}
.idt-prefs .idt-chip {
  background: #fffaf3;
}
.idt-prefs .idt-chip[aria-pressed='true'] {
  background: var(--idt-bark);
  border-color: var(--idt-bark);
  color: #fff;
}

.idt-unique textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  border: 1px solid #cfc3b4;
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}

.idt-btn {
  font: inherit;
  cursor: pointer;
  background: #fff;
  border: 1px solid #cfc3b4;
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--idt-ink);
}
.idt-btn:hover {
  border-color: var(--idt-forest);
}
.idt-reset {
  justify-self: start;
}

/* Live guide */
.idt-out {
  position: sticky;
  top: var(--idt-top);
  max-height: calc(100vh - var(--idt-top) - 16px);
  overflow-y: auto;
  background: var(--idt-forest-tint);
  border: 2px solid var(--idt-forest);
  border-radius: 14px;
}
.idt-out-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--idt-forest);
  color: #fff;
}
.idt-live {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.idt-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9fe0b9;
  box-shadow: 0 0 0 0 rgba(159, 224, 185, 0.7);
  animation: idt-pulse 2s infinite;
}
@keyframes idt-pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(159, 224, 185, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(159, 224, 185, 0);
  }
}
.idt-progress {
  font-size: 0.88rem;
  opacity: 0.9;
  font-variant-numeric: tabular-nums;
}
.idt-out-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}
.idt-out-body.is-flash {
  animation: idt-flash 0.6s ease-out;
}
@keyframes idt-flash {
  from {
    background: #dcefe4;
  }
  to {
    background: transparent;
  }
}
.idt-out-body p {
  margin: 0;
}
.idt-out-body ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 4px;
}
.idt-out-body a {
  color: var(--idt-forest);
  font-weight: 600;
}
.idt-empty {
  color: var(--idt-muted);
  font-size: 1.02rem;
}
.idt-out-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--idt-forest);
  margin-bottom: 6px;
}

.idt-flag {
  background: var(--idt-stop-tint);
  border-left: 4px solid var(--idt-stop);
  border-radius: 6px;
  padding: 10px 12px;
}
.idt-flag b {
  color: var(--idt-stop);
}
.idt-short {
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid;
}
.idt-short b {
  display: block;
  font-size: 1.08rem;
  margin-bottom: 2px;
}
.idt-short.is-stop {
  background: var(--idt-stop);
  border-color: var(--idt-stop);
  color: #fff;
}
.idt-short.is-warn {
  background: var(--idt-warn-tint);
  border-color: #e6c48f;
}
.idt-short.is-warn b {
  color: var(--idt-warn);
}
.idt-short.is-go {
  background: #fff;
  border-color: var(--idt-forest-line);
}
.idt-short.is-go b {
  color: var(--idt-forest);
}
.idt-cand {
  background: #fff;
  border: 1px solid var(--idt-forest-line);
  border-left: 4px solid var(--idt-forest);
  border-radius: 6px;
  padding: 10px 12px;
}
.idt-cand + .idt-cand {
  margin-top: 8px;
}
.idt-cand p {
  margin: 2px 0 4px;
}
.idt-copied {
  font-size: 0.9rem;
  color: var(--idt-forest);
  margin-left: 6px;
}
.idt-out-sec .idt-btn {
  margin-top: 10px;
}

/* Phone: guide follows the questions; a sticky pill jumps to it */
.idt-jump {
  display: none;
}
@media (max-width: 860px) {
  .idt-grid {
    grid-template-columns: 1fr;
  }
  .idt-out {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .idt-out-head {
    position: static;
  }
  .idt-jump:not([hidden]) {
    display: inline-flex;
    gap: 8px;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 50;
    background: var(--idt-forest);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  }
  .idt-jump span {
    font-weight: 400;
    opacity: 0.85;
  }
}

/* Tools */
.idt-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 10px;
}
.idt-tools > div {
  background: #fff;
  border: 1px solid var(--idt-line);
  border-radius: 10px;
  padding: 12px 14px;
}
.idt-tools b {
  display: block;
  color: var(--idt-forest-dark);
}
.idt-tools p {
  margin: 4px 0 6px;
  font-size: 0.94rem;
  color: var(--idt-muted);
}
.idt-tools a {
  color: var(--idt-forest);
  font-weight: 600;
}
.idt-disclaimer {
  margin-top: 32px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--idt-bark-tint);
  border: 1px solid var(--idt-line);
  font-size: 0.96rem;
}

@media (prefers-reduced-motion: reduce) {
  .idt-dot,
  .idt-out-body.is-flash {
    animation: none;
  }
}
