/* Shared styles for the /noticias/ section */

.noticias-page,
.noticia-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem;
}

.noticias-page h1,
.noticia-page h1 {
  margin: 0 0 1.5rem;
  font-weight: 600;
  font-size: 1.8rem;
}

.noticias-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.noticia-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease-in-out;
}

.noticia-card:hover {
  transform: scale(1.01);
}

.noticia-card a {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
}

.noticia-card__image {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
  flex-shrink: 0;
}

.noticia-card__date {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.noticia-card__title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.noticia-card__summary {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Article detail page */

.noticia-page {
  background-color: var(--color-surface);
  border-radius: var(--radius);
}

.noticia-page__back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.noticia-page__date {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.noticia-page__image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.noticia-page__body {
  line-height: 1.7;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 1rem;
}

/* Everything spans the full width by default (its own row); paragraphs
   holding a single standalone image (Markdown wraps `![alt](src)` lines in
   their own <p>) opt back into the 2-column track instead, so the grid's
   auto-placement pairs them up two-per-row. A run of images of any length
   pairs correctly, and text before/after always starts on a fresh row. */
.noticia-page__body > * {
  grid-column: 1 / -1;
}

.noticia-page__body p:has(> img:only-child) {
  grid-column: auto;
}

.noticia-page__body p:has(> img.noticia-img--wide) {
  grid-column: 1 / -1;
  padding: 1rem 5rem;
}

@media (max-width: 480px) {
  .noticia-page__body {
    grid-template-columns: 1fr;
  }
}

.noticia-page__body h2 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.25rem;
}

.noticia-page__body p {
  margin: 0 0 1rem;
}

.noticia-page__body ul,
.noticia-page__body ol {
  list-style: disc;
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.noticia-page__body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.noticia-page__body iframe {
  margin: 1rem auto;
}

@media (max-width: 480px) {
  .noticia-page__body p:has(> img:only-child) {
    width: 100%;
    margin: 0 0 1rem;
  }
}
