/* Bar Madrid Staff: same look as barmadrid.com.au (night background, red, Chulapa + Lato),
   with a light version that follows the phone's day/night setting. */
@font-face { font-family: "Chulapa"; src: url("/fonts/chulapa-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Chulapa"; src: url("/fonts/chulapa-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f6f3ef;
  --surface: #ffffff;
  --field: #efebe6;
  --ink: #131314;
  --muted: #6b6560;
  --line: rgba(19, 19, 20, .12);
  --red: #d92626;
  --red-hover: #c41f1f;
  --red-soft: rgba(226, 43, 43, .08);
  --ok: #1f8a4c;
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(19, 19, 20, .1);
  --shadow: 0 10px 30px rgba(0, 0, 0, .12);
  --display: "Chulapa", "Lato", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131314;
    --surface: #1d1d1f;
    --field: #2a2a2b;
    --ink: #ffffff;
    --muted: rgba(255, 255, 255, .62);
    --line: rgba(255, 255, 255, .1);
    --red: #e22b2b;
    --red-hover: #ee3b3b;
    --red-soft: rgba(226, 43, 43, .14);
    --ok: #3ecf6e;
    --glass: rgba(28, 28, 30, .55);
    --glass-line: rgba(255, 255, 255, .14);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 "Lato", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}
a { color: var(--red); }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .03em; text-transform: uppercase; }
.brand img { width: 28px; height: 28px; }

/* ---------- layout and type ---------- */
main { max-width: 720px; margin: 0 auto; padding: 18px 16px; }
h1 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; font-size: 30px; line-height: 1.05; margin: 6px 0 14px; }
h2 { font-size: 13px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; min-width: 0; width: auto; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; margin: 10px 0;
}
.card.mine { box-shadow: inset 3px 0 0 var(--red); }
.card.open { border-color: color-mix(in srgb, var(--red) 55%, transparent); background: var(--red-soft); }
a.card { display: block; color: inherit; text-decoration: none; }
a.card.row { display: flex; }
.banner { background: var(--surface); border: 1px dashed color-mix(in srgb, var(--red) 60%, transparent); border-radius: 18px; padding: 12px 16px; margin: 10px 0; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor;
}
.badge.open { color: var(--red); }
.badge.ok { color: var(--ok); }
.badge.draft { color: var(--muted); }

/* ---------- buttons and inputs ---------- */
button, .button {
  font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: transform .15s, background .2s, border-color .2s;
}
button:active, .button:active { transform: scale(.97); }
button.primary, .button.primary { background: var(--red); border-color: var(--red); color: #fff; }
@media (hover: hover) {
  button.primary:hover, .button.primary:hover { background: var(--red-hover); }
  button:not(.primary):not(.link):hover, .button:not(.primary):hover { border-color: var(--ink); }
}
button.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); }
button.link { border: 0; background: none; min-height: 0; padding: 4px 6px; color: var(--red); }
button:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 42px; padding: 0; font-size: 18px; }

input, select, textarea {
  font: inherit; font-size: 16px; width: 100%; padding: 11px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--field); color: var(--ink); outline: none;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; margin: 12px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: center; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 15px; }
label.check input { width: 20px; height: 20px; accent-color: var(--red); }
form .actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.error { color: var(--red); min-height: 1.2em; margin: 8px 0 0; }

/* ---------- bottom pill menu, like the website ---------- */
.nav {
  position: fixed; z-index: 10; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: calc(100% - 20px); max-width: 560px;
  display: flex; justify-content: space-around; gap: 2px; padding: 6px;
  border-radius: 28px; background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid var(--glass-line); box-shadow: var(--shadow);
}
.nav a {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0 5px; border-radius: 22px;
  color: var(--muted); text-decoration: none; font-size: 10.5px; letter-spacing: .04em;
  transition: background .2s, color .2s;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.active { color: #fff; background: var(--red); font-weight: 700; }
.nav .dot {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid var(--bg);
}
.nav a.active .dot { background: #fff; color: var(--red); border-color: var(--red); }

/* ---------- roster ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.week-nav .title { text-align: center; }
.week-nav .title b { font-family: var(--display); font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.day { margin: 22px 0 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.day h2 { margin: 0; color: var(--ink); }
.shift-line { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.shift-line .who { font-weight: 700; }
.when-big { font-family: var(--display); font-size: 19px; text-transform: uppercase; letter-spacing: .02em; }

/* ---------- board ---------- */
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.post-title { font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; margin-top: 6px; }
.comment { border-top: 1px solid var(--line); padding: 10px 0 0; margin-top: 10px; font-size: .95rem; }
.actions svg { width: 18px; height: 18px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:not(:empty) { margin-top: 10px; }
.thumb { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--field); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; min-height: 0; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 16px; line-height: 1;
}
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 4px; }
.photos .photo {
  display: block; padding: 0; min-height: 0; border: 0; border-radius: 12px; overflow: hidden;
  aspect-ratio: 1; background: var(--field);
}
.photos.n1 { grid-template-columns: 1fr; }
.photos.n1 .photo { aspect-ratio: auto; }
.photos.n1 img { max-height: 460px; }
.photos.n3 .photo:first-child { grid-column: span 2; aspect-ratio: 2; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
dialog img.full { display: block; width: 100%; max-height: calc(100dvh - 160px); object-fit: contain; border-radius: 14px; }

/* ---------- dialogs and toasts ---------- */
dialog {
  border: 1px solid var(--line); border-radius: 22px; padding: 20px; width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px); overflow: auto;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
dialog h2 { font-family: var(--display); font-size: 24px; letter-spacing: .02em; color: var(--ink); margin: 0 0 6px; }
dialog::backdrop { background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(96px + env(safe-area-inset-bottom));
  background: var(--glass); color: var(--ink); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow);
  padding: 11px 18px; border-radius: 999px; max-width: 90vw; font-size: 15px;
}
ol.steps { padding-left: 20px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
