/*
 * Dragonology (/dragon-numerology). Loaded by the page's own blocks (src/dragonology.php), so the
 * shared main.css and layout stay unchanged. Uses main.css's tokens, so light and dark mode follow.
 */

/* The Dragonology page is a wider column (800px), centred on the page, like the full story pages
   (Morne, 2026-11-15). Only the page with the package cards (and its admin preview). */
.page-body:has(.dn-packages) { max-width: 50rem; margin-inline: auto; }

/* The "for personal interest" note: always visible, set apart from the history pages. */
.dn-note {
  margin: var(--space-l) 0;
  padding: var(--space-m) var(--space-l);
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-left: 5px solid var(--color-focus);
  border-radius: var(--radius);
}
.dn-note p { margin: 0; }
.dn-note .dn-note__label {
  margin-bottom: var(--space-2xs);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Package cards */
.dn-packages {
  list-style: none;
  margin: var(--space-m) 0 var(--space-l);
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-m);
}
/* one card a row on a phone, two by two from tablet width up (never 3 + 1) */
@media (min-width: 36rem) { .dn-packages { grid-template-columns: repeat(2, 1fr); } }
.dn-package {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--space-m);
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius);
}
.dn-package.is-chosen { border-color: var(--color-link); border-top-color: var(--color-link); }
.dn-package__name {
  margin: 0 0 var(--space-2xs);
  font-size: var(--step-1);
}
.dn-package__price {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--step-3);
  line-height: 1.1;
  color: var(--color-heading);
}
.dn-package__meta {
  margin: 0 0 var(--space-s);
  font-size: var(--step--1);
  color: var(--color-text-muted);
}
.dn-package__each::before { content: " · "; }
.dn-package__text { margin: 0 0 var(--space-m); }
.dn-package__choose { margin-top: auto; align-self: flex-start; }

/* The order form */
.dn-order { margin: var(--space-m) 0 var(--space-l); }
.dn-form { margin-block: var(--space-m); }
.dn-fieldset {
  margin: 0 0 var(--space-l);
  padding: var(--space-m);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  background: var(--color-surface);
  min-width: 0;
}
.dn-fieldset[hidden] { display: none; }
.dn-fieldset legend {
  padding: 0 var(--space-2xs);
  font-family: var(--font-heading);
  font-size: var(--step-1);
  color: var(--color-heading);
}
.dn-fieldset .form__field:last-child { margin-bottom: 0; }
.dn-person__needed, .dn-optional { font-family: var(--font-body); font-size: var(--step--1); font-weight: 400; color: var(--color-text-muted); }
.dn-nojs-note { font-size: var(--step--1); color: var(--color-text-muted); }

/* Name fields side by side, then date, time and weight, once there's room. */
.dn-row { display: grid; gap: 0 var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); align-items: end; }
.dn-fieldset .dn-row .form__field { margin-bottom: var(--space-m); }
.dn-fieldset .dn-row:last-child .form__field { margin-bottom: 0; }
.dn-form .form__field input { max-width: none; }
.dn-form .form__field input[type="email"], .dn-form #dn-buyer-name { max-width: 28rem; }
.dn-form select {
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--color-text-muted);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  max-width: 100%;
}
.dn-form select[aria-invalid="true"] { border: 2px solid var(--color-link); }
.dn-weight { display: flex; gap: var(--space-xs); }
.dn-weight input { flex: 1 1 auto; min-width: 0; }
.dn-weight select { flex: none; }

/* The list of problems after a failed submit */
.dn-errors { margin-bottom: var(--space-m); font-size: var(--step-0); }
.dn-errors h3 { margin: 0 0 var(--space-xs); font-size: var(--step-1); }
.dn-errors ul { margin: 0; padding-left: 1.25em; }
.dn-errors:focus { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* Honeypot: off-screen for people, still in the form for robots. */
.dn-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* After PayPal (pages/dragonology-done.php) */
.dn-summary {
  margin: var(--space-m) 0;
  padding: var(--space-m) var(--space-l);
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-left: 5px solid var(--color-accent);
  border-radius: var(--radius);
}
.dn-summary > div { display: flex; flex-wrap: wrap; gap: 0 var(--space-s); padding-block: var(--space-2xs); }
.dn-summary dt { min-width: 7rem; font-weight: 600; color: var(--color-text-muted); }
.dn-summary dd { margin: 0; }
.dn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s) var(--space-l); margin: var(--space-l) 0; }
