/* NOTÍCIAS — cartões de notícia compartilhados por Jornal Diário e Edições. */

.story {
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.story.featured {
  grid-column: span 2;
}

#featured-news .spotlight-card,
.news-grid .story {
  padding: 2rem;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(17, 17, 17, 0.07);
}

#featured-news .spotlight-card h2,
.news-grid .story h2 {
  color: var(--primary);
}

#featured-news .spotlight-card > p:not(.context) {
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.7;
}

#featured-news .spotlight-card .story-footer {
  margin-top: 0.5rem;
}

.story h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.history-item {
  width: 100%;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.history-item:hover {
  background: var(--bg-body);
}

.history-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

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

@media (max-width: 992px) {
  .story.featured {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .story {
    padding: 1.15rem;
  }

  .story h2 {
    font-size: 1.2rem;
  }
}

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

  .story h2 {
    font-size: 1.1rem;
  }
}

.data-loading-grid {
  grid-column: 1 / -1;
  min-height: 320px;
}

.data-loading-history {
  min-height: 160px;
}

.data-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: data-loading-spin 0.8s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .data-loading-spinner {
    animation: none;
  }
}

@media (min-width: 901px) {
  /* Cartões sem imagem: o texto ocupa a largura toda em vez de deixar vazio */

  .story.featured.has-no-image {
    grid-template-columns: minmax(0, 1fr);
  }
}

.story-image {
  display: block;
  width: 100%;
  max-height: 320px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.75rem;
  margin: 0 0 1rem;
}

.story-image + .story-meta {
  margin-top: 0;
}

@media (min-width: 901px) {
  .story.featured {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    column-gap: clamp(1rem, 3vw, 2rem);
    align-content: start;
    align-items: start;
  }

  .story.featured .story-image {
    grid-column: 2;
    grid-row: 1 / 6;
    align-self: center;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 360px;
    aspect-ratio: auto;
    object-fit: contain;
    margin: 0;
  }

  .story.featured .story-meta,
  .story.featured h2,
  .story.featured p,
  .story.featured .story-footer {
    grid-column: 1;
  }

  .story.featured .story-footer {
    align-self: end;
  }
}

@media (max-width: 900px) {
  .story.featured .story-image {
    align-self: stretch;
    width: 100%;
    max-height: 320px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 0 0 1rem;
  }
}

@media (max-width: 600px) {
  .story-image {
    max-height: 220px;
    border-radius: 0.5rem;
  }
}
