/* Ritocchi minimi sopra Bootstrap Italia — Rivalta sul Mincio */

.rsm-brand-logo {
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Chip di ricerca rapida nella modale */
.rsm-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Slot auth nello slim header allineato a destra */
.it-header-slim-right-zone #nav-auth .dropdown,
.it-header-slim-right-zone #nav-auth > a {
  display: inline-flex;
}

/* Spaziatura standard del contenuto di pagina */
.rsm-page {
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
}

/* Stati a comparsa (login, reset, ecc.) */
.state { display: none; }
.state.active { display: block; }

/* Viste multiple (login multi-step) */
.view { display: none; }
.view.is-active { display: block; }

/* Banner di errore inline */
.err-banner { display: none; }
.err-banner.show { display: block; }

/* Picker emoji/colore (modifica profilo, registrazione) */
.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.emoji-grid input[type="radio"] { display: none; }
.emoji-grid label {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; cursor: pointer; border-radius: 10px;
  border: 2px solid transparent; padding: 6px;
  background: rgba(0, 0, 0, .04);
}
.emoji-grid input:checked + label { border-color: var(--primary, #06c); }
.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.color-grid input[type="radio"] { display: none; }
.color-grid label {
  display: block; width: 100%; aspect-ratio: 1;
  border-radius: 10px; cursor: pointer; border: 3px solid transparent;
}
.color-grid input:checked + label { border-color: #17324d; box-shadow: 0 0 0 2px var(--primary, #06c); }

/* Skeleton (Bootstrap Italia non ha un componente equivalente) */
.rsm-skel {
  background: #e6e9ee;
  border-radius: 6px;
  display: inline-block;
  min-height: 1em;
}

/* Miniature post (archivio, categorie, dashboard) */
.rsm-post-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.rsm-post-thumb--empty {
  background: linear-gradient(135deg, #0b1626, #1e2338);
}

/* Galleria home: tessere uniformi 4:3 (4 per riga via col-md-3, margini g-2, bordi .rounded) */
#galleria .row img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  display: block;
}

/* Foto di contenuto in home: cap di altezza per non superare la sezione */
.rsm-home-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 26rem;
  margin-inline: auto;
}

/* ── Pagina articolo (post): tipografia e layout del corpo ── */
.rsm-article .post-nav { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 1.5rem; }
.rsm-article .post-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem; }
.rsm-article .post-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: #5a6882; font-size: .85rem; margin-bottom: 1rem; }
.rsm-article .meta-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.rsm-article .post-title { line-height: 1.2; margin-bottom: 1rem; }
.rsm-article .post-lead { font-size: 1.05rem; color: #45526b; border-left: 3px solid #06c; padding-left: 14px; margin-bottom: 1.5rem; }
.rsm-article .reading-brief { display: grid; gap: 10px; margin-bottom: 1.5rem; padding: 14px 0; border-top: 1px solid #e3e7ee; border-bottom: 1px solid #e3e7ee; }
.rsm-article .reading-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #5a6882; }
.rsm-article .reading-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.rsm-article .reading-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; }
.rsm-article .content-divider { height: 1px; background: #e3e7ee; margin-bottom: 1.5rem; }
.rsm-article .post-hero-img { margin: 0 0 1.75rem; border-radius: 12px; overflow: hidden; }
.rsm-article .post-hero-img img { width: 100%; height: auto; display: block; }
.rsm-article .content { font-size: 1.05rem; line-height: 1.7; }
.rsm-article .content p { margin-bottom: 1.1em; }
.rsm-article .content h2 { margin: 1.8em 0 .5em; }
.rsm-article .content h3 { margin: 1.4em 0 .4em; }
.rsm-article .content blockquote { margin: 1.4em 0; padding-left: 16px; border-left: 3px solid #c6a462; font-style: italic; color: #45526b; }
.rsm-article .post-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e3e7ee; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.rsm-article .post-reactions { margin-top: 1rem; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rsm-article .discussion { margin-top: 2rem; border-top: 1px solid #e3e7ee; padding-top: 1.5rem; display: grid; gap: 14px; }
.rsm-article .discussion-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rsm-article .comment-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: #5a6882; }
.rsm-article .comment-body { line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.rsm-article .comment-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rsm-article .comments-list { display: grid; gap: 10px; }
.rsm-article .skel { background: linear-gradient(90deg, #eef1f6 25%, #e2e7ef 50%, #eef1f6 75%); background-size: 400% 100%; animation: rsm-shimmer 1.4s ease-in-out infinite; border-radius: 8px; }
@keyframes rsm-shimmer { to { background-position: -400% 0; } }
.rsm-article .error-wrap { text-align: center; padding: 4rem 1rem; }

/* ── Editor post (write): griglia selezione immagini ── */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.img-opt { display: block; cursor: pointer; border: 2px solid transparent; border-radius: 8px; padding: 4px; text-align: center; }
.img-opt input { display: none; }
.img-opt.selected { border-color: var(--primary, #06c); background: rgba(6,102,204,.06); }
.img-thumb svg { width: 100%; height: auto; border-radius: 6px; display: block; }
.img-label { font-size: .72rem; color: #5a6882; margin-top: 4px; }

/* ── Dashboard: mini grafico a barre (Bootstrap Italia non ha un componente chart) ── */
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.chart-bars .bar { flex: 1; background: linear-gradient(180deg, #6ee7b7, #059669); border-radius: 4px 4px 0 0; min-height: 3px; }
.chart-labels { display: flex; gap: 6px; margin-top: 4px; }
.chart-label { flex: 1; text-align: center; font-size: .7rem; color: #5a6882; }

/* Newsletter inline nel footer scuro: campo leggibile su sfondo scuro */
.it-footer .form-control {
  color: #fff;
  background-color: transparent;
  border-color: rgba(255, 255, 255, .55);
}
.it-footer .form-control::placeholder { color: rgba(255, 255, 255, .7); }
.it-footer .form-control:focus { color: #fff; border-color: #fff; box-shadow: none; }
/* Testi leggibili sul footer scuro (copyright e stato newsletter) */
.it-footer-small-prints-list { color: rgba(255, 255, 255, .85); }
.it-footer .form-text { color: rgba(255, 255, 255, .85); }
.it-footer .form-text.text-success { color: #7ee0b0 !important; }
.it-footer .form-text.text-warning { color: #ffd591 !important; }
