/* Guides — the /guides/ archive, guide cards, "More guides" and the Guides block.
 * Same tokens as content-blocks.css (card = the instant-win prize rows; pill =
 * their "remaining" tag; section titles = .title-medium). */

/* ---- Archive header ------------------------------------------------------- */

.titlebar h1.ep-guides-head__title {
  text-transform: none; /* the titlebar capitalises; a written heading keeps its case */
}

.ep-guides-head__intro {
  max-width: 44rem;
  margin: 0.6rem 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--ep-fs-lg, 1.125rem);
  line-height: 1.6;
}

/* ---- Card ----------------------------------------------------------------- */
/* The competition and winner cards' chrome: white, 16px radius, no border, the
   shared --ep-shadow-card, a square image on top (_shop.scss .otg-winner-card).
   The grid itself is Bootstrap's row/col markup, as on those pages. */

.ep-guide-card {
  height: 100%;
}

.ep-guide-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ep-shadow-card, 0 2px 12px rgba(20, 38, 58, 0.12));
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ep-guide-card__link:hover,
.ep-guide-card__link:focus-visible {
  box-shadow: var(--ep-shadow-lift, 0 2px 4px rgba(20, 38, 58, 0.08), 0 12px 28px rgba(20, 38, 58, 0.1));
  transform: translateY(-2px);
}

.ep-guide-card__link:focus-visible {
  outline: 2px solid var(--ep-violet, #6d28d9);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .ep-guide-card__link { transition: none; }
  .ep-guide-card__link:hover, .ep-guide-card__link:focus-visible { transform: none; }
}

.ep-guide-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--ep-tint, #f4efff);
}

.ep-guide-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ep-guide-card__link:hover .ep-guide-card__img {
  transform: scale(1.03);
}

.ep-guide-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(80% 120% at 80% 0%, rgba(124, 58, 237, 0.35) 0%, rgba(124, 58, 237, 0) 60%),
    var(--ep-band, #1b0b38);
}

.ep-guide-card__placeholder img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}

.ep-guide-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 18px 20px 20px; /* the winner card's body padding */
}

.ep-guide-card__topic {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ep-wash, rgba(109, 40, 217, 0.08));
  color: var(--ep-plum, #5b21b6);
  font-size: var(--ep-fs-2xs, 0.75rem);
  font-weight: 700;
}

/* Two lines reserved, as on the winner cards, so the text below lines up
   across a row of cards whatever the title length. */
.ep-guide-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 2.6em;
  margin: 0;
  color: var(--ep-navy, #14263a);
  font-size: var(--ep-fs-base, 1rem);
  font-weight: 700;
  line-height: 1.3;
}

.ep-guide-card__link:hover .ep-guide-card__title {
  color: var(--ep-violet, #6d28d9);
}

.ep-guide-card__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  margin: 0;
  color: var(--ep-text, #374758);
  font-size: var(--ep-fs-sm, 0.875rem);
  line-height: 1.5;
}

.ep-guide-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  width: 100%;
  margin: auto 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(109, 40, 217, 0.08); /* the winner card's note rule */
  color: var(--ep-muted, #64748b);
  font-size: var(--ep-fs-xs, 0.8125rem);
  font-weight: 600;
}

/* ---- "More guides" on a guide, and the Guides block ----------------------- */

/* Space above only. A `margin` shorthand here reset the space BELOW the
   block too, so the next section (an FAQ panel on a hub) sat flush on it. */
.ep-guides-related,
.ep-guides-block {
  margin-top: 3rem;
}

.ep-guides-related__head,
.ep-guides-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ep-guides-related__head .ep-section-title,
.ep-guides-block__head .ep-section-title {
  margin: 0 !important;
}

.ep-guides-related__all,
.ep-guides-block__all {
  flex: 0 0 auto;
  color: var(--ep-violet, #6d28d9);
  font-size: var(--ep-fs-sm, 0.875rem);
  font-weight: 700;
  text-decoration: none;
}

.ep-guides-related__all:hover,
.ep-guides-block__all:hover {
  color: var(--ep-plum, #5b21b6);
  text-decoration: underline;
}

/* ---- Phones --------------------------------------------------------------- */

@media (max-width: 575.98px) {
  .ep-guides-head {
    padding-top: 1.25rem !important;
    padding-bottom: 1.5rem !important;
  }

  .titlebar h1.ep-guides-head__title {
    margin-top: 0.75rem !important;
    font-size: clamp(1.5rem, 6.6vw, 1.875rem);
    line-height: 1.18;
  }

  .ep-guides-head__intro {
    font-size: 0.9375rem;
  }

  .ep-guide-card__body {
    padding: 16px 18px 18px;
  }

  .ep-guides-related,
  .ep-guides-block {
    margin-top: 2rem;
  }

  .ep-guides-related__all,
  .ep-guides-block__all {
    font-size: var(--ep-fs-xs, 0.8125rem);
  }
}
