/* ============================================================
   BERANDA KECIL — 12 MARKET SURFACES V1
   Community topic carousel + Tools 12-market reference layout
   ============================================================ */

/* Community: compact vertical carousel keeps sidebar height controlled. */
.community-topic-card {
  overflow:hidden;
}

.community-topic-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:9px;
}

.community-topic-head h3 {
  margin:0;
}

.community-topic-controls {
  display:flex;
  gap:5px;
}

.community-topic-controls button {
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid var(--border);
  border-radius:9px;
  background:var(--panel-2);
  color:var(--text);
  font:inherit;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
}

.community-topic-controls button:hover:not(:disabled) {
  border-color:rgba(192,168,136,.52);
  background:rgba(192,168,136,.08);
}

.community-topic-controls button:disabled {
  opacity:.3;
  cursor:default;
}

.community-topic-carousel {
  height:238px;
  overflow-y:auto;
  overflow-x:hidden;
  scroll-behavior:smooth;
  scroll-snap-type:y proximity;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:var(--border) transparent;
}

.community-topic-carousel::-webkit-scrollbar {
  width:5px;
}

.community-topic-carousel::-webkit-scrollbar-track {
  background:transparent;
}

.community-topic-carousel::-webkit-scrollbar-thumb {
  border-radius:999px;
  background:var(--border);
}

.community-topic-track {
  display:grid;
}

.community-topic-item {
  min-height:47px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 3px;
  border-bottom:1px solid rgba(255,255,255,.055);
  color:var(--text);
  scroll-snap-align:start;
}

.community-topic-item:last-child {
  border-bottom:0;
}

.community-topic-item:hover,
.community-topic-item.active {
  color:var(--accent);
}

.community-topic-item > span:last-child {
  color:var(--accent);
}

.community-topic-position {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:8px;
  color:var(--muted);
  font-size:9px;
}

.community-topic-position small {
  color:var(--muted);
  font-size:8px;
}

/* Tools: 12 reference cards remain readable without becoming oversized. */
.latest-reference-card {
  overflow:hidden;
}

.latest-results-grid {
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:stretch;
}

.latest-result-item {
  height:100%;
  display:flex;
  flex-direction:column;
}

.latest-result-foot {
  margin-top:auto;
}

@media(max-width:1100px) {
  .latest-results-grid {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:820px) {
  .latest-results-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:620px) {
  .community-topic-carousel {
    height:225px;
  }

  .latest-results-grid {
    grid-template-columns:1fr;
  }
}


/* ============================================================
   POLISHING — MOBILE REFERENCE PAGINATION / 3 CARDS PER PAGE
   ============================================================ */

.latest-reference-pagination {
  display:none;
}

@media(max-width:620px) {
  .latest-reference-pagination:not([hidden]) {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    align-items:center;
    gap:8px;
    margin-top:13px;
    padding-top:12px;
    border-top:1px solid var(--border);
  }

  .latest-reference-page-btn {
    min-height:44px;
    padding:9px 10px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--panel-2);
    color:var(--text);
    font:inherit;
    font-size:12px;
    font-weight:800;
    cursor:pointer;
  }

  .latest-reference-page-btn:hover:not(:disabled) {
    border-color:rgba(192,168,136,.52);
    background:rgba(192,168,136,.08);
  }

  .latest-reference-page-btn:disabled {
    opacity:.38;
    cursor:default;
  }

  .latest-reference-page-status {
    min-width:50px;
    padding:7px 8px;
    border:1px solid var(--border);
    border-radius:999px;
    background:rgba(255,255,255,.025);
    color:var(--muted);
    font-size:11px;
    font-weight:900;
    text-align:center;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
  }

  .latest-result-item[hidden] {
    display:none !important;
  }
}

@media(max-width:380px) {
  .latest-reference-pagination:not([hidden]) {
    grid-template-columns:1fr auto 1fr;
    gap:6px;
  }

  .latest-reference-page-btn {
    padding-inline:7px;
    font-size:10px;
  }

  .latest-reference-page-status {
    min-width:44px;
    padding-inline:6px;
    font-size:10px;
  }
}
