/* ============================================================
   News — home.php (archive) + single.php
   Enqueued conditionally via inc/enqueue.php
   ============================================================ */

/* ── Archive section rhythm ── */
.news-archive {
  padding-block: var(--space-xl);
}

.news-archive-header {
  margin-bottom: var(--space-lg);
}

.news-archive-header__title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  position: relative;
  display: inline-block;
}

.news-archive-header__title::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
  margin-top: 0.4em;
}

/* ============================================================
   News card grid — 3 columns desktop, 1 mobile
   ============================================================ */
.news-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* ── Card ── */
.news-card {
  display: flex;
  flex-direction: column;
}

.news-card__image {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

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

.news-card:hover .news-card__image img {
  transform: scale(1.05);
}

.news-card__body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card__date {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--green);
  margin-bottom: var(--space-xs);
}

.news-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: var(--space-sm);
}

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

.news-card__title a:hover {
  text-decoration: underline;
}

.news-card__excerpt {
  font-size: 0.875rem;
  color: var(--text);
  opacity: 0.78;
  line-height: 1.6;
  flex: 1;
  margin-bottom: var(--space-md);
}

.news-card__excerpt p {
  margin-bottom: 0;
}

.news-card__read-more {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  margin-top: auto;
}

.news-card__read-more:hover {
  text-decoration: underline;
}

.news-empty {
  text-align: center;
  color: var(--text);
  opacity: 0.6;
  padding: var(--space-xl) 0;
}

/* ============================================================
   Pagination
   ============================================================ */
.news-pagination {
  display: flex;
  justify-content: center;
  margin-top: var(--space-xl);
}

.pagination-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
}

.pagination-list .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding-inline: 0.5em;
  border: 1px solid rgba(0, 32, 91, 0.18);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.pagination-list .page-numbers:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  text-decoration: none;
}

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

.pagination-list .page-numbers.dots {
  border: none;
  background: none;
  color: var(--text);
  opacity: 0.5;
  cursor: default;
}

.pagination-list .pagination-first,
.pagination-list .pagination-last {
  font-size: 0.95rem;
}

/* ============================================================
   Single post — two-column layout
   ============================================================ */
.single-news-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-xl);
  align-items: start;
  padding-block: var(--space-xl);
}

.single-news-main__title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: var(--space-sm);
}

.single-news-main__date {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--green);
  margin-bottom: var(--space-lg);
}

.single-news-main__image {
  margin-bottom: var(--space-lg);
  border-radius: var(--card-radius);
  overflow: hidden;
}

.single-news-main__image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Post body content ── */
.news-content {
  line-height: 1.78;
  font-size: 1rem;
}

.news-content h2,
.news-content h3,
.news-content h4 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.news-content p {
  margin-bottom: var(--space-md);
}

.news-content ul,
.news-content ol {
  list-style: revert;
  padding-left: 1.5em;
  margin-bottom: var(--space-md);
}

.news-content ul li,
.news-content ol li {
  margin-bottom: var(--space-xs);
}

.news-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--card-radius);
  margin-block: var(--space-md);
}

.news-content a {
  color: var(--green);
  text-decoration: underline;
}

/* Responsive YouTube / oEmbed (Classic Editor wraps in .embed-youtube) */
.news-content .embed-youtube,
.news-content .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  margin-block: var(--space-md);
  border-radius: var(--card-radius);
}

.news-content .embed-youtube iframe,
.news-content .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Block editor wp-block-embed */
.news-content .wp-block-embed {
  margin-block: var(--space-md);
}

.news-content .wp-block-embed figure {
  margin: 0;
}

/* ── Sidebar ── */
.single-news-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
}

/* ARCHIVES sidebar box reuses .sidebar-box from global; just extend it */
.single-news-sidebar .sidebar-box {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: var(--space-lg);
}

.single-news-sidebar .sidebar-box__title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--navy);
}

/* ── Year accordion ── */
.archive-years-list {
  list-style: none;
}

.archive-year-item {
  border-bottom: 1px solid rgba(0, 32, 91, 0.07);
}

.archive-year-item:last-child {
  border-bottom: none;
}

.archive-year-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  background: none;
  border: none;
  padding: 0.55em 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  text-align: left;
}

.archive-year-toggle:hover {
  color: var(--navy);
  opacity: 0.8;
}

.archive-year-toggle__count {
  font-weight: 400;
  opacity: 0.55;
  font-size: 0.8rem;
  margin-left: auto;
  margin-right: var(--space-xs);
}

/* Chevron icon via CSS */
.archive-year-toggle__icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.archive-year-toggle[aria-expanded="true"] .archive-year-toggle__icon {
  transform: rotate(-135deg);
}

/* Collapsed list */
.archive-year-posts {
  list-style: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.archive-year-posts.is-open {
  max-height: 2000px; /* generous cap */
}

@media (prefers-reduced-motion: reduce) {
  .archive-year-toggle__icon {
    transition: none;
  }

  .archive-year-posts {
    transition: none;
  }
}

.archive-year-posts li {
  display: flex;
  flex-direction: column;
  padding: 0.4em 0 0.4em 0.75em;
  border-bottom: 1px solid rgba(0, 32, 91, 0.05);
}

.archive-year-posts li:last-child {
  border-bottom: none;
}

.archive-year-posts a {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.35;
  transition: color 0.15s;
}

.archive-year-posts a:hover {
  color: var(--navy);
  text-decoration: none;
}

.archive-post-date {
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.5;
  margin-top: 0.1em;
}

/* ── Share/Print block spacing for single post ── */
.single-news-main .share-print-block {
  margin-top: var(--space-xl);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .news-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .single-news-layout {
    grid-template-columns: 1fr 260px;
  }
}

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

  .single-news-sidebar {
    position: static;
  }
}

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