/* Homepage Insights (section #home-insights, components/card-blog.php). Articles come from content/blog. */
#home-insights {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: var(--sectionPadding);
  background-color: #f7f7f7;
}
#home-insights .cs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 80rem;
  margin: auto;
  gap: clamp(2.5rem, 5vw, 3.5rem);
}
#home-insights .cs-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}
#home-insights .cs-title {
  max-width: 100%;
  text-wrap: balance;
}
#home-insights .cs-text {
  max-width: 37.5rem;
  text-wrap: balance;
}
@media only screen and (min-width: 40rem) {
  #home-insights .cs-text {
    text-wrap: pretty; /* fills the 600px measure instead of splitting into two narrow lines */
  }
}

/* ------------------------------------------------------------------ cards: a swipe row below 64rem, then three across */
.in-carousel {
  width: 100%;
}
.in-list {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.in-card {
  display: flex;
  box-sizing: border-box;
  min-width: 0;
  margin: 0;
}
.in-article {
  position: relative; /* the headline link stretches over this */
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid #e4e8ee;
  border-radius: 1rem;
  background-color: #fff;
  transition: border-color 0.25s;
}
.in-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #001f3f;
}
.in-media img,
.in-ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Temporary placeholder: plain navy with a single cyan rule. */
.in-ph {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #001f3f 0%, #062f55 100%);
}
.in-ph::before {
  content: "";
  width: 2.5rem;
  height: 2px;
  background-color: var(--secondary);
}
.in-ph span {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b9cde0;
}
.in-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.5rem 1.5rem 1.25rem;
}
.in-pillar {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0a6aa8;
}
.in-title {
  margin: 0 0 0.875rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--headerColor);
  text-wrap: pretty;
}
.in-link {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  text-decoration: none;
}
.in-link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.in-summary {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--bodyTextColor);
}
/* Pinned to the foot with a fixed minimum height, so the rules line up across cards. */
.in-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  box-sizing: border-box;
  min-height: 4.5rem;
  margin-top: auto;
  padding-top: 1.125rem;
  border-top: 1px solid #e4e8ee;
}
.in-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}
.in-portrait {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}
.in-name,
.in-role {
  display: block;
  line-height: 1.4;
}
.in-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--headerColor);
}
.in-role {
  font-size: 0.8125rem;
  color: var(--bodyTextColor);
}
.in-read {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 0 auto;
  font-size: 0.8125rem;
  color: var(--bodyTextColor);
}
.in-read span {
  font-size: inherit;
}
.in-arrow {
  color: #0a74b5;
  transition: transform 0.25s;
}
.in-article:has(.in-link:hover) {
  border-color: var(--secondary);
}
.in-article:has(.in-link:hover) .in-arrow {
  transform: translateX(4px);
}
.in-article:has(.in-link:focus-visible) {
  border-color: #0a74b5;
  outline: 3px solid #0a74b5;
  outline-offset: -3px;
}
.in-link:focus-visible {
  outline: none;
}
.in-link:focus-visible::after {
  border-radius: 1rem;
}
/* Narrow cards: author above, reading time below, in a taller foot so the rules still line up. */
.in-article {
  container-type: inline-size;
}
@container (max-width: 22.5rem) {
  .in-foot {
    flex-direction: column;
    align-items: stretch;
    min-height: 6.125rem;
  }
  .in-read {
    justify-content: space-between;
    margin: auto 0 0;
  }
}
.in-all {
  margin: 0;
}
.in-dots {
  display: none;
}
@media only screen and (min-width: 64rem) {
  .in-list {
    gap: 1.5rem;
  }
  .in-card {
    flex: 0 0 calc((100% - 3rem) / 3); /* with one or two articles the cards keep this width and sit in the centre */
  }
}
@media only screen and (min-width: 80rem) {
  .in-body {
    padding: 1.75rem 1.75rem 1.5rem;
  }
  .in-title {
    font-size: 1.5rem;
  }
}

/* ------------------------------------------------------------------ phones and tablets: a native swipe row with position dots */
@media only screen and (max-width: 63.999rem) {
  .in-carousel {
    width: calc(100% + 2rem);
    margin: 0 -1rem; /* the row runs to the screen edges; the section's side padding is 1rem */
  }
  .in-list {
    position: relative;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 1rem;
    scrollbar-width: none;
  }
  .in-list::-webkit-scrollbar {
    display: none;
  }
  .in-list:focus-visible {
    outline: 2px solid #0a74b5;
    outline-offset: -2px;
  }
  .in-card {
    scroll-snap-align: start;
  }
  .in-title {
    font-size: 1.25rem;
  }
  .in-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.75rem;
  }
  .in-dots[hidden],
  .in-dot[hidden] {
    display: none;
  }
  .in-dot {
    display: grid;
    place-items: center;
    min-width: 1.5rem;
    margin: 0;
    border: 0;
    background: none;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
  }
  .in-dot span {
    display: block;
    border-radius: 99px;
    background-color: rgba(0, 31, 63, 0.28);
    height: 0.5rem;
    width: 0.5rem;
    transition: width 0.25s, background-color 0.25s;
  }
  .in-dot.is-active span {
    background-color: #0a76c2;
    width: 1.5rem;
  }
  .in-dot:focus-visible {
    outline: 2px solid #0a74b5;
    border-radius: 0.5rem;
  }
}
/* Phones: one card, with about 15% of the next showing. */
@media only screen and (max-width: 39.999rem) {
  .in-card {
    flex: 0 0 calc((100% + 0.25rem) / 1.15);
  }
  .in-card:only-child {
    flex-basis: 100%;
  }
}
/* Tablets: two complete cards and a sliver of the next. One or two articles share the width instead. */
@media only screen and (min-width: 40rem) and (max-width: 63.999rem) {
  .in-card {
    flex: 0 0 calc((100% - 2.5rem) / 2);
  }
  .in-card:only-child {
    flex: 0 1 32rem;
  }
  .in-list:has(> .in-card:only-child) {
    justify-content: center;
  }
  .in-card:first-child:nth-last-child(2),
  .in-card:first-child:nth-last-child(2) ~ .in-card {
    flex: 1 1 0;
  }
}

/* The organisation's mark: the "W" cut from the header logo (assets/images/logo1.png, 1953 x 266, where the "W" occupies the
 * first 568 px across and rows 11 to 255) on a white disc, so it reads the same in light and dark. If that logo file changes,
 * these three figures change with it. */
.ar-mark {
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  border: 1px solid #dde3ea;
  border-radius: 50%;
  background-color: #fff;
}
.ar-mark__crop {
  position: relative;
  display: block;
  width: 72%;
  aspect-ratio: 568 / 245;
  overflow: hidden;
}
.ar-mark__crop img {
  position: absolute;
  top: -4.49%; /* 11 of 245 */
  left: 0;
  width: 343.84%; /* 1953 of 568 */
  max-width: none;
  height: auto;
}
html.dark-mode .ar-mark {
  border-color: #fff;
}

/* ------------------------------------------------------------------ dark mode */
html.dark-mode #home-insights {
  background-color: rgba(0, 0, 0, 0.2);
}
html.dark-mode #home-insights .cs-title,
html.dark-mode #home-insights .cs-text,
html.dark-mode .in-title,
html.dark-mode .in-name {
  color: var(--bodyTextColorWhite);
}
html.dark-mode .in-article {
  border-color: #17303f;
  background-color: #0a1a27;
}
html.dark-mode .in-summary,
html.dark-mode .in-role,
html.dark-mode .in-read {
  color: #b4c1cf;
}
html.dark-mode .in-foot {
  border-top-color: #1d3547;
}
html.dark-mode .in-pillar,
html.dark-mode .in-arrow {
  color: var(--secondary);
}
html.dark-mode .in-article:has(.in-link:hover) {
  border-color: var(--secondary);
}
html.dark-mode .in-article:has(.in-link:focus-visible),
html.dark-mode .in-list:focus-visible,
html.dark-mode .in-dot:focus-visible {
  border-color: var(--secondary);
  outline-color: var(--secondary);
}
html.dark-mode .in-dot span {
  background-color: rgba(255, 255, 255, 0.32);
}
html.dark-mode .in-dot.is-active span {
  background-color: var(--secondary);
}
@media (prefers-reduced-motion: reduce) {
  .in-article,
  .in-arrow,
  .in-dot span {
    transition: none;
  }
}
