.guide-directory-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #080b0d;
  border-bottom: 4px solid #9b6b29;
}

.guide-directory-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(5, 8, 10, 0.98) 0%, rgba(5, 8, 10, 0.9) 27%, rgba(5, 8, 10, 0.44) 55%, rgba(5, 8, 10, 0.12) 100%),
    linear-gradient(0deg, rgba(5, 8, 10, 0.66) 0%, transparent 46%);
}

.guide-directory-hero__media,
.guide-directory-hero__media img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
}

.guide-directory-hero__media img {
  object-fit: cover;
  object-position: center;
}

.guide-directory-hero__inner {
  display: flex;
  align-items: center;
  min-height: 390px;
  padding-top: clamp(54px, 7vw, 90px);
  padding-bottom: clamp(54px, 7vw, 90px);
}

.guide-directory-hero__copy {
  max-width: 720px;
}

.guide-directory-hero__eyebrow {
  margin: 0 0 14px;
  color: #65d9e8;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.86);
}

.guide-directory-hero h1 {
  max-width: 13ch;
  margin: 0 0 20px;
  color: #fff;
  font-family: var(--font-pixel);
  font-size: clamp(2.45rem, 5vw, 4.8rem);
  line-height: 1.02;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.88);
}

.guide-directory-hero__copy > p:last-child {
  max-width: 680px;
  margin: 0;
  color: #d6dce1;
  font-size: clamp(1rem, 1.55vw, 1.18rem);
  line-height: 1.75;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.84);
}

.guide {
  padding-top: 44px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
}

.guide-section {
  padding: 20px;
}

.guide-section h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

/* Sub-headings inside a section, used by the privacy page to split one
   numbered section into named parts. Sized below h2 so the numbering still
   reads as the top level. */
.guide-section h3 {
  margin: 18px 0 8px;
  font-size: 0.98rem;
}

.guide-section h3:first-of-type {
  margin-top: 0;
}

.guide-section p {
  margin: 0 0 12px;
}

.guide-section p:last-child,
.guide-section ul:last-child {
  margin-bottom: 0;
}

.guide-section ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.guide-section li {
  margin-bottom: 6px;
}

.guide-section code {
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 1px 5px;
  font-family: var(--font-pixel);
  font-size: 0.88em;
  /* pre-wrap keeps the spacing in things like `~ ~1 ~` intact, while
     overflow-wrap lets a long unbroken selector such as
     @e[type=zombie,sort=nearest,limit=1] split rather than push the page
     sideways on a phone. Plain nowrap used to do the former and caused the
     latter. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Block code sits in <pre>, which scrolls itself — it must not inherit the
   wrapping above or the horizontal scroller becomes pointless. */
.guide-section pre code {
  white-space: pre;
  overflow-wrap: normal;
  background: none;
  border: 0;
  padding: 0;
}

/* Callout for caveats and gotchas */
.guide-note {
  background: #f6dfa4;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  color: #5c3a00;
  padding: 10px 12px;
  font-size: 0.88rem;
  margin: 12px 0 0;
}

.guide-note code {
  background: rgba(0, 0, 0, 0.1);
}

/* Tables scroll inside their own container so long rows never push the page
   into horizontal overflow on phones. */
.guide-table-wrap {
  overflow-x: auto;
  margin: 0 0 12px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #d2d2d2;
}

.guide-table th,
.guide-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  vertical-align: top;
}

.guide-table thead th {
  background: var(--mc-deep-raised);
  color: #eef1f3;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.guide-table tbody tr:last-child th,
.guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.guide-table tbody tr:nth-child(even) {
  background: #c6c6c6;
}

/* Guides index: one card per guide, plus the "read next" list every guide
   page ends with. */
.guide-index {
  display: grid;
  /* minmax(0, …) so a long summary cannot push a track past the viewport. */
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.guide-card {
  display: block;
  padding: 18px;
  text-decoration: none;
}

.guide-card h2 {
  margin: 6px 0 8px;
  font-size: 1.05rem;
}

.guide-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.guide-card__level {
  display: inline-block;
  padding: 1px 8px;
  border: 2px solid var(--mc-outline);
  background: var(--mc-deep-raised);
  color: #f4f4f8;
  font-size: 0.72rem;
  font-weight: 700;
}

.guide-more {
  margin: 0;
  padding-left: 20px;
}

.guide-more li {
  margin-bottom: 8px;
}

.guide-more a {
  font-weight: 700;
}

@media (min-width: 761px) {
  .guide-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .guide-directory-hero::after {
    background:
      linear-gradient(0deg, rgba(5, 8, 10, 0.98) 0%, rgba(5, 8, 10, 0.76) 58%, rgba(5, 8, 10, 0.38) 100%),
      linear-gradient(90deg, rgba(5, 8, 10, 0.74) 0%, rgba(5, 8, 10, 0.18) 100%);
  }

  .guide-directory-hero__media img {
    object-position: 68% center;
  }

  .guide-directory-hero__inner {
    align-items: flex-end;
    min-height: 440px;
    padding-top: 104px;
    padding-bottom: 44px;
  }

  .guide-directory-hero h1 {
    max-width: 10ch;
  }

  .guide {
    padding-top: 30px;
    padding-bottom: 48px;
  }
}

@media (max-width: 520px) {
  .guide-directory-hero__media img {
    object-position: 70% center;
  }

  .guide-directory-hero__inner {
    min-height: 420px;
  }
}
