/* =========================================================
   Poosting - COMUNIDADES
   Estrutura inspirada no Orkut clássico.
   ========================================================= */

.communities-page-shell {
  width: min(1180px, calc(100% - 20px));
  margin: 14px auto 28px;
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr) 220px;
  gap: 12px;
  align-items: start;
}

.communities-user-card {
  padding: 9px;
}

.communities-user-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  background: #edf3f8;
  border: 1px solid #becbd6;
}

.communities-user-name {
  display: block;
  margin: 8px 2px 5px;
  color: #3d6f91;
  font-weight: 700;
  text-decoration: none;
}

.communities-left-links {
  border-top: 1px solid #d4dee6;
  padding-top: 6px;
}

.communities-left-links a {
  display: block;
  padding: 3px 2px;
  color: #4a7896;
  font-size: 11px;
  text-decoration: none;
}

.communities-left-links a.selected {
  font-weight: 700;
}

.communities-box {
  margin-top: 10px;
  padding: 9px;
}

.communities-box h3 {
  margin: 0 0 8px;
  color: #4d5f6d;
  font-size: 12px;
}

.communities-mini-list {
  display: grid;
  gap: 6px;
}

.communities-mini-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #46718f;
  text-decoration: none;
  font-size: 11px;
}

.communities-mini-item img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border: 1px solid #c0cdd8;
}

.communities-mini-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communities-box-footer {
  display: block;
  margin-top: 8px;
  text-align: right;
  color: #4c7895;
  font-size: 10px;
  text-decoration: none;
}

.community-loading {
  color: #7c8992;
  font-size: 11px;
}

.communities-main {
  overflow: hidden;
  min-height: 640px;
  border-radius: 0 38px 0 0;
}

.communities-main-header,
.community-detail-header {
  padding: 15px 18px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid #c8d7e3;
}

.communities-main-header h1,
.community-detail-header h1 {
  margin: 0;
  color: #111;
  font-size: 30px;
  font-weight: 400;
}

.communities-main-header p,
.community-detail-header p {
  margin: 5px 0 0;
  color: #707d86;
  line-height: 1.45;
}

.community-search-area {
  padding: 12px 14px;
  background: #eaf4fc;
  border-bottom: 1px solid #c7d6e2;
}

.community-search-form {
  display: flex;
  gap: 6px;
}

.community-search-form input {
  min-width: 0;
  flex: 1;
  padding: 7px 8px;
  border: 1px solid #9fb5c7;
}

.community-section {
  border-bottom: 1px solid #c8d6e2;
}

.community-section-title {
  min-height: 38px;
  padding: 10px 14px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.community-section-title h2 {
  margin: 0;
  color: #3b4d59;
  font-size: 15px;
}

.community-section-title h2 span {
  color: #61819a;
  font-weight: 400;
}

.community-list {
  border-top: 1px solid #cbd8e3;
}

.community-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #cad8e4;
}

.community-row:nth-child(odd) {
  background: #eaf4fc;
}

.community-row:nth-child(even) {
  background: #dfedf8;
}

.community-row-photo {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: cover;
  border: 1px solid #afbfcc;
  background: #edf3f8;
}

.community-row-title {
  color: #366d90;
  font-weight: 700;
  text-decoration: none;
}

.community-row-description {
  margin: 3px 0 0;
  color: #586874;
  font-size: 11px;
  line-height: 1.35;
}

.community-row-category {
  margin-top: 4px;
  color: #7d8991;
  font-size: 10px;
}

.community-row-meta {
  text-align: center;
  color: #71808a;
  font-size: 10px;
}

.community-row-meta strong {
  display: block;
  color: #4d7088;
  font-size: 15px;
}

.community-empty {
  padding: 28px 14px;
  color: #74818a;
  text-align: center;
  font-size: 12px;
}

.community-empty.small {
  padding: 12px 6px;
}

.community-empty[hidden],
.community-section[hidden],
.community-modal-overlay[hidden] {
  display: none !important;
}

.community-categories {
  padding: 5px 14px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.community-categories button {
  min-height: 28px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid #d6e0e8;
  background: transparent;
  color: #477696;
  text-align: left;
  cursor: pointer;
}

.communities-right {
  min-width: 0;
}

.community-help p {
  margin: 0;
  color: #687782;
  font-size: 11px;
  line-height: 1.5;
}

.orkut-button {
  min-height: 29px;
  padding: 5px 10px;
  border: 1px solid #a8bac9;
  border-radius: 3px;
  background: linear-gradient(#fff, #e6eef4);
  color: #496d86;
  font: inherit;
  cursor: pointer;
}

.orkut-button.primary {
  border-color: #4f7ca3;
  background: linear-gradient(#79a7cb, #5383a9);
  color: #fff;
}

.orkut-button.danger {
  border-color: #c4a6a6;
  background: linear-gradient(#fff, #f3e5e5);
  color: #974747;
}

.orkut-button.full {
  width: 100%;
  margin-top: 7px;
}

.orkut-button:disabled {
  opacity: .6;
  cursor: wait;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #4d7894;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
}

.community-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  background: rgba(22, 31, 39, .56);
}

.community-modal {
  width: min(540px, 100%);
  margin-top: 40px;
  overflow: hidden;
  border: 1px solid #8fa8bb;
  border-radius: 5px;
  background: #fff;
}

.community-modal-header {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #dcebf6;
  border-bottom: 1px solid #aebfcd;
}

.community-modal-header h2 {
  margin: 0;
  color: #3e5f77;
  font-size: 16px;
}

.community-modal-close {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #546c7d;
  font-size: 24px;
  cursor: pointer;
}

.community-form {
  padding: 14px;
}

.community-form label {
  display: block;
  margin-bottom: 11px;
  color: #53636f;
  font-size: 12px;
}

.community-form input,
.community-form select,
.community-form textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #aabccc;
  background: #fff;
  font: inherit;
}

.community-form textarea {
  resize: vertical;
}

.community-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.community-form-message {
  min-height: 18px;
  margin: 4px 0 8px;
  color: #6c7881;
  font-size: 11px;
}

.community-form-message.error {
  color: #a13c3c;
}

.community-image-preview-wrap {
  margin-bottom: 10px;
}

.community-image-preview-wrap[hidden] {
  display: none !important;
}

.community-image-preview {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border: 1px solid #bccbd6;
}


/* COMUNIDADE INDIVIDUAL */

.community-detail-shell {
  width: min(1180px, calc(100% - 20px));
  margin: 14px auto 28px;
  display: grid;
  grid-template-columns: 175px minmax(0, 1fr) 225px;
  gap: 12px;
  align-items: start;
}

.community-photo-card {
  padding: 9px;
}

.community-large-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border: 1px solid #b4c4d1;
  background: #edf3f8;
}

.community-left-meta {
  display: grid;
  gap: 8px;
  color: #6b7882;
  font-size: 10px;
}

.community-left-meta span {
  display: block;
}

.community-left-meta strong,
.community-left-meta a {
  color: #426e8c;
  font-size: 11px;
  text-decoration: none;
}

.community-detail-main {
  min-height: 620px;
  overflow: hidden;
  border-radius: 0 38px 0 0;
}

.community-breadcrumb {
  margin-bottom: 6px;
  color: #7d8991;
  font-size: 10px;
}

.community-breadcrumb a {
  color: #467493;
  text-decoration: none;
}

.community-topics-list {
  border-top: 1px solid #ccd9e4;
}

.community-topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 95px;
  gap: 8px;
  padding: 9px 12px;
  align-items: center;
  border-bottom: 1px solid #cad8e4;
}

.community-topic-row:nth-child(odd) {
  background: #eaf4fc;
}

.community-topic-row:nth-child(even) {
  background: #dfeef9;
}

.community-topic-title {
  color: #356d91;
  font-weight: 700;
  text-decoration: none;
}

.community-topic-author,
.community-topic-replies {
  color: #71808a;
  text-align: center;
  font-size: 10px;
}

.community-members-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.community-member {
  min-width: 0;
  color: #47728e;
  text-align: center;
  text-decoration: none;
  font-size: 9px;
}

.community-member img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border: 1px solid #b8c8d4;
}

.community-member span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* TÓPICO */

.topic-page-shell {
  width: min(900px, calc(100% - 20px));
  margin: 14px auto 28px;
}

.topic-main-card {
  overflow: hidden;
  min-height: 540px;
  border-radius: 0 38px 0 0;
}

.topic-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid #cad8e3;
}

.topic-header h1 {
  margin: 5px 0 0;
  font-size: 26px;
  font-weight: 400;
}

.topic-post {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  border-bottom: 1px solid #cbd8e3;
}

.topic-post-author {
  padding: 10px 7px;
  text-align: center;
  background: #e6f1f9;
  border-right: 1px solid #cad8e3;
}

.topic-post-author img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid #afbfcc;
}

.topic-post-author a {
  display: block;
  margin-top: 4px;
  color: #3d7192;
  font-size: 10px;
  text-decoration: none;
}

.topic-post-body {
  padding: 10px 12px;
}

.topic-post-date {
  margin-bottom: 7px;
  color: #818d95;
  font-size: 10px;
}

.topic-post-message {
  margin: 0;
  color: #333b41;
  line-height: 1.5;
  white-space: pre-wrap;
}

.topic-replies-list {
  border-top: 1px solid #cbd8e3;
}

.topic-reply-section {
  padding: 14px;
  background: #edf6fc;
}

.topic-reply-section h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.topic-reply-section textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid #aebfcd;
  resize: vertical;
}

.topic-reply-actions {
  margin-top: 7px;
  text-align: right;
}


@media (max-width: 900px) {
  .communities-page-shell,
  .community-detail-shell {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .communities-right,
  .community-detail-right {
    grid-column: 1 / -1;
  }

  .communities-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 650px) {
  .communities-page-shell,
  .community-detail-shell {
    width: calc(100% - 12px);
    display: block;
  }

  .communities-left,
  .community-detail-left {
    margin-bottom: 10px;
  }

  .communities-user-card {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
  }

  .communities-user-name,
  .communities-left-links {
    grid-column: 2;
  }

  .communities-user-avatar {
    grid-row: 1 / 3;
  }

  .communities-main,
  .community-detail-main,
  .topic-main-card {
    border-radius: 7px;
  }

  .community-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .community-row-photo {
    width: 52px;
    height: 52px;
  }

  .community-row-meta {
    grid-column: 1 / -1;
    display: flex;
    gap: 4px;
    justify-content: flex-end;
  }

  .community-row-meta strong {
    display: inline;
    font-size: 11px;
  }

  .community-categories {
    grid-template-columns: 1fr;
  }

  .communities-right {
    display: block;
  }

  .community-topic-row {
    grid-template-columns: 1fr;
  }

  .community-topic-author,
  .community-topic-replies {
    text-align: left;
  }

  .topic-post {
    grid-template-columns: 68px minmax(0, 1fr);
  }
}


/* =========================================================
   MODERADORES DE COMUNIDADE
   ========================================================= */

.community-moderation-legend {
  margin-bottom: 8px;
  padding: 6px 7px;
  background: #fff8d8;
  border: 1px solid #e5d89b;
  color: #71632b;
  font-size: 10px;
  line-height: 1.35;
}

.community-moderation-legend[hidden] {
  display: none !important;
}

.community-member-wrap {
  min-width: 0;
}

.community-member-role {
  display: block;
  margin-top: 2px;
  color: #806b1d;
  font-size: 9px;
  font-weight: 700;
}

.community-member-role-button {
  width: 100%;
  margin-top: 4px;
  padding: 3px 4px;
  border: 1px solid #aebfcd;
  border-radius: 2px;
  background: linear-gradient(#fff, #e8f0f6);
  color: #4c718a;
  font-size: 9px;
  cursor: pointer;
}

.topic-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.topic-title-row h1 {
  min-width: 0;
}

.topic-post-actions {
  margin-top: 10px;
}

.topic-delete-reply {
  font-size: 10px;
}


/* =========================================================
   MOBILE - BLOQUEIO DE ZOOM
   ========================================================= */

html,
body {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

input,
textarea,
select,
button {
  font-size: 16px;
}

@media (min-width: 701px) {
  input,
  textarea,
  select,
  button {
    font-size: inherit;
  }
}


/* FOTO OBRIGATÓRIA NA CRIAÇÃO DA COMUNIDADE */
.community-photo-required-note {
  margin: -4px 0 11px;
  color: #7a6d83;
  font-size: 11px;
  line-height: 1.4;
}


/* ALTERAR FOTO DA COMUNIDADE */
.community-photo-change-status {
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid #c9d8e4;
  background: #eef6fc;
  color: #557188;
  font-size: 10px;
  line-height: 1.4;
}

.community-photo-change-status.error {
  border-color: #debcbc;
  background: #fff2f2;
  color: #9b4848;
}

.community-photo-change-status[hidden] {
  display: none !important;
}


/* REMOÇÃO PERMANENTE DE MEMBRO */
.community-member-remove-button {
  width: 100%;
  margin-top: 4px;
  padding: 3px 4px;
  border: 1px solid #d0aaaa;
  border-radius: 2px;
  background: linear-gradient(#fff, #f7e8e8);
  color: #9a4444;
  font-size: 9px;
  cursor: pointer;
}

.community-member-remove-button:hover {
  background: #f8dddd;
}


/* COMUNIDADE PRIVADA / PEDIDOS DE ENTRADA */
.community-privacy-owner-box {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #d7e2ec;
  background: #f7fbfe;
}

.community-privacy-owner-box label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #496679;
}

.community-privacy-owner-box select {
  width: 100%;
  min-height: 34px;
  margin-bottom: 6px;
  box-sizing: border-box;
}

.community-join-requests-list {
  display: grid;
  gap: 8px;
}

.community-join-request {
  padding: 7px 0;
  border-bottom: 1px solid #e2eaf0;
}

.community-join-request-user {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #356b8b;
  text-decoration: none;
  font-size: 11px;
}

.community-join-request-user img {
  width: 38px;
  height: 38px;
  border-radius: 3px;
  object-fit: cover;
}

.community-join-request-actions {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.community-join-request-actions .orkut-button {
  font-size: 10px;
}

/* Tópicos recentes e tópicos em destaque */
.community-topic-discovery-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.community-topic-discovery-head .community-activity-title {
  min-width: 0;
  flex: 1;
}

.community-topic-reply-count {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid #cad9e5;
  border-radius: 10px;
  background: #eef6fc;
  color: #58768d;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .community-topic-discovery-head {
    display: block;
  }

  .community-topic-reply-count {
    display: inline-block;
    margin-top: 5px;
  }
}
