/* Feed publicaciones – portada estilo Facebook */
.home-section--publicaciones {
  padding: 32px 0 48px;
  background: var(--color-surface);
}

.pub-feed {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pub-feed__loading,
.pub-feed__empty {
  text-align: center;
  color: var(--color-text-medium);
  padding: 24px;
}

.pub-feed__card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-card, 12px);
  box-shadow: var(--shadow-card);
  overflow: visible;
}

.pub-feed__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 8px;
  position: relative;
}

.pub-feed__head-text {
  flex: 1;
  min-width: 0;
}

.pub-feed__avatar {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-border-light);
  background: #fff;
}

.pub-feed__avatar img {
  position: absolute;
  inset: 0;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  transform: none;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: #fff;
}

.pub-feed__author {
  font-weight: 700;
  color: var(--color-text-heading);
  text-decoration: none;
  font-size: 0.95rem;
}

.pub-feed__author-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.pub-feed__verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-brand-gold, #b9984b);
  color: #fff;
  font-size: 0.6rem;
  line-height: 1;
}

.pub-feed__author:hover {
  color: var(--color-brand-primary);
}

.pub-feed__time {
  display: block;
  font-size: 0.78rem;
  color: var(--color-text-medium);
}

.pub-feed__body {
  padding: 0 16px 12px;
}

.pub-feed__content-wrap {
  margin: 0 0 10px;
}

.pub-feed__content-wrap--clamp .pub-feed__content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.pub-feed__content {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: #050505;
  font-weight: 500;
  word-break: break-word;
}

.pub-feed__toggle-text {
  display: inline-block;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #050505;
  cursor: pointer;
}

.pub-feed__toggle-text:hover {
  text-decoration: underline;
}

.pub-feed__toggle-text[hidden] {
  display: none !important;
}

.pub-feed__media {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  max-height: 560px;
  background: var(--color-border-light, #e8e8e8);
}

.pub-feed__media img {
  width: 100%;
  max-width: 100%;
  height: auto !important;
  max-height: 560px;
  min-height: 1px;
  object-fit: contain;
  object-position: center center;
  display: block;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.pub-feed__media:hover img {
  transform: scale(1.01);
}

.pub-feed__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--color-text-medium);
  border-top: 1px solid var(--color-border-light);
}

/* Sin likes/comentarios/compartidos: oculta el bloque para no duplicar el borde de acciones */
.pub-feed__stats:empty {
  display: none;
  padding: 0;
  border: none;
}

.pub-feed__stat i {
  color: var(--color-brand-primary);
  margin-right: 4px;
}

.pub-feed__actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--color-border-light);
  background: #fff;
  margin-top: 0;
  padding: 0;
}

.pub-feed__action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-medium, #65676b);
  cursor: pointer;
  transition: background 0.15s;
}

.pub-feed__action i {
  color: var(--color-text-medium, #65676b);
  font-size: 0.95rem;
}

.pub-feed__action:hover {
  background: rgba(0, 0, 0, 0.04);
}

.pub-feed__action--liked,
.pub-feed__action--liked i {
  color: var(--color-brand-primary);
}

.pub-feed__comments {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border-light);
  background: #fafafa;
}

.pub-feed__comments-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.pub-feed__comment {
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.pub-feed__comment-time {
  font-size: 0.72rem;
  color: var(--color-text-medium);
  margin-left: 6px;
}

.pub-feed__comment p {
  margin: 4px 0 0;
}

.pub-feed__comments-empty {
  font-size: 0.85rem;
  color: var(--color-text-medium);
  margin: 0 0 10px;
}

.pub-feed__comments-login {
  font-size: 0.85rem;
  color: var(--color-text-medium);
  margin: 0;
}

.pub-feed__comments-login a {
  color: var(--color-brand-primary);
  font-weight: 600;
}

.pub-feed__comment-form {
  display: flex;
  gap: 8px;
}

.pub-feed__comment-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: 999px;
  font-size: 0.88rem;
}

.pub-feed__comment-submit {
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: var(--color-brand-gold);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .pub-feed__actions {
    grid-template-columns: 1fr;
  }

  .pub-feed__action {
    justify-content: flex-start;
    padding-left: 16px;
  }

  .pub-feed__comment-form {
    flex-direction: column;
  }

  .pub-feed__comment-submit {
    width: 100%;
  }
}

/* Ficha afiliado — misma presentación que portada (feed 680px centrado + Ver más) */
.afiliado-pub-home {
  width: 100%;
}

.afiliado-panel--publicaciones .pub-feed,
.afiliado-inicio-block--publicaciones .pub-feed {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.afiliado-panel--publicaciones .panel-pagination-wrap {
  max-width: 680px;
  margin: 16px auto 0;
}

.afiliado-inicio-block--publicaciones .pub-feed {
  max-width: none;
  margin: 0;
}

/* Texto del post alineado a la izquierda (como portada) */
.afiliado-panel--publicaciones .pub-feed__head-text,
.afiliado-panel--publicaciones .pub-feed__body,
.afiliado-panel--publicaciones .pub-feed__content-wrap,
.afiliado-panel--publicaciones .pub-feed__content,
.afiliado-panel--publicaciones .pub-feed__toggle-text,
.afiliado-panel--publicaciones .pub-feed__comments,
.afiliado-inicio-block--publicaciones .pub-feed__head-text,
.afiliado-inicio-block--publicaciones .pub-feed__body,
.afiliado-inicio-block--publicaciones .pub-feed__content-wrap,
.afiliado-inicio-block--publicaciones .pub-feed__content,
.afiliado-inicio-block--publicaciones .pub-feed__toggle-text {
  text-align: left;
}

.pub-report-modal {
  position: fixed;
  inset: 0;
  /* Por encima del visor fullscreen (10050) y del menú ··· fixed (10100) */
  z-index: 10200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pub-report-modal[hidden] {
  display: none !important;
}

.pub-report-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.pub-report-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: min(100%, 420px);
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.pub-report-modal__dialog h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.pub-report-modal__dialog form {
  max-width: 100%;
}

.pub-report-modal__dialog label {
  display: block;
  margin: 10px 0 4px;
  font-size: 0.9rem;
}

.pub-report-modal__dialog select,
.pub-report-modal__dialog textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.pub-report-modal__dialog textarea {
  resize: vertical;
  min-height: 72px;
}

.pub-report-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.pub-report-modal__cancel,
.pub-report-modal__submit {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
}

.pub-report-modal__cancel {
  background: #f3f4f6;
}

.pub-report-modal__submit {
  background: #dc2626;
  color: #fff;
}

.pub-feed__action--report {
  color: #6b7280;
}

.pub-feed__more {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-start;
}

.pub-feed__more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -6px -4px 0 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-medium, #65676b);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pub-feed__more-btn:hover,
.pub-feed__more-btn:focus-visible,
.pub-feed__more.is-open .pub-feed__more-btn {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-heading, #1c1e21);
  outline: none;
}

.pub-feed__more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 40;
  min-width: 220px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--color-border-light, #e4e6eb);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.pub-feed__more-menu[hidden] {
  display: none !important;
}

.pub-feed__more-menu--fixed {
  position: fixed !important;
  right: auto !important;
  margin: 0;
}

.pub-feed__more-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--color-text-heading, #1c1e21);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.pub-feed__more-item i {
  width: 1.1em;
  color: var(--color-text-medium, #65676b);
  text-align: center;
}

.pub-feed__more-item:hover,
.pub-feed__more-item:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  outline: none;
}

.pub-photo-viewer__head {
  position: relative;
}

.pub-photo-viewer__head .pub-feed__more {
  margin-left: auto;
  z-index: 5;
}

.pub-photo-viewer__head .pub-feed__more-menu:not(.pub-feed__more-menu--fixed) {
  z-index: 60;
}

/* Visor foto estilo Facebook: imagen a pantalla completa + panel lateral */
.pub-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(420px, 100%);
  background: rgba(0, 0, 0, 0.92);
}

.pub-photo-viewer[hidden] {
  display: none !important;
}

.pub-photo-viewer__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  background: #000;
}

.pub-photo-viewer__close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.pub-photo-viewer__close:hover,
.pub-photo-viewer__close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}

.pub-photo-viewer__image-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 24px;
  box-sizing: border-box;
}

.pub-photo-viewer__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
}

.pub-photo-viewer__sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100vh;
  background: #fff;
  color: var(--color-text-dark, #1c1e21);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow: visible;
}

.pub-photo-viewer__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.pub-photo-viewer__head .pub-feed__head-text {
  flex: 1;
  min-width: 0;
}

.pub-photo-viewer__head .pub-feed__avatar {
  width: 40px;
  height: 40px;
}

.pub-photo-viewer__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.pub-photo-viewer__scroll::-webkit-scrollbar {
  width: 8px;
}

.pub-photo-viewer__scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.pub-photo-viewer__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.pub-photo-viewer__body {
  padding: 0 16px 12px;
}

.pub-photo-viewer__body .pub-feed__content-wrap {
  margin: 0;
}

.pub-photo-viewer__body .pub-feed__content {
  font-size: 0.92rem;
  line-height: 1.4;
}

.pub-photo-viewer__actions {
  border-top: 1px solid var(--color-border-light, #e4e6eb);
  border-bottom: 1px solid var(--color-border-light, #e4e6eb);
}

.pub-photo-viewer__comments-list {
  padding: 12px 16px;
}

.pub-photo-viewer__composer {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border-light, #e4e6eb);
  background: #fff;
}

.pub-photo-viewer__composer .pub-feed__comments-login {
  margin: 0;
}

@media (max-width: 900px) {
  .pub-photo-viewer {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(42vh, 52vh) minmax(0, 1fr);
    overflow: hidden;
  }

  .pub-photo-viewer__sidebar {
    border-left: none;
    border-top: 1px solid var(--color-border-light, #e4e6eb);
    max-height: none;
  }

  .pub-photo-viewer__image-wrap {
    padding: 56px 12px 12px;
  }

  .pub-photo-viewer__actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .pub-photo-viewer__actions .pub-feed__action {
    justify-content: center;
    padding-left: 8px;
    font-size: 0.78rem;
  }
}

@media (max-width: 640px) {
  .pub-photo-viewer__actions .pub-feed__action {
    gap: 4px;
  }

  .pub-photo-viewer__composer .pub-feed__comment-form {
    flex-direction: row;
  }

  .pub-photo-viewer__composer .pub-feed__comment-submit {
    width: auto;
  }
}

/* Noticias en el feed de portada */
.pub-feed__card--noticia {
  border-left: 3px solid var(--color-primary, #0b6bcb);
}

.pub-feed__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
}

.pub-feed__cat-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-primary, #0b6bcb);
  background: rgba(11, 107, 203, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.pub-feed__noticia-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
}

.pub-feed__noticia-title a {
  color: inherit;
  text-decoration: none;
}

.pub-feed__noticia-title a:hover {
  text-decoration: underline;
}

.pub-feed__noticia-link {
  display: inline-block;
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary, #0b6bcb);
  text-decoration: none;
}

.pub-feed__noticia-link:hover {
  text-decoration: underline;
}

