/**
 * GNZDEV Portal Layout, Blog Feed, Threaded Comments & Tools Showcase
 */

.portal-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem 4rem;
}

/* Encabezado y Selector de Vistas / Pestañas Superiores */
.portal-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-nav-pills {
  display: flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.nav-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.nav-pill-btn:hover {
  color: var(--text-primary);
}

.nav-pill-btn.active {
  background: var(--btn-secondary-hover);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.portal-filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

/* Hero / Artículo Destacado */
.featured-hero-card {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 2rem;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.featured-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.85) 75%, #000000 100%);
}

.featured-hero-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  width: 100%;
}

.hero-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  color: #FFFFFF;
}

.featured-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 149, 0, 0.2);
  color: var(--apple-orange);
  border: 1px solid rgba(255, 149, 0, 0.4);
}

.featured-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
  max-width: 850px;
}

.featured-hero-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 800px;
  margin-bottom: 1rem;
}

.featured-hero-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Grilla de Artículos */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.post-card-thumb {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: #242426;
}

.post-card-category-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
}

.post-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.post-card-metrics {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  font-weight: 600;
}

.metric-approved {
  color: var(--apple-green);
}

.metric-disapproved {
  color: var(--apple-red);
}

.metric-comments {
  color: var(--apple-blue);
}

/* Vista Detallada de Artículo */
.article-reader-container {
  max-width: 860px;
  margin: 0 auto;
}

.article-back-nav {
  margin-bottom: 1.5rem;
}

.article-header-hero {
  margin-bottom: 2rem;
}

.article-main-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0.75rem 0 1rem;
}

.article-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.article-author-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.author-large-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.author-meta-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.author-meta-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-featured-image {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius-xl);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-lg);
}

/* Tipografía de Lectura Markdown */
.article-markdown-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-markdown-body .article-h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 2rem 0 1rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.article-markdown-body .article-h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 1.75rem 0 0.85rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.article-markdown-body .article-h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

.article-markdown-body .article-p {
  margin-bottom: 1.4rem;
}

.article-markdown-body .apple-quote {
  border-left: 3px solid var(--apple-blue);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(0, 122, 255, 0.06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.article-markdown-body .apple-code-block {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 1.75rem 0;
  color: var(--apple-cyan);
}

.article-markdown-body .apple-inline-code {
  background: var(--btn-secondary-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--apple-blue);
}
  color: var(--apple-pink);
}

.article-markdown-body .apple-divider {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 2.5rem 0;
}

.article-markdown-body .apple-ul {
  margin: 1rem 0 1.5rem 1.75rem;
}

.article-markdown-body .apple-li {
  margin-bottom: 0.5rem;
}

/* Barra de Votación (Aprobado / No Aprobado) */
.article-voting-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  margin: 2.5rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
}

.voting-bar-left h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.voting-bar-left p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.voting-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--btn-secondary-bg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vote-btn:hover {
  background: var(--btn-secondary-hover);
  color: var(--text-primary);
}

.vote-btn-approve.active {
  background: rgba(52, 199, 89, 0.2);
  border-color: var(--apple-green);
  color: var(--apple-green);
  box-shadow: 0 0 14px rgba(52, 199, 89, 0.3);
}

.vote-btn-disapprove.active {
  background: rgba(255, 59, 48, 0.2);
  border-color: var(--apple-red);
  color: var(--apple-red);
  box-shadow: 0 0 14px rgba(255, 59, 48, 0.3);
}

/* Sección de Comentarios Anidados */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.comment-input-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.comment-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  min-height: 85px;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.comment-input-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Lista de Árbol de Comentarios Anidados */
.comments-tree {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  position: relative;
  transition: border-color 0.15s ease;
}

.comment-item:hover {
  border-color: var(--border-medium);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.comment-author-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.comment-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.comment-code-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: rgba(0, 122, 255, 0.15);
  color: var(--apple-blue);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.comment-time {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.comment-content {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.comment-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.comment-action-btn:hover {
  color: var(--apple-blue);
  background: rgba(0, 122, 255, 0.1);
}

.comment-action-btn.btn-delete:hover {
  color: var(--apple-red);
  background: rgba(255, 59, 48, 0.1);
}

/* Respuestas Anidadas (Threading) */
.comment-replies-list {
  margin-top: 1rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reply-form-container {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

/* Vitrina de Herramientas de la Comunidad (5 Herramientas) */
.tools-showcase-view {
  max-width: 1040px;
  margin: 0 auto;
}

.tools-hero-banner {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
}

.tools-hero-banner h2 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.tools-hero-banner p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
}

.tools-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.tool-launch-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.tool-launch-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

/* Fin de Portal CSS */

/* Media Queries Responsivas del Portal & Feed */
@media (max-width: 768px) {
  .portal-scroll-container {
    padding: 1.25rem 1rem 3.5rem;
  }
  .portal-tabs-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .portal-nav-pills {
    width: 100%;
  }
  .nav-pill-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
  }
  .portal-filter-row {
    justify-content: flex-end;
  }
  .featured-hero-card {
    min-height: 240px;
    margin-bottom: 1.5rem;
  }
  .featured-hero-content {
    padding: 1.25rem;
  }
  .featured-hero-title {
    font-size: 1.25rem;
  }
  .posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
  }
  .tools-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
  }
  .article-reader-container {
    padding: 1.25rem 1rem 3.5rem;
  }
  .article-full-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .portal-scroll-container {
    padding: 0.85rem 0.65rem 3rem;
  }
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .tools-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .post-card-content {
    padding: 1rem;
  }
  .post-card-title {
    font-size: 1.05rem;
  }
  .comment-item {
    padding: 0.75rem;
  }
  .comment-children {
    padding-left: 0.75rem;
    margin-left: 0.35rem;
  }
}

