/* ================================================================
   Presentable — shared app chrome for the Vibe-a-thon Planning App
   Reuses the design language + tokens from
   01-Projects/presentable/prototypes/lightweight-app.html and
   01-Projects/presentable/theme/paper.css (warm paper / ink /
   persimmon / forest, editorial serif display). Not the strict
   pp- markup contract (this app needs real forms + JS), just the
   same visual language.
   ================================================================ */

:root {
  --paper: #FAF7F2;
  --ink: #1A1815;
  --ink-soft: #5C564C;
  --ink-faint: #8A8375;
  --persimmon: #E05B3D;
  --persimmon-soft: rgba(224, 91, 61, 0.09);
  --persimmon-border: rgba(224, 91, 61, 0.28);
  --forest: #2D5A4A;
  --forest-soft: rgba(45, 90, 74, 0.10);
  --forest-border: rgba(45, 90, 74, 0.25);
  --amber: #B0713A;
  --amber-soft: #F5EBDF;
  --amber-border: rgba(176, 113, 58, 0.28);
  --slate: #3D5A73;
  --slate-soft: rgba(61, 90, 115, 0.10);
  --slate-border: rgba(61, 90, 115, 0.28);
  --card: #FFFFFF;
  --line: #EDE7DD;
  --line-soft: #F3EFE7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 24, 21, 0.04), 0 6px 20px -8px rgba(26, 24, 21, 0.08);
  --display: ui-serif, Georgia, "Times New Roman", serif;
  --body: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(224, 91, 61, 0.045), transparent 60%),
    radial-gradient(900px 480px at -10% 12%, rgba(45, 90, 74, 0.045), transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}
.page--narrow { max-width: 520px; }
.page--board { max-width: 1120px; } /* Kanban board needs more width for 4 comfortable lanes (Phase 2.5) */

/* ————— Masthead ————— */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.masthead .from { font-size: 12.5px; color: var(--ink-faint); }
.masthead .from strong { color: var(--ink-soft); font-weight: 600; }

.eyebrow {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--persimmon);
}

/* ————— Hero ————— */
.hero { margin-bottom: 34px; }
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 5.4vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 10px 0 10px;
  text-wrap: balance;
}
.hero p.lede { font-size: 15px; color: var(--ink-soft); max-width: 58ch; }
.hero .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }

.kind-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--persimmon); background: var(--persimmon-soft);
  border: 1px solid var(--persimmon-border); border-radius: 999px; padding: 3.5px 11px;
}
.kind-chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--persimmon);
  transform: rotate(45deg);
}
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--forest);
  background: var(--forest-soft); border: 1px solid var(--forest-border);
  border-radius: 999px; padding: 3px 10px 3px 8px;
}
.live-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--forest);
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ————— Section headers ————— */
section { margin-bottom: 42px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.sec-head h2 {
  font-family: var(--display); font-weight: 550; font-size: 21px;
  letter-spacing: -0.008em; white-space: nowrap;
}
.sec-head .rule { flex: 1; height: 1px; background: var(--line); transform: translateY(-4px); }
.sec-head .aside { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }

/* ————— Cards ————— */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 20px;
}

/* ————— Forms ————— */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; font-weight: 650; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--body); font-size: 14px; color: var(--ink);
  background: #FDFCF9; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 76px; font-family: var(--body); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--forest-border); box-shadow: 0 0 0 3px var(--forest-soft);
}
/* Custom select arrow (Phase 2.5 polish) — the tag picker is chips now, but
   any other real <select> (e.g. the lane filter) keeps its native semantics
   with a themed chevron instead of the browser default. */
.field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238A8375' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 11px 7px;
}
.field .hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; }
.row { display: flex; gap: 10px; }
.row .field { flex: 1; }

.btn {
  font-family: var(--body); font-size: 13.5px; font-weight: 650; letter-spacing: 0.02em;
  color: #FDFCFA; background: linear-gradient(180deg, #37695A, var(--forest));
  border: none; border-radius: 8px; padding: 11px 20px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 6px -1px rgba(45, 90, 74, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -2px rgba(45, 90, 74, 0.5); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-block { width: 100%; }

.msg {
  font-size: 12.5px; font-weight: 600; margin-top: 12px; display: none; border-radius: 8px;
  padding: 9px 12px;
}
.msg.show { display: block; }
.msg.ok { color: var(--forest); background: var(--forest-soft); border: 1px solid var(--forest-border); }
.msg.err { color: var(--persimmon); background: var(--persimmon-soft); border: 1px solid var(--persimmon-border); }

/* ————— Idea board controls (lane filter, Phase 2.2 → 2.5) ————— */
.board-controls { margin-bottom: 16px; }
.board-controls .field { margin-bottom: 0; max-width: 220px; }

/* ————— Kanban board (Phase 2.5) ————— */
/* Lanes side-by-side on desktop; horizontally scrolling on narrow/mobile
   (rather than stacked) so drag between lanes stays reachable with a thumb. */
.kanban { display: flex; align-items: flex-start; gap: 16px; }
.lane {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.lane-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; border-bottom: 1px solid var(--line);
}
.lane-count { font-weight: 650; letter-spacing: 0.02em; opacity: 0.75; }
.lane-header-theme { color: var(--forest); background: var(--forest-soft); border-bottom-color: var(--forest-border); }
.lane-header-format { color: var(--persimmon); background: var(--persimmon-soft); border-bottom-color: var(--persimmon-border); }
.lane-header-logistics { color: var(--amber); background: var(--amber-soft); border-bottom-color: var(--amber-border); }
.lane-header-other { color: var(--slate); background: var(--slate-soft); border-bottom-color: var(--slate-border); }

.lane-list {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  padding: 12px; min-height: 100px;
}
.lane-empty {
  text-align: center; padding: 22px 10px; color: var(--ink-faint); font-size: 12.5px;
  border: 1px dashed var(--line); border-radius: 8px;
}

/* ————— Idea board ————— */
.idea-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px 16px; position: relative; overflow: hidden;
  cursor: grab;
}
.idea-card:active { cursor: grabbing; }
.idea-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--forest);
}
.idea-card[data-tag="format"]::before { background: var(--persimmon); }
.idea-card[data-tag="logistics"]::before { background: var(--amber); }
.idea-card[data-tag="other"]::before { background: var(--slate); }
.idea-card.editing { border-color: var(--forest-border); box-shadow: 0 0 0 3px var(--forest-soft), var(--shadow); cursor: default; }

/* SortableJS drag-state hooks (see public/js/board.js) */
.idea-card-ghost { opacity: 0.4; }
.idea-card-chosen { box-shadow: 0 0 0 3px var(--forest-soft), var(--shadow); }
.idea-card-drag { opacity: 0.92; transform: rotate(1.5deg); cursor: grabbing; }

.idea-card .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.idea-card h3 { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; }
.idea-card p.body-text { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin-top: 4px; white-space: pre-wrap; }
.idea-card .meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 10px; }
.idea-card .meta strong { color: var(--ink-soft); font-weight: 600; }

.idea-card .field:last-of-type { margin-bottom: 12px; }

/* ————— Idea actions (edit / delete / save / cancel) ————— */
.idea-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.idea-actions .btn { padding: 8px 16px; font-size: 12.5px; }
.link-btn {
  font-family: var(--body); font-size: 12px; font-weight: 650; letter-spacing: 0.02em;
  color: var(--ink-faint); background: none; border: none; padding: 0; cursor: pointer;
  transition: color 0.15s ease;
}
.link-btn:hover { color: var(--ink); }
.link-btn.danger:hover { color: var(--persimmon); }

.tag-chip {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2.5px 9px; border-radius: 999px; white-space: nowrap;
}
.tag-chip.theme { color: var(--forest); background: var(--forest-soft); border: 1px solid var(--forest-border); }
.tag-chip.format { color: var(--persimmon); background: var(--persimmon-soft); border: 1px solid var(--persimmon-border); }
.tag-chip.logistics { color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-border); }
.tag-chip.other { color: var(--slate); background: var(--slate-soft); border: 1px solid var(--slate-border); }

/* ————— Segmented pill-chip tag picker (Phase 2.5) ————— */
/* Accessible radiogroup: a visually-hidden radio per tag + a <label> styled
   as a tappable colored pill. Replaces the native tag <select> in both the
   create form and the inline-edit form (public/js/board.js buildTagPicker). */
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tag-pill {
  display: inline-flex; align-items: center; font-family: var(--body);
  font-size: 12.5px; font-weight: 650; letter-spacing: 0.02em; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #FDFCF9; color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tag-pill:hover { border-color: var(--ink-faint); }
.tag-pill-input:focus-visible + .tag-pill { box-shadow: 0 0 0 3px var(--forest-soft); }

.tag-pill-theme { border-color: var(--forest-border); color: var(--forest); }
.tag-pill-input:checked + .tag-pill-theme { background: var(--forest); border-color: var(--forest); color: #FDFCFA; }

.tag-pill-format { border-color: var(--persimmon-border); color: var(--persimmon); }
.tag-pill-input:checked + .tag-pill-format { background: var(--persimmon); border-color: var(--persimmon); color: #FDFCFA; }

.tag-pill-logistics { border-color: var(--amber-border); color: var(--amber); }
.tag-pill-input:checked + .tag-pill-logistics { background: var(--amber); border-color: var(--amber); color: #FDFCFA; }

.tag-pill-other { border-color: var(--slate-border); color: var(--slate); }
.tag-pill-input:checked + .tag-pill-other { background: var(--slate); border-color: var(--slate); color: #FDFCFA; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-faint); font-size: 14px;
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ————— Footer ————— */
footer { margin-top: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.pub-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  font-size: 12.5px; color: var(--ink-faint);
}
.pub-row .brand { font-family: var(--display); font-weight: 650; font-size: 13.5px; color: var(--ink); }
.pub-row .brand::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--persimmon); margin-right: 7px; transform: rotate(45deg) translateY(-1px);
}
.pub-row .sep { color: #D9D2C4; }

@media (max-width: 560px) {
  .page { padding: 28px 18px 44px; }
  .row { flex-direction: column; }
  .masthead { flex-direction: column; gap: 4px; margin-bottom: 26px; }
}

/* Narrower than 4 comfortable lane widths — scroll the board horizontally
   instead of squeezing lanes, so drag targets stay a reasonable size for
   touch (Phase 2.5). */
@media (max-width: 720px) {
  .kanban { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .lane { min-width: 250px; }
}
@media (max-width: 560px) {
  .kanban { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
}
