/* EDIÇÕES — arquivo de edições, filtros e histórico. */

/* EDITIONS */

.editions {
  padding: 3rem 3rem 4rem;
}

.editions-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.editions-heading .eyebrow {
  margin-bottom: 0.6rem;
}

.editions-heading h2 {
  font-size: 1.5rem;
  margin: 0;
}

.editions-heading > p {
  max-width: 360px;
  margin: 0 0 0.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: right;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-container);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--bg-body);
  border-color: var(--primary);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 2rem;
}

#featured-news .spotlight-card .category,
.news-grid .story .category {
  padding: 0.35rem 0.55rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
}

#news-grid .story.featured h2 {
  max-width: 30ch;
  margin-bottom: 0.85rem;
  font-size: 1.8rem;
  line-height: 1.2;
}

#featured-news .spotlight-card .context,
.news-grid .story .context {
  margin-top: 0.25rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 4px 4px 0;
  background: color-mix(in srgb, var(--bg-body) 55%, var(--card-bg));
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.dot {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  background: #aaa;
  border-radius: 50%;
}

.story p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.story .context {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.story-footer {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
}

.source {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.source-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.source-link:hover {
  text-decoration: underline;
}

.history-toggle {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 100;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg-body);
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.history-toggle:hover {
  background: var(--primary-hover);
}

.history-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 99;
  width: 350px;
  max-height: 80vh;
  background: var(--bg-container);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  box-shadow: -4px -4px 20px rgba(0, 0, 0, 0.1);
  visibility: hidden;
  transform: translateY(100%);
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
  overflow: hidden;
}

.history-panel.open {
  visibility: visible;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.history-header h3 {
  font-family: "Playfair Display", serif;
  font-size: 1.2rem;
}

.close-history {
  display: grid;
  width: var(--kn-modal-close-size);
  height: var(--kn-modal-close-size);
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.history-list {
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

@media (max-width: 992px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .editions {
    padding: 2rem 1.25rem 2.5rem;
  }

  .editions-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
  }

  .editions-heading > p {
    text-align: left;
  }

  .filter-buttons {
    margin-bottom: 1.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .filter-btn {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .news-grid {
    gap: 1rem;
  }

  .story p {
    font-size: 0.92rem;
  }

  .story-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .history-toggle {
    right: 1rem;
    bottom: 1rem;
    width: 46px;
    height: 46px;
  }

  .history-panel {
    left: var(--kn-modal-gap);
    right: var(--kn-modal-gap);
    width: auto;
    max-width: none;
    border-radius: 16px 16px 0 0;
  }

  .history-list {
    max-height: 65vh;
  }
}

@media (max-width: 480px) {
  .editions {
    padding: 1.75rem 1rem 2rem;
  }

  .editions-heading > p {
    font-size: 0.85rem;
  }

  .filter-buttons {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .filter-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
  }

  .news-grid .story {
    padding: 1.25rem;
  }

  #news-grid .story.featured h2 {
    font-size: 1.35rem;
  }

  .story p {
    font-size: 0.9rem;
  }

  .source,
  .source-link {
    font-size: 0.72rem;
  }
}

@media (max-width: 360px) {
  .filter-btn {
    padding: 0.45rem 0.7rem;
  }
}

.header-main-nav-editions {
  gap: 0.85rem;
}

.header-main-nav-editions .nav-search {
  flex: 0 1 220px;
}

.header-main-nav-editions .nav-search input {
  width: 100%;
}

@media (max-width: 992px) {
  /* Em Edições a busca ocupa o espaço livre entre a marca e o menu. */

  .site-header:has(> .header-main-nav-editions) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .header-main-nav-editions .nav-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 420px;
  }
}

@media (max-width: 680px) {
  .header-main-nav-editions .nav-search input {
    padding-left: 2.25rem;
    font-size: 1rem;
  }

  .header-main-nav-editions .nav-search i {
    left: 0.85rem;
  }
}

/* Alvos de toque confortáveis em links utilitários */

.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding-block: 0.25rem;
}

/* Títulos principais das páginas Sobre e Edições */

.editions-heading h1 {
  font-family: "Playfair Display", Georgia, serif;
}

.editions-heading h1 {
  font-size: 1.5rem;
  margin: 0;
}
