/* ============================================================
   8FLiX — Archive Index Navigation Cards
   File: /css/efx-index-nav.css
   Replaces old table-based az-index layouts
   ============================================================ */

.efx-index-nav{
  --efx-accent: #D3239A;
  --efx-warm: #FF6A00;
  --efx-br: 14px;

  --efx-bg: #111827;
  --efx-bg-soft: #161F2E;
  --efx-bg-deep: #0B0F17;

  --efx-text: #F4F7FB;
  --efx-text-soft: #D6DCE7;
  --efx-muted: #AEB7C6;

  --efx-border: rgba(255,255,255,.12);
  --efx-ring: rgba(255,106,0,.32);

  display: block;
  width: 100%;
  margin: 1rem 0 2rem;
}

.efx-index-group{
  margin: 0 0 1.75rem;
}

.efx-index-heading{
  margin: 0 0 .85rem !important;
  color: var(--efx-text);
}

.efx-index-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}

.efx-index-card,
.efx-index-card:link,
.efx-index-card:visited{
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: .85rem 1rem .85rem 1.05rem;

  border-radius: var(--efx-br);
  border: 1px solid var(--efx-border);
  background:
    radial-gradient(circle at 0 0, rgba(211,35,154,.13), transparent 38%),
    linear-gradient(135deg, rgba(255,255,255,.052), rgba(255,255,255,.018)),
    var(--efx-bg-soft);

  color: var(--efx-text);
  font-weight: 850;
  line-height: 1.25;
  text-decoration: none !important;
  overflow: hidden;

  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    filter .16s ease;
}

.efx-index-card::before{
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--efx-accent), var(--efx-warm));
  opacity: .55;
  transition: opacity .16s ease;
}

.efx-index-card:hover,
.efx-index-card:focus-visible{
  transform: translateY(-1px);
  border-color: rgba(255,106,0,.34);
  color: #FFB15C;
  box-shadow:
    0 14px 30px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.05),
    0 0 22px rgba(211,35,154,.10);
  filter: saturate(1.04) contrast(1.02);
}

.efx-index-card:hover::before,
.efx-index-card:focus-visible::before{
  opacity: .95;
}

.efx-index-card:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px var(--efx-ring),
    0 14px 30px rgba(0,0,0,.28);
}

/* Astra/archive descriptions may inject wpautop <p> and <br> tags. */
.efx-index-nav .efx-index-grid > p:empty,
.efx-index-nav .efx-index-grid > br {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* If wpautop wraps links in <p>, make those paragraphs invisible as boxes,
   but keep their child links alive as grid cards. */
.efx-index-nav .efx-index-grid > p:not(:empty) {
  display: contents !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* If this lives in Astra archive descriptions, let the nav span properly. */
body.archive #primary.ast-grid-2 .ast-archive-description:has(.efx-index-nav){
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 1200px !important;
  overflow: visible !important;
}

@media (max-width: 920px){
  .efx-index-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px){
  .efx-index-grid{
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce){
  .efx-index-card{
    transition: none;
  }
}

.efx-index-card,
.efx-index-grid > p > .efx-index-card,
.efx-index-card:link,
.efx-index-card:visited {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: .85rem 1rem .85rem 1.05rem;

  border-radius: var(--efx-br);
  border: 1px solid var(--efx-border);
  background:
    radial-gradient(circle at 0 0, rgba(211,35,154,.13), transparent 38%),
    linear-gradient(135deg, rgba(255,255,255,.052), rgba(255,255,255,.018)),
    var(--efx-bg-soft);

  color: var(--efx-text);
  font-weight: 850;
  line-height: 1.25;
  text-decoration: none !important;
  overflow: hidden;

  box-shadow: 0 10px 24px rgba(0,0,0,.18);
  transition:
    transform .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    filter .16s ease;
}