/**
 * News listing (views/blocks/homepage-industry-insights-block.twig).
 *
 * Cards (.news-card) are also used on the XPT News page (featured-post.twig,
 * article-card.twig).
 *
 * Section background stays as set in the editor (beige group). The whole
 * card is clickable through the title link's ::after.
 * :not(#xpt-news) outranks the theme and Customizer rules for the old
 * .home-insights-block / .featured-post markup.
 *
 * Plain CSS outside the Sass build; loaded by AssetsServiceProvider.
 */

.news-listing:not(#xpt-news) {
  --news-ink: #16201d;
  --news-text: #3a4744;
  --news-muted: #5f6b67;
  --news-line: #d9dcd6;
  --news-green: #00ce7c;
  --news-green-text: #00744b;
  padding: clamp(40px, 5vw, 72px) 0; /* the beige group around it adds 24px */
}

.news-listing:not(#xpt-news) .xpt-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--global--container-horizontal-padding, 20px);
}

/* ---- Head: heading left, button right ---------------------------------- */

.news-listing:not(#xpt-news) .news-listing__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 48px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.news-listing:not(#xpt-news) .news-listing__title {
  margin: 0;
  font-family: "TradeGothicLT-BoldCondTwenty", "TradeGothicLT-Bold", "Arial Narrow", sans-serif;
  font-weight: normal;
  font-size: clamp(36px, 3.6vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
  text-align: left;
  color: var(--news-ink);
}

/* Short green rule above the heading, as on the hero and portfolio section. */
.news-listing:not(#xpt-news) .news-listing__title::before {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin-bottom: 20px;
  background: var(--news-green);
}

.news-listing:not(#xpt-news) .news-listing__intro {
  max-width: 64ch;
  margin: 16px 0 0;
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.6;
  text-align: left;
}

.news-listing:not(#xpt-news) .news-listing__cta { margin: 0 !important; }

/* ---- Cards ------------------------------------------------------------- */

.news-listing:not(#xpt-news) .news-listing__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-listing:not(#xpt-news) .news-listing__grid > li { margin: 0; }

.news-card:not(#xpt-news) {
  --news-ink: #16201d;
  --news-text: #3a4744;
  --news-muted: #5f6b67;
  --news-line: #d9dcd6;
  --news-green: #00ce7c;
  --news-green-text: #00744b;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 32px 32px 28px;
  border-top: 4px solid var(--news-ink);
  background: #fff;
  transition: border-color 0.25s ease;
}

.news-card:not(#xpt-news):hover,
.news-card:not(#xpt-news):focus-within { border-top-color: var(--news-green); }

/* Generated title card (NewsCard) across the top of the card, edge to edge. */
.news-card:not(#xpt-news) .news-card__image {
  display: block;
  width: calc(100% + 64px);
  max-width: none;
  height: auto;
  aspect-ratio: 1200 / 630;
  margin: -32px -32px 24px;
  object-fit: cover;
}

.news-card:not(#xpt-news) .news-card__date {
  margin-bottom: 14px;
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--news-muted);
}

.news-card:not(#xpt-news) .news-card__title {
  margin: 0 0 16px;
  max-width: none;
  font-family: "TradeGothicLT-BoldCondTwenty", "TradeGothicLT-Bold", "Arial Narrow", sans-serif;
  font-weight: normal;
  font-size: clamp(22px, 1.8vw, 27px);
  line-height: 1.18;
  letter-spacing: 0;
}

.news-card:not(#xpt-news) .news-card__title a {
  color: var(--news-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

/* Stretch the title link over the whole card. */
.news-card:not(#xpt-news) .news-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.news-card:not(#xpt-news):hover .news-card__title a { color: var(--news-green-text); }

.news-card:not(#xpt-news) .news-card__title a:focus-visible { outline: none; }
.news-card:not(#xpt-news) .news-card__title a:focus-visible::after {
  outline: 3px solid var(--news-green);
  outline-offset: 3px;
}

.news-card:not(#xpt-news) .news-card__excerpt {
  flex: 1;
  margin: 0 0 24px;
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--news-text);
}

.news-card:not(#xpt-news) .news-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--news-line);
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: var(--news-green-text);
}

.news-card:not(#xpt-news) .news-card__more svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.news-card:not(#xpt-news):hover .news-card__more svg { transform: translateX(4px); }

@media (max-width: 1023px) {
  .news-listing:not(#xpt-news) .news-listing__grid { grid-template-columns: 1fr; gap: 16px; }
  .news-card:not(#xpt-news) { padding: 24px 22px 22px; }
  .news-card:not(#xpt-news) .news-card__image { width: calc(100% + 44px); margin: -24px -22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .news-card:not(#xpt-news),
  .news-card:not(#xpt-news) .news-card__more svg,
  .news-card:not(#xpt-news) .news-card__title a { transition: none; }
}

/* Company filter on the XPT News page (posts.twig, App\Helpers\NewsCompany). */
.news-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
}

.news-filter .news-filter__item {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px 8px;
  border: 2px solid #16201d;
  border-radius: 2px;
  background: transparent;
  color: #16201d;
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.news-filter .news-filter__item:hover {
  border-color: #00ce7c;
  background: #00ce7c;
  color: #16201d;
}

.news-filter .news-filter__item[aria-current="page"] {
  border-color: #16201d;
  background: #16201d;
  color: #fff;
}

.news-filter .news-filter__item:focus-visible {
  outline: 3px solid #00ce7c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .news-filter .news-filter__item { transition: none; }
}

/* Under single news posts: the beige used by the homepage section, so the
   white cards stand out from the white article page. */
.news-listing.news-listing--single:not(#xpt-news) {
  background: var(--wp--preset--color--light-beige, #efeae6);
}

/* "About the company" boxes under news posts (single.twig). */
.post-companies {
  max-width: 1000px;
  margin: 0 auto clamp(48px, 6vw, 72px);
  padding: 0 var(--global--container-horizontal-padding, 20px);
}

.post-companies__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.post-companies__item {
  padding: 24px 26px;
  border-left: 4px solid #00ce7c;
  background: #f4f6f5;
}

.post-companies .post-companies__title {
  max-width: none;
  margin: 0 0 8px;
  font-family: "TradeGothicLT-BoldCondTwenty", "TradeGothicLT-Bold", "Arial Narrow", sans-serif;
  font-weight: normal;
  font-size: 22px;
  line-height: 1.15;
  color: #16201d;
}

.post-companies__item p { margin: 0 0 12px; font-size: 16px; line-height: 1.55; color: #3a4744; }

.post-companies .post-companies__link {
  font-family: "TradeGothicLT-Bold", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: #00744b;
}
