/* The Peg Board. Colours and type from PEG-BOARD-PROJECT-NOTES.md ("Visual tokens"). */
:root {
  --board: #C99A5B; --holes: #9A6F3A; --wood: #4A2F18; --ink: #2B1D12; --cream: #FFF6DC;
  --yellow: #FFD23F; --green: #1F6B45; --muted: #4A3A2A; --white: #FFFFFF;
  --pixel: 'Silkscreen', ui-monospace, monospace;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--wood); }
a { color: var(--ink); }
button { font: inherit; color: inherit; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 50; background: var(--yellow); color: var(--ink); padding: 10px 14px; font-weight: 700; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.bar :focus-visible, .foot :focus-visible { outline-color: var(--cream); }
#app { min-height: 100dvh; display: flex; flex-direction: column; outline: none; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; }

/* The pegboard wall */
.wall { background-color: var(--board); background-image: radial-gradient(var(--holes) 2px, transparent 2.5px); background-size: 20px 20px; }

/* Wood bars */
.bar { background: var(--wood); border-bottom: 4px solid var(--ink); color: var(--cream); position: sticky; top: 0; z-index: 6; } /* stays in view while scrolling, on every screen size */
.bar .wrap { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--pixel); font-weight: 700; font-size: 18px; line-height: 22px; color: var(--cream); text-decoration: none; }
.brand span { display: block; }
.sign { min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; background: var(--green); color: var(--white); border: 3px solid var(--white); font-family: var(--pixel); font-size: 13px; text-decoration: none; }
.back { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--cream); font-family: var(--pixel); font-size: 13px; text-decoration: none; }
.bar .code { font-family: var(--pixel); font-size: 13px; }

/* Category filters */
.filters { background: var(--cream); border-bottom: 4px solid var(--ink); }
.filters .wrap { padding: 12px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--white); border: 2px solid var(--ink); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.chip[aria-current="true"] { background: #FFE680; border-width: 3px; padding: 0 9px; }
.chip.wide { grid-column: 1 / -1; }
.sw { flex: none; width: 12px; height: 12px; border: 2px solid var(--ink); background: var(--pin); }
@media (min-width: 760px) {
  .filters .wrap { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .chip.wide { grid-column: auto; }
}

/* Category colours */
.k-event { --pin: #C22F22; --paper: #FFFDF5; }
.k-lost { --pin: #FFD23F; --paper: #FFE680; }
.k-lessons { --pin: #2F62C9; --paper: #D5E6F7; }
.k-biz { --pin: #1F6B45; --paper: #D3EDD8; }
.k-rec { --pin: #E8742A; --paper: #FBE0CC; }

/* The board */
.board { flex: 1; }
.board .wrap { padding: 14px 16px 28px; display: flex; flex-direction: column; gap: 18px; }
.strip { align-self: flex-start; background: var(--ink); color: var(--cream); font-family: var(--pixel); font-size: 11px; line-height: 16px; padding: 4px 8px; }
.strip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.strip-row a { background: var(--cream); color: var(--ink); border: 2px solid var(--ink); font-size: 12px; font-weight: 600; padding: 3px 8px; text-decoration: none; min-height: 28px; display: inline-flex; align-items: center; }
.pins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; align-items: start; }
@media (max-width: 339px) { .pins { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 620px) { .pins { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 22px; } }
@media (min-width: 900px) { .pins { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 26px; } }
.empty { background: var(--cream); border: 2px solid var(--ink); padding: 16px; font-size: 15px; line-height: 22px; max-width: 420px; }

/* A flyer on the board */
.flyer { display: block; position: relative; text-decoration: none; color: var(--ink); }
.flyer:nth-child(4n+1) { transform: rotate(-2deg); }
.flyer:nth-child(4n+2) { transform: rotate(1.5deg); }
.flyer:nth-child(4n+3) { transform: rotate(1deg); }
.flyer:nth-child(4n) { transform: rotate(-1.5deg); }
.pushpin { position: absolute; top: -9px; left: 50%; margin-left: -8px; width: 16px; height: 16px; background: var(--pin); border: 3px solid var(--ink); z-index: 1; }
.paper { background: var(--paper); padding: 18px 12px 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 4px 4px 0 rgba(43, 29, 18, 0.45); }
.flyer.paid .paper { outline: 2px solid var(--ink); outline-offset: -2px; }
.kind { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.flyer h2 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 700; }
.flyer p { margin: 0; font-size: 13px; line-height: 18px; }
.flyer p.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; } /* long details are cut short on the board; the flyer page shows all of it */
.by { font-size: 12px; line-height: 17px; color: var(--muted); }
.meta { font-size: 11px; line-height: 16px; color: var(--muted); }
.phil { align-self: flex-start; background: var(--ink); color: var(--cream); font-family: var(--pixel); font-size: 10px; line-height: 14px; padding: 2px 6px; }
.fringe { display: flex; gap: 2px; padding-top: 2px; }
.fringe span { flex: 1; height: 16px; background: var(--paper); }
.fringe span.gone { background: none; }
.flyer:hover .paper, .flyer:focus-visible .paper { box-shadow: 6px 6px 0 rgba(43, 29, 18, 0.55); }

/* Bottom bar */
.foot { background: var(--wood); border-top: 4px solid var(--ink); position: sticky; bottom: 0; z-index: 5; }
.foot .wrap { padding: 12px 16px; display: flex; gap: 12px; }
.btn { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-family: var(--pixel); font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.plain { background: var(--cream); box-shadow: none; font-family: var(--body); font-size: 13px; font-weight: 600; }
.foot .btn { flex: 2; }
.foot .btn.plain { flex: 1; }
@media (min-width: 620px) { .foot .btn, .foot .btn.plain { flex: none; min-width: 220px; } .foot .wrap { justify-content: center; } }

/* The menu button: About, Privacy, Contact */
.menu { position: relative; flex: none; }
.menu summary { list-style: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--cream); border: 3px solid var(--cream); cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--cream); color: var(--ink); }
.menu nav { position: absolute; right: 0; top: 52px; z-index: 20; min-width: 180px; display: flex; flex-direction: column; background: var(--cream); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.menu nav a, .menu nav button { min-height: 48px; display: flex; align-items: center; padding: 0 16px; color: var(--ink); font-family: var(--body); font-size: 15px; font-weight: 600; text-decoration: none; text-align: left; background: none; border: 0; border-bottom: 2px solid var(--ink); cursor: pointer; white-space: nowrap; }
.menu nav > :last-child { border-bottom: 0; }
.menu nav a:hover, .menu nav a:focus-visible, .menu nav button:hover, .menu nav button:focus-visible { background: #FFE680; outline-offset: -3px; }
/* Share: green like the area sign */
.menu nav button.share { margin: 10px; min-height: 44px; justify-content: center; background: var(--green); color: var(--white); border: 3px solid var(--white); box-shadow: 0 0 0 3px var(--ink); font-family: var(--pixel); font-size: 13px; font-weight: 400; }
.menu nav button.share:hover, .menu nav button.share:focus-visible { background: #17553A; }

/* Computers: PIN IT and Find a board sit in the top bar, and the bottom bar goes away. */
.bar-right { display: flex; align-items: center; gap: 14px; }
.top-actions { display: none; }
@media (min-width: 760px) {
  .top-actions { display: flex; align-items: center; gap: 12px; }
  .top-actions .btn { min-height: 44px; font-size: 14px; }
  .top-actions .btn.plain { font-size: 13px; }
  .foot { display: none; }
}
.small-links { background: var(--wood); color: var(--cream); font-size: 13px; }
.small-links .wrap { padding: 6px 16px 16px; display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; }
.small-links a { color: var(--cream); min-height: 44px; display: inline-flex; align-items: center; }

/* One flyer, opened */
.detail { flex: 1; }
.detail .wrap { max-width: 480px; padding: 28px 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.big { position: relative; transform: rotate(-1deg); }
.big .pushpin { top: -11px; margin-left: -10px; width: 20px; height: 20px; border-width: 4px; }
.big .paper { padding: 24px 18px 16px; gap: 12px; box-shadow: 6px 6px 0 rgba(43, 29, 18, 0.45); }
.big .kind { font-size: 12px; }
.big h1 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; }
.big p { margin: 0; font-size: 15px; line-height: 22px; }
.photo { display: block; width: 100%; max-height: 300px; object-fit: cover; background: var(--cream); border: 2px solid var(--ink); }
.sig { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; line-height: 18px; color: var(--muted); border-top: 2px solid var(--ink); padding-top: 10px; }
.big .fringe { gap: 3px; padding-top: 3px; }
.big .fringe span { height: 64px; writing-mode: vertical-rl; font-size: 10px; display: flex; align-items: center; justify-content: center; }
.big .fringe span.gone { color: transparent; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.count { align-self: center; background: var(--ink); color: var(--cream); font-family: var(--pixel); font-size: 11px; line-height: 16px; padding: 4px 8px; }
.actions .btn { width: 100%; min-height: 56px; }
.btn.torn { background: var(--cream); }
.note { margin: 0; background: var(--cream); border: 2px solid var(--ink); padding: 10px 12px; font-size: 13px; line-height: 19px; }
.pair { display: flex; gap: 10px; }
.pair > * { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }

/* Area picker and plain pages */
.plain { flex: 1; background: var(--cream); }
.plain .wrap { max-width: 560px; padding: 22px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.plain h1 { margin: 0; font-family: var(--pixel); font-weight: 700; font-size: 22px; line-height: 28px; }
.plain h2 { margin: 12px 0 0; font-size: 17px; line-height: 24px; }
.plain p, .plain li { margin: 0; font-size: 15px; line-height: 23px; }
.plain ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.area-open { min-height: 48px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--green); color: var(--white); border: 3px solid var(--white); box-shadow: 0 0 0 3px var(--ink); font-family: var(--pixel); font-size: 15px; text-decoration: none; }
.area-open small { font-size: 11px; }
.hoods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 4px; }
.hood { min-height: 44px; padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--white); color: var(--ink); border: 2px solid var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.hood.all { grid-column: 1 / -1; background: #FFE680; border-width: 3px; font-weight: 700; }
.hood[aria-current="true"] { background: #FFE680; border-width: 3px; }
.hood small { font-weight: 500; color: var(--muted); }
.rule { border-top: 3px solid var(--ink); padding-top: 14px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; }
.area-shut { min-height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #5C5148; color: var(--white); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--ink); font-family: var(--pixel); font-size: 14px; }
.area-shut small { font-size: 10px; }
.area-block { display: flex; flex-direction: column; gap: 6px; }
.area-block p { font-size: 13px; line-height: 19px; }
.plain-page { max-width: 560px; margin: 0 auto; padding: 32px 20px; background: var(--cream); }

/* Short messages */
.toast { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 40; max-width: min(92vw, 420px); background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 10px 14px; font-size: 14px; line-height: 20px; font-weight: 600; text-align: center; }
.toast:empty { display: none; }

/* Phones turned sideways */
.rotate-note { display: none; }
@media (orientation: landscape) and (max-height: 480px) and (pointer: coarse) {
  .rotate-note { display: flex; position: fixed; inset: 0; z-index: 60; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--wood); color: var(--cream); font-family: var(--pixel); font-size: 16px; }
  .rotate-note p { margin: 0; }
  .rotate-phone { width: 44px; height: 76px; border: 4px solid var(--cream); background: var(--board); animation: upright 2.4s steps(4, end) infinite; }
}
@keyframes upright { 0%, 30% { transform: rotate(90deg); } 60%, 100% { transform: rotate(0deg); } }

@media (prefers-reduced-motion: reduce) {
  .rotate-phone { animation: none; }
  .btn:active { transform: none; }
}
