/**
 * News listing page — custom-news-page.php
 */

body.page-template-custom-news-page #secondary.widget-area,
body.page-template-custom-news-page-php #secondary.widget-area,
.site-content:has(.mfe-news-list) #secondary.widget-area {
  display: none !important;
}

body.page-template-custom-news-page .site-content .hm-container,
body.page-template-custom-news-page-php .site-content .hm-container,
.site-content:has(.mfe-news-list) .hm-container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#primary.content-area.mfe-news-list-wrap {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.mfe-news-list {
  --mfe-red: #e11d2e;
  --mfe-ink: #0f172a;
  --mfe-muted: #64748b;
  --mfe-line: #e2e8f0;
  --mfe-soft: #f4f6f8;
  --mfe-radius: 16px;
  --mfe-font: "Outfit", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(900px 320px at 8% -8%, rgba(225, 29, 46, 0.06), transparent 55%),
    #fff;
  color: var(--mfe-ink);
  font-family: var(--mfe-font);
}

.mfe-news-list a {
  text-decoration: none;
  color: inherit;
}

.mfe-news-list__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

.mfe-news-list__header {
  margin-bottom: 28px;
  max-width: 40rem;
}

.mfe-news-list__eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mfe-red);
}

.mfe-news-list__title {
  margin: 0 0 10px;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.mfe-news-list__sub {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--mfe-muted);
}

.mfe-news-list__count {
  display: inline-block;
  margin-left: 6px;
  color: var(--mfe-ink);
  font-weight: 600;
}

.mfe-news-list__empty {
  padding: 48px 20px;
  text-align: center;
  background: var(--mfe-soft);
  border-radius: var(--mfe-radius);
  color: var(--mfe-muted);
}

/* Featured story */
.mfe-news-feature {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0;
  margin-bottom: 28px;
  border: 1px solid var(--mfe-line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mfe-news-feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.mfe-news-feature__media {
  position: relative;
  min-height: 280px;
  background: #0f172a;
}

.mfe-news-feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

.mfe-news-feature__placeholder {
  display: block;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(225, 29, 46, 0.4), transparent 50%),
    linear-gradient(160deg, #1f2937, #0f172a);
}

.mfe-news-feature__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 28px 30px;
}

.mfe-news-feature__date {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--mfe-red);
}

.mfe-news-feature__title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.mfe-news-feature__excerpt {
  margin: 0 0 18px;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--mfe-muted);
}

.mfe-news-feature__cta {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mfe-red);
}

/* Grid cards */
.mfe-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.mfe-news-list .mfe-news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--mfe-line);
  border-radius: var(--mfe-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mfe-news-list .mfe-news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}

.mfe-news-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
}

.mfe-news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mfe-news-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 70% 30%, rgba(225, 29, 46, 0.35), transparent 50%),
    linear-gradient(145deg, #1f2937, #0f172a);
}

.mfe-news-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 16px 18px;
}

.mfe-news-card__date {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--mfe-red);
}

.mfe-news-card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mfe-news-card__excerpt {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--mfe-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mfe-news-card__more {
  margin-top: auto;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--mfe-red);
}

/* Pagination */
.mfe-news-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--mfe-line);
}

.mfe-news-pager__btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--mfe-line);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mfe-ink) !important;
}

.mfe-news-pager__btn:hover:not(.is-disabled) {
  border-color: var(--mfe-red);
  color: var(--mfe-red) !important;
}

.mfe-news-pager__btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.mfe-news-pager__status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mfe-muted);
  font-weight: 600;
}

@media (max-width: 900px) {
  .mfe-news-feature {
    grid-template-columns: 1fr;
  }

  .mfe-news-feature__media {
    min-height: 220px;
    aspect-ratio: 16 / 10;
  }

  .mfe-news-feature__media img {
    position: absolute;
  }

  .mfe-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .mfe-news-list__inner {
    padding: 24px 14px 48px;
  }

  .mfe-news-grid {
    grid-template-columns: 1fr;
  }

  .mfe-news-feature__body {
    padding: 18px 16px 20px;
  }

  .mfe-news-pager {
    flex-wrap: wrap;
    justify-content: center;
  }

  .mfe-news-pager__status {
    order: -1;
    width: 100%;
    text-align: center;
  }
}
