/*
 * Bookclub — the whole of the app's styling.
 *
 * Hand-written and served as a static file rather than going through Vite or
 * Tailwind, so the app needs no `npm install` and no build step: `php artisan
 * serve` is the only command required to look at it. Filament ships its own
 * compiled assets for the operator panel and is unaffected by any of this.
 *
 * Mobile first. Every rule here is the phone layout; the few places that want
 * more room widen inside a min-width query at the bottom of their section.
 *
 * REBRANDING: change the :root block below and nothing else. Token names
 * describe a role, never a hue, precisely so a change of palette does not
 * leave the stylesheet lying about itself.
 *
 * Every pairing is checked for WCAG AA: body and small text clears 4.5:1
 * against its own ground, large display text clears 3:1. Keep that true.
 */

:root {
  /* Brand — ink and brick, chosen to read like a printed page rather than a
     dashboard. */
  --ink:         #241c17;  /* headings, dark grounds        15.7:1 on paper */
  --brand:       #8c3b2e;  /* buttons, links, active states  7.1:1 on paper */
  --brand-deep:  #6b2b20;  /* pressed states, dark accents  10.4:1 on paper */
  --brand-pale:  #f6ece8;  /* tinted panels, hover grounds */
  --accent:      #e8b04b;  /* highlights on dark grounds     8.6:1 on ink */

  /* Neutrals. The page ground is paper, never pure white. */
  --paper:       #faf7f2;
  --white:       #ffffff;  /* cards lifted off the paper */
  --rule:        #e5ddd3;  /* borders and dividers */
  --muted:       #6a5f57;  /* secondary text                 5.8:1 on paper */
  --body:        #3f362f;  /* body copy                     10.3:1 on paper */
  --on-ink:      #d8cec4;  /* body text on --ink            10.8:1 */
  --on-ink-veil: rgba(255,255,255,.09);  /* rules on a dark ground */

  /* Status. Deliberately outside the brand: these must stay readable as
     themselves through any rebrand, and must not be mistaken for --brand. */
  --ok:     #2f6b43;
  --warn:   #8a5a12;
  --error:  #a02c26;
  --ok-pale:    #e9f2ec;
  --error-pale: #fbecea;

  /* Type. Named here and nowhere else — the same promise the colours make.
     Literata is a reading face and sets everything that is meant to be read
     as prose; Inter sets the furniture. Both end in a real fallback stack, so
     a blocked font request degrades rather than disappears. */
  --font-display: 'Literata', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(36,28,23,.06), 0 8px 24px rgba(36,28,23,.07);
  --gutter: 20px;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font-family: inherit; font-size: inherit; }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 var(--gutter); }

/* ───── HEADER ───── */

.masthead { background: var(--ink); color: var(--on-ink); padding: 12px 0; }
.masthead .wrap { display: flex; align-items: center; gap: 12px; }
.masthead a { color: var(--on-ink); }
.mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  background: var(--brand); color: var(--white);
  font-family: var(--font-display); font-weight: 700;
  border-radius: 8px;
}
.masthead-name { font-family: var(--font-display); font-size: 1.05rem; color: var(--white); font-weight: 600; }
.masthead nav { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .9rem; }

/* Nothing in the bar breaks across two lines. "Sign out" is two words and the
   first thing to wrap when the row runs short; flex-shrink would squeeze it
   rather than let the row scroll. */
.masthead nav > *,
.masthead nav a,
.masthead nav .linkish { white-space: nowrap; flex-shrink: 0; }
.linkish { background: none; border: 0; color: var(--on-ink); cursor: pointer; padding: 0; }
.linkish:hover { text-decoration: underline; }

/* ───── PAGE ───── */

main { flex: 1; padding: 28px 0 56px; }
.page-head { margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 4px; }

.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 14px; }

.stack > * + * { margin-top: 14px; }

/* Four numbers of the same weight, so they are one even row rather than four
   cards sized by the length of their own labels — "pages" is one word and
   "books read" is two, which is enough to make them differ otherwise.
   grid-auto-rows keeps every row equal even when the labels wrap. */
.stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ───── MEMBER LIST ───── */

.people { display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.person + .person { border-top: 1px solid var(--rule); }
.avatar {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  background: var(--brand-pale); color: var(--brand-deep);
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  border-radius: 50%;
}
.person-name { font-weight: 500; color: var(--ink); }

/* ───── BADGES ───── */

.badge {
  display: inline-block;
  font-size: .72rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--brand-pale); color: var(--brand-deep);
}
.badge-muted { background: var(--rule); color: var(--muted); }
.badge-dead  { background: var(--error-pale); color: var(--error); }

/* ───── FORMS ───── */

label { display: block; font-size: .85rem; font-weight: 500; color: var(--ink); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=number], select {
  width: 100%;
  font: inherit;
  color: var(--body);
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 12px;
}
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-pale); }
.field + .field { margin-top: 14px; }
.hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }

.btn {
  display: inline-block;
  font: inherit; font-weight: 600;
  background: var(--brand); color: var(--white);
  border: 1px solid transparent; border-radius: 8px;
  padding: 11px 18px;
  cursor: pointer;
}
.btn:hover { background: var(--brand-deep); text-decoration: none; }
.btn-quiet { background: transparent; color: var(--brand); border-color: var(--rule); }
.btn-quiet:hover { background: var(--brand-pale); color: var(--brand-deep); }
.btn-block { display: block; width: 100%; }

/* ───── NOTICES ───── */

.notice { border-radius: 8px; padding: 12px 14px; font-size: .92rem; }
.notice-ok { background: var(--ok-pale); color: var(--ok); }
.notice-bad { background: var(--error-pale); color: var(--error); }
.notice + * { margin-top: 14px; }

/* ───── INVITE LINKS ───── */

.token {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  word-break: break-all;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--body);
}
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row-end { margin-left: auto; }

/* ───── EMPTY ───── */

.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.empty h2 { margin-bottom: 6px; }

/* ───── FOOTER ───── */

footer {
  background: var(--ink); color: var(--on-ink);
  padding: 20px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  font-size: .85rem;
}

/* ───── BOOKS ───── */

.book-row { align-items: flex-start; gap: 14px; }
.book-row h2, .book-row h3 { margin-bottom: 2px; }
.byline { color: var(--muted); font-size: .9rem; }
.shelf-head { margin: 28px 0 12px; font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.reading-now { border-left: 3px solid var(--brand); }
.prose { margin-top: 14px; max-width: 62ch; }

.cover {
  flex: 0 0 auto;
  border-radius: 4px;
  background: var(--brand-pale);
  box-shadow: 0 1px 3px rgba(36,28,23,.18);
  object-fit: cover;
}
.cover-s { width: 44px; height: 66px; }
.cover-m { width: 72px; height: 108px; }
.cover-l { width: 104px; height: 156px; }

/* Standing in for a cover the way a club's initial stands in for a logo. */
.cover-blank {
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700;
  color: var(--brand-deep);
}
.cover-blank.cover-s { font-size: 1.2rem; }
.cover-blank.cover-m { font-size: 1.8rem; }
.cover-blank.cover-l { font-size: 2.4rem; }

.result + .result { border-top: 1px solid var(--rule); padding-top: 14px; }

/* ───── MEETINGS ───── */

.is-off { opacity: .62; }
.is-off h3 a { text-decoration: line-through; }

/* ───── DISCUSSION ───── */

.veiled { color: var(--muted); font-style: italic; }
.post .prose { margin-top: 8px; white-space: pre-wrap; }
textarea {
  width: 100%; font: inherit; color: var(--body);
  background: var(--white); border: 1px solid var(--rule);
  border-radius: 8px; padding: 10px 12px; resize: vertical;
}
textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-pale); }

/* ───── VOTING ───── */

.tickable { cursor: pointer; align-items: flex-start; gap: 10px; font-weight: 400; }
.tickable input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }
.tickable .byline { display: block; }

/* ───── HISTORY ───── */

/* Centred in both directions, so a tile whose label wraps does not sit
   higher than the one beside it. */
.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1;
}

/* ───── NOTES AND QUESTIONS ───── */

.note, .question { border-left: 3px solid var(--rule); padding-left: 12px; margin-bottom: 14px; }
.note { border-left-color: var(--brand-pale); }

/* ───── PEOPLE ───── */

img.avatar { object-fit: cover; }
.person-bio { display: block; color: var(--muted); font-size: .85rem; }
.person-actions { display: flex; gap: 8px; align-items: center; }
input[type=password] {
  width: 100%; font: inherit; color: var(--body);
  background: var(--white); border: 1px solid var(--rule);
  border-radius: 8px; padding: 10px 12px;
}
input[type=password]:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-pale); }

/* ───── WORDMARK AND CLUB SWITCHER ───── */

.wordmark {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em;
  color: var(--white);
  flex: 0 0 auto;
}
.wordmark:hover { text-decoration: none; color: var(--accent); }

/* A rule between the app and whichever club you happen to be in. */
.switcher { position: relative; flex: 0 1 auto; min-width: 0; }
.switcher::before {
  content: ""; position: absolute; left: -10px; top: 50%;
  width: 1px; height: 20px; margin-top: -10px;
  background: var(--on-dark-veil);
}
.switcher > summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; list-style: none; padding: 4px 6px;
  border-radius: 8px; color: var(--on-dark);
}
.switcher > summary::-webkit-details-marker { display: none; }
.switcher > summary:hover { background: var(--on-dark-veil); color: var(--white); }
.switcher > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.switcher-name {
  font-family: var(--font-display); font-weight: 600; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.switcher-caret { font-size: .7rem; opacity: .7; }
.switcher[open] > summary .switcher-caret { transform: rotate(180deg); }

.switcher-menu {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0;
  min-width: 240px;
  background: var(--white); color: var(--body);
  border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
}
.switcher-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; color: var(--body);
}
.switcher-menu a:hover { background: var(--brand-pale); text-decoration: none; }
.switcher-menu a.is-current { font-weight: 600; color: var(--ink); }
.switcher-menu .mark { width: 26px; height: 26px; flex: 0 0 26px; font-size: .8rem; }
.switcher-all {
  border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 12px !important;
  color: var(--muted) !important; font-size: .9rem;
}

/* The nav is the part that has to give way when the screen is narrow. */
@media (max-width: 620px) {
  .masthead .wrap { flex-wrap: wrap; }
  .masthead nav { width: 100%; margin-left: 0; overflow-x: auto; padding-top: 8px; }
}

/* ───── A BADGE THAT LABELS A CARD ───── */

/* Block-level on purpose: an inline-block's bottom margin does not reliably
   push a following block element away from it. */
.card-label { margin-bottom: 14px; }
.reading-now > .card-label + * { margin-top: 0; }
.thread-title { margin-top: 4px; }

/* ───── NAVIGATION: WHERE YOU ARE ───── */

/* --accent is the app's one highlight on a dark ground, and the masthead is
   the only dark ground a signed-in member sees. Hover says "this is a
   control"; is-here says "and you are already in it". */
.masthead nav a { padding: 4px 2px; border-bottom: 2px solid transparent; }
.masthead nav a:hover { color: var(--accent); text-decoration: none; }
.masthead nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.masthead nav a.is-here {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* The underline carries it when colour cannot — a member who cannot tell the
   yellow from the grey still sees which section is lit. */
.masthead nav a.is-here:hover { color: var(--accent); }

.masthead .linkish:hover { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------------------
   Discovery — the public surfaces, added 2026-09-27

   Every value below is a token from the :root block at the top of this file.
   Nothing here introduces a colour or a typeface literal, which is the promise
   that block makes.
   --------------------------------------------------------------------------- */

/* The landing page. Larger type than anywhere else in the app, because this is
   the one page read by somebody who does not yet know what it is for. */
.hero { padding: 16px 0 28px; text-align: center; }
.hero h1 { font-size: 2rem; line-height: 1.15; max-width: 22ch; margin: 0 auto; }
.hero-lede {
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--body);
  max-width: 54ch;
  margin: 16px auto 0;
  line-height: 1.6;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.hero .hint { margin-top: 12px; }

@media (min-width: 640px) {
  .hero { padding: 36px 0 40px; }
  .hero h1 { font-size: 2.6rem; }
}

.pitch { display: grid; gap: 14px; margin-bottom: 28px; }
@media (min-width: 640px) { .pitch { grid-template-columns: 1fr 1fr; gap: 18px; } }
.pitch-item {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px;
}
.pitch-item h2 { font-size: 1.05rem; margin-bottom: 6px; }
.pitch-item p { color: var(--body); font-size: .94rem; line-height: 1.6; }

/* A club's badge: its picture, or its initial standing in for one. The same
   idea as .cover and .avatar, sized for a club rather than a book or a face. */
.club-badge {
  width: 64px; height: 64px; flex: 0 0 64px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--brand-pale);
}
.club-badge-blank {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--brand);
}
.club-badge-l { width: 96px; height: 96px; flex: 0 0 96px; }
.club-badge-l.club-badge-blank { font-size: 2.4rem; }

.club-row h3 { margin-bottom: 2px; }
.club-row .prose { margin-top: 6px; font-size: .94rem; }

/* The profile masthead: badge beside the name, stacking on a phone. */
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.profile-head-text { min-width: 0; }
.profile-foot { margin-top: 24px; text-align: center; max-width: 52ch; margin-left: auto; margin-right: auto; }

.search-row { gap: 8px; }
.search-row input[type=text] { flex: 1 1 200px; min-width: 0; }

/* A radio or checkbox whose label is a sentence rather than a word. */
.choice { padding: 10px 0; align-items: flex-start; }
.choice + .choice { border-top: 1px solid var(--rule); }
.choice input[type=radio] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 20px; }
.choice .byline { display: block; margin-top: 2px; }

.preview-list { margin-top: 10px; color: var(--body); font-size: .94rem; }
.preview-list li { padding: 3px 0 3px 18px; position: relative; }
.preview-list li::before { content: '·'; position: absolute; left: 6px; color: var(--muted); }

.door-actions { margin-top: 14px; gap: 8px; }

.badge-ok { background: var(--ok-pale); color: var(--ok); }
.badge-count {
  background: var(--accent);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 6px;
  font-size: .75rem;
  font-weight: 600;
  margin-left: 4px;
}

/* Destructive, and deliberately not --brand, which is itself a red: closing an
   account must not look like the primary action on the page. */
.btn-danger { background: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--brand-deep); }

.footer-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.footer-row a { color: var(--on-ink); text-decoration: underline; }

.pager { margin-top: 18px; }
.pager svg { width: 18px; height: 18px; display: inline; }
.pager nav { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; font-size: .9rem; }
.pager nav a, .pager nav span { color: var(--muted); }

/* Visible to a screen reader, and to nothing else. */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------------
   Reporting — added 2026-09-27

   Deliberately quiet. A prominent report button invites idle clicking, and this
   queue is read by one person between other jobs.
   --------------------------------------------------------------------------- */

.report { margin-top: 18px; }
.report > summary {
  font-size: .82rem;
  color: var(--muted);
  cursor: pointer;
  display: inline-block;
  padding: 2px 0;
  list-style: none;
}
.report > summary::-webkit-details-marker { display: none; }
.report > summary::before { content: '⚑ '; opacity: .6; }
.report > summary:hover { color: var(--error); text-decoration: underline; }
.report > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.report-form {
  margin-top: 12px;
  padding: 14px;
  background: var(--brand-pale);
  border-radius: var(--radius);
  max-width: 44ch;
}
.report-form .hint { margin-top: 0; }

/* Inside a member row the disclosure sits among other small actions, so it
   must not introduce its own vertical rhythm. */
.person-actions .report { margin-top: 0; }
.person-actions .report-form { position: relative; z-index: 1; }

/* Suspended, shown wherever a person is listed for an operator. */
.badge-suspended { background: var(--error-pale); color: var(--error); }
