/* Homepage editorial guides V2. Source-owned while authored frontend source is absent. */

.guides-v2 {
  padding: clamp(3rem, 6vw, 5.25rem) 1rem;
  background: var(--color-page-bg, #fffaf2);
}

.guides-v2-inner {
  width: min(100%, 72rem);
  margin-inline: auto;
}

.guides-v2-head {
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.guides-v2-heading {
  max-width: 45rem;
}

.guides-v2-eyebrow {
  margin: 0 0 .5rem;
  color: #d97706;
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .15em;
}

html[lang="fa"] .guides-v2-eyebrow {
  letter-spacing: 0;
}

.guides-v2-title {
  margin: 0;
  color: #111827;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 850;
  line-height: 1.14;
  letter-spacing: -.025em;
}

html[lang="fa"] .guides-v2-title {
  letter-spacing: 0;
}

.guides-v2-intro {
  max-width: 42rem;
  margin: .8rem 0 0;
  color: #6b7280;
  font-size: .96rem;
  line-height: 1.8;
}

.guides-v2-all {
  flex: 0 0 auto;
  min-height: 2.8rem;
  padding: .68rem .95rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid rgb(217 119 6 / 20%);
  border-radius: .9rem;
  color: #b45309;
  font-size: .84rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.guides-v2-all:hover {
  transform: translateY(-1px);
  border-color: rgb(217 119 6 / 38%);
  background: rgb(255 251 235 / 72%);
  color: #92400e;
}

.guides-v2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Image-first editorial card: the artwork stays full-bleed and the text sits
 * on a controlled bottom scrim. This keeps the custom guide artwork visible
 * instead of shrinking it to a narrow side column. */
.guides-v2-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 20rem;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: block;
  border: 1px solid rgb(15 23 42 / 10%);
  border-radius: 1.25rem;
  background: #111827;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 12px 30px rgb(15 23 42 / 7%);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.guides-v2-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgb(7 10 16 / 2%) 0%,
    rgb(7 10 16 / 10%) 38%,
    rgb(7 10 16 / 62%) 68%,
    rgb(7 10 16 / 94%) 100%
  );
}

.guides-v2-card:hover {
  transform: translateY(-2px);
  border-color: rgb(217 119 6 / 34%);
  box-shadow: 0 18px 38px rgb(15 23 42 / 12%);
}

.guides-v2-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  display: block;
  background: #e5e7eb;
}

.guides-v2-media img,
.guides-v2-image-fallback {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.guides-v2-media img {
  transition: transform .32s ease;
}

.guides-v2-card:hover .guides-v2-media img {
  transform: scale(1.025);
}

.guides-v2-image-fallback {
  background: #d1d5db;
}

.guides-v2-body {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  min-width: 0;
  padding: clamp(1.05rem, 2vw, 1.45rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

html[lang="fa"] .guides-v2-body {
  align-items: flex-end;
  text-align: right;
}

.guides-v2-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  color: rgb(255 255 255 / 76%);
  font-size: .72rem;
  font-weight: 750;
  text-shadow: 0 1px 10px rgb(0 0 0 / 28%);
}

.guides-v2-kind {
  padding: .3rem .52rem;
  border: 1px solid rgb(245 158 11 / 34%);
  border-radius: 9999px;
  background: rgb(17 24 39 / 72%);
  color: #fbbf24;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.guides-v2-category::before {
  content: "·";
  margin-inline-end: .45rem;
}

.guides-v2-card-title {
  max-width: 34rem;
  margin-top: .72rem;
  color: #ffffff;
  font-size: clamp(1.08rem, 1.7vw, 1.34rem);
  font-weight: 850;
  line-height: 1.48;
  text-shadow: 0 2px 18px rgb(0 0 0 / 48%);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.guides-v2-read {
  margin-top: .85rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #fbbf24;
  font-size: .8rem;
  font-weight: 850;
  text-shadow: 0 1px 10px rgb(0 0 0 / 32%);
}

.guides-v2-all:focus-visible,
.guides-v2-card:focus-visible {
  outline: 2px solid #d97706;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .guides-v2-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .guides-v2-card {
    min-height: 18rem;
    aspect-ratio: 16 / 8;
  }
}

@media (max-width: 767px) {
  .guides-v2 {
    padding: 2.75rem 1rem;
  }

  .guides-v2-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .guides-v2-title {
    font-size: 2rem;
  }

  .guides-v2-intro {
    margin-top: .65rem;
    font-size: .91rem;
  }

  .guides-v2-all {
    min-height: 2.65rem;
    padding: .62rem .85rem;
  }

  .guides-v2-grid {
    gap: .9rem;
  }

  .guides-v2-card {
    min-height: 19rem;
    aspect-ratio: 4 / 3;
    border-radius: 1.05rem;
  }

  .guides-v2-body {
    padding: 1rem;
  }

  .guides-v2-card-title {
    margin-top: .62rem;
    font-size: 1.05rem;
    -webkit-line-clamp: 2;
  }

  .guides-v2-read {
    margin-top: .7rem;
  }
}

@media (prefers-color-scheme: dark) {
  .guides-v2 {
    background: var(--color-page-bg, #101010);
  }

  .guides-v2-title {
    color: #f5f5f5;
  }

  .guides-v2-intro {
    color: #a3a3a3;
  }

  .guides-v2-all {
    border-color: rgb(245 158 11 / 22%);
    color: #f59e0b;
  }

  .guides-v2-all:hover {
    border-color: rgb(245 158 11 / 38%);
    background: #1c1811;
    color: #fbbf24;
  }

  .guides-v2-card {
    border-color: rgb(255 255 255 / 9%);
    background: #181818;
    box-shadow: 0 12px 30px rgb(0 0 0 / 14%);
  }

  .guides-v2-card:hover {
    border-color: rgb(245 158 11 / 30%);
    box-shadow: 0 18px 38px rgb(0 0 0 / 24%);
  }

  .guides-v2-media,
  .guides-v2-image-fallback {
    background: #202020;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guides-v2-all,
  .guides-v2-card,
  .guides-v2-media img {
    transition: none;
  }

  .guides-v2-all:hover,
  .guides-v2-card:hover,
  .guides-v2-card:hover .guides-v2-media img {
    transform: none;
  }
}
