/* public/community/community.css — The Community Board.
   Paper index cards pinned to a cork board, set into the studio's espresso
   room. Single scheme (html.dark is a harmless no-op — the board is already
   the dark room). Per-tool accent seam: override --src/--src-soft/--src-deep. */

@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-var.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-italic-var.woff2') format('woff2'); font-style: italic; font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Hanken Grotesk'; src: url('/fonts/hanken-var.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --room:        #140f0b;    /* espresso — same room as the landing */
  --room-line:   #3c3026;
  --cork:        #6b4f31;    /* the board */
  --cork-deep:   #58402a;
  --paper:       #f6efdf;    /* index cards */
  --paper-edge:  #e4d7bd;
  --ink:         #2a1c10;    /* pencil-dark ink on paper */
  --ink-soft:    #7a6151;
  --bone:        #f1e7d6;    /* text in the room */
  --room-muted:  #a3937f;
  --brass:       #c9a227;    /* pins, frame, stamps */
  --brass-dim:   #8a6f1f;

  /* per-tool accent seam (drink-recipes default: bitters orange) */
  --src:         #c2773e;
  --src-soft:    #f3e2cf;
  --src-deep:    #8e511f;

  /* mode facets (on paper) */
  --m-cocktail:     #b45309;  --m-cocktail-bg:  #fde9c9;
  --m-mocktail:     #047857;  --m-mocktail-bg:  #d1fae5;
  --m-coffee:       #6f4321;  --m-coffee-bg:    #f1e3d2;

  --font-serif: 'Fraunces', ui-serif, Georgia, serif;
  --font-sans:  'Hanken Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --muted: var(--room-muted); /* legacy alias used by templates */
}
/* The room is already dark — theme toggle is a no-op here by design. */
html.dark, html[data-theme="dark"] { --room: #140f0b; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--room);
  color: var(--bone);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
a { color: var(--brass); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.community-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 96px; }

/* ── Hero (in the room, above the board) ─────────────────────── */
.community-hero { padding: 10px 4px 26px; position: relative; }
.community-hero a.back {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--room-muted);
}
.community-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.02;
  color: var(--bone); margin-top: 14px;
}
.community-hero h1 em { font-style: italic; color: var(--brass); }
.community-hero p.tagline {
  font-size: clamp(15px, 1.5vw, 18px);
  color: var(--room-muted); max-width: 64ch; margin-top: 12px;
}
.community-hero p.tagline a { font-weight: 600; }
.community-hero p.tagline b, .community-hero p.tagline strong { color: var(--bone); }
.community-hero p.meta {
  display: inline-block; margin-top: 16px; padding: 5px 12px;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--brass);
  border: 1px solid var(--brass-dim); border-radius: 2px;
  transform: rotate(-1deg); background: rgba(201,162,39,0.07);
}

/* ── Toolbar + filters (room furniture) ──────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"] {
  flex: 1 1 240px; padding: 11px 16px;
  border: 1px solid var(--room-line); border-radius: 8px;
  font: inherit; background: #1d150e; color: var(--bone);
  transition: border-color 0.15s;
}
.toolbar input[type="search"]::placeholder { color: var(--room-muted); }
.toolbar input[type="search"]:focus { outline: none; border-color: var(--brass); }
.toolbar select {
  padding: 11px 16px; border: 1px solid var(--room-line); border-radius: 8px;
  background: #1d150e; color: var(--bone); font: inherit; cursor: pointer;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; }
.filter-row .label {
  font-family: var(--font-mono); font-size: 10px; color: var(--room-muted);
  margin-right: 4px; text-transform: uppercase; letter-spacing: 0.16em;
}
.chip {
  padding: 6px 13px; border: 1px solid var(--room-line);
  background: transparent; color: var(--room-muted);
  font-size: 13px; font-weight: 500; font-family: var(--font-sans); cursor: pointer;
  border-radius: 999px; transition: all 0.15s;
}
.chip:hover { color: var(--bone); border-color: var(--room-muted); }
.chip.active { background: var(--brass); color: #1c130a; border-color: var(--brass); font-weight: 700; }
.chip:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ── The cork board ──────────────────────────────────────────── */
.board {
  background-color: var(--cork);
  background-image:
    radial-gradient(rgba(0,0,0,0.16) 1px, transparent 1.4px),
    radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1.6px);
  background-size: 11px 11px, 23px 23px;
  background-position: 0 0, 6px 9px;
  border: 6px solid #241a13;
  outline: 1px solid var(--brass-dim);
  border-radius: 6px;
  box-shadow: inset 0 2px 18px rgba(0,0,0,0.45), 0 18px 44px rgba(0,0,0,0.45);
  padding: 30px 26px 34px;
}
.grid { display: grid; gap: 26px 22px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

/* ── Pinned index cards ──────────────────────────────────────── */
.card {
  background: var(--paper);
  background-image: linear-gradient(rgba(42,28,16,0.045) 1px, transparent 1px);
  background-size: 100% 28px;
  background-position: 0 74px;
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  border-radius: 3px;
  padding: 0;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: 0 8px 18px rgba(0,0,0,0.4);
  transition: transform 0.2s cubic-bezier(0.34,1.3,0.64,1), box-shadow 0.2s;
}
/* pinned at slight angles; straighten on hover */
.grid .card:nth-child(4n+1) { transform: rotate(-0.9deg); }
.grid .card:nth-child(4n+2) { transform: rotate(0.7deg); }
.grid .card:nth-child(4n+3) { transform: rotate(0.4deg); }
.grid .card:nth-child(4n+4) { transform: rotate(-0.5deg); }
.grid .card:hover, .grid .card:focus-within {
  transform: rotate(0deg) translateY(-5px);
  box-shadow: 0 18px 34px rgba(0,0,0,0.5);
  z-index: 3;
}
/* brass pin */
.card::before {
  content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #eed685, var(--brass) 55%, var(--brass-dim));
  box-shadow: 0 2px 4px rgba(0,0,0,0.55), 0 5px 6px rgba(0,0,0,0.25);
  z-index: 2;
}
.card .ribbon { height: 5px; width: 100%; background: var(--src); border-radius: 3px 3px 0 0; }
.card[data-mode="cocktail"] .ribbon { background: var(--m-cocktail); }
.card[data-mode="mocktail"] .ribbon { background: var(--m-mocktail); }
.card[data-mode="coffee"]   .ribbon { background: var(--m-coffee); }

.card .body { padding: 18px 20px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .mode-pill {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--src-soft); color: var(--src-deep);
}
.card[data-mode="cocktail"] .mode-pill { background: var(--m-cocktail-bg); color: var(--m-cocktail); }
.card[data-mode="mocktail"] .mode-pill { background: var(--m-mocktail-bg); color: var(--m-mocktail); }
.card[data-mode="coffee"]   .mode-pill { background: var(--m-coffee-bg);   color: var(--m-coffee); }

.card h3 {
  font-family: var(--font-serif); font-size: 23px; font-weight: 600;
  line-height: 1.12; letter-spacing: -0.01em; color: var(--ink);
}
.card .hero { font-size: 13px; color: var(--ink-soft); letter-spacing: 0.01em; margin-top: -3px; }
.card .stats { display: flex; flex-wrap: wrap; gap: 11px; font-size: 13.5px; color: var(--ink); margin-top: 2px; align-items: center; }
.card .stats .rating { color: var(--src-deep); font-weight: 700; }
.card .stats .made, .card .stats .tried { color: var(--ink-soft); }
.card a.view { align-self: flex-start; font-size: 14px; font-weight: 700; color: var(--src-deep); margin-top: 2px; }
.card a.view::after { content: " →"; transition: margin-left 0.15s; }
.card:hover a.view::after { margin-left: 4px; }
.card .by-line {
  font-size: 13.5px; color: var(--ink); font-weight: 600;
  border-top: 1px dashed var(--paper-edge); padding-top: 10px; margin-top: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card .by-line .by-label { color: var(--ink-soft); font-weight: 500; margin-right: 4px; }
.card .by-line .handle { color: var(--src-deep); }

/* ── Cheers (the stamp) ──────────────────────────────────────── */
.cheer-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 2px;
  border: 1.5px solid var(--src-deep);
  background: transparent; color: var(--src-deep);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.06em; cursor: pointer;
  transform: rotate(-1.5deg);
  transition: transform 0.15s, background 0.15s, color 0.15s;
  position: relative;
}
.cheer-btn:hover { background: var(--src-soft); transform: rotate(-1.5deg) scale(1.05); }
.cheer-btn:focus-visible { outline: 2px solid var(--src-deep); outline-offset: 2px; }
.cheer-btn.cheered {
  background: var(--src-deep); color: var(--paper); border-color: var(--src-deep);
  animation: stampThunk 0.35s cubic-bezier(0.34, 1.6, 0.64, 1);
  cursor: default;
}
@keyframes stampThunk {
  0%   { transform: rotate(-1.5deg) scale(1.7); opacity: 0.4; }
  60%  { transform: rotate(-1.5deg) scale(0.94); opacity: 1; }
  100% { transform: rotate(-1.5deg) scale(1); }
}
/* burst particles */
.cheer-btn .burst { position: absolute; inset: 0; pointer-events: none; }
.cheer-btn.cheered .burst::before, .cheer-btn.cheered .burst::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brass);
  animation: burstFly 0.5s ease-out forwards;
}
.cheer-btn.cheered .burst::after { background: var(--src); animation-name: burstFly2; }
@keyframes burstFly  { to { transform: translate(-26px, -22px) scale(0); } }
@keyframes burstFly2 { to { transform: translate(24px, -18px) scale(0); } }

/* ── States ──────────────────────────────────────────────────── */
.empty-state { padding: 70px 24px; text-align: center; color: var(--room-muted); font-size: 16px; }
.empty-state button {
  margin-top: 16px; border: 1px solid var(--brass); background: transparent;
  color: var(--brass); padding: 10px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; font: inherit;
}
.loadmore {
  display: block; margin: 30px auto 4px; padding: 13px 36px;
  border: 1.5px solid var(--brass); background: transparent;
  color: var(--brass); font-weight: 700; border-radius: 999px;
  cursor: pointer; font-size: 15px; font-family: var(--font-sans); transition: background 0.15s, color 0.15s;
}
.loadmore:hover { background: var(--brass); color: #1c130a; }
.loadmore:disabled { opacity: 0.4; cursor: default; }
.offline-banner {
  padding: 22px; border: 2px dashed var(--room-line); border-radius: 8px;
  text-align: center; color: var(--room-muted); margin: 40px 0;
}

/* ── Detail page: one card, up close ─────────────────────────── */
.detail-hero {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--paper-edge);
  border-radius: 3px; padding: 30px 28px; margin: 14px 0 22px;
  position: relative;
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
}
.detail-hero::before {
  content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #eed685, var(--brass) 55%, var(--brass-dim));
  box-shadow: 0 2px 4px rgba(0,0,0,0.55);
}
.detail-hero[data-mode="cocktail"] { border-top: 6px solid var(--m-cocktail); }
.detail-hero[data-mode="mocktail"] { border-top: 6px solid var(--m-mocktail); }
.detail-hero[data-mode="coffee"]   { border-top: 6px solid var(--m-coffee); }
.detail-hero h1 {
  font-family: var(--font-serif); font-size: clamp(30px, 4.5vw, 46px);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; color: var(--ink);
}
.detail-hero p { color: var(--ink-soft); }
.detail-hero strong { color: var(--src-deep); }
.detail-section {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--paper-edge);
  border-radius: 3px; padding: 22px 24px; margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.detail-section h2 {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  margin-bottom: 12px; color: var(--src-deep);
  border-bottom: 1px dashed var(--paper-edge); padding-bottom: 8px;
}
.detail-section ul { padding-left: 18px; line-height: 1.85; }
.detail-section p, .detail-section li { color: var(--ink); }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 4px; align-items: center; }
.btn-primary {
  display: inline-block; padding: 13px 26px; border: none; border-radius: 999px;
  background: var(--src); color: #fff; font-weight: 700; font-size: 15px; font-family: var(--font-sans);
  text-decoration: none; cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn-primary:hover { background: var(--src-deep); transform: translateY(-1px); opacity: 1; }
.btn-secondary {
  display: inline-block; padding: 13px 26px; border: 1.5px solid var(--src-deep); border-radius: 999px;
  background: transparent; color: var(--src-deep); font-weight: 700; font-size: 15px; font-family: var(--font-sans);
  text-decoration: none; cursor: pointer;
}
.btn-secondary:hover { background: var(--src-soft); opacity: 1; }
/* on the espresso room background outside a paper card, links stay brass */
.community-wrap > p > a { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--room-muted) !important; }

.report-link {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--room-muted); text-decoration: underline dotted;
}
.report-link:hover { color: var(--bone); }
.report-link:disabled { text-decoration: none; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .card, .cheer-btn, .btn-primary, .chip, a { transition: none !important; animation: none !important; }
  .grid .card { transform: none; }
  .grid .card:hover, .grid .card:focus-within { transform: none; }
  .cheer-btn.cheered { animation: none; }
  .cheer-btn.cheered .burst::before, .cheer-btn.cheered .burst::after { animation: none; content: none; }
}

@media (max-width: 640px) {
  .community-wrap { padding: 16px 12px 60px; }
  .board { padding: 20px 14px 24px; border-width: 4px; }
  .card h3 { font-size: 20px; }
  .grid { gap: 20px 14px; grid-template-columns: 1fr; }
}
