/* Final choices (/decisions). Builds on styles.css and responses.css (header, filters, table). */

.d-years { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.d-years a {
  min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border: 1px solid var(--cream);
  border-radius: 999px; color: var(--cream); text-decoration: none; font-size: 16px;
}
.d-years a[aria-current="page"] { background: var(--cream); color: var(--cobalt); }
.d-add-btn {
  align-self: flex-start; margin-top: 20px; display: inline-flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 0 28px; border-radius: 999px; background: var(--cream); color: var(--cobalt) !important;
  font-size: 20px; text-decoration: none; border: 1px solid var(--cream); transition: background .2s, color .2s;
}
.d-add-btn:hover { background: transparent; color: var(--cream) !important; }

/* Table: name first, then where they study, then the three choices. */
.d-table { min-width: 980px; }
.d-table td.d-name { font-family: var(--serif); font-style: normal; font-size: 20px; line-height: 1.2; color: var(--ink); }
.d-where { display: flex; flex-direction: column; line-height: 1.3; font-size: 16px; }
.d-where small { font-size: 14px; color: var(--muted); }
.d-choice { display: flex; flex-direction: column; line-height: 1.25; }
.d-choice span { font-size: 16px; }
.d-choice small { font-size: 13px; color: var(--muted); }
.d-choice.is-match span { background: var(--wash); box-shadow: 0 0 0 3px var(--wash); }
.d-contact a { color: var(--cobalt); text-underline-offset: 3px; overflow-wrap: anywhere; }
.d-contact { font-size: 15px; overflow-wrap: anywhere; }
.d-none { color: var(--muted); }

/* The list's heading, with how many to show beside it. */
.d-list-head { align-items: flex-end; }

/* Form, above the list */
.d-form-section { border-bottom: 3px double var(--cobalt); }

.d-form-section { background: var(--paper); scroll-margin-top: 16px; }
#dForm { display: flex; flex-direction: column; gap: 20px; }
#dForm .btn { align-self: flex-start; }
.field select {
  border: 1px solid var(--cobalt); background: #fff; color: var(--ink); padding: 13px 14px; border-radius: 2px; min-height: 50px;
  font-family: var(--sc); font-size: 17px;
}
.field select[aria-invalid="true"], .d-radios[aria-invalid="true"] { outline: 1px solid var(--danger); }
.d-radios { border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; gap: 10px 14px; }
.d-radios legend { font-size: 20px; padding: 0; margin-bottom: 6px; width: 100%; }
.d-radios label {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--cobalt); border-radius: 999px; cursor: pointer; font-size: 18px;
}
.d-radios label:has(input:checked) { background: var(--cobalt); color: var(--paper); }
.d-radios label:has(input:focus-visible) { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.d-radios input { margin: 0; accent-color: var(--cobalt); }

@media (max-width: 720px) {
  .d-table { min-width: 0; }
  .d-table tr { grid-template-columns: 1fr auto; }
  .d-table td { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .d-table td.d-c-name { margin-bottom: 2px; }
  .d-table td.d-c-where { color: var(--muted); }
  .d-table td.d-c-choice { margin-top: 8px; }
  .d-table td.d-c-choice::before, .d-table td.d-c-contact::before {
    content: attr(data-label); display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  }
  .d-table td.d-c-contact { margin-top: 8px; }
  .d-table td.d-c-contact:empty, .d-table td.d-c-choice.is-empty { display: none; }
  .d-add-btn { min-height: 48px; font-size: 18px; }
  /* The world is wide: a shorter frame on phones (full screen gives the rest). */
  .d-map-frame { height: 340px; }
  .d-map-rank { gap: 6px; }
}

/* Map, between the form and the list */
.d-map-section { padding-block: 48px 0; }
.d-map-figure .list-head { margin-bottom: 8px; }
.d-map-rank button { white-space: nowrap; }
.d-map-frame { aspect-ratio: 1600 / 820; }
.d-map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-controls svg.i-shrink, .is-full .map-controls svg.i-expand { display: none; }
.is-full .map-controls svg.i-shrink { display: block; }
.card-figs .is-dim { opacity: .4; }
.card-actions button.is-quiet { background: transparent; color: var(--cobalt); }
.d-who { list-style: none; margin: 0; padding: 0; max-height: 240px; flex: none; overflow-y: auto; border-bottom: 1px solid var(--line); }
.d-who li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.d-who li:last-child { border-bottom: 0; }
.d-who-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.d-who-name { font-family: var(--serif); font-size: 18px; }
.d-who-meta { font-size: 13px; color: var(--muted); }
.d-who-rank { flex: none; font-size: 13px; color: var(--cobalt); border: 1px solid var(--cobalt); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }

/* Full screen: the browser's own, or a fixed overlay where there is none (iPhone). */
.d-map-figure.is-full {
  position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100%; max-width: none; margin: 0;
  background: var(--paper); padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 8px;
}
.d-map-figure.is-full .d-map-frame { flex: 1; aspect-ratio: auto; height: auto; min-height: 0; outline: 0; }
.d-map-figure:fullscreen { background: var(--paper); }
html.d-map-full, html.d-map-full body { overflow: hidden; }
