/* comunita: rifinitura del 18/11/2026. Caricato dopo style.css: le regole qui vincono. */

/* ---------- Comunità ---------- */
.community-row a:focus-visible { border-radius: var(--r-sm); }
.communities .empty { border-bottom: 0; }
.name-status { display: flex; align-items: center; gap: .3rem; min-height: 1.3em; }
.name-status:empty { min-height: 0; margin: 0; }
.name-status.free { font-weight: 650; }
.community-head h1 { overflow-wrap: anywhere; }
.shortlist li { min-height: 44px; }
.shortlist li > span { min-width: 0; overflow-wrap: anywhere; }
.member-list a { border-radius: 50%; }
.empty .btn + .btn { margin-left: .5rem; }

/* ---------- Gioco del Fanta ---------- */
.fanta { border-top: 1px solid var(--rule); }
.fanta-phase { display: block; margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sage-2); font-weight: 400; }
.phase-aperto, .phase-chiuso, .phase-concluso { background: var(--sage-2); color: var(--ink); }
.fanta-steps { list-style: none; margin: 0 0 .7rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; counter-reset: step; }
.fanta-steps li { counter-increment: step; padding-top: .45rem; border-top: 3px solid var(--rule-strong); font-size: .84rem; font-weight: 650; color: var(--ink-2); }
.fanta-steps li::before { content: counter(step) ". "; font-variant-numeric: tabular-nums; }
.fanta-steps li.done { border-top-color: var(--forest); }
.fanta-steps li.now { border-top-color: var(--forest); color: var(--ink); font-weight: 800; }
.phase-chiuso .fanta-steps li.now { border-top-color: var(--amber); }
.fanta-phase-line { margin: 0; font-size: .95rem; }
.fanta-todo { margin: .25rem 0 0; font-weight: 650; color: var(--forest); }
.fanta-need { margin: 0 0 .8rem; padding: .55rem .75rem; border-radius: var(--r-sm); background: var(--amber-soft); font-size: .92rem; }
.fanta-mine { margin: 0 0 .5rem; }
.fanta h3 { margin-top: 1.4rem; }
.fanta-count { font-weight: 600; color: var(--ink-2); }
.fanta-books li { min-height: 48px; }
.fanta-books li.on { border-width: 1px; }
.fanta-pick input { flex: none; width: 18px; height: 18px; }
.fanta-pick span { overflow-wrap: anywhere; }
.captain-btn { min-height: 34px; }
.captain-btn:hover { border-color: var(--amber); }
.captain-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.fanta-books input:disabled + span { color: var(--ink-2); }
.fanta-results table { min-width: 320px; }
.fanta-results td input { width: 20px; height: 20px; }
.fanta-deadline .inline-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.fanta-deadline .inline-form input { flex: 1 1 200px; min-width: 0; }
.fanta-board li { min-height: 48px; }
.fanta-board .rank { flex: none; }
.fanta-board .points { white-space: nowrap; }
.fanta-start .field { max-width: 320px; }

/* ---------- Mercatino ---------- */
.market-card:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: var(--r); }
.market-card:hover .market-title { text-decoration: underline; text-underline-offset: 2px; }
.market-badge { border-radius: var(--r-sm); }
.market-filters-row .check { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; }
.new-post-grid > div:first-child:has(> #market-photo:focus-visible) > label.btn { outline: 2px solid var(--forest); outline-offset: 2px; }
.field > .hint { margin: 0; font-weight: 400; font-size: .82rem; }
.listing-contact { display: flex; flex-direction: column; gap: .5rem; }
.listing-contact p { margin: 0; }
.segmented button:focus-visible { outline: 2px solid var(--forest); outline-offset: 0; }
.segmented button.on { box-shadow: none; border: 1px solid var(--rule-strong); }

/* Annuncio in bacheca: stessa ossatura della scheda di una lettura */
.market-post .post-head { padding: .75rem .6rem .75rem .9rem; }
.market-post-body { padding: .2rem 1rem .9rem; border-radius: var(--r-sm); }
.market-post-body:focus-visible { outline: 2px solid var(--forest); outline-offset: -2px; }
.market-post-info .book-title { font-size: 1.3rem; overflow-wrap: anywhere; }
.market-post-tag { color: var(--ink-2); font-weight: 650; }
.market-post-facts { margin: 0; }
.market-post .post-actions { margin-top: 0; }
.market-post-photo .market-badge { top: 8px; right: 8px; }

@media (max-width: 720px) {
  .fanta-steps li { font-size: .78rem; }
  .fanta-start .field { max-width: none; }
  .captain-btn { min-height: 44px; padding: .2rem .8rem; }
  .fanta-books li { flex-wrap: wrap; }
  .fanta-pick { min-height: 44px; }
  .fanta-results td input { width: 24px; height: 24px; }
  .shortlist .btn-icon { width: 44px; min-height: 44px; }
  .segmented button { min-height: 44px; }
  .price-edit .btn, .price-edit input, .add-book .btn, .add-book input { min-height: 44px; }
  .market-filters-row .check { min-height: 44px; }
  .empty .btn + .btn { margin: .5rem 0 0; }
  .market-post-photo { width: 104px; }
  .market-post-info .book-title { font-size: 1.15rem; }
  .market-post .post-actions .btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-card { transition: none; }
}
