/* Lønningspils — mobile-first, one beer-amber accent, zero build step. */

:root {
  --amber: #d97706;
  --amber-dark: #b45309;
  --amber-light: #fef3c7;
  --ink: #1c1917;
  --muted: #78716c;
  --bg: #fafaf9;
  --card: #ffffff;
  --border: #e7e5e4;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #ca8a04;
}

* { box-sizing: border-box; }

/* The hidden attribute must always win, including over .js-only display rules. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

h1 { font-size: 1.6rem; margin: 0.5rem 0; }
h2 { font-size: 1.15rem; margin: 1.2rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1rem 0 0.3rem; }

.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero h1 { font-size: 2.2rem; }
.lead { color: var(--muted); font-size: 1.05rem; }
.muted { color: var(--muted); font-weight: normal; font-size: 0.9em; }
.center { text-align: center; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

label { display: block; font-weight: 600; margin: 0.8rem 0 0.25rem; }

input[type="text"], input[type="search"], input[type="date"], input[type="time"],
input:not([type]), textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--amber); outline-offset: 0; border-color: var(--amber); }

fieldset { border: 1px solid var(--border); border-radius: 10px; margin: 1rem 0; padding: 0.8rem; }
legend { font-weight: 600; padding: 0 0.4rem; }

.date-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.date-row input[type="date"] { flex: 2; }
.date-row input[type="time"] { flex: 1; }
.js-hidden { display: none; }

button { font: inherit; cursor: pointer; }

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.btn-primary:hover { background: var(--amber-dark); }

.btn-ghost {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  color: var(--muted);
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-dark); }

.btn-link { background: none; border: none; padding: 0; color: var(--amber-dark); text-decoration: underline; }

.errors, .warning, .success {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin: 1rem 0;
}
.errors { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.errors ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.warning { background: var(--amber-light); border: 1px solid #fcd34d; }
.success { background: #f0fdf4; border: 1px solid #bbf7d0; }

.badge {
  font-size: 0.6em;
  background: var(--amber);
  color: #fff;
  border-radius: 6px;
  padding: 0.15em 0.5em;
  vertical-align: middle;
}

/* links section */
.link-row { display: flex; gap: 0.5rem; margin-bottom: 0.6rem; }
.link-row input { flex: 1; font-size: 0.85rem; color: var(--muted); }
.btn-copy {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  padding: 0 0.9rem;
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--amber); }

/* place chips + suggestions */
.chips { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--amber-light);
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
}
.chip small { color: var(--muted); display: block; }
.chip-remove { background: none; border: none; font-size: 1.2rem; color: var(--muted); }

.place-search { position: relative; }
.suggestions {
  position: absolute;
  z-index: 1000;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 16rem;
  overflow-y: auto;
}
.suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
}
.suggestions button:last-child { border-bottom: none; }
.suggestions button:hover { background: var(--amber-light); }
.suggestions small { color: var(--muted); display: block; }
.suggestions .suggest-pubs { background: var(--amber-light); }
.suggestions .suggest-pubs:hover { background: #fde68a; }

/* map */
.map { height: 16rem; border-radius: 10px; margin: 0.8rem 0; border: 1px solid var(--border); }

/* voting */
.vote-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.vote-row:last-child { border-bottom: none; }
.vote-label { font-weight: 600; }
.vote-label small { display: block; font-weight: normal; }
.vote-choices { display: flex; gap: 0.4rem; }
.choice { display: inline-block; margin: 0; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
}
.choice input:focus-visible + span { outline: 2px solid var(--amber); }
.choice-yes input:checked + span { background: #dcfce7; border-color: var(--green); color: #14532d; }
.choice-maybe input:checked + span { background: #fef9c3; border-color: var(--yellow); color: #713f12; }
.choice-no input:checked + span { background: #fee2e2; border-color: var(--red); color: #7f1d1d; }

/* tables */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 0.45rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; white-space: nowrap; }
.vote-grid td:not(:first-child) { text-align: center; }
.cell-yes { color: var(--green); font-weight: 700; }
.cell-maybe { color: var(--yellow); }
.cell-no { color: var(--red); }
.cell-blank { color: var(--border); }
tr.you { background: var(--amber-light); }
tr.winner { background: #f0fdf4; }
.tally-row td { font-weight: 600; border-top: 2px solid var(--ink); }

/* confirmed */
.confirmed { text-align: center; }
.confirmed-badge { font-size: 1.1rem; font-weight: 700; color: var(--green); margin: 0; }
.big-date { font-size: 1.5rem; font-weight: 800; margin: 0.4rem 0; }
.big-place { font-size: 1.15rem; margin: 0.3rem 0 1rem; }

details summary { cursor: pointer; font-weight: 600; }

footer {
  max-width: 40rem;
  margin: 2rem auto;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
footer a { color: var(--muted); }

.js-only { display: none; }
.js .js-only { display: block; }
.js .place-search { display: block; }
