/* ============================================
   BRÈ BRÈ – feed.css
   Post "stile Facebook" per galleria e home
   (da caricare DOPO style.css)
   ============================================ */

/* ===================== FEED ===================== */
.bb-feed { width: 100%; max-width: 680px; margin: 0 auto; }
.news-col .bb-feed { max-width: none; }
.bb-feed-list { display: flex; flex-direction: column; gap: 22px; }
.bb-feed-sentinel { height: 1px; }

/* ===================== POST ===================== */
.bb-post {
  position: relative;
  background: #fff;
  border: 1px solid var(--gray-lt);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  animation: bbIn .35s ease both;
}
.bb-post [hidden] { display: none !important; }
.bb-post.is-filtered { display: none; }
.bb-post.is-busy { pointer-events: none; opacity: .7; }
@keyframes bbIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* intestazione */
.bb-post-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.bb-avatar-link { flex-shrink: 0; }
.bb-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; display: block; }
.bb-avatar-txt {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--red), var(--blue));
  color: #fff; font-family: var(--font-display); font-size: 1.35rem;
}
.bb-post-who { flex: 1; min-width: 0; }
.bb-post-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.2; }
.bb-post-name > a { font-family: var(--font-body); font-weight: 600; font-size: 1.08rem; color: var(--dark); }
.bb-post-name > a:hover { color: var(--red); }
.bb-follow {
  padding: 2px 10px; border-radius: 12px;
  border: 1.5px solid var(--red); background: transparent; color: var(--red);
  font-family: var(--font-mono); font-size: .6rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; cursor: pointer; transition: all .2s;
}
.bb-follow:hover { background: var(--red); color: #fff; }
.bb-post-meta {
  margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px;
  font-family: var(--font-mono); font-size: .7rem; color: var(--gray);
}
.bb-post-meta i { font-style: normal; opacity: .6; }

/* menu admin "⋯" e menu condividi */
.bb-menu-wrap { position: relative; flex-shrink: 0; }
.bb-menu-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent;
  font-size: 1.3rem; line-height: 1; color: #666; cursor: pointer;
}
.bb-menu-btn:hover { background: var(--off-white); }
.bb-menu, .bb-share-menu {
  position: absolute; z-index: 50; min-width: 210px;
  background: #fff; border: 1px solid var(--gray-lt); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.15); overflow: hidden;
}
.bb-menu { top: 40px; right: 0; }
.bb-share-menu { bottom: calc(100% + 6px); right: 0; }
.bb-menu button, .bb-share-menu button, .bb-share-menu a {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 16px; border: none; border-bottom: 1px solid var(--gray-lt);
  background: #fff; text-align: left; cursor: pointer;
  font-family: var(--font-mono); font-size: .78rem; color: var(--dark);
}
.bb-menu > :last-child, .bb-share-menu > :last-child { border-bottom: none; }
.bb-menu button:hover, .bb-share-menu button:hover, .bb-share-menu a:hover { background: var(--off-white); }
.bb-menu .bb-danger { color: var(--red); }

/* titolo + didascalia */
.bb-post-title {
  padding: 0 16px; margin: 2px 0 6px;
  font-family: var(--font-display); font-weight: 400; font-size: 1.7rem;
  line-height: 1.08; letter-spacing: .01em; color: var(--blue);
}
.bb-post-title a:hover { color: var(--red); }
.bb-post-desc { padding: 0 16px 12px; }
.bb-desc-text {
  font-size: 1.05rem; line-height: 1.55; color: #3a3a3a;
  white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden;
}
.bb-post-desc.is-open .bb-desc-text { display: block; -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.bb-more {
  margin-top: 2px; padding: 0; border: none; background: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem; color: var(--blue);
}
.bb-more:hover { text-decoration: underline; }

/* foto */
.bb-post-media {
  position: relative; display: block; overflow: hidden;
  background: var(--off-white);
  border-top: 1px solid var(--gray-lt); border-bottom: 1px solid var(--gray-lt);
}
.bb-post-media img { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: contain; margin: 0 auto; }
.bb-post-media.is-broken { min-height: 120px; }
.bb-post-media.is-broken img { display: none; }
.bb-media-empty { height: 220px; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.bb-album-badge {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(0,0,0,.65); color: #fff; padding: 4px 10px; border-radius: 12px;
  font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
}

/* riga statistiche */
.bb-post-stats {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 16px; font-family: var(--font-mono); font-size: .75rem; color: #666;
}
.bb-stat-score { display: inline-flex; align-items: center; gap: 6px; }
.bb-score-badge {
  width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .65rem;
}
.bb-score { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1; color: var(--red); }
.bb-score-max, .bb-count, .bb-noscore { color: var(--gray); }
.bb-stat-right { display: inline-flex; gap: 12px; }
.bb-stat-right a:hover { color: var(--red); }

/* pulsanti azione */
.bb-post-actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  margin: 0 12px; padding: 4px 0; border-top: 1px solid var(--gray-lt);
}
.bb-post-actions.bb-cols-2 { grid-template-columns: repeat(2, 1fr); }
.bb-share-wrap { position: relative; display: flex; }
.bb-act {
  flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 6px; border: none; background: none; border-radius: 8px; cursor: pointer;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .04em; text-transform: uppercase;
  color: #555; white-space: nowrap; transition: background .15s, color .15s;
}
.bb-act:hover { background: var(--off-white); color: var(--blue); }
.bb-act.is-voted { color: var(--red); font-weight: 700; }

/* pannello voto 1–10 */
.bb-vote-panel { margin: 0 12px; padding: 12px 4px 16px; border-top: 1px dashed var(--gray-lt); }
.bb-vote-hint {
  margin-bottom: 8px; font-family: var(--font-mono); font-size: .68rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--gray);
}
.bb-vote-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.bb-vbtn {
  height: 38px; border: 1.5px solid var(--gray-lt); border-radius: 8px;
  background: var(--off-white); color: var(--dark); cursor: pointer;
  font-family: var(--font-mono); font-size: .82rem; transition: all .15s;
}
.bb-vbtn.is-on { background: var(--red-dk); border-color: var(--red-dk); color: #fff; }
@media (hover: hover) {
  .bb-vote-row:hover .bb-vbtn { background: var(--red); border-color: var(--red); color: #fff; }
  .bb-vote-row .bb-vbtn:hover ~ .bb-vbtn { background: var(--off-white); border-color: var(--gray-lt); color: var(--dark); }
}

/* ===================== COMMENTI NEL POST ===================== */
.bb-ccount {
  border: none; background: none; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: .75rem; color: #666;
}
.bb-ccount:hover { color: var(--red); text-decoration: underline; }
.bb-comments { margin: 0 12px; padding: 8px 4px 14px; border-top: 1px solid var(--gray-lt); }
.bb-cmore {
  display: block; margin: 2px 0 8px; padding: 0; border: none; background: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: .98rem; color: #555;
}
.bb-cmore:hover { text-decoration: underline; color: var(--blue); }
.bb-clist { display: flex; flex-direction: column; gap: 8px; }
.bb-c { display: flex; gap: 8px; align-items: flex-start; }
.bb-cav { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; }
.bb-cav-txt {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--red), var(--blue)); color: #fff;
  font-family: var(--font-display); font-size: 1rem;
}
.bb-cbody { min-width: 0; max-width: calc(100% - 40px); }
.bb-cbubble { display: inline-block; max-width: 100%; background: var(--off-white); border-radius: 16px; padding: 7px 12px 8px; }
.bb-cname { display: block; font-family: var(--font-body); font-weight: 600; font-size: .95rem; color: var(--dark); line-height: 1.25; }
.bb-cname:hover { color: var(--red); }
.bb-ctext { font-size: 1rem; line-height: 1.4; color: #333; white-space: pre-line; overflow-wrap: anywhere; }
.bb-cmeta { padding: 2px 12px 0; font-family: var(--font-mono); font-size: .66rem; color: var(--gray); }
.bb-cdel { border: none; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--gray); }
.bb-cdel:hover { color: var(--red); text-decoration: underline; }
.bb-cform { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.bb-cinput {
  flex: 1; display: flex; align-items: flex-end; gap: 4px;
  background: var(--off-white); border: 1.5px solid transparent; border-radius: 18px; padding: 4px 6px 4px 14px;
  transition: border-color .15s, background .15s;
}
.bb-cinput:focus-within { border-color: var(--blue); background: #fff; }
.bb-cinput textarea {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none; resize: none;
  font-family: var(--font-body); font-size: 1rem; line-height: 1.4; padding: 5px 0; max-height: 160px; color: var(--dark);
}
.bb-csend {
  width: 32px; height: 32px; flex-shrink: 0; border: none; border-radius: 50%; cursor: pointer;
  background: var(--red); color: #fff; font-size: .9rem; transition: opacity .15s, background .15s;
}
.bb-csend:hover { background: var(--red-dk); }
.bb-csend:disabled { opacity: .35; cursor: default; background: var(--gray); }
.bb-clogin { flex: 1; font-family: var(--font-mono); font-size: .78rem; color: var(--gray); padding: 6px 2px; }
.bb-clogin a { color: var(--blue); text-decoration: underline; }

/* stato del feed */
.bb-feed-status { text-align: center; padding-top: 20px; }
.bb-feed-loading, .bb-feed-end, .bb-feed-msg {
  padding: 14px; font-family: var(--font-mono); font-size: .8rem; color: var(--gray);
}
.bb-feed-empty {
  padding: 50px 20px; border: 1.5px dashed var(--gray-lt); border-radius: var(--radius-lg);
  font-family: var(--font-mono); font-size: .85rem; color: var(--gray);
}
.bb-feed-more {
  display: inline-block; padding: 12px 26px; border: 1.5px solid var(--blue); border-radius: var(--radius);
  background: transparent; color: var(--blue); cursor: pointer;
  font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  transition: all .2s;
}
.bb-feed-more:hover { background: var(--blue); color: #fff; }
.bb-link-btn { border: none; background: none; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; }

/* scheletro di caricamento */
.bb-skel { background: #fff; border: 1px solid var(--gray-lt); border-radius: var(--radius-lg); padding: 14px 16px 16px; }
.bb-skel-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.bb-skel-head span { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.bb-skel-head div { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.bb-skel-head i { display: block; height: 10px; width: 40%; border-radius: 5px; }
.bb-skel-head i + i { width: 25%; }
.bb-skel-img { height: 300px; border-radius: 8px; }
.bb-skel span, .bb-skel i, .bb-skel-img {
  background: linear-gradient(90deg, #eee 0%, #f7f7f7 50%, #eee 100%);
  background-size: 200% 100%; animation: bbShimmer 1.2s infinite linear;
}
@keyframes bbShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ===================== PAGINA GALLERIA (3 colonne) ===================== */
.bb-gal-wrap {
  max-width: 1280px; margin: 0 auto; padding: 32px 24px 80px;
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 32px; align-items: start;
}
.bb-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 18px; }
.bb-box { background: #fff; border: 1px solid var(--gray-lt); border-radius: var(--radius-lg); padding: 18px; }
.bb-side-title { font-family: var(--font-display); font-weight: 400; font-size: 2.1rem; line-height: 1; color: var(--blue); margin-bottom: 14px; }
.bb-search {
  width: 100%; padding: 10px 16px; border: 1.5px solid var(--gray-lt); border-radius: 30px;
  background: var(--off-white); font-size: .95rem; outline: none; transition: border-color .2s, background .2s;
}
.bb-search:focus { border-color: var(--blue); background: #fff; }
.bb-sort { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bb-sort button {
  padding: 5px 12px; border: 1.5px solid var(--gray-lt); border-radius: 20px;
  background: var(--off-white); color: var(--dark); cursor: pointer;
  font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em;
  transition: all .18s;
}
.bb-sort button:hover, .bb-sort button.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.bb-side-links { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.bb-side-links a {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 1.02rem; color: var(--dark);
}
.bb-side-links a:hover { background: var(--off-white); color: var(--blue); }
.bb-side-links .ico {
  width: 34px; height: 34px; border-radius: 50%; background: var(--off-white); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* colonna destra */
.bb-box-label {
  margin-bottom: 8px; font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--red);
}
.bb-top-item { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--gray-lt); }
.bb-top-item:last-child { border-bottom: none; }
.bb-top-pos { width: 24px; text-align: center; font-family: var(--font-display); font-size: 1.1rem; color: var(--blue); flex-shrink: 0; }
.bb-top-item img { width: 52px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--off-white); flex-shrink: 0; }
.bb-top-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bb-top-title { font-size: .92rem; font-weight: 600; line-height: 1.25; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-top-item:hover .bb-top-title { color: var(--red); }
.bb-top-user { font-family: var(--font-mono); font-size: .65rem; color: var(--gray); }
.bb-top-score { font-family: var(--font-display); font-size: 1.15rem; color: var(--red); flex-shrink: 0; }
.bb-top-empty { font-family: var(--font-mono); font-size: .75rem; color: var(--gray); }
.bb-cta-box { background: var(--blue); border-color: var(--blue); color: #fff; }
.bb-cta-box h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; line-height: 1; margin-bottom: 6px; }
.bb-cta-box p { font-size: .95rem; line-height: 1.45; color: rgba(255,255,255,.8); margin-bottom: 14px; }
.bb-cta-box .btn { width: 100%; justify-content: center; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
  .bb-gal-wrap { grid-template-columns: 240px minmax(0, 1fr); }
  .bb-side-right { display: none; }
}
@media (max-width: 900px) {
  .bb-gal-wrap { grid-template-columns: 1fr; padding: 20px 14px 60px; gap: 18px; }
  .bb-side-left { position: static; }
  .bb-side-links { flex-direction: row; flex-wrap: wrap; }
  .bb-side-links a { flex: 1 1 45%; }
}
@media (max-width: 600px) {
  .bb-post { border-radius: 10px; }
  .bb-post-title { font-size: 1.45rem; }
  .bb-act { font-size: .66rem; gap: 5px; padding: 10px 2px; }
  .bb-vbtn { height: 34px; font-size: .74rem; }
  .bb-vote-row { gap: 3px; }
}
