/* News & Updates — archive (home.php) + single (single.php) */

.news-page,
.news-single-page {
  --news-navy: #0f2c49;
  --news-cyan: var(--color-primary-600, #02a2e4);
  --news-surface: #f3f5f8;
  --news-card-bg: #ffffff;
  --news-text-muted: #64748b;
  --news-card-radius: 1.125rem;
  --news-card-shadow: 0 10px 32px rgba(15, 44, 73, 0.07);
  --news-card-shadow-hover: 0 18px 48px rgba(2, 162, 228, 0.16);
}

.news-content,
.news-single-content {
  background: var(--news-surface);
}

.news-content__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 3vw, 1.5rem) clamp(3rem, 5vw, 4.5rem);
}

.news-single-content__inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 3vw, 1.5rem) clamp(3rem, 5vw, 4.5rem);
}

/* Category chips */
.news-page__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.news-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.news-chip:hover,
.news-chip:focus {
  border-color: rgba(2, 162, 228, 0.45);
  color: var(--news-navy);
  box-shadow: var(--news-card-shadow-hover);
  transform: translateY(-1px);
}

.news-chip.is-active {
  background: var(--news-navy);
  border-color: var(--news-navy);
  color: #fff;
}

.news-chip.is-active:hover,
.news-chip.is-active:focus {
  background: var(--news-navy);
  border-color: var(--news-navy);
  color: #fff;
  transform: none;
}

.news-category-summary {
  margin: -0.5rem 0 1.75rem;
  text-align: center;
  color: var(--news-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.news-empty .news-card__cta {
  margin-top: 1rem;
}

/* Toolbar / filters */
.news-page__toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.news-page__toolbar select {
  min-width: 11rem;
  padding: 0.65rem 2.25rem 0.65rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E")
    no-repeat right 0.7rem center / 1rem;
  color: #334155;
  font-size: 0.875rem;
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-page__toolbar select:focus {
  outline: none;
  border-color: var(--news-cyan);
  box-shadow: 0 0 0 3px rgba(2, 162, 228, 0.14);
}

/* Featured post */
.news-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0;
  margin-bottom: 2.5rem;
  overflow: hidden;
  border-radius: var(--news-card-radius);
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: var(--news-card-bg);
  box-shadow: var(--news-card-shadow);
}

.news-featured__media {
  position: relative;
  min-height: 280px;
  background: #e2e8f0;
  overflow: hidden;
}

.news-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.news-featured:hover .news-featured__media img {
  transform: scale(1.03);
}

.news-featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.news-featured__badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(2, 162, 228, 0.12);
  color: #0369a1;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.news-featured__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
  color: var(--news-text-muted);
  font-size: 0.875rem;
}

.news-featured__title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--news-navy);
}

.news-featured__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-featured__title a:hover {
  color: var(--news-cyan);
}

.news-featured__excerpt {
  margin: 0 0 1.25rem;
  color: var(--news-text-muted);
  line-height: 1.65;
}

.news-featured__cta,
.news-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  background: var(--news-navy);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.news-featured__cta:hover,
.news-card__cta:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

/* Card grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.15rem, 2.2vw, 1.65rem);
}

.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--news-card-radius);
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: var(--news-card-bg);
  box-shadow: var(--news-card-shadow);
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: rgba(2, 162, 228, 0.35);
  box-shadow: var(--news-card-shadow-hover);
}

.news-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #e2e8f0;
  overflow: hidden;
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.news-card:hover .news-card__media img {
  transform: scale(1.04);
}

.news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.15rem 1.2rem 1.25rem;
}

.news-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
  color: var(--news-text-muted);
  font-size: 0.8125rem;
}

.news-card__title {
  margin: 0 0 0.65rem;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--news-navy);
}

.news-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.news-card__title a:hover {
  color: var(--news-cyan);
}

.news-card__excerpt {
  flex: 1;
  margin: 0 0 1rem;
  color: var(--news-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.news-card__footer {
  margin-top: auto;
}

.news-card__cta--outline {
  background: transparent;
  border: 1px solid var(--news-navy);
  color: var(--news-navy);
}

.news-card__cta--outline:hover {
  background: var(--news-navy);
  color: #fff;
}

/* Pagination */
.news-pagination {
  margin-top: 2.5rem;
}

.news-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  margin: 0 0.2rem;
  padding: 0 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.news-pagination .page-numbers.current {
  background: var(--news-navy);
  border-color: var(--news-navy);
  color: #fff;
}

.news-pagination .page-numbers:hover:not(.current):not(.dots) {
  border-color: rgba(2, 162, 228, 0.45);
  color: var(--news-navy);
}

.news-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: var(--news-card-radius);
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--news-text-muted);
}

/* Single article */
.news-single-page {
  letter-spacing: normal;
}

.news-single-page .news-single-prose,
.news-single-page .news-single-lead {
  letter-spacing: normal;
}

.news-single-article {
  margin: 0 auto;
}

.news-single-article__card {
  overflow: hidden;
  border-radius: var(--news-card-radius);
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: var(--news-card-shadow);
}

.news-single-header {
  padding: 1.25rem clamp(1.25rem, 3vw, 2rem) 0;
}

.news-single-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

.news-single-header__dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-left: auto;
}

.news-single-date,
.news-single-updated {
  color: var(--news-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.news-single-updated::before {
  content: "·";
  margin-right: 0.65rem;
  color: #cbd5e1;
}

.news-single-category {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(2, 162, 228, 0.12);
  color: #0369a1;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.news-single-category:hover {
  background: rgba(2, 162, 228, 0.2);
  color: var(--news-navy);
}

.news-single-media {
  margin: 1.25rem 0 0;
  overflow: hidden;
  background: #f1f5f9;
}

.news-single-media__image,
.news-single-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 26rem;
  object-fit: cover;
}

.news-single-read {
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2.5rem) clamp(2rem, 4vw, 2.75rem);
}

.news-single-lead {
  margin: 0 0 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e8edf2;
  color: #334155;
  font-size: clamp(1.0625rem, 1.8vw, 1.2rem);
  font-weight: 500;
  line-height: 1.7;
}

.news-single-prose {
  color: #475569;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.85;
}

.news-single-prose > *:first-child {
  margin-top: 0;
}

.news-single-prose > *:last-child {
  margin-bottom: 0;
}

.news-single-prose p,
.news-single-prose .wp-block-paragraph {
  margin: 0 0 1.35rem;
}

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

.news-single-lead + .news-single-prose > p:first-child {
  margin-top: 0;
}

.news-single-section-label {
  margin: 2rem 0 0.85rem;
  color: var(--news-navy);
  font-size: 1.125rem;
  font-weight: 700;
}

.news-single-section-list {
  margin: 0 0 1.35rem;
  padding-left: 1.4rem;
  list-style: disc;
}

.news-single-section-list li {
  margin-bottom: 0.5rem;
  padding-left: 0.2rem;
}

.news-single-section-list li::marker {
  color: var(--news-cyan);
}

/* When no excerpt lead, treat opening paragraph as the article intro */
.news-single-read:not(:has(.news-single-lead)) .news-single-prose > p:first-child {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e8edf2;
  color: #334155;
  font-size: clamp(1.0625rem, 1.8vw, 1.2rem);
  font-weight: 500;
  line-height: 1.7;
}

.news-single-prose h2,
.news-single-prose h3,
.news-single-prose h4,
.news-single-prose .wp-block-heading {
  color: var(--news-navy);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.news-single-prose h2,
.news-single-prose h2.wp-block-heading {
  margin: 2.25rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8edf2;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.news-single-prose h2:first-child,
.news-single-prose h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.news-single-prose h3,
.news-single-prose h3.wp-block-heading {
  margin: 1.75rem 0 0.75rem;
  font-size: clamp(1.125rem, 1.6vw, 1.25rem);
}

.news-single-prose h4 {
  margin: 1.35rem 0 0.55rem;
  font-size: 1.0625rem;
}

.news-single-prose ul,
.news-single-prose ol,
.news-single-prose .wp-block-list {
  margin: 0 0 1.35rem;
  padding-left: 1.4rem;
}

.news-single-prose li {
  margin-bottom: 0.5rem;
  padding-left: 0.2rem;
}

.news-single-prose li::marker {
  color: #94a3b8;
}

.news-single-prose a {
  color: #0369a1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.news-single-prose a:hover {
  color: var(--news-navy);
}

.news-single-prose strong,
.news-single-prose b {
  color: #1e293b;
  font-weight: 700;
}

.news-single-prose blockquote,
.news-single-prose .wp-block-quote {
  margin: 1.75rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--news-cyan);
  border-radius: 0 0.65rem 0.65rem 0;
  background: #f8fafc;
  color: #334155;
  font-size: 1.02rem;
  font-style: normal;
  line-height: 1.7;
}

.news-single-prose blockquote p:last-child {
  margin-bottom: 0;
}

.news-single-prose hr,
.news-single-prose .wp-block-separator {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid #e2e8f0;
}

.news-single-prose img,
.news-single-prose .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.5rem 0;
  border-radius: 0.75rem;
}

.news-single-prose figure {
  margin: 1.5rem 0;
}

.news-single-prose figcaption {
  margin-top: 0.5rem;
  color: var(--news-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.news-single-back {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.news-single-back__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--news-navy);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.news-single-back__link:hover {
  border-color: var(--news-cyan);
  color: #0369a1;
}

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

  .news-featured {
    grid-template-columns: 1fr;
  }
}

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

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

  .news-page__toolbar select {
    width: 100%;
  }
}
