/* The same typefaces and palette as the display board and the map
   (assets/seating/fonts, src/seating/Palette.hpp). */

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("fonts/BarlowSemiCondensed-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("fonts/BarlowSemiCondensed-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Display";
  src: url("fonts/DMSerifDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  /* The map is drawn in these fixed colours, so the page stays light too. */
  color-scheme: light;
  --page: #f3eee6;
  --card: #fffdfa;
  --ink: #1f2b3b;
  --muted: #667080;
  --line: #e4dbce;
  --wall: #cdbfab;
  --gold: #c39a45;
  --gold-ink: #8e6c25;
  --hover: #f6efe2;
  --error: #9b3b3b;
  --sans: "Barlow Semi Condensed", system-ui, -apple-system, sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 500 17px/1.4 var(--sans);
}

.masthead,
main,
footer {
  max-width: 560px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ---- Header ---- */
.masthead {
  padding-top: calc(22px + env(safe-area-inset-top));
  text-align: center;
}

h1 {
  margin: 0;
  font: 400 36px/1.05 var(--serif);
}

.byline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---- Search ---- */
.search {
  position: relative;
  margin-top: 20px;
}

.search-label,
.place .label,
.details h2 {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.search-label {
  margin-bottom: 6px;
}

.field {
  position: relative;
}

input[type="search"] {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border: 1.5px solid var(--wall);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  /* 16px or more, or iOS zooms the page when the field gets focus. */
  font: 500 19px var(--sans);
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

input[type="search"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgb(195 154 69 / 0.25);
}

input[type="search"]:disabled {
  opacity: 0.6;
}

.clear {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.results {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  max-height: 60svh;
  margin: 6px 0 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 12px 32px rgb(31 43 59 / 0.16);
}

.results button,
.browse-list button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.results button[aria-selected="true"],
.results button:hover,
.browse-list button:hover {
  background: var(--hover);
}

.meta {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.results .empty {
  padding: 12px;
  color: var(--muted);
}

.status {
  margin: 16px 0;
  color: var(--muted);
  text-align: center;
}

.status[data-kind="error"] {
  color: var(--error);
}

/* ---- The answer ---- */
.result {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.guest {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 600;
}

.place {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.seat-box {
  text-align: right;
}

.place .value {
  color: var(--gold-ink);
  font: 600 46px/1 var(--sans);
}

.place .sub {
  margin-left: 10px;
  font-size: 19px;
}

/* ---- Map ---- */
.map-wrap {
  position: relative;
  margin-top: 14px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--page);
}

#map {
  display: block;
  width: 100%;
  height: 100%;
  /* A finger on the map still scrolls the page. */
  touch-action: pan-y;
}

.view-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 253 250 / 0.94);
  color: var(--ink);
  font: 600 15px var(--sans);
  box-shadow: 0 2px 8px rgb(31 43 59 / 0.12);
}

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 15px;
}

.key {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.key-here {
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--card);
}

.key-seat {
  margin-left: 14px;
  border-radius: 4px;
  background: var(--gold);
}

/* ---- Directions and tablemates ---- */
.details h2 {
  margin: 24px 0 8px;
}

.steps {
  margin: 0;
  padding-left: 24px;
}

.steps li {
  margin: 8px 0;
  padding-left: 4px;
}

.note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tablemates {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 16px;
}

.tablemates li {
  padding: 3px 0;
  break-inside: avoid;
}

.tablemates .seat {
  display: inline-block;
  min-width: 24px;
  color: var(--muted);
  font-size: 14px;
}

/* ---- Browse ---- */
.browse {
  margin: 24px 0 0;
}

.browse summary {
  padding: 8px 0;
  color: var(--gold-ink);
  font-weight: 600;
  cursor: pointer;
}

.browse-list details {
  border-top: 1px solid var(--line);
}

.browse-list summary {
  color: var(--ink);
}

footer {
  padding-top: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
