.pia-eguides {
  --pia-purple:      var(--clr-primary, #595efa);    /* = --clr-primary   */
  --pia-purple-deep: var(--clr-secondary, #4632da);  /* = --clr-secondary */
  --pia-navy:        var(--clr-title-lt, #16192c);   /* = --clr-title-lt (also --clr-text-lt) */
  --pia-accent-lt:   var(--clr-accent-lt, #f8f9fc);  /* neutral surface: chip / tag / cover placeholder bg */
  --pia-base-lt:     var(--clr-base-lt, #fff);        /* white text on a solid secondary chip */
  --pia-chip-bg: #EFF0FE;
  /* no muted-copy role exists in the token set — this is --clr-text-lt at
  reduced opacity, not a new color. Flag if you'd rather keep body copy
  at full --clr-text-lt strength. */
  --pia-muted:       rgba(22, 25, 44, .65);

  --pia-card-radius: 6px;
  --pia-card-shadow: 0 0 10px rgba(0, 0, 0, .15);
  --pia-gap:         20px;

  padding: 80px 0 100px;
}
.pia-eguides__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}
/* ---------- section heading ---------- */
.pia-eguides__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.pia-eguides__title {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pia-navy);
}
.pia-eguides__intro {
  margin-top: 10px;
  max-width: 60ch;
  font-size: 17px;
  line-height: 1.7;
  color: var(--pia-muted);
}
.pia-eguides__header-title {
    margin-bottom: 12px;
}
.pia-eguides__intro > :first-child { margin-top: 0; }
.pia-eguides__intro > :last-child  { margin-bottom: 0; }
.pia-eguides__count {
  flex: none;
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--pia-accent-lt);
  color: var(--pia-purple-deep);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
/* ---------- grid ---------- */
.pia-eguides__grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -20px;
  row-gap:40px
}
.pia-eguides__card { 
  width: 100%;
  padding: 0 20px;
}
/* ---------- card ---------- */
.pia-eguides__card-inner {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: var(--pia-card-radius);
  box-shadow: var(--pia-card-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
  height:100%;
}

a.pia-eguides__card:hover .pia-eguides__card-inner,
a.pia-eguides__card:focus-visible .pia-eguides__card-inner{
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(22, 25, 44, .17);
  text-decoration: none;
}

a.pia-eguides__card:focus-visible {
  outline: 2px solid var(--pia-purple);
  outline-offset: 3px;
}

/* ---------- cover ---------- */
.pia-eguides__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--pia-accent-lt);
  overflow: hidden;
}

.pia-eguides__header.scale--relative {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 36px;
}
.pia-eguides__desc p:last-child {
  margin: 0;
}
.pia-eguides__description.scale-rich-text p:last-child {
  margin-bottom: 0;
}

/* fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .pia-eguides__cover { height: 0; padding-bottom: 56.25%; }
  .pia-eguides__cover-img { position: absolute; inset: 0; }
}

.pia-eguides__cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* keeps the cover's title area in frame */
  transition: transform .4s ease;
}

a.pia-eguides__card:hover .pia-eguides__cover-img { transform: scale(1.04); }

/* ---------- type chip ---------- */
/* default = "Guide" and any unrecognised label: neutral surface, secondary-purple text */
.pia-eguides__chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--pia-chip-bg);
  color: var(--pia-purple-deep);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(22, 25, 44, .18);
}

/* "Whitepaper" is the only other type in the library today, so it gets the
inverse treatment (solid secondary, white text) using the same two brand
hues — no third color introduced. If more types are added later and need
their own look, they should reuse this same primary/secondary swap rather
than a new hue, since the theme doesn't define more than two brand colors. */
.pia-eguides__chip--whitepaper {
  background: var(--pia-purple-deep);
  color: var(--pia-base-lt);
}

/* ---------- content ---------- */
.pia-eguides__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px 22px;
}

.pia-eguides__card-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--pia-navy);
}

.pia-eguides__desc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--pia-muted);
}

.pia-eguides__desc > :first-child { margin-top: 0; }
.pia-eguides__desc > :last-child  { margin-bottom: 0; }

/* ---------- tags ---------- */
.pia-eguides__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pia-eguides__tag {
  font-size: 11px;
  font-weight: 500;
  color: #4B5163;
  background: #F4F5F9;
  border-radius: 4px;
  padding: 3px 8px;
}

/* ---------- pseudo-CTA (whole card is the link) ---------- */
.pia-eguides__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
  color: var(--pia-purple);      /* = --clr-link-lt */
  font-size: 13px;
  font-weight: 700;
  transition: color .18s ease;
}

/* matches --clr-link-hover-lt, which resolves to the same navy as --pia-navy */
a.pia-eguides__card:hover .pia-eguides__cta { color: var(--pia-navy); }

.pia-eguides__cta-arrow { transition: transform .18s ease; }
a.pia-eguides__card:hover .pia-eguides__cta-arrow { transform: translateX(3px); }
@media (min-width: 768px) {
.pia-eguides__card { 
  width: 50%;
}
}
/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .pia-eguides--cols-3 .pia-eguides__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .pia-eguides { padding: 46px 0 64px; }
  .pia-eguides__head { margin-bottom: 24px; }
  .pia-eguides__title { font-size: 26px; }
  .pia-eguides__intro { font-size: 16px; }
  .pia-eguides--cols-2 .pia-eguides__grid,
  .pia-eguides--cols-3 .pia-eguides__grid { grid-template-columns: 1fr; }
  .pia-eguides__card-title { font-size: 18px; }
}

/* ---------- respect reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .pia-eguides__card,
  .pia-eguides__cover-img,
  .pia-eguides__cta,
  .pia-eguides__cta-arrow { transition: none; }
  a.pia-eguides__card:hover { transform: none; }
  a.pia-eguides__card:hover .pia-eguides__cover-img { transform: none; }
}
