/* ==========================================================================
   Nively Editorial — design system + category archive
   Loaded by the nively-editorial plugin. Does NOT touch the parent theme.
   Structural rules are scoped to .nively-archive so the Elementor homepage
   is not disturbed. Only design tokens + the Hello #c36 link fix are global.
   ========================================================================== */

:root {
  --nively-ink:        #20293A;
  --nively-body:       #4F5968;
  --nively-ivory:      #FBF8F3;
  --nively-white:      #FFFFFF;
  --nively-sage:       #7FA18C;
  --nively-sage-dark:  #537360; /* WCAG-safe for text/links on white */
  --nively-sage-pale:  #E8F0EA;
  --nively-blush:      #F3E6E3;
  --nively-plum:       #765069;
  --nively-border:     #E6E2DC;

  --nively-radius:     14px;
  --nively-radius-lg:  18px;
  --nively-shadow:     0 1px 2px rgba(32,41,58,.04), 0 6px 18px rgba(32,41,58,.06);
  --nively-shadow-h:   0 2px 6px rgba(32,41,58,.06), 0 14px 32px rgba(32,41,58,.10);

  --nively-maxw:       1200px;
  --nively-pad:        clamp(16px, 4vw, 48px);

  --nively-font-head:  "Fraunces", Georgia, "Times New Roman", serif;
  --nively-font-body:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* 8px spacing scale */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s7: 64px; --s8: 80px;
}

/* --- Global, low-risk: fix Hello Elementor's default #c36 pink on native
   (non-Elementor) pages only. Elementor pages set their own link colours. --- */
body.archive a,
body.blog a,
body.search a {
  color: var(--nively-sage-dark);
}
body.archive a:hover,
body.blog a:hover,
body.search a:hover { color: var(--nively-plum); }

/* =========================================================================
   ARCHIVE
   ========================================================================= */
.nively-archive {
  background: var(--nively-ivory);
  font-family: var(--nively-font-body);
  color: var(--nively-body);
  -webkit-font-smoothing: antialiased;
}
.nively-archive * { box-sizing: border-box; }
.nively-archive .nv-wrap {
  max-width: var(--nively-maxw);
  margin-inline: auto;
  padding-inline: var(--nively-pad);
}

/* Hide Hello's cramped native page-title if it ever renders alongside */
.nively-archive + .site-main .page-header { display: none; }

/* --- Breadcrumb --- */
.nv-breadcrumb {
  padding-top: var(--s4);
  font-size: 14px;
  font-family: var(--nively-font-body);
}
.nv-breadcrumb ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  color: var(--nively-body);
}
.nv-breadcrumb a { color: var(--nively-sage-dark); text-decoration: none; }
.nv-breadcrumb a:hover { text-decoration: underline; }
.nv-breadcrumb li[aria-current="page"] { color: var(--nively-ink); font-weight: 600; }
.nv-breadcrumb .nv-sep { color: var(--nively-border); }

/* --- Hero --- */
.nv-hero { padding: var(--s4) 0 var(--s5); border-bottom: 1px solid var(--nively-border); }
.nv-eyebrow {
  font-family: var(--nively-font-body);
  font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--nively-sage-dark); margin: 0 0 var(--s2);
}
.nv-hero h1 {
  font-family: var(--nively-font-head);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -.01em;
  color: var(--nively-ink);
  margin: 0 0 var(--s3);
  max-width: 18ch;
}
.nv-hero .nv-intro {
  font-size: 18px; line-height: 1.6; color: var(--nively-body);
  max-width: 62ch; margin: 0;
}
.nv-hero .nv-count {
  display: inline-block; margin-top: var(--s3);
  font-size: 13px; font-weight: 600; color: var(--nively-sage-dark);
  background: var(--nively-sage-pale);
  padding: 6px 14px; border-radius: 999px;
}

/* --- Featured story --- */
.nv-featured { padding: var(--s6) 0 var(--s5); }
.nv-featured .nv-card-featured {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s5);
  align-items: center;
  background: var(--nively-white);
  border: 1px solid var(--nively-border);
  border-radius: var(--nively-radius-lg);
  overflow: hidden;
  box-shadow: var(--nively-shadow);
  position: relative;
  transition: box-shadow .2s ease, transform .2s ease;
}
.nv-featured .nv-card-featured:hover { box-shadow: var(--nively-shadow-h); }
.nv-featured .nv-media { aspect-ratio: 4 / 3; }
.nv-featured .nv-body { padding: var(--s5) var(--s5) var(--s5) 0; }
.nv-featured h2 {
  font-family: var(--nively-font-head); font-weight: 600;
  font-size: clamp(24px, 3vw, 34px); line-height: 1.14; letter-spacing: -.01em;
  color: var(--nively-ink); margin: var(--s2) 0 var(--s2);
}
.nv-featured .nv-excerpt { font-size: 17px; line-height: 1.6; margin: 0 0 var(--s3); }

/* --- Grid --- */
.nv-grid-section { padding-bottom: var(--s8); }
.nv-grid-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s2); margin: 0 0 var(--s4);
}
.nv-grid-head h2 {
  font-family: var(--nively-font-head); font-weight: 600;
  font-size: clamp(22px, 2.4vw, 28px); color: var(--nively-ink); margin: 0;
}
.nv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s4);
}

/* --- Card --- */
.nv-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--nively-white);
  border: 1px solid var(--nively-border);
  border-radius: var(--nively-radius);
  overflow: hidden;
  box-shadow: var(--nively-shadow);
  transition: box-shadow .2s ease, transform .2s ease;
}
.nv-card:hover { transform: translateY(-3px); box-shadow: var(--nively-shadow-h); }

/* Media: fixed ratio, cover — the fix for the blank-space problem */
.nv-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--nively-sage-pale); }
.nv-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.nv-card:hover .nv-media img { transform: scale(1.04); }

/* Branded fallback when no featured image (no empty fixed-height box) */
.nv-media--fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(0deg, var(--nively-sage-pale), var(--nively-sage-pale)); /* flat, not a gradient look */
  background: var(--nively-sage-pale);
}
.nv-media--fallback .nv-fallback-mark {
  font-family: var(--nively-font-head); font-weight: 600;
  font-size: 30px; color: var(--nively-sage-dark);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.nv-media--fallback .nv-fallback-mark small {
  font-family: var(--nively-font-body); font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--nively-sage-dark); opacity: .8;
}

.nv-card .nv-body { display: flex; flex-direction: column; flex: 1; padding: var(--s3); }
.nv-cat {
  font-family: var(--nively-font-body);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--nively-sage-dark); margin: 0 0 10px;
  position: relative; z-index: 2; align-self: flex-start; text-decoration: none;
}
.nv-cat:hover { color: var(--nively-plum); }
.nv-card h3 {
  font-family: var(--nively-font-head); font-weight: 600;
  font-size: 21px; line-height: 1.22; letter-spacing: -.005em;
  color: var(--nively-ink); margin: 0 0 10px;
}
.nv-card h3 a { color: inherit; text-decoration: none; }
.nv-excerpt {
  font-size: 15px; line-height: 1.6; color: var(--nively-body); margin: 0 0 var(--s2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nv-meta {
  margin-top: auto; padding-top: var(--s2);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--nively-body);
  border-top: 1px solid var(--nively-border);
}
.nv-meta .nv-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--nively-border); }
.nv-readlink {
  margin-left: auto; font-weight: 600; color: var(--nively-sage-dark);
  text-decoration: none; font-size: 13px; position: relative; z-index: 2;
}
.nv-readlink:hover { color: var(--nively-plum); }

/* Stretched link: whole card is one accessible target */
.nv-card .nv-stretch::after,
.nv-featured .nv-stretch::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
}
.nv-card a:focus-visible,
.nv-featured a:focus-visible,
.nv-breadcrumb a:focus-visible,
.nv-pagination a:focus-visible {
  outline: 3px solid var(--nively-sage-dark); outline-offset: 3px; border-radius: 4px;
}

/* --- Buttons --- */
.nv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 11px 22px;
  font-family: var(--nively-font-body); font-size: 15px; font-weight: 600;
  border-radius: 10px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s ease, color .15s ease;
}
.nv-btn--primary { background: var(--nively-sage-dark); color: #fff; }
.nv-btn--primary:hover { background: #3f5a4a; color: #fff; }
.nv-btn--ghost { background: transparent; color: var(--nively-ink); border-color: var(--nively-border); }
.nv-btn--ghost:hover { border-color: var(--nively-sage-dark); color: var(--nively-sage-dark); }

/* --- Pagination --- */
.nv-pagination { padding: var(--s2) 0 var(--s8); }
.nv-pagination .nav-links, .nv-pagination ul {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.nv-pagination a, .nv-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  font-family: var(--nively-font-body); font-size: 15px; font-weight: 600;
  border: 1px solid var(--nively-border); border-radius: 10px;
  color: var(--nively-ink); background: var(--nively-white); text-decoration: none;
}
.nv-pagination a:hover { border-color: var(--nively-sage-dark); color: var(--nively-sage-dark); }
.nv-pagination .current {
  background: var(--nively-sage-dark); border-color: var(--nively-sage-dark); color: #fff;
}
.nv-pagination .dots { border-color: transparent; background: transparent; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1024px) {
  .nv-grid { grid-template-columns: repeat(2, 1fr); }
  .nv-featured .nv-card-featured { grid-template-columns: 1fr; }
  .nv-featured .nv-media { aspect-ratio: 16 / 9; }
  .nv-featured .nv-body { padding: 0 var(--s4) var(--s5); }
}
@media (max-width: 640px) {
  .nv-grid { grid-template-columns: 1fr; gap: var(--s3); }
  .nv-hero { padding-top: var(--s3); }
  .nv-featured { padding-top: var(--s5); }
}
