/* ============================================================
   Cooper News — content layer (child of Cooper Base)
   Article typography, cards, grids, lead story, filter, pagination,
   related, and category header. Tokens come from design-system.css.
   ============================================================ */

/* ---------------------------------------------------------------
   Shared: card + card title + grids
   --------------------------------------------------------------- */
.cardtitle {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy-800);
  line-height: 1.32;
  text-decoration: none;
}

.cn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
  margin-top: 8px;
}

.cn-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-out);
}

.cn-card:hover {
  box-shadow: var(--shadow-md);
}

.cn-card__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--navy-300), var(--navy-500));
  overflow: hidden;
}

.cn-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cn-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 20px 22px;
}

.cn-eyebrow {
  display: inline-block;
  text-decoration: none;
}

.cn-card__title {
  font-size: var(--fs-18);
  margin: 9px 0 8px;
}

.cn-card__title:hover {
  color: var(--cooper-red);
}

.cn-card__excerpt {
  font-size: var(--fs-14);
  line-height: 1.55;
  color: var(--neutral-600);
  margin-bottom: 16px;
}

.cn-card__meta,
.cn-meta {
  font-size: 13px;
  color: var(--neutral-500);
}

.cn-card__meta {
  margin-top: auto;
}

.cn-dot {
  opacity: 0.5;
}

/* ---------------------------------------------------------------
   Archive / blog index
   --------------------------------------------------------------- */
.cn-archive {
  padding-top: 8px;
}

.cn-archive__head {
  padding: 24px 0 4px;
}

.cn-archive__head .cb-page-title {
  padding: 4px 0 0;
}

/* Featured lead story */
.cn-lead {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: center;
  margin: 28px 0 8px;
}

.cn-lead__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-400), var(--navy-500));
}

.cn-lead__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cn-lead__title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--navy-800);
  margin: 12px 0 14px;
}

.cn-lead__title a {
  color: inherit;
  text-decoration: none;
}

.cn-lead__title a:hover {
  color: var(--cooper-red);
}

.cn-lead__excerpt {
  font-size: 17px;
  line-height: 1.6;
  color: var(--neutral-600);
  margin-bottom: 18px;
}

.cn-meta-row {
  margin-bottom: 20px;
}

.cn-readmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cooper-red);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}

.cn-arrow {
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Category filter pills */
.cn-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px 0;
  margin-top: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.cn-pill {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--navy-800);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

.cn-pill:hover {
  border-color: var(--navy-400);
}

.cn-pill.is-active {
  background: var(--navy-500);
  border-color: var(--navy-500);
  color: #fff;
  font-weight: 600;
}

/* Archive count / sort row */
.cn-archive__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0;
  font-size: var(--fs-14);
  color: var(--neutral-500);
}

/* ---------------------------------------------------------------
   Pagination
   --------------------------------------------------------------- */
.cn-pagination {
  margin: 40px 0 8px;
}

.cn-pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cn-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  font-size: var(--fs-14);
  color: var(--navy-800);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.cn-pagination .page-numbers.current {
  background: var(--navy-500);
  border-color: var(--navy-500);
  color: #fff;
  font-weight: 600;
}

.cn-pagination .page-numbers.dots {
  border: none;
  background: none;
  color: var(--neutral-400);
}

.cn-pagination .page-numbers.prev,
.cn-pagination .page-numbers.next {
  border: none;
  background: none;
  color: var(--cooper-red);
  font-weight: 700;
}

/* ---------------------------------------------------------------
   Single article
   --------------------------------------------------------------- */
.cn-article-head {
  padding: 52px 48px 0;
}

.cn-breadcrumb {
  font-size: 13px;
  color: var(--neutral-500);
  margin-bottom: 18px;
}

.cn-breadcrumb a {
  color: var(--neutral-500);
  text-decoration: none;
}

.cn-breadcrumb a:hover {
  color: var(--cooper-red);
}

.cn-crumb-sep {
  margin: 0 6px;
}

.cn-article-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--navy-800);
  margin: 12px 0 20px;
}

.cn-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.cn-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--navy-100);
  color: var(--navy-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-16);
}

.cn-byline__text {
  font-size: var(--fs-14);
  color: var(--neutral-600);
}

.cn-byline__text strong {
  color: var(--navy-800);
}

.cn-featured {
  margin: 32px 0 0;
  padding: 0 48px;
}

.cn-featured img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.cn-featured figcaption {
  font-size: 13px;
  color: var(--neutral-500);
  margin-top: 10px;
}

/* Article body typography (also styles block content inside .article-body) */
.cn-article-body {
  padding: 40px 48px 8px;
}

.article-body p {
  font-size: var(--fs-18);
  line-height: 1.75;
  color: var(--navy-800);
  margin: 0 0 22px;
}

.article-body > p:first-of-type {
  font-size: var(--fs-20);
  line-height: 1.65;
  color: var(--neutral-600);
}

.article-body h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--fs-30);
  letter-spacing: -0.02em;
  color: var(--navy-800);
  margin: 40px 0 14px;
}

.article-body h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: var(--fs-20);
  color: var(--navy-800);
  margin: 30px 0 10px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}

.article-body li {
  font-size: var(--fs-18);
  line-height: 1.7;
  color: var(--navy-800);
  margin-bottom: 10px;
}

.article-body blockquote {
  margin: 30px 0;
  padding: 6px 0 6px 26px;
  border-left: 4px solid var(--cooper-red);
}

.article-body blockquote p {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--fs-24);
  line-height: 1.45;
  color: var(--navy-800);
  margin: 0;
}

/* Images render as blocks so any trailing caption text sits below, not wrapping
   into the empty space beside a sub-container-width image. */
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  border-radius: var(--radius-md);
}

/* Proper WordPress / Gutenberg captions: small, muted, below the image. */
.article-body figure {
  margin: 24px 0;
}

.article-body figcaption,
.article-body .wp-caption-text {
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--neutral-500);
  margin-top: 8px;
}

.article-body .wp-caption {
  max-width: 100%;
}

/* Legacy pattern (Inside Cooper etc.): a full-size image immediately followed by
   its caption text inside one paragraph. Put the caption below the image and at a
   smaller, muted caption size. (:has() — graceful no-op in older browsers.) */
.article-body p:has(> img) > img {
  margin-bottom: 8px;
}

.article-body p:has(> img.size-full) {
  font-size: var(--fs-14);
  line-height: 1.5;
  color: var(--neutral-500);
}

.article-body a {
  color: var(--cooper-red);
}

/* ---------------------------------------------------------------
   Related row
   --------------------------------------------------------------- */
.cn-related {
  background: var(--cooper-lavender);
  margin-top: 48px;
  padding: 48px 0;
}

.cn-related__title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--fs-30);
  letter-spacing: -0.02em;
  color: var(--navy-800);
  margin: 10px 0 26px;
}

/* ---------------------------------------------------------------
   Category / archive header
   --------------------------------------------------------------- */
.cn-cat-head {
  background: var(--cooper-lavender);
  padding: 56px 0;
  margin-bottom: 8px;
}

.cn-cat-desc {
  max-width: 640px;
  font-size: var(--fs-18);
  line-height: 1.6;
  color: var(--neutral-600);
  margin-top: 12px;
}

.cn-empty {
  padding: 40px 0;
  color: var(--neutral-600);
}

/* ---------------------------------------------------------------
   Footer promo band (cn-promo widget area, above the footer)
   --------------------------------------------------------------- */
.cn-promo {
  background: var(--cooper-lavender);
  padding: 44px 0;
}

.cn-promo__inner,
.cn-promo__widget,
.cn-promo .textwidget {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: center;
}

.cn-promo a {
  display: block;
  transition: transform var(--dur-base) var(--ease-out);
}

.cn-promo a:hover {
  transform: translateY(-2px);
}

.cn-promo img {
  display: block;
  width: 280px;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

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

@media (max-width: 781px) {
  .cn-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cn-lead {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cn-article-head,
  .cn-article-body {
    padding-left: 22px;
    padding-right: 22px;
  }

  .cn-featured {
    padding-left: 22px;
    padding-right: 22px;
  }

  /* Give wrapped post titles more breathing room on small screens. */
  .cardtitle {
    line-height: 1.35;
  }

  .cn-lead__title {
    line-height: 1.2;
  }
}
