/*
 * News Plugin
 * The colour variables can be overridden by the active theme if needed.
 */
:root {
  --news-accent: var(--site-accent, #9d2842);
  --news-accent-dark: var(--site-accent-dark, #741d31);
  --news-ink: var(--site-text, #242424);
  --news-muted: #5f6469;
  --news-border: #d9dde1;
  --news-surface: #ffffff;
  --news-surface-soft: #f5f6f7;
  --news-focus: #1f6fb2;
  --news-radius: 6px;
  --news-shadow: 0 10px 28px rgba(20, 30, 40, 0.09);
}

.news-archive,
.news-grid,
.news-filter,
.news-empty,
.news-status-badges {
  box-sizing: border-box;
}

.news-archive *,
.news-grid *,
.news-filter *,
.news-empty *,
.news-status-badges * {
  box-sizing: border-box;
}

.news-archive__content {
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.news-archive__header {
    margin: 0 0 clamp(1.5rem, 3vw, 1.25rem);
    text-align: left;
    align-items: normal;
}

.news-archive__featured-image {
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
}

.news-archive__featured-image-element {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: min(56vw, 34rem);
  margin: 0;
  object-fit: cover;
}

.news-screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.news-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto;
  gap: 1rem;
  align-items: end;
  margin: 0 0 1.5rem;
  padding: clamp(1rem, 2.5vw, 1.4rem);
  border: 1px solid var(--news-border);
  border-left: 5px solid var(--news-accent);
  border-radius: var(--news-radius);
  background: var(--news-surface-soft);
}

.news-filter__field label {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--news-ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.news-filter input[type="search"],
.news-filter select {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid #858d95;
  border-radius: 3px;
  background-color: var(--news-surface);
  color: var(--news-ink);
  font: inherit;
  line-height: 1.2;
}

.news-filter input[type="search"]::placeholder {
  color: #70757a;
  opacity: 1;
}

.news-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  min-height: 46px;
}

.news-button {
  display: inline-flex;
  min-height: 46px;
  padding: 0.65rem 1.05rem;
  border: 2px solid var(--news-accent);
  border-radius: 3px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--news-accent);
  color: #fff !important;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.news-button:hover {
  border-color: var(--news-accent-dark);
  background: var(--news-accent-dark);
  color: #fff !important;
  transform: translateY(-1px);
}

.news-filter__clear {
  color: var(--news-accent);
  font-weight: 700;
  text-underline-offset: 0.18em;
}

.news-results-summary {
  margin: 0 0 0.75rem;
  color: var(--news-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.6rem);
  margin: 0;
}

.news-grid--shortcode {
  margin: 1.25rem 0;
}

.news-card {
  position: relative;
  display: flex;
  min-width: 0;
  height: 100%;
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  flex-direction: column;
  overflow: hidden;
  background: var(--news-surface);
  box-shadow: 0 2px 8px rgba(20, 30, 40, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.news-card:hover,
.news-card:focus-within {
  border-color: color-mix(in srgb, var(--news-accent) 55%, var(--news-border));
  box-shadow: var(--news-shadow);
  transform: translateY(-3px);
}

.news-card__image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e9ecef;
}

.news-card__thumbnail {
  display: block;
  width: 100%;
  height: 100% !important;
  margin: 0;
  object-fit: cover;
  transition: transform 300ms ease;
}

.news-card:hover .news-card__thumbnail,
.news-card:focus-within .news-card__thumbnail {
  transform: scale(1.025);
}

.news-card__content {
  display: flex;
  min-width: 0;
  height: 100%;
  padding: clamp(1rem, 2vw, 1.3rem);
  flex-direction: column;
}

.news-card--no-image .news-card__content {
  border-top: 5px solid var(--news-accent);
}

.news-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.7rem;
}

.news-status-badges--single {
  margin-bottom: 1rem;
}

.news-single__date {
  margin: 0 0 0.75rem;
  color: var(--news-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.news-status-badge {
  display: inline-flex;
  min-height: 26px;
  padding: 0.3rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
}

.news-status-badge--sticky {
  border-color: #aeb7c0;
  background: #eef1f4;
  color: #31383f;
}

.news-status-badge--important {
  border-color: var(--news-accent-dark);
  background: var(--news-accent);
  color: #fff;
}

.news-card__date {
  display: block;
  margin: 0 0 0.55rem;
  color: var(--news-accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.4;
  text-transform: uppercase;
}

.news-card__title {
  margin: 0 0 0.65rem;
  color: var(--news-ink);
  font-size: clamp(1.08rem, 1.7vw, 1.3rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.news-card:hover .news-card__title,
.news-card:focus-within .news-card__title {
  color: var(--news-accent);
}

.news-card__excerpt {
  margin: 0 0 1rem;
  color: var(--news-muted);
  font-size: 0.96rem;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.news-card__content-image {
  margin: 0 0 1rem;
}

.news-card__content-image img {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: 28rem;
  margin: 0;
  object-fit: contain;
}

.news-card__more {
  display: inline-flex;
  width: fit-content;
  min-height: 46px;
  margin-top: auto;
  padding: 0.65rem 1.05rem;
  border: 2px solid var(--news-accent);
  border-radius: 3px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--news-accent);
  color: #fff !important;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

/* The visible Read more control is the card's one real link. Its pseudo-element
   expands the hit area across the card without adding duplicate links. */
.news-card__more::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: var(--news-radius);
  cursor: pointer;
}

.news-card__more:focus-visible::after {
  outline: 3px solid var(--news-focus);
  outline-offset: -3px;
}

.news-card__more span {
  line-height: 1;
  transition: transform 160ms ease;
}

.news-card:hover .news-card__more,
.news-card:focus-within .news-card__more {
  border-color: var(--news-accent-dark);
  background: var(--news-accent-dark);
  color: #fff !important;
  text-decoration: none !important;
}

.news-card:hover .news-card__more span,
.news-card:focus-within .news-card__more span {
  transform: translateX(3px);
}

.news-all-link {
  margin: 1.5rem 0 0;
  text-align: center;
}

/* Prevent accidental navigation while using the live block-editor preview. */
.editor-styles-wrapper .news-plugin-latest-news-editor-preview a {
  pointer-events: none;
}

.news-empty {
  margin: 1.5rem 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--news-border);
  border-radius: var(--news-radius);
  background: var(--news-surface-soft);
  text-align: center;
}

.news-empty h2 {
  margin-top: 0;
}

.news-empty p:last-child {
  margin-bottom: 0;
}

.news-archive .navigation.pagination {
  margin: clamp(2rem, 5vw, 3.5rem) 0 0;
}

.news-archive .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
}

.news-archive .page-numbers {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--news-border);
  border-radius: 3px;
  align-items: center;
  justify-content: center;
  background: var(--news-surface);
  color: var(--news-ink);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.news-archive .page-numbers.current,
.news-archive a.page-numbers:hover {
  border-color: var(--news-accent);
  background: var(--news-accent);
  color: #fff;
}

.news-archive .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

.news-filter input:focus,
.news-filter select:focus,
.news-button:focus-visible,
.news-filter__clear:focus-visible,
.news-archive .page-numbers:focus-visible {
  outline: 3px solid var(--news-focus);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-filter {
    grid-template-columns: minmax(200px, 1fr) minmax(150px, 210px);
  }

  .news-filter__actions {
    grid-column: 1 / -1;
  }
}

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

  .news-filter__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .news-filter__actions .news-button,
  .news-filter__clear {
    width: 100%;
    text-align: center;
  }

  .news-filter__clear {
    padding: 0.4rem;
  }

  .news-card:hover,
  .news-card:focus-within {
    transform: none;
  }

  .news-archive .page-numbers.prev,
  .news-archive .page-numbers.next {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-button,
  .news-card,
  .news-card__thumbnail,
  .news-card__more span {
    transition: none;
  }
}

.news-card--fallback-image .news-card__image {
  background: #eef2f5;
}

.news-card__thumbnail--fallback {
  object-fit: cover;
}

