/* =========================================================================
   NEWS CAROUSEL (Nov 2026)
   A scrolling row of news posts as white cards on a khaki band. Three show
   on a wide screen, two on a tablet, one and a bit on a phone so it is plain
   there is more to the side. Native scroll with snap points; the previous
   and next buttons are an extra added by js/news-carousel.js.

   Markup: inc/news-carousel.php. Used on the home page ("Latest news", all
   posts) and on Our Alumni ("Alumni news", posts tagged "alumni"). Loaded
   only on those two templates by artsed_news_carousel_assets().

   Everything is scoped to .news-carousel. Primaries only: khaki, navy, white.
   ========================================================================= */


.news-carousel {
  background-color: var(--khaki);
  color: var(--navy);
  padding-top: var(--sec-pad, 96px);
  padding-bottom: var(--sec-pad, 96px);
}
.news-carousel [hidden] { display: none !important; }
.news-carousel .news-carousel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.news-carousel h2 {
  margin: 0;
  padding: 0;
  font-size: clamp(30px, 2.8vw, 40px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  text-align: left;
  color: var(--navy);
}
.news-carousel .news-carousel__nav { display: flex; gap: 8px; flex: none; }
.news-carousel .news-carousel__nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--navy);
  color: #ffffff;
  cursor: pointer;
}
.news-carousel .news-carousel__nav button svg { display: block; }
.news-carousel .news-carousel__nav button:hover:not(:disabled) { background: #ffffff; color: var(--navy); }
.news-carousel .news-carousel__nav button:disabled { opacity: .35; cursor: default; }
.news-carousel .news-carousel__nav button:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

.news-carousel .news-carousel__track {
  --nc-gap: clamp(16px, 2.4vw, 40px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--nc-gap)) / 3);
  column-gap: var(--nc-gap);
  list-style: none;
  margin: var(--sec-pad-sm, 48px) 0 0;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.news-carousel .news-carousel__track::-webkit-scrollbar { display: none; }
.news-carousel .news-carousel__item {
  margin: 0;
  padding: 0;
  background-image: none; /* the theme draws list bullets as a background */
  scroll-snap-align: start;
}
.news-carousel .news-carousel__item::before { content: none; }
.news-carousel .news-carousel__item a {
  display: block;
  height: 100%;
  background: #ffffff;
  color: var(--navy);
  text-decoration: none;
}
.news-carousel .news-carousel__item a:focus-visible { outline: 3px solid var(--navy); outline-offset: -3px; }
.news-carousel .news-carousel__media {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background-color: var(--khaki-soft, #e7e2d8);
}
.news-carousel .news-carousel__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: 0;
  transition: transform .4s ease;
}
.news-carousel .news-carousel__item a:hover .news-carousel__media img { transform: scale(1.04); }
.news-carousel .news-carousel__date {
  display: block;
  padding: 20px 24px 0;
  font-size: 15px;
  line-height: 1.3;
  color: var(--navy);
}
.news-carousel .news-carousel__title {
  display: block;
  padding: 8px 24px 28px;
  font-size: clamp(19px, 1.5vw, 24px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.news-carousel .news-carousel__item a:hover .news-carousel__title,
.news-carousel .news-carousel__item a:focus-visible .news-carousel__title { text-decoration: underline; text-underline-offset: 4px; }
.news-carousel .news-carousel__all { margin: 32px 0 0; text-align: left; }
.news-carousel .news-carousel__all a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
@media (prefers-reduced-motion: reduce) {
  .news-carousel .news-carousel__media img { transition: none; }
  .news-carousel .news-carousel__item a:hover .news-carousel__media img { transform: none; }
}
@media only screen and (max-width: 900px) {
  .news-carousel .news-carousel__track { grid-auto-columns: calc((100% - var(--nc-gap)) / 2); }
}
@media only screen and (max-width: 600px) {
  .news-carousel .news-carousel__track { grid-auto-columns: 82%; }
  .news-carousel .news-carousel__date { padding: 16px 18px 0; }
  .news-carousel .news-carousel__title { padding: 6px 18px 22px; }
}

/* ---- Home page: the signposts that follow ---------------------------------
   Meet the staff / Join the team / Get in touch sat on khaki. Directly under
   this khaki band the two would run into one, so there they take a white
   ground. Their three cards (navy, white with a navy outline, aqua) are
   unchanged. */
.news-carousel + .panel.blue-bg.meet-join,
.news-carousel + section.meet-join { background-color: #ffffff !important; }
