/* ==========================================================
   Universo Dessert Map
   ========================================================== */

/* Chart colors: change these to match your theme */
.dessert-map {
  --udm-tried: #5b2a4e;
  --udm-heard: #c8702a;
}

/* ----------------------------------------------------------
   Questions
   ---------------------------------------------------------- */

.dessert-map .dessert-map__form .dessert-map__intro {
  margin: 0 0 2.5rem;
}

.dessert-map__question {
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1.25rem;
}

.dessert-map__question legend {
  font-size: 1.125rem;
  font-weight: 700;
  padding: 0 0.5rem;
}

/* Locales line under each pastry */
.dessert-map__hint {
  white-space: pre-line;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.dessert-map__image {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0.5rem 0;
  border-radius: 6px;
}

/* Answer choices */
.dessert-map__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.dessert-map__question label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 1.25rem 0.5rem 0;
  padding: 0.25rem 0;
  cursor: pointer;
}

.dessert-map__question input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: currentColor;
}

/* Submit button */
.dessert-map__form button[type="submit"],
.dessert-map__actions button {
  padding: 0.75rem 1.5rem;
  border: 2px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Visible focus ring for keyboard users */
.dessert-map__question input[type="radio"]:focus-visible,
.dessert-map__form button:focus-visible,
.dessert-map__actions button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   Results
   ---------------------------------------------------------- */

.dessert-map__results {
  margin-top: 3rem;
}

.dessert-map__results-heading {
  font-size: clamp(2rem, 5vw, 3rem);
}

.dessert-map__results-heading:focus {
  outline: none; /* Focus is moved here by script, not by the keyboard user. */
}

.dessert-map__summary p {
  margin: 0 0 0.5rem;
}

.dessert-map__chart {
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
}

/* Numbers table */
.dessert-map__numbers summary {
  cursor: pointer;
  font-weight: 700;
}

.dessert-map__numbers table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}

.dessert-map__numbers caption {
  text-align: left;
  margin-bottom: 0.5rem;
}

.dessert-map__numbers th,
.dessert-map__numbers td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid currentColor;
  text-align: left;
}

/* ----------------------------------------------------------
   Where to wander next
   ---------------------------------------------------------- */

.dessert-map__next {
  margin-top: 2.5rem;
}

.dessert-map__next h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.dessert-map__next-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.dessert-map__next-item {
  padding: 1.25rem;
  border: 1px solid currentColor;
  border-radius: 6px;
}

.dessert-map__next-item h4 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.dessert-map__next-item p {
  margin: 0 0 1rem;
}

.dessert-map__browse {
  font-weight: 700;
}
/* Print / change answers buttons */
.dessert-map__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

/* Only shown when printed */
.dessert-map__print-credit {
  display: none;
}

/* ----------------------------------------------------------
   Print
   ---------------------------------------------------------- */

@media print {
  #wpadminbar,
  .site-header,
  .page-banner,
  .site-footer,
  .dessert-map__form,
  .dessert-map__actions,
  .dessert-map__numbers summary {
    display: none !important;
  }

  .dessert-map__results {
    margin-top: 0;
  }

  .dessert-map__print-credit {
    display: block;
    margin-top: 2rem;
    font-size: 0.85rem;
  }

  /* Keep each card, the chart and the table from splitting across pages */
  .dessert-map__chart,
  .dessert-map__numbers table,
  .dessert-map__next-item {
    break-inside: avoid;
  }
}
