/* The site's look (specs/pages.md, "Look and feel"): coins, cardboard price
   tags and highlighter pens.  Bright and a little loud.  Titles and the name
   in Fredoka (vendor/fonts), everything else in the system font.  Phone
   first; light and dark. */

@font-face {
  font-family: "Fredoka";
  src: url("../../vendor/fonts/Fredoka-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --copper: #B8682E;          /* the signature colour */
  --mint: #2E9E6B;
  --tag-yellow: #FFD23F;
  --alarm: #D7263D;
  --paper: #FBF7EF;
  --ink: #1F1B16;
  --night: #17140F;

  --bg: var(--paper);
  --surface: #FFFFFF;
  --text: var(--ink);
  --muted: #6B6358;
  --line: #E4DBC8;
  --link: #9A521F;             /* copper, darkened to read as text on paper */
  --heading: var(--copper);
  --bar-bg: var(--paper);
  --button-bg: var(--copper);
  --button-text: #FFFFFF;
  --mint-text: #1F7A50;
  --alarm-text: #B81D31;
  --warn-bg: #FFF1F2;
  --good-bg: #E7F6EE;
  --tag-bg: #FFF3C2;
  --focus: #1F1B16;
  --radius: 14px;
  --title-font: "Fredoka", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --text-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --surface: #241F18;
    --text: #F3EDE0;
    --muted: #B3A995;
    --line: #3A3326;
    --link: #F0A767;
    --heading: #F0A767;
    --bar-bg: #1E1A13;
    --button-bg: var(--copper);
    --mint-text: #5BD39A;
    --alarm-text: #FF7A89;
    --warn-bg: #3A1A1F;
    --good-bg: #16301F;
    --tag-bg: #3A3010;
    --focus: var(--tag-yellow);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--text-font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1, h2 { font-family: var(--title-font); font-weight: 700; color: var(--heading); }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; margin-top: 1.4em; }
h3 { font-size: 1.1rem; font-family: var(--title-font); font-weight: 600; }
p { margin: 0 0 .8em; }

/* a highlighter pen stroke under a few words */
.hl { background: linear-gradient(transparent 55%, var(--tag-yellow) 55%, var(--tag-yellow) 92%, transparent 92%); padding: 0 .12em; }
@media (prefers-color-scheme: dark) { .hl { background: linear-gradient(transparent 55%, #8A6D00 55%, #8A6D00 92%, transparent 92%); } }

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--muted); margin-bottom: .2em; }
.clip { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- the header bar ------------------------------------------------------ */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px 6px 16px;
  padding-top: max(6px, env(safe-area-inset-top));
  background: var(--bar-bg); color: var(--text);
  border-bottom: 4px solid var(--copper);
  position: sticky; top: 0; z-index: 1000;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--copper); text-decoration: none; white-space: nowrap; }
.brand .brand-icon { width: 38px; height: 38px; flex: none; }
.brand-name { font: 700 1.2rem/1 var(--title-font); color: var(--heading); }
.bar nav { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; align-items: center; }
.bar nav a {
  color: var(--text); text-decoration: none; padding: 0 10px; border-radius: 999px;
  font-size: .95rem; font-weight: 600; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center;
}
.bar nav a:hover, .bar nav a[aria-current="page"] { background: var(--tag-bg); }
.bar nav a.add-link { background: var(--tag-yellow); color: var(--ink); }
[data-me] { max-width: 10em; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .brand-name { display: none; }
  .bar { padding-left: 12px; }
  .bar nav a { font-size: .9rem; padding: 0 8px; }
  [data-me] { max-width: 7em; }
}

.foot {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line);
}

/* --- page frames ----------------------------------------------------------- */
.page { width: 100%; max-width: 820px; margin: 0 auto; padding: 20px 16px 32px; }
.page.narrow { max-width: 620px; }

/* --- controls ---------------------------------------------------------------- */
.button, button.button, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--button-bg); color: var(--button-text); text-decoration: none;
  font: 700 1.15rem/1.2 var(--title-font); cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
}
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.button.small { min-height: 40px; padding: 6px 16px; font-size: 1rem; }
.button.yellow { background: var(--tag-yellow); color: var(--ink); }
.button.good { background: var(--mint); color: #fff; }
.button.quiet { background: var(--surface); color: var(--text); border-color: var(--copper); box-shadow: 0 3px 0 var(--copper); }
.button.danger { background: var(--alarm); color: #fff; }
.button:disabled { opacity: .55; cursor: default; }
@media (prefers-color-scheme: dark) {
  .button, button.button, input[type=submit] { border-color: #000; box-shadow: 0 3px 0 #000; }
  .button.quiet { border-color: var(--copper); box-shadow: 0 3px 0 var(--copper); }
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: .88rem; }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 2px solid var(--line); border-radius: 10px;
}
textarea { min-height: 140px; resize: vertical; }
input.code { font: 700 1.6rem/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3em; text-align: center; max-width: 12em; }
fieldset { border: 2px solid var(--line); border-radius: var(--radius); padding: 8px 14px 14px; margin: 14px 0; }
legend { font-weight: 700; padding: 0 6px; }
.choice { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 6px 0; min-height: 40px; }
.choice input { width: 22px; height: 22px; accent-color: var(--copper); flex: none; }

.status { min-height: 1.5em; margin: 10px 0; font-weight: 600; }
.status.error { color: var(--alarm-text); }

/* --- cards, notices, chips ------------------------------------------------------ */
.card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin: 0 0 10px;
}
.card .thumb { width: 88px; height: 66px; object-fit: cover; border-radius: 8px; flex: none; background: var(--line); }
.card .thumb.none { display: grid; place-items: center; color: var(--muted); font: 700 1.6rem var(--title-font); }
.card-title { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.card p { margin: 2px 0; }
.card-list { list-style: none; padding: 0; margin: 16px 0; }

.notice { border-left: 6px solid var(--line); background: var(--surface); padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.notice.warn { border-color: var(--alarm); background: var(--warn-bg); }
.notice.ok { border-color: var(--mint); background: var(--good-bg); }
.notice.tag { border-color: var(--tag-yellow); background: var(--tag-bg); }
button.linklike { background: none; border: 0; padding: 8px 4px; min-height: 40px; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; }
button.linklike.small { font-size: .9rem; }

/* a category as a little price tag */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px 2px 8px; font-size: .82rem; font-weight: 700;
  background: var(--tag-bg); color: var(--text); border: 1.5px solid var(--cat, var(--copper));
  border-radius: 4px 999px 999px 4px; line-height: 1.5;
}
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--cat, var(--copper)); flex: none; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 2px solid transparent; }
.badge.good { background: var(--good-bg); color: var(--mint-text); border-color: var(--mint); }
.badge.gone { background: var(--warn-bg); color: var(--alarm-text); border-color: var(--alarm); }
.badge.scam { background: var(--alarm); color: #fff; }

/* freshness: one line saying whether the deal is still real */
.fresh { font-weight: 700; margin: 8px 0; }
.fresh.good { color: var(--mint-text); }
.fresh.gone, .fresh.old { color: var(--alarm-text); }
.fresh.none { color: var(--muted); font-weight: 400; }

.owner-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }


/* --- map markers: a price tag with a hole, in the category's colour ------------------ */
.leaflet-container { font: inherit; }
.tagpin { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
.tagpin-shape {
  position: relative; width: 28px; height: 34px; background: var(--cat, var(--copper));
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
  color: #fff; display: grid; place-items: center; padding-top: 6px;
  font: 700 14px/1 var(--title-font); text-shadow: 0 0 2px rgba(0, 0, 0, .6);
}
.tagpin-shape::before { content: ""; position: absolute; top: 4px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.leaflet-bar a, .leaflet-bar a:hover, .leaflet-control-layers-toggle { background-color: var(--tag-yellow); color: var(--ink); }
.leaflet-bar a { border-bottom-color: rgba(0, 0, 0, .25); }
.leaflet-popup-content { margin: 12px 14px; min-width: 190px; font-family: var(--text-font); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.popup-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
.popup-card strong { display: block; font-size: 1rem; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(255, 210, 63, .5) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color: var(--copper) !important; color: #fff; font: 700 14px var(--title-font); }

.spam-hint p { margin: 4px 0; }
.spam-hint code { user-select: all; overflow-wrap: anywhere; }
.coin { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.15em; }

/* Ace's greeting and the honest ledger (about and contact pages) */
.ace .room { font-style: italic; margin-top: -.4em; }
.ledger { list-style: none; margin: 12px 0; padding: 12px 16px; background: var(--tag-yellow); color: var(--ink); border: 2px dashed var(--ink); border-radius: var(--radius); font-weight: 700; }
.ledger li { margin: 2px 0; }
.ledger .small { font-weight: 400; color: var(--ink); opacity: .8; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
