/**
 * EDS Newspaper Posts — Styles
 * All layout rules use CSS Grid. Zero inline styles.
 * Custom properties for per-instance colour/size overrides via Elementor selectors.
 * eDesign Space · https://edesignspace.com/
 */

/* ── Custom Properties (defaults; overridden per-widget via Elementor) ──────── */
.eds-np {
  --eds-np-gap      : 24px;
  --eds-np-row-gap  : 24px;
  --eds-np-img-h    : 220px;
  --eds-np-card-bg  : #ffffff;
  --eds-np-accent   : var(--e-global-color-accent, #6366f1);
  --eds-np-radius   : 8px;
  --eds-np-title-clamp   : 3;
  --eds-np-excerpt-clamp : 3;
}

/* ── Base article ─────────────────────────────────────────────────────────── */
.eds-np__article {
  background: var(--eds-np-card-bg);
  border-radius: var(--eds-np-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.2s ease;
  height: 100%;
}

.eds-np__article:hover {
  transform: translateY(-2px);
}

/* Thumbnail */
.eds-np__thumb {
  display: block;
  overflow: hidden;
  flex-shrink: 0;
  height: var(--eds-np-img-h);
}

.eds-np__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.eds-np__article:hover .eds-np__img {
  transform: scale(1.04);
}

/* Body */
.eds-np__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

/* Category badge */
.eds-np__cat {
  display: inline-block;
  background: var(--eds-np-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  text-decoration: none;
  align-self: flex-start;
  line-height: 1.6;
  transition: opacity 0.2s;
}

.eds-np__cat:hover { opacity: 0.85; text-decoration: none; }

/* Title */
.eds-np__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: var(--eds-np-title-clamp);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eds-np__title--lg {
  font-size: 1.35rem;
  --eds-np-title-clamp: 4;
}

.eds-np__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.eds-np__title a:hover { color: var(--eds-np-accent); text-decoration: none; }

/* Excerpt */
.eds-np__excerpt {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: var(--eds-np-excerpt-clamp);
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Meta */
.eds-np__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: #9ca3af;
  flex-wrap: wrap;
  margin-top: auto;
}

.eds-np__meta time,
.eds-np__meta .eds-np__author { white-space: nowrap; }

.eds-np__meta .eds-np__author::before { content: '·'; margin-right: 6px; }

/* Read more */
.eds-np__rm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--eds-np-accent);
  text-decoration: none;
  transition: gap 0.2s;
  margin-top: auto;
}

.eds-np__rm:hover { gap: 8px; text-decoration: none; }

/* Empty */
.eds-np__empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT: MAGAZINE
   1 large post left (2/3 width) + stack of smaller posts right (1/3)
════════════════════════════════════════════════════════════════════════════ */
.eds-np--magazine {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--eds-np-gap);
  align-items: start;
}

.eds-np--magazine .eds-np__main {
  /* container for the featured post */
}

.eds-np--magazine .eds-np__main .eds-np__article {
  height: 100%;
}

.eds-np--magazine .eds-np__main .eds-np__thumb {
  height: calc(var(--eds-np-img-h) * 1.5);
}

.eds-np--magazine .eds-np__stack {
  display: flex;
  flex-direction: column;
  gap: var(--eds-np-row-gap);
}

.eds-np--magazine .eds-np__stack .eds-np__article {
  flex-direction: row;
  align-items: stretch;
}

.eds-np--magazine .eds-np__stack .eds-np__thumb {
  width: 110px;
  height: auto;
  min-height: 90px;
  flex-shrink: 0;
}

.eds-np--magazine .eds-np__stack .eds-np__body {
  padding: 12px;
  gap: 5px;
}

.eds-np--magazine .eds-np__stack .eds-np__title {
  font-size: 0.9rem;
  --eds-np-title-clamp: 3;
}

.eds-np--magazine .eds-np__stack .eds-np__excerpt { display: none; }

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT: TILES (mosaic)
   3-column CSS Grid, posts span 1 or 2 columns based on --size class
════════════════════════════════════════════════════════════════════════════ */
.eds-np--tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--eds-np-gap);
  align-items: start;
}

.eds-np--tiles .eds-np__article--lg {
  grid-column: span 2;
}

.eds-np--tiles .eds-np__article--lg .eds-np__thumb {
  height: calc(var(--eds-np-img-h) * 1.3);
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT: SPOTLIGHT
   1 hero full-width + 4-column grid below
════════════════════════════════════════════════════════════════════════════ */
.eds-np--spotlight {
  display: flex;
  flex-direction: column;
  gap: var(--eds-np-row-gap);
}

.eds-np--spotlight .eds-np__hero .eds-np__article {
  flex-direction: row;
  gap: 0;
}

.eds-np--spotlight .eds-np__hero .eds-np__thumb {
  width: 55%;
  height: calc(var(--eds-np-img-h) * 1.6);
  flex-shrink: 0;
}

.eds-np--spotlight .eds-np__hero .eds-np__body {
  padding: 28px;
  justify-content: center;
}

.eds-np--spotlight .eds-np__hero .eds-np__title {
  font-size: 1.6rem;
  --eds-np-title-clamp: 5;
}

.eds-np--spotlight .eds-np__hero .eds-np__excerpt {
  --eds-np-excerpt-clamp: 4;
}

.eds-np--spotlight .eds-np__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--eds-np-gap);
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT: EDITORIAL (numbered list)
════════════════════════════════════════════════════════════════════════════ */
.eds-np--editorial {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.eds-np--editorial .eds-np__article {
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid #e5e7eb;
  padding: 18px 0;
}

.eds-np--editorial .eds-np__article:last-child {
  border-bottom: none;
}

.eds-np--editorial .eds-np__article:hover {
  transform: none;
  background: transparent;
}

.eds-np--editorial .eds-np__num {
  font-size: 2rem;
  font-weight: 900;
  color: #e5e7eb;
  line-height: 1;
  min-width: 52px;
  padding-top: 4px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.eds-np--editorial .eds-np__body {
  padding: 0 0 0 4px;
  gap: 6px;
}

.eds-np--editorial .eds-np__title {
  font-size: 1rem;
  --eds-np-title-clamp: 2;
}

.eds-np--editorial .eds-np__excerpt {
  --eds-np-excerpt-clamp: 2;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
════════════════════════════════════════════════════════════════════════════ */

/* Tablet: ≤1024px */
@media (max-width: 1024px) {

  /* Magazine → stacked single column */
  .eds-np--magazine {
    grid-template-columns: 1fr;
  }

  .eds-np--magazine .eds-np__stack .eds-np__article {
    flex-direction: column;
  }

  .eds-np--magazine .eds-np__stack .eds-np__thumb {
    width: 100%;
    height: var(--eds-np-img-h);
  }

  /* Tiles → 2 columns */
  .eds-np--tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .eds-np--tiles .eds-np__article--lg {
    grid-column: span 2;
  }

  /* Spotlight grid → 2 columns */
  .eds-np--spotlight .eds-np__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: ≤767px */
@media (max-width: 767px) {

  /* Magazine stack → vertical cards */
  .eds-np--magazine .eds-np__main .eds-np__thumb {
    height: var(--eds-np-img-h);
  }

  /* Tiles → 1 column, all full width */
  .eds-np--tiles {
    grid-template-columns: 1fr;
  }

  .eds-np--tiles .eds-np__article--lg {
    grid-column: span 1;
  }

  .eds-np--tiles .eds-np__article--lg .eds-np__thumb {
    height: var(--eds-np-img-h);
  }

  /* Spotlight → stacked */
  .eds-np--spotlight .eds-np__hero .eds-np__article {
    flex-direction: column;
  }

  .eds-np--spotlight .eds-np__hero .eds-np__thumb {
    width: 100%;
    height: var(--eds-np-img-h);
  }

  .eds-np--spotlight .eds-np__hero .eds-np__body {
    padding: 16px;
  }

  .eds-np--spotlight .eds-np__hero .eds-np__title {
    font-size: 1.2rem;
  }

  .eds-np--spotlight .eds-np__grid {
    grid-template-columns: 1fr;
  }

  /* Editorial — tighten number */
  .eds-np--editorial .eds-np__num {
    min-width: 40px;
    font-size: 1.6rem;
  }
}
