/* =============================================================
   GEPS News — [geps_news] shortcode
   White section, colorful text. Image-first poster cards.
   ============================================================= */

.geps-news-block * {
  box-sizing: border-box;
}

.geps-news-block {
  --gn-navy: #0f2742;
  --gn-navy-700: #1d3a5e;
  --gn-gold: #a6c5db;
  --gn-gold-bright: #a6c5db;
  --gn-rule: #e3eaf1;
  --gn-muted: #607791;
  --gn-bg: #ffffff;
  --gn-display: 'Plus Jakarta Sans', 'GT Walsheim Pro', 'GTWalsheimPro-Bold', system-ui, -apple-system, Segoe UI, sans-serif;
  --gn-serif: 'Fraunces', Georgia, serif;
  --gn-body: 'Public Sans', system-ui, sans-serif;

  background: var(--gn-bg);
  color: var(--gn-navy);
  --gn-pad-x: clamp(20px, 5vw, 96px);
  padding: clamp(48px, 6vw, 96px) var(--gn-pad-x);
  font-family: var(--gn-body);
  position: relative;
  overflow: hidden;
}

.geps-news-block__inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
}

/* ---------- Header ---------- */

.geps-news-block__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 4vw, 56px);
  flex-wrap: wrap;
}

.geps-news-block__head > div:first-child {
  min-width: 0;
  flex: 1 1 280px;
}

.geps-news-block__eyebrow {
  font-family: var(--gn-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--gn-gold);
  margin: 0;
}

.geps-news-block__title {
  font-family: var(--gn-display);
  font-weight: 800;
  font-size: clamp(1.875rem, 4.4vw, 4rem);
  line-height: 1.02;
  color: var(--gn-navy);
  letter-spacing: -0.025em;
  margin: 14px 0 0;
  text-wrap: balance;
}

.geps-news-block__title em {
  font-family: var(--gn-serif);
  font-style: italic;
  font-weight: 500;
  color: var(--gn-gold);
  font-size: 0.9em;
}

.geps-news-block__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.geps-news-block__nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: transparent;
  color: var(--gn-navy);
  border: 1px solid var(--gn-rule);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.geps-news-block__nav-btn:hover {
  background: var(--gn-navy);
  border-color: var(--gn-navy);
  color: #fff;
}
.geps-news-block__nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.geps-news-block__nav-btn svg { width: 18px; height: 18px; }

.geps-news-block__viewall {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  height: 44px;
  border-radius: 999px;
  background: var(--gn-navy);
  color: #fff;
  font-family: var(--gn-display);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease, color .2s ease;
}
.geps-news-block__viewall:hover {
  background: var(--gn-navy-700);
  transform: translateX(2px);
  color: #fff;
}

/* ---------- Grid ---------- */

.geps-news-block__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 980px) {
  .geps-news-block__grid { grid-template-columns: repeat(2, 1fr); }
  .geps-news-block__grid > article:nth-child(3) { display: none; }
}

@media (max-width: 640px) {
  .geps-news-block__grid {
    display: flex;
    grid-template-columns: none;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 24px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin: 0 calc(-1 * var(--gn-pad-x, 24px));
    padding: 4px var(--gn-pad-x, 24px) 12px;
    scrollbar-width: none;
  }
  .geps-news-block__grid::-webkit-scrollbar { display: none; }
  .geps-news-block__grid > article {
    flex: 0 0 80%;
    max-width: 320px;
    min-width: 240px;
    scroll-snap-align: start;
  }
  .geps-news-block__grid > article:nth-child(3) { display: block; }
}

@media (max-width: 380px) {
  .geps-news-block__grid > article { flex-basis: 84%; }
}

/* ---------- Card ----------
   The post image fills the whole card. Title + meta sit on top of the image
   with a navy gradient at the bottom for legibility.
   ----------------------------------------------------------------- */

.geps-news-card {
  position: relative;
  margin: 0;
}

.geps-news-card__link {
  display: block;
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  background: #eef4f8;
  /* support using inline or theme background-images and make them cover */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  isolation: isolate;
  box-shadow: 0 1px 2px rgba(15, 39, 66, 0.04),
              0 10px 24px -12px rgba(15, 39, 66, 0.18);
  transition: box-shadow .25s ease, transform .25s ease;
}
.geps-news-card__link:hover {
  box-shadow: 0 4px 8px rgba(15, 39, 66, 0.08),
              0 20px 40px -16px rgba(15, 39, 66, 0.28);
  transform: translateY(-2px);
}

/* The actual <img> — stretched to fill the card, centered */
.geps-news-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* ensure the image raster fills the entire card without letterboxing */
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
  z-index: 0;
  display: block;
}
.geps-news-card__link:hover .geps-news-card__img {
  transform: scale(1.05);
}

/* Placeholder when no featured image */
.geps-news-card__img--placeholder {
  background: linear-gradient(135deg, #1d3a5e 0%, #34495e 60%, #607791 100%);
  display: grid;
  place-items: center;
  color: var(--gn-gold-bright);
  font-family: var(--gn-display);
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 14px;
  text-transform: uppercase;
}

.geps-news-card__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(15,39,66,0.95) 0%,
    rgba(15,39,66,0.55) 35%,
    rgba(15,39,66,0.0)  60%);
  z-index: 1;
  pointer-events: none;
}

.geps-news-card__category {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  background: var(--gn-gold-bright);
  border: 0;
  color: var(--gn-navy);
  padding: 7px 12px 6px;
  border-radius: 999px;
  font-family: var(--gn-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  line-height: 1;
}

.geps-news-card__date {
  position: absolute;
  top: 22px;
  right: 18px;
  z-index: 2;
  color: rgba(255,255,255,0.95);
  font-family: var(--gn-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}

.geps-news-card__body {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 2;
}

.geps-news-card__title {
  font-family: var(--gn-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 1.3vw, 1.4rem);
  line-height: 1.2;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.geps-news-card__meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(255,255,255,0.9);
  font-family: var(--gn-display);
  font-size: 13px;
  font-weight: 600;
}

.geps-news-card__read {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gn-gold-bright);
  transition: gap .2s ease;
}
.geps-news-card__link:hover .geps-news-card__read { gap: 10px; }
.geps-news-card__read::after { content: "→"; }

.geps-news-card__readtime {
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}

/* Focus ring */
.geps-news-card__link:focus-visible {
  outline: 2px solid var(--gn-navy);
  outline-offset: 3px;
}

/* Empty state */
.geps-news-block__empty {
  color: var(--gn-muted);
  font-family: var(--gn-display);
  text-align: center;
  padding: 40px;
}

/* RTL polish (theme has style-rtl.css) */
[dir="rtl"] .geps-news-card__category { left: auto; right: 18px; }
[dir="rtl"] .geps-news-card__date { right: auto; left: 18px; }
[dir="rtl"] .geps-news-card__read::after { content: "←"; }

[dir="rtl"] .geps-news-block__grid {
  scroll-padding-left: 0;
  scroll-padding-right: 24px;
}

/* ---------- Mobile polish ---------- */

@media (max-width: 640px) {
  .geps-news-block {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .geps-news-block__head {
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 24px;
  }

  .geps-news-block__eyebrow {
    font-size: 11px;
    letter-spacing: 0.2em;
  }

  .geps-news-block__title {
    margin-top: 10px;
  }

  .geps-news-block__actions {
    width: 100%;
    gap: 10px;
  }

  .geps-news-block__viewall {
    flex: 1 1 auto;
    justify-content: center;
    height: 48px;
    padding: 0 20px;
    font-size: 14px;
  }

  .geps-news-block__nav-btn { display: none; }

  .geps-news-card__link {
    aspect-ratio: 3 / 4;
    border-radius: 10px;
  }

  .geps-news-card__category {
    display: none;
    top: 14px;
    left: 14px;
    padding: 6px 10px 5px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .geps-news-card__date {
    top: 18px;
    right: 14px;
    font-size: 11px;
  }

  .geps-news-card__body {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .geps-news-card__title {
    font-size: 1.05rem;
    line-height: 1.25;
    -webkit-line-clamp: 4;
  }

  .geps-news-card__meta {
    margin-top: 10px;
    font-size: 12px;
  }
}

/* On touch devices, disable lift/scale hovers that get stuck after tap */
@media (hover: none) {
  .geps-news-card__link:hover { transform: none; box-shadow:
    0 1px 2px rgba(15, 39, 66, 0.04),
    0 10px 24px -12px rgba(15, 39, 66, 0.18); }
  .geps-news-card__link:hover .geps-news-card__img { transform: none; }
  .geps-news-card__link:active { transform: translateY(-1px); }
  .geps-news-block__viewall:hover { transform: none; background: var(--gn-navy); }
}
