/* ============================================================
   ZILLA TRAINING — News / Blog
   Used by /news/ (landing) and the individual article pages.
   Depends on the tokens in main.css.
   ============================================================ */

/* ---- Grid: 3 up desktop, 2 up tablet, 1 up mobile ---- */
/* ============================================================
   NEWS FILTERS — filter + sort bar above the listing grid
   ============================================================ */

/* Hidden until news-filters.js adds .is-ready, so a visitor without JS sees
   the full listing rather than controls that do nothing. */
.news-filters {
  display: none;
  margin-bottom: 2.5rem;
}

.news-filters.is-ready {
  display: block;
}

.news-filters__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--color-white);
  border: 1px solid var(--color-grey-2);
  border-radius: 8px;
}

.news-filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
  flex: 1 1 180px;
  min-width: 0;
}

.news-filters__field label {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.news-filters__field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-dark);
  background-color: var(--color-white);
  border: 1px solid var(--color-grey-2);
  border-radius: 6px;
  padding: 0.6875rem 2.25rem 0.6875rem 0.875rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  /* Chevron drawn inline so the control needs no extra markup or icon font. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230D0D0D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.news-filters__field select:hover {
  border-color: var(--color-text-muted);
}

.news-filters__field select:focus-visible {
  outline: none;
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px rgba(232, 24, 31, 0.15);
}

.news-filters__clear {
  flex: 0 0 auto;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-red);
  background: none;
  border: 1px solid var(--color-grey-2);
  border-radius: 6px;
  padding: 0.75rem 1.125rem;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.news-filters__clear:hover {
  background: var(--color-red);
  border-color: var(--color-red);
  color: var(--color-white);
}

.news-filters__status {
  margin: 0.875rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ---- Empty state ---- */
.news-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  font-size: 1.0625rem;
  color: var(--color-text-muted);
  background: var(--color-white);
  border: 1px dashed var(--color-grey-2);
  border-radius: 8px;
}

.news-empty__reset {
  display: inline-block;
  margin-left: 0.375rem;
  font: inherit;
  color: var(--color-red);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-empty__reset:hover { color: var(--color-dark); }

/* ---- Card show/hide + reveal ----
   .news-card sets display:flex, which beats the UA rule for [hidden], so the
   hidden state has to be restated here at a higher specificity.
   The listing cards no longer carry .js-fade-up: the filter module owns their
   reveal, so a card brought back by a filter change can't be left at the
   opacity:0 that GSAP's ScrollTrigger starts from. */
.news-card[hidden] {
  display: none;
}

/* Scoped to .is-enhanced, which news-filters.js adds to the listing grid only.
   Without that scope this would (a) leave every card invisible when JS is off
   or fails, and (b) hit the homepage's .news-grid--4, which has no filter
   module to ever add .is-revealed. */
.news-grid.is-enhanced .news-card {
  opacity: 0;
  transform: translateY(16px);
}

.news-grid.is-enhanced .news-card.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  transition-delay: calc(var(--card-index, 0) * 45ms);
}

@media (prefers-reduced-motion: reduce) {
  .news-grid.is-enhanced .news-card,
  .news-grid.is-enhanced .news-card.is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 1000px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
}

@media (max-width: 768px) {
  .news-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* 4-up variant, used by the homepage "Latest News" strip so four posts fill
   one row instead of leaving an orphan on a 3-col grid. Declared after the
   base breakpoints above so it wins at equal specificity. */
.news-grid--4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1200px) {
  .news-grid--4 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

@media (max-width: 768px) {
  .news-grid--4 { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Narrower cards in the 4-up row — trim the copy so the cards stay even */
.news-grid--4 .news-card__body { padding: 1.5rem; }
.news-grid--4 .news-card__title { font-size: 1.125rem; }
.news-grid--4 .news-card__excerpt {
  font-size: 0.9375rem;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* ---- Homepage "Latest News" section ---- */
.latest-news__cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ---- Card ---- */
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-grey-2);
  border-radius: 8px;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-gold);
}

/* Keyboard users get the same affordance as the mouse hover */
.news-card:focus-within {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-md);
}

/* ---- Cover image ---- */
.news-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-dark-2);
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
}

.news-card:hover .news-card__media img {
  transform: scale(1.05);
}

/* Soft scrim so the date block always reads against a busy photo */
.news-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 13, 13, 0.45) 0%, transparent 45%);
  pointer-events: none;
}

/* ---- Date block (day / month + year) ---- */
.news-card__date {
  position: absolute;
  left: 0;
  bottom: 1.25rem;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  background: var(--color-red);
  color: var(--color-white);
  padding: 0.5rem 1rem 0.5rem 1.25rem;
  border-radius: 0 4px 4px 0;
  font-family: var(--font-heading);
  text-transform: uppercase;
}

.news-card__date strong {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.news-card__date span {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* ---- Body ---- */
.news-card__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 1.75rem;
}

.news-card__title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--color-dark);
  margin-bottom: 0.875rem;
}

.news-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast);
}

.news-card__title a:hover {
  color: var(--color-red);
}

/* The title link covers the whole card, so the entire card is clickable
   while there is still only one tab stop and one accessible name. */
.news-card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
}

/* No flex-grow here on purpose: a growing -webkit-box gets stretched past its
   clamp height, so overflow:hidden stops cutting the extra lines and you end
   up with the ellipsis mid-paragraph AND the rest of the text below it.
   .news-card__more carries margin-top:auto instead to pin itself to the
   bottom, which keeps the cards even without breaking the clamp. */
.news-card__excerpt {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  margin-top: auto;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-red);
}

.news-card__more svg {
  transition: transform var(--duration-fast) var(--ease-out);
}

.news-card:hover .news-card__more svg {
  transform: translateX(4px);
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .news-card,
  .news-card__media img,
  .news-card__more svg {
    transition: none;
  }
  .news-card:hover {
    transform: none;
  }
  .news-card:hover .news-card__media img {
    transform: none;
  }
}

/* ============================================================
   ARTICLE PAGE (news/<slug>.html)
   ============================================================ */

/* ---- Hero ---- */
.article-hero {
  position: relative;
  padding-top: calc(var(--nav-height) + var(--space-lg));
  padding-bottom: var(--space-lg);
  padding-inline: var(--container-pad);
  background: var(--color-dark) center/cover no-repeat;
  overflow: hidden;
}

/* Scrim: heaviest at the bottom so the headline always holds up */
.article-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 13, 13, 0.97) 0%, rgba(13, 13, 13, 0.86) 45%, rgba(13, 13, 13, 0.72) 100%);
  pointer-events: none;
}

.article-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin-inline: auto;
}

.article-hero__cat {
  display: inline-block;
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.375rem 0.875rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.article-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--color-white);
  margin-bottom: 1.25rem;
}

.article-hero__dek {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.5rem;
}

.article-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.article-hero__meta span[aria-hidden] { color: rgba(255, 255, 255, 0.3); }

/* ---- Body ---- */
.article-body {
  max-width: 720px;
  margin-inline: auto;
}

.article-body p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

/* Opening line carries the post — give it weight */
.article-body__lead {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.25rem) !important;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1 !important;
  color: var(--color-dark);
  margin-bottom: 1.75rem !important;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--color-dark);
  margin-top: 3rem;
  margin-bottom: 1rem;
}

/* In-article promotion / recap lists */
.article-body ul {
  margin: 0 0 1.5rem;
  padding-left: 0;
  list-style: none;
}

.article-body ul li {
  position: relative;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  padding-left: 1.5rem;
  margin-bottom: 0.625rem;
}

.article-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red);
}

.article-body a:not(.btn) {
  color: var(--color-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:not(.btn):hover { color: var(--color-dark); }

/* ---- Pull quote ---- */
.article-quote {
  border-left: 4px solid var(--color-red);
  padding-left: 1.75rem;
  margin: 2.75rem 0;
}

.article-quote p {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--color-dark);
  margin-bottom: 0.875rem !important;
}

.article-quote cite {
  display: block;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---- Embeds (Instagram, YouTube, etc.) ---- */
.article-embed {
  display: flex;
  justify-content: center;
  margin: 2.75rem 0;
}

.article-embed .instagram-media {
  margin: 0 auto !important;
}

/* ---- Standalone in-body image (e.g. an event poster or standalone photo
   dropped into the copy — not a card, not a feature link) ---- */
.article-body__image {
  margin: 2.5rem auto;
  max-width: 440px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.article-body__image img {
  display: block;
  width: 100%;
  height: auto;
}

.article-body__image figcaption {
  padding: 0.75rem 1rem;
  background: var(--color-grey);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---- Self-hosted in-body video (a short native <video>, not a card, not a
   social embed — same container treatment as .article-body__image) ---- */
.article-body__video {
  margin: 2.5rem auto;
  max-width: 440px;
}

.article-body__video video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  background: var(--color-dark-2);
}

/* Full-measure variant — for wide/banner-shaped images (a partner logo strip,
   an article header banner) that would be unreadable squeezed to 440px. */
.article-body__image--wide {
  max-width: 100%;
}

/* ---- Service crest grid (REORG eligibility) ----
   Sits inside .article-body, which is capped at 720px, so the cells are a good
   deal smaller than the equivalent strip on /reorg-partnership. Built from divs,
   not a <ul>, so the red bullet on .article-body ul li::before doesn't apply. */
.article-svc {
  margin: 2.5rem 0;
}

.article-svc__group {
  margin-bottom: 1.5rem;
}

.article-svc__group:last-child {
  margin-bottom: 0;
}

.article-svc__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 1rem;
}

.article-svc__title::before,
.article-svc__title::after {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  max-width: 80px;
  background: var(--color-grey-2);
}

.article-svc__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 0.75rem;
}

.article-svc__cell {
  background: var(--color-white);
  border: 1px solid var(--color-grey-2);
  border-radius: 10px;
  padding: 0.875rem 0.5rem;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.article-svc__cell img {
  max-height: 46px;
  max-width: 84px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.article-svc__name {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.35;
}

@media (max-width: 480px) {
  .article-svc__row { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0.5rem; }
  .article-svc__cell { min-height: 96px; padding: 0.75rem 0.375rem; }
  .article-svc__cell img { max-height: 38px; max-width: 68px; }
}

/* ---- Responsive third-party video embed (Vimeo/YouTube iframe) ----
   Distinct from .article-body__video, which wraps a self-hosted <video>. */
.article-video-embed {
  position: relative;
  margin: 2.5rem auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--color-dark-2);
}

.article-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---- Two-up in-body photo gallery (a pair of images side by side,
   e.g. two shots from the same session) ---- */
.article-body__gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2.5rem auto;
  max-width: 680px;
}

.article-body__gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 600px) {
  .article-body__gallery {
    grid-template-columns: 1fr;
    max-width: 440px;
  }
}

/* ---- External video feature (e.g. a press clip that can't be embedded
   inline — links out to the source instead of an iframe) ---- */
.article-feature {
  margin: 2.75rem 0;
}

.article-feature__media {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--color-dark-2);
  box-shadow: var(--shadow-sm);
}

.article-feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
}

.article-feature__media:hover img {
  transform: scale(1.04);
}

.article-feature__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.35));
  pointer-events: none;
}

.article-feature__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--color-red);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--duration-fast) var(--ease-out), background var(--duration-fast);
}

.article-feature__media:hover .article-feature__play {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--color-dark);
}

.article-feature__caption {
  display: block;
  text-align: center;
  margin-top: 0.875rem;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-red);
  text-decoration: none;
}

.article-feature__caption:hover {
  color: var(--color-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .article-feature__media img,
  .article-feature__play {
    transition: none;
  }
  .article-feature__media:hover img {
    transform: none;
  }
  .article-feature__media:hover .article-feature__play {
    transform: translate(-50%, -50%);
  }
}

/* ---- Tags ---- */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-grey-2);
}

.article-tags__label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-right: 0.25rem;
}

.article-tags ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.article-tags li {
  position: relative;
  list-style: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-grey);
  border: 1px solid var(--color-grey-2);
  border-radius: 999px;
  padding: 0.3125rem 0.875rem;
}

/* Tag chips sit inside .article-body ul too — strip the promotion-list
   red-dot marker (see .article-body ul li::before above) so it doesn't
   leak onto them. Selector matches that rule's specificity (class + 3
   type/pseudo selectors) so it isn't silently outranked. */
.article-tags ul li::before {
  content: none;
}

/* ---- In-article CTA ---- */
.article-cta {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--color-grey);
  border: 1px solid var(--color-grey-2);
  border-radius: 8px;
  text-align: center;
}

.article-cta h2 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  font-size: 1.5rem !important;
}

.article-cta p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem !important;
  font-size: 1rem !important;
}

/* ---- Back link ---- */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-red);
  text-decoration: none !important;
}

.article-back:hover { color: var(--color-dark); }

@media (max-width: 768px) {
  .article-quote {
    padding-left: 1.25rem;
    margin: 2rem 0;
  }
  .article-cta { padding: 1.5rem; }
}
