/* profilo: rifinitura del 18/11/2026. Caricato dopo style.css: le regole qui vincono.
   Solo variabili del tema (niente colori fissi): il tema scuro segue da solo. */

/* ---------- Profilo ---------- */
.page > .profile.card .stats li { white-space: nowrap; }
.page > .profile.card h1 { line-height: 1.2; overflow-wrap: anywhere; }
.page > .profile.card .profile-actions > .btn { min-height: 44px; }
.page > .profile.card .profile-actions .more-menu .btn,
.page > .profile.card .profile-actions .more-menu button { min-height: 44px; min-width: 44px; }
.page > .profile.card .chip { min-height: 36px; }

.affinity { border-radius: var(--r-lg); }
.affinity p { line-height: 1.5; }

.library .tabs { justify-content: flex-start; gap: 0; }
.library .tabs button { flex: 1; max-width: 240px; min-height: 44px; }
.library .tabs button:focus-visible { outline: 2px solid var(--forest); outline-offset: -2px; }
.library .empty { padding: 2rem 1.25rem; }

/* tocco: il pulsante «togli» resta piccolo ma l'area utile è 44px */
.to-read-remove { width: 32px; height: 32px; box-shadow: none; border: 1px solid var(--rule-strong); }
.to-read-remove::after { content: ""; position: absolute; inset: -6px; }

/* ---------- Impostazioni ---------- */
.settings { gap: 16px; }
.settings .settings-block h2 { display: flex; align-items: center; gap: .45rem; }
.settings .settings-block > .muted { margin-top: 0; }
.settings .segmented button { min-height: 44px; }
.settings .segmented button.on { box-shadow: none; outline: 1px solid var(--rule-strong); outline-offset: -1px; }
.settings .segmented button:focus-visible { outline: 2px solid var(--forest); outline-offset: 1px; }
.settings .plain-row { min-height: 52px; }
.settings .plain-row .btn { min-height: 44px; }

/* zona pericolosa: filo e titolo rossi, pulsante pieno solo quando c'è la password */
.settings .danger-card { border-color: var(--danger); }
.settings .danger-zone h2 { color: var(--danger); }
.settings .danger-zone h2 .icon { color: var(--danger); }
.settings .danger-zone .btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.settings .danger-zone .btn-danger { min-height: 44px; }

/* ---------- Utenti ---------- */
.reader { min-height: 72px; }
.reader:focus-within { background: var(--sage-2); }
.reader-info .strong { overflow-wrap: anywhere; }
.reader-info .affinity-chip { line-height: 1.35; }
.reader > .btn-icon { width: 44px; height: 44px; flex-shrink: 0; }
.reader > .btn-icon:focus-visible { outline: 2px solid var(--forest); outline-offset: -2px; }
.page > .search { width: 100%; }

/* ---------- Notifiche ---------- */
.notification-groups { display: flex; flex-direction: column; gap: 22px; }
.notification-group { display: flex; flex-direction: column; gap: 10px; }
.notification-group .section-title { margin: 0; font-size: 1rem; color: var(--ink-2); }
.notification { position: relative; min-height: 64px; align-items: center; }
.notification:focus-visible { outline: 2px solid var(--forest); outline-offset: -2px; border-radius: 0; }
.notification-text { flex: 1; }
.notification-kind { flex-shrink: 0; color: var(--ink-2); display: inline-flex; }
.notification.unread { box-shadow: inset 3px 0 0 var(--forest); }
.notification.unread .notification-kind { color: var(--forest); }
.notification-why { color: var(--forest); font-size: .875rem; }
.notification-quote { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.page > .empty.card h3 { margin-top: 0; }

/* ---------- Cerca ---------- */
.search-wrap input.search-big:not([type=range]):not([type=file]):not([type=checkbox]):not([type=radio]) { min-height: 52px; }
.result-row { min-height: 56px; }
.result-row:focus-visible, .result-book:focus-visible { outline: 2px solid var(--forest); outline-offset: -2px; }
.result-book .strong { overflow-wrap: anywhere; }
.search-results .empty.card { padding: 2rem 1.25rem; }
.search-results .empty.card p { margin: 0 0 .3rem; }

@media (max-width: 720px) {
  .page > .profile.card .profile-actions > .btn { min-height: 44px; }
  .notification { padding: .8rem .9rem; }
  .result-books { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px 12px; }
  .settings-block { padding: 1.1rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .result-book:hover img, .result-book:hover .cover-gen { transform: none; }
}

/* ---------- Seguire (18/11/2026) ---------- */
.follow-btn { min-width: 6.5rem; justify-content: center; flex-shrink: 0; }
.follow-btn.btn-sm { min-width: 5.5rem; }
.stats .stat-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.stats .stat-link:hover { color: var(--forest); }
.stats .stat-link:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 4px; }
.stats-minor { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .35rem 0 0; }
.tag-friend { background: var(--forest); color: var(--forest-ink); }
.follow-list { list-style: none; margin: 0; padding: 0; }
.follow-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; }
.follow-row + .follow-row { border-top: 1px solid var(--rule); }
.follow-list > .muted, .follow-list > .form-error { padding: .6rem 0; }
.follow-who, .result-who, .match-who { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.follow-who > span, .result-who .result-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.follow-who .strong, .follow-who .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-suggest { text-align: left; margin: 1rem 0; }
.follow-suggest h4 { margin: 0 0 .25rem; font-size: .95rem; }
.result-row-follow { gap: .75rem; }
.reader-actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.match .match-info .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .follow-btn.btn-sm { min-width: 0; padding-inline: .7rem; }

/* Profilo: riga con voto medio, da leggere e «Amici / Ti segue» sotto i numeri */
.page > .profile.card {
  grid-template-areas: "avatar name" "avatar handle" "avatar stats" "avatar minor" "bio bio" "chips chips" "actions actions";
}
.page > .profile.card .profile-info > p.stats-minor { grid-area: minor; margin: .35rem 0 0; }
.page > .profile.card .stats { gap: 1.3rem; flex-wrap: wrap; }
@media (max-width: 720px) {
  .page > .profile.card {
    grid-template-areas: "avatar stats" "name name" "handle handle" "minor minor" "bio bio" "chips chips" "actions actions";
  }
  .page > .profile.card .stats { gap: 0; flex-wrap: nowrap; }
  .page > .profile.card .stats .stat-link { text-align: center; }
}

/* Generi preferiti (iscrizione e Modifica profilo): etichette da accendere */
.genre-picker { border: 0; padding: 0; margin: 0 0 .9rem; min-width: 0; }
.genre-picker legend { padding: 0; font-size: .86rem; font-weight: 650; margin-bottom: .15rem; }
.genre-choices { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.genre-choice { user-select: none; }
.genre-choice:has(input:checked) { background: var(--forest-soft); border-color: var(--forest); color: var(--forest); }
.genre-choice:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px; }
.genre-choice-all { font-weight: 700; }
.bio .bio-text { margin: 0; }
.bio .favorite-genres { margin: .35rem 0 0; white-space: normal; }
