@layer components {
  .news-page {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1.5rem 4rem;
  }

  .news-page__heading {
    margin-bottom: 2rem;
  }

  .news-page__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .news-filter {
    padding: 0.4rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;

    &:hover {
      border-color: var(--primary-color, #ff2800);
    }

    [data-theme="dark"] & { border-color: #374151; }

    @media (prefers-color-scheme: dark) {
      :root:not([data-theme="light"]) & { border-color: #374151; }
    }
  }

  .news-filter--active {
    background: var(--primary-color, #ff2800);
    border-color: var(--primary-color, #ff2800);
    color: #fff;
  }

  .news-page__grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;

    @media (min-width: 640px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (min-width: 1024px) {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .news-card {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.15s ease;

    &:hover {
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    }

    [data-theme="dark"] & { border-color: #374151; }

    @media (prefers-color-scheme: dark) {
      :root:not([data-theme="light"]) & { border-color: #374151; }
    }
  }

  .news-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  .news-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .news-card__title {
    margin: 0;
  }

  .news-card__excerpt {
    margin: 0;
    color: #6b7280;
  }

  .news-card__link {
    color: var(--primary-color, #ff2800);
    font-weight: 600;
  }

  .news-article {
    padding: 0 0 4rem;
  }

  .news-article__container {
    max-width: 740px;
    margin: 3rem auto;
    padding: 0 1.5rem;
  }

  .news-article__back {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--primary-color, #ff2800);
    text-decoration: none;

    &:hover { opacity: 0.8; }
  }

  .news-article__title {
    margin-bottom: 0.5rem;
  }

  .news-article__date {
    margin-bottom: 1.5rem;
  }

  .news-article__image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 2rem;
  }

  .news-article__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    line-height: 1.7;

    & ul, & ol {
      padding-left: 1.5rem;
    }

    & blockquote {
      padding-left: 1rem;
      border-left: 3px solid #e5e7eb;
      color: #6b7280;
    }

    & a {
      color: var(--primary-color, #ff2800);
    }
  }

  .news-article__draft-banner {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.875rem;
    font-weight: 600;
  }
}
