/* ASH interactive tools. Loaded only with the date-letter and EPNS shortcodes. */

.ash-tool {
  --ash-bg: var(--wp--preset--color--base, #FBFAF7);
  --ash-surface: var(--wp--preset--color--surface, #fff);
  --ash-ink: var(--wp--preset--color--contrast, #1A1A1A);
  --ash-ink-2: var(--wp--preset--color--contrast-2, #6B6760);
  --ash-ink-3: var(--wp--preset--color--contrast-3, #908B82);
  --ash-line: var(--wp--preset--color--line, #E6E2D9);
  --ash-line-2: var(--wp--preset--color--line-2, #D8D3C7);
  --ash-bronze: var(--wp--preset--color--bronze-ink, #8A6D3F);
  --ash-slate: var(--wp--preset--color--slate, #4A5568);
  --ash-serif: var(--wp--preset--font-family--serif, Georgia, "Times New Roman", serif);
  --ash-sans: var(--wp--preset--font-family--sans, Inter, system-ui, sans-serif);
  box-sizing: border-box;
  font-family: var(--ash-sans);
  color: var(--ash-ink);
  background: var(--ash-surface);
  border: 1px solid var(--ash-line-2);
  border-radius: 10px;
  padding: 1.15rem 1.15rem 1.25rem;
  margin: 1.5rem 0;
}

.ash-tool *,
.ash-tool *::before,
.ash-tool *::after {
  box-sizing: border-box;
}

.ash-tool fieldset {
  border: 0;
  margin: 0 0 1.1rem;
  padding: 0;
  min-inline-size: 0;
}

.ash-tool legend {
  font-family: var(--ash-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ash-ink-2);
  padding: 0;
  margin: 0 0 0.55rem;
}

.ash-tool p {
  margin: 0 0 0.7rem;
}

.ash-tool a {
  color: var(--ash-bronze);
  text-underline-offset: 0.15em;
}

.ash-tool a:hover {
  text-decoration: underline;
}

.ash-dl__hint,
.ash-tool__fine {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ash-ink-2);
}

.ash-dl__offices {
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .ash-dl__offices {
    grid-template-columns: 1fr 1fr;
  }
}

.ash-choice {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--ash-line-2);
  border-radius: 6px;
  background: var(--ash-bg);
  cursor: pointer;
  line-height: 1.35;
}

.ash-choice:has(input:checked) {
  border-color: var(--ash-slate);
  background: var(--ash-surface);
  box-shadow: inset 2px 0 0 var(--ash-slate);
}

.ash-choice:has(input:focus-visible) {
  outline: 2px solid var(--ash-slate);
  outline-offset: 2px;
}

.ash-choice input {
  margin-top: 0.15rem;
  accent-color: var(--ash-slate);
  flex: 0 0 auto;
}

.ash-choice b {
  font-weight: 600;
}

.ash-tool__sub {
  display: block;
  color: var(--ash-ink-2);
  font-size: 0.82rem;
  font-weight: 400;
}

.ash-dl__typewrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 0 0.75rem;
  max-width: 16rem;
}

.ash-dl__cyclewrap {
  max-width: none;
}

.ash-dl__typewrap span,
.ash-epns__more > p {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ash-ink-2);
}

.ash-tool input[type="text"],
.ash-tool select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--ash-line-2);
  border-radius: 6px;
  background: var(--ash-bg);
  color: var(--ash-ink);
}

.ash-tool input[type="text"] {
  max-width: 5rem;
  text-align: center;
  font-family: var(--ash-serif);
  font-size: 1.35rem;
}

.ash-tool input:focus-visible,
.ash-tool select:focus-visible,
.ash-tool button:focus-visible {
  outline: 2px solid var(--ash-slate);
  outline-offset: 2px;
}

.ash-dl__case {
  margin: 0.35rem 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ash-ink-2);
}

.ash-dl__keys {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.ash-dl__key {
  font: inherit;
  font-size: 1rem;
  min-height: 2.75rem;
  min-width: 0;
  padding: 0.2rem;
  border: 1px solid var(--ash-line-2);
  border-radius: 6px;
  background: var(--ash-bg);
  color: var(--ash-ink);
  cursor: pointer;
}

.ash-dl__key[aria-pressed="true"] {
  background: var(--ash-ink);
  color: #fff;
  border-color: var(--ash-ink);
}

.ash-dl__cell {
  min-height: 3.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}

.ash-dl__cell b {
  font-weight: 600;
  font-size: 1rem;
}

.ash-dl__cell small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62rem;
  letter-spacing: 0;
  color: var(--ash-ink-2);
}

.ash-dl__key[aria-pressed="true"] small {
  color: inherit;
  opacity: 0.82;
}

.ash-dl__out,
.ash-epns__out {
  margin-top: 0.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--ash-line);
}

.ash-dl__lead,
.ash-epns__lead {
  font-size: 0.95rem;
  line-height: 1.5;
}

.ash-dl__town,
.ash-dl__span,
.ash-dl__note,
.ash-dl__confirm,
.ash-dl__style {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ash-ink-2);
}

.ash-dl__hit {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.8rem 0.35rem;
  border: 1px solid var(--ash-line);
  border-radius: 8px;
  background: var(--ash-bg);
}

.ash-dl__hit--on {
  border-color: var(--ash-slate);
  box-shadow: inset 3px 0 0 var(--ash-slate);
}

.ash-dl__year {
  font-family: var(--ash-serif);
  font-size: 1.65rem;
  line-height: 1.15;
  font-weight: 560;
  color: var(--ash-bronze);
  margin-bottom: 0.35rem;
}

.ash-tool__links {
  margin: 0.2rem 0 0;
  padding: 0;
  list-style: none;
}

.ash-tool__links li {
  margin: 0.2rem 0;
}

.ash-tool__note {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ash-line);
}

.ash-epns__qs {
  display: grid;
  gap: 0.5rem;
}

.ash-epns__card {
  padding: 0.85rem 0.9rem 0.45rem;
  border-radius: 8px;
  background: var(--ash-bg);
  border: 1px solid var(--ash-line);
  border-left-width: 3px;
}

.ash-epns__card--plate {
  border-left-color: var(--ash-bronze);
}

.ash-epns__card--sterling {
  border-left-color: var(--ash-slate);
}

.ash-epns__card--photo {
  border-left-color: var(--ash-ink-2);
}

.ash-epns__title {
  font-family: var(--ash-serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.55rem;
  color: var(--ash-ink);
}

.ash-epns__card p {
  font-size: 0.92rem;
  line-height: 1.5;
}

.ash-epns__links a {
  display: inline-block;
  margin: 0 0.85rem 0.45rem 0;
}

.ash-tool__reset {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--ash-line-2);
  background: var(--ash-surface);
  color: var(--ash-ink);
  cursor: pointer;
  min-height: 2.75rem;
}

.ash-tool__reset:hover {
  border-color: var(--ash-slate);
}

@media (max-width: 480px) {
  .ash-tool {
    padding: 0.95rem 0.85rem 1rem;
  }

  .ash-dl__year,
  .ash-epns__title {
    font-size: 1.4rem;
  }
}
