/* ==========================================================================
   Insights listing (/insights and /insights/<category>)
   Scoped under .sc-news so it never collides with the corespin theme.
   Rendered inside the theme's #main (full width, fixed header above it).

   The .sc-news__* class names are inherited from the old /news page, whose
   stylesheet this file absorbed. The detail page (/insights/<cat>/<slug>)
   also loads this file, for the "Not released" badge.
   ========================================================================== */

.sc-news {
  --sc-blue: #002f6c;
  --sc-blue-dark: #08254a;
  --sc-cyan: #24a9e0;
  --sc-orange: #f4762d;
  --sc-text: #222;
  --sc-muted: #707070;
  --sc-border: #d9dee5;
  --sc-soft: #f5f7fa;
  --sc-max: 1200px;

  font-family: Arial, Helvetica, sans-serif;
  color: var(--sc-text);
  line-height: 1.45;
}

.sc-news *,
.sc-news *::before,
.sc-news *::after {
  box-sizing: border-box;
}

.sc-news a {
  color: inherit;
  text-decoration: none;
}

.sc-news__shell {
  width: min(var(--sc-max), calc(100% - 48px));
  margin: 0 auto;
}

/* ---- Hero band (full-bleed) --------------------------------------------- */
.sc-news__hero {
  background:
    linear-gradient(100deg, rgba(0, 47, 108, .92), rgba(8, 37, 74, .84)),
    radial-gradient(circle at 85% 20%, rgba(36, 169, 224, .45), transparent 34%);
  color: #fff;
  padding: 48px 0 42px;
}

.sc-news__eyebrow {
  color: var(--sc-orange);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .09em;
  margin: 0 0 8px;
}

.sc-news__title {
  font-size: clamp(34px, 4vw, 58px);
  line-height: .98;
  margin: 0;
  letter-spacing: -.04em;
  color: #fff;
}

.sc-news__title-accent {
  color: var(--sc-orange);
}

.sc-news__intro {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, .86);
  font-size: 18px;
}

/* "← All Insights" under a category heading. */
.sc-news__hero .sc-news__intro a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
}

.sc-news__hero .sc-news__intro a:hover {
  border-bottom-color: #fff;
}

/* Editable intro under the hero title (one Concrete area per category). It
   sits on the dark hero, so block content is re-coloured to read on navy. */
.sc-news__cms-intro {
  max-width: 760px;
  color: rgba(255, 255, 255, .86);
  font-size: 18px;
}

/* Spacing lives on the content, so an unused area adds no gap to the hero. */
.sc-news__cms-intro > :first-child {
  margin-top: 18px;
}

.sc-news__cms-intro h2,
.sc-news__cms-intro h3,
.sc-news__cms-intro h4,
.sc-news__cms-intro p,
.sc-news__cms-intro li {
  color: inherit;
}

.sc-news__cms-intro p:last-child {
  margin-bottom: 0;
}

/* Same specificity as `.sc-news a` above, so it must stay after it. */
.sc-news__cms-intro a {
  color: #fff;
  text-decoration: underline;
}

/* ---- Body / toolbar ----------------------------------------------------- */
.sc-news__body {
  padding: 42px 0 70px;
}

.sc-news__toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 310px) 1fr minmax(230px, 280px);
  align-items: center;
  gap: 22px;
  margin-bottom: 34px;
}

/* The row of category links sits in the toolbar's first grid column. */
.sc-news__cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.sc-news__cat {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sc-blue);
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.sc-news__cat:hover,
.sc-news__cat:focus-visible {
  border-color: var(--sc-cyan);
  background: var(--sc-soft);
  color: var(--sc-blue-dark);
  text-decoration: none;
}

.sc-news__cat:focus-visible {
  outline: 2px solid var(--sc-cyan);
  outline-offset: 2px;
}

/* The category currently being viewed. aria-current carries the same meaning
   for assistive tech; the class is what paints it. */
.sc-news__cat.is-active {
  border-color: var(--sc-blue);
  background: var(--sc-blue);
  color: #fff;
}

.sc-news__cat.is-active:hover,
.sc-news__cat.is-active:focus-visible {
  border-color: var(--sc-blue-dark);
  background: var(--sc-blue-dark);
  color: #fff;
}

.sc-news__search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sc-news__search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a95a3;
  pointer-events: none;
}

.sc-news input[type="search"] {
  width: 100%;
  height: 44px;
  border: 1px solid #bfc7d1;
  background: #fff;
  border-radius: 0;
  padding: 0 14px 0 42px;
  color: #344252;
  font-size: 16px;
  outline: none;
}

.sc-news input[type="search"]:focus {
  border-color: var(--sc-blue);
  box-shadow: 0 0 0 3px rgba(36, 169, 224, .16);
}

.sc-news__result-summary {
  color: var(--sc-muted);
  font-size: 14px;
  text-align: center;
}

.sc-news__editor-preview {
  margin: -12px 0 26px;
  padding: 12px 16px;
  border-left: 4px solid var(--sc-orange);
  background: #fff7e7;
  color: #5c4313;
  font-size: 14px;
  font-weight: 700;
}

.sc-news__editor-preview code {
  background: rgba(0, 0, 0, .06);
  padding: 1px 5px;
}

/* ---- Results / cards ---------------------------------------------------- */
/* The fade is applied to the stage CONTENT (not the stage itself) so the
   loading overlay stays fully visible while the cards fade out. */
.sc-news__results-stage {
  position: relative;
}

.sc-news__results-stage > .sc-news__grid,
.sc-news__results-stage > .sc-news__empty {
  transition: opacity .28s ease;
}

.sc-news__results-stage.is-fading > .sc-news__grid,
.sc-news__results-stage.is-fading > .sc-news__empty {
  opacity: 0;
}

/* ---- Loading (feed AJAX: search, pagination) ---------------------------- */
.sc-news__results-stage.is-loading {
  min-height: 220px;
}

.sc-news__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 64px;
  background: rgba(255, 255, 255, .72);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
  pointer-events: none;
  z-index: 2;
}

.sc-news__results-stage.is-loading > .sc-news__loader {
  opacity: 1;
  visibility: visible;
}

.sc-news__spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(0, 47, 108, .18);
  border-top-color: var(--sc-orange);
  border-radius: 50%;
  animation: sc-news-spin .7s linear infinite;
}

@keyframes sc-news-spin {
  to { transform: rotate(360deg); }
}

.sc-news__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 46px 30px;
}

.sc-news__card {
  min-width: 0;
  position: relative;
}

.sc-news__card[hidden] {
  display: none;
}

.sc-news__card-link {
  display: block;
}

.sc-news__thumb {
  width: 100%;
  aspect-ratio: 1.52 / 1;
  overflow: hidden;
  background: #dfe6ee;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-news__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);
  transition: transform .28s ease, filter .28s ease;
}

.sc-news__card:hover .sc-news__thumb img {
  transform: scale(1.035);
  filter: saturate(1.08) contrast(1.04);
}

.sc-news__thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  color: rgba(8, 37, 74, .35);
  background:
    linear-gradient(135deg, rgba(0, 47, 108, .10), rgba(36, 169, 224, .18));
}

.sc-news__card-title {
  font-size: 20px;
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 0 3px;
  color: #2b2f34;
  font-weight: 800;
}

.sc-news__card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sc-news__card-type {
  margin: 0;
  color: var(--sc-orange);
  font-size: 14px;
  font-weight: 800;
  /* text-transform: uppercase; */
  letter-spacing: .09em;
}

.sc-news__card-sub {
  margin: 4px 0 0;
  color: var(--sc-muted);
  font-size: 13px;
}

/* ---- Status badges (editor preview / signed-in viewers) ----------------- */
.sc-news__status-badge {
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
  color: #fff;
  background: #6c7682;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .04em;
}

.sc-news__status-draft { background: #7c5aa6; }
.sc-news__status-pending { background: #bb7419; }
.sc-news__status-scheduled { background: #0d7490; }
.sc-news__status-expired { background: #747474; }

/* "Not released" badge.

   Shown only to a signed-in viewer, on a post whose publish_release is still
   in the future. The public never sees these posts at all — the listing query
   filters them out and the article answers 404 — so the badge exists to
   explain why a signed-in editor can see something the site cannot.

   Amber rather than the grey of the status badges: this is a state that will
   resolve by itself on the release date, not a problem to fix. */
.sc-news__status-badge.sc-news__status-unreleased,
.sc-post__status-badge.sc-post__status-unreleased {
  background: #b25e06;
  color: #fff;
}

/* The detail page renders its badge inline with the By/Published/Read Time
   run, where the surrounding text is larger. */
.sc-post__status-badge.sc-post__status-unreleased {
  font-size: 11px;
  line-height: 1;
  padding: 5px 7px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .04em;
}

.sc-news__empty {
  display: none;
  padding: 60px 24px;
  text-align: center;
  background: var(--sc-soft);
  color: var(--sc-muted);
  border: 1px dashed var(--sc-border);
}

.sc-news__empty.is-visible {
  display: block;
}

/* ---- Pagination --------------------------------------------------------- */
.sc-news__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  font-size: 14px;
  font-weight: 700;
}

.sc-news__pagination[hidden] {
  display: none;
}

/* No page hopping while a feed request is in flight. */
.sc-news__pagination.is-loading {
  opacity: .45;
  pointer-events: none;
}

.sc-news__page-btn {
  background: none;
  border: 0;
  padding: 4px 8px;
  color: #30343a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sc-news__page-btn:hover:not(:disabled) {
  color: var(--sc-orange);
}

.sc-news__page-btn.is-active {
  color: var(--sc-orange);
}

.sc-news__page-btn:disabled {
  color: #b6bec7;
  cursor: default;
}

.sc-news__page-ellipsis {
  color: #30343a;
}

/* ---- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sc-news__cat,
  .sc-news__results-stage > .sc-news__grid,
  .sc-news__results-stage > .sc-news__empty,
  .sc-news__loader,
  .sc-news__thumb img {
    transition: none !important;
  }

  .sc-news__results-stage.is-fading > .sc-news__grid,
  .sc-news__results-stage.is-fading > .sc-news__empty {
    opacity: 1;
  }

  .sc-news__spinner {
    animation-duration: 1.4s;
  }
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 960px) {
  .sc-news__toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .sc-news__result-summary {
    grid-column: 1 / -1;
    order: 3;
    text-align: left;
  }

  .sc-news__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The category links wrap freely, so on narrow screens let them use the full
   row rather than being squeezed into the first column. */
@media (max-width: 900px) {
  .sc-news__cats {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .sc-news__shell {
    width: min(100% - 32px, var(--sc-max));
  }

  .sc-news__toolbar {
    grid-template-columns: 1fr;
  }

  .sc-news__grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .sc-news__hero {
    padding: 36px 0 32px;
  }

  .sc-news__body {
    padding-top: 30px;
  }
}
