/* ==========================================
   PSGVPM Parent Website — News & Events feed
   Loaded only on /news/. Styles the markup built by assets/js/news-events-feed.js
   from the site's own tokens. Classes are prefixed ne- and do not touch global rules.
   ========================================== */

.ne-status {
  margin: 0 0 var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  border-inline-start: 3px solid var(--color-accent);
  background: rgba(200, 149, 47, 0.08);
  font-size: var(--font-size-small);
}

.ne-status.is-error {
  border-color: #a33a2a;
}

/* ---- Grids of cards (news, social) ---- */
.ne-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.ne-grid > * {
  flex: 1 1 100%;
}

@media (min-width: 40rem) {
  .ne-grid > * {
    flex: 0 1 calc((100% - var(--space-md)) / 2);
  }
}

@media (min-width: 62rem) {
  .ne-grid > * {
    flex: 0 1 calc((100% - 2 * var(--space-md)) / 3);
  }
}

.ne-grid > .ne-empty {
  flex: 1 1 100%;
}

.ne-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.ne-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--color-bg-khadi-deep);
}

.ne-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ne-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem 1.3rem;
}

.ne-card__title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
}

.ne-card__text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}

.ne-date,
.ne-event__meta {
  color: var(--color-text-muted);
  font-size: var(--font-size-caption);
  font-weight: 600;
}

.ne-link {
  align-self: flex-start;
  margin-block-start: auto;
  padding-block-start: var(--space-xs);
  border-bottom: 0;
}

.ne-link {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ---- Badges ---- */
.ne-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ne-badge {
  padding: 0.1rem 0.6rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  color: var(--color-accent-deep);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ne-badge--featured {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.ne-platform {
  position: absolute;
  inset: auto auto 0.6rem 0.6rem;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--color-primary-dark);
  color: var(--color-text-inverse);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ---- Placeholder shown when a row has no (working) image ---- */
.ne-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(200, 149, 47, 0.18), transparent 65%),
    var(--color-bg-khadi-deep);
}

.ne-placeholder__label {
  padding-inline: var(--space-sm);
  color: var(--color-primary);
  font-family: var(--font-family-heading);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

/* ---- Events: a dated list ---- */
.ne-events {
  display: grid;
  gap: var(--space-sm);
  max-width: 52rem;
}

.ne-event {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: var(--space-sm);
  padding: 1rem 1.15rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.ne-event__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: start;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-accent-soft);
  line-height: 1.1;
}

.ne-event__month {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.ne-event__day {
  font-family: var(--font-family-heading);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--color-text-inverse);
}

.ne-event__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ne-event__meta {
  margin: 0;
}

/* ---- Loading skeletons and empty/error states ---- */
/* Placeholder heights follow the real cards (measured at 390-1280 px), so content replaces them without a jump */
.ne-grid > .ne-skeleton {
  min-height: 25.5rem;
}

.ne-events > .ne-skeleton {
  min-height: 7.25rem;
}

@media (max-width: 39.99rem) {
  .ne-events > .ne-skeleton {
    min-height: 11.5rem;
  }
}

.ne-skeleton {
  min-height: 11rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--color-bg-khadi) 0%, #fbf7ee 50%, var(--color-bg-khadi) 100%);
}

.ne-empty {
  margin: 0;
  padding: var(--space-md);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-align: center;
}

.ne-empty--error {
  border-color: #a33a2a;
  color: var(--color-text);
}

@media (prefers-reduced-motion: no-preference) {
  .ne-skeleton {
    background-size: 200% 100%;
    animation: ne-shimmer 1600ms ease-in-out infinite;
  }

  @keyframes ne-shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
  }
}
