/* Hemp page (hemp.html): the two starting options, the Police/MPI notification helper and the
   congratulations screen. Colours come from Pico v2's dark theme variables. */

/* ---------- Views ----------
   The inline script in <head> sets data-hemp-view before first paint, so only one view shows.
   Without JavaScript the attribute is never set: every view shows, one after the other, and the
   parts that need JavaScript (the form) are hidden. */
html[data-hemp-view] .hemp-view {
  display: none;
}

html[data-hemp-view="home"] #home,
html[data-hemp-view="notify"] #notify,
html[data-hemp-view="details"] #details {
  display: block;
}

html:not([data-hemp-view]) .hemp-needs-js {
  display: none !important;
}

html:not([data-hemp-view]) .hemp-view + .hemp-view {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.hemp-view [tabindex="-1"]:focus {
  outline: none;
}

.hemp-back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-decoration: none;
}

.hemp-center {
  text-align: center;
}

.hemp-fine-print {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.hemp-callout {
  margin: 0 auto 1.5rem auto;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--pico-primary);
  border-radius: var(--pico-border-radius, 4px);
  background-color: rgba(255, 255, 255, 0.02);
}

.hemp-callout > :last-child {
  margin-bottom: 0;
}

/* ---------- Landing ---------- */
.hemp-hero {
  max-width: 36rem;
  margin: 0.75rem auto 2rem auto;
  text-align: center;
  line-height: 1.25;
}

.hemp-hero-lead {
  display: block;
  font-size: clamp(2rem, 7.5vw, 2.8rem);
}

.hemp-hero-lead em {
  font-style: normal;
  color: var(--pico-ins-color);
}

.hemp-hero-date {
  display: block;
  margin: 0.4rem 0 0.9rem 0;
  font-size: 1rem;
  color: var(--pico-primary);
}

.hemp-hero-rest {
  display: block;
  font-size: clamp(1.15rem, 4.2vw, 1.4rem);
  font-weight: 500;
  color: var(--pico-contrast);
}

/* One option per row at every width: side by side, the text column got so narrow the headings
   wrapped onto three lines. */
.hemp-choices {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Emoji on the left, the text beside it. */
.hemp-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.85rem;
  row-gap: 0.15rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--pico-primary);
  border-radius: calc(var(--pico-border-radius) * 3);
  background: rgba(1, 170, 255, 0.06);
  color: var(--pico-contrast);
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.hemp-choice:hover,
.hemp-choice:focus-visible {
  transform: translateY(-2px);
  background: rgba(1, 170, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  color: var(--pico-contrast);
  text-decoration: none;
}

.hemp-choice-primary,
.hemp-choice-primary:hover,
.hemp-choice-primary:focus-visible {
  border-color: var(--pico-primary-background);
  background: var(--pico-primary-background);
  color: #fff;
}

.hemp-choice-primary:hover,
.hemp-choice-primary:focus-visible {
  background: var(--pico-primary-hover-background);
}

.hemp-choice-icon {
  grid-row: 1 / span 3;
  font-size: 1.9rem;
  line-height: 1;
}

.hemp-choice > :not(.hemp-choice-icon) {
  grid-column: 2;
  text-wrap: pretty;
}

.hemp-choice strong {
  font-size: 1.2rem;
  line-height: 1.3;
}

.hemp-choice-meta {
  padding-top: 0.3rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ---------- Notification form ---------- */
.hemp-note {
  margin: -0.5rem 0 1.5rem 0;
  font-size: 0.78rem;
  color: var(--pico-muted-color);
}

.hemp-form-heading {
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pico-primary);
}

.hemp-form-heading:first-of-type {
  margin-top: 0.5rem;
}

.hemp-optional {
  font-weight: normal;
  color: var(--pico-muted-color);
}

.hemp-switch {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.hemp-switch input {
  flex: none;
  margin-top: 0.1em;
}

.hemp-options button.hemp-help,
.hemp-options button.hemp-help:is(:hover, :focus, :active) {
  display: inline;
  width: auto;
  margin: 0 0 0 0.25rem;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  color: var(--pico-primary);
  font-size: 0.85rem;
  font-weight: normal;
  text-decoration: underline;
  cursor: pointer;
}

.hemp-options {
  margin-bottom: 1.5rem;
}

.hemp-options legend {
  margin-bottom: 0.6rem;
  font-weight: 600;
  line-height: 1.4;
}

.hemp-options legend small {
  font-weight: normal;
  color: var(--pico-muted-color);
}

.hemp-options > label,
.hemp-options-row > label {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 0 0 0.5rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--pico-form-element-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-form-element-background-color);
  line-height: 1.4;
  cursor: pointer;
}

.hemp-options label:has(input:checked) {
  border-color: var(--pico-primary);
  background: rgba(1, 170, 255, 0.1);
}

.hemp-options label input {
  flex: none;
  margin-top: 0.05em;
}

/* Indoors / Outdoors / Both sit side by side once there's room; on a phone they stack like the rest. */
@media (min-width: 576px) {
  .hemp-options-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .hemp-options-row > label {
    margin-bottom: 0;
  }
}

.hemp-options > small {
  display: block;
  color: var(--pico-muted-color);
}

.hemp-options.hemp-invalid legend {
  color: var(--disclaimer-color);
}

.hemp-options.hemp-invalid label {
  border-color: var(--pico-form-element-invalid-border-color);
}

#n-production-other {
  margin-top: 0.25rem;
}

/* ---------- Send it to Police, send it to MPI ---------- */
.hemp-send {
  margin: 2.5rem 0 1rem 0;
  padding: 1.25rem;
  border: 1px solid var(--pico-primary);
  border-radius: calc(var(--pico-border-radius) * 3);
  background: rgba(1, 170, 255, 0.05);
}

.hemp-send h2 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.hemp-steps {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0;
}

.hemp-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--pico-border-radius);
  background: rgba(255, 255, 255, 0.03);
  list-style: none;
}

.hemp-step-mark {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 2px solid var(--pico-muted-color);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}

.hemp-step-who {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.hemp-step-who small {
  display: block;
  overflow-wrap: break-word;
  color: var(--pico-muted-color);
}

.hemp-step-status {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.5rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 1rem;
  font-size: 0.75rem;
  white-space: nowrap;
  vertical-align: 0.1em;
  color: var(--pico-muted-color);
}

.hemp-steps li.is-done .hemp-step-mark {
  border-color: var(--pico-ins-color);
  background: var(--pico-ins-color);
  color: #0b1a14;
  font-size: 0;
}

.hemp-steps li.is-done .hemp-step-mark::after {
  content: "✓";
  font-size: 1rem;
}

.hemp-steps li.is-done .hemp-step-status {
  border-color: var(--pico-ins-color);
  color: var(--pico-ins-color);
}

.hemp-send-button {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.9rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.hemp-send-alt {
  font-size: 0.85rem;
  text-align: center;
  color: var(--pico-muted-color);
}

.hemp-copy {
  margin: 1rem 0 0 0;
  background: none;
}

.hemp-copy summary {
  font-size: 0.9rem;
}

.hemp-copy-mail {
  margin-top: 1rem;
}

.hemp-copy-mail h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.hemp-copy-mail textarea {
  font-size: 0.8rem;
}

.hemp-copy-mail [role="group"] {
  margin-bottom: 0.5rem;
}

/* ---------- Congratulations ---------- */
.hemp-congrats {
  padding: 1rem 0 0.5rem 0;
  text-align: center;
}

.hemp-congrats-emoji {
  font-size: clamp(4.5rem, 20vw, 6.5rem);
  line-height: 1;
  animation: hemp-pop 0.7s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.hemp-congrats h1 {
  margin: 0.75rem 0 0.5rem 0;
  /* Small enough that "Congratulations!" stays on one line on a 320px phone. */
  font-size: clamp(1.6rem, 8.2vw, 3.6rem);
}

.hemp-congrats-lead {
  max-width: 30rem;
  margin: 0 auto 1.5rem auto;
  font-size: 1.2rem;
}

.hemp-pass {
  max-width: 26rem;
  margin: 0 auto 1.5rem auto;
  padding: 1rem 1.25rem;
  border: 2px solid var(--pico-ins-color);
  border-radius: calc(var(--pico-border-radius) * 3);
  background: rgba(98, 175, 154, 0.08);
  text-align: left;
}

.hemp-pass-title {
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pico-ins-color);
}

.hemp-pass dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.hemp-pass dt {
  font-size: 0.9rem;
  color: var(--pico-muted-color);
}

.hemp-pass dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.hemp-congrats-next {
  max-width: 30rem;
  margin: 0 auto 1.5rem auto;
  text-align: left;
}

.hemp-congrats-actions {
  display: grid;
  gap: 0.75rem;
  max-width: 26rem;
  margin: 0 auto;
}

.hemp-congrats-actions > * {
  width: 100%;
  margin: 0;
}

@keyframes hemp-pop {
  0% {
    transform: scale(0.3) rotate(-20deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.hemp-confetti {
  position: fixed;
  inset: 0;
  z-index: 10001;
  overflow: hidden;
  pointer-events: none;
}

.hemp-confetti i {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: hemp-confetti-fall 3s cubic-bezier(0.25, 0.4, 0.5, 1) forwards;
}

@keyframes hemp-confetti-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0);
  }

  100% {
    transform: translate3d(var(--drift, 0), 105vh, 0) rotate(var(--spin, 360deg));
  }
}

/* ---------- Details view ---------- */
.hemp-cta {
  margin: 2rem 0 1rem 0;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .hemp-choice,
  .hemp-congrats-emoji {
    transition: none;
    animation: none;
  }

  .hemp-confetti {
    display: none;
  }
}
