/* Guide Center — extends site brand tokens from styles.css */

.guide-body {
  --guide-max: 1120px;
  --guide-rail: 240px;
}

.guide-nav-extra {
  display: none;
}

@media (min-width: 900px) {
  .guide-nav-extra {
    display: inline;
  }
}

/* —— Guide home —— */
.guide-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(72vh, 580px);
  display: grid;
  align-items: end;
  color: var(--sand);
}

.guide-hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.guide-hero-media picture,
.guide-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.guide-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(8, 32, 30, 0.8) 0%, rgba(12, 61, 58, 0.5) 45%, rgba(10, 35, 33, 0.28) 100%),
    linear-gradient(180deg, rgba(8, 32, 30, 0.28) 0%, transparent 30%, rgba(8, 32, 30, 0.82) 100%);
}

.guide-hero-copy {
  width: min(var(--guide-max), calc(100% - 2rem));
  margin: 0 auto 2.75rem;
  padding-top: 5.5rem;
}

.guide-hero-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
  max-width: 12ch;
}

.guide-hero-copy .lede {
  margin: 0.9rem 0 0;
  max-width: 36rem;
  color: rgba(242, 230, 212, 0.92);
  font-size: 1.1rem;
}

.guide-search {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.6rem;
  max-width: 34rem;
}

.guide-search input {
  flex: 1;
  min-height: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(242, 230, 212, 0.28);
  background: rgba(255, 250, 243, 0.12);
  color: var(--sand);
  padding: 0.75rem 1.15rem;
  font: inherit;
  outline: none;
}

.guide-search input::placeholder {
  color: rgba(242, 230, 212, 0.65);
}

.guide-search input:focus {
  border-color: var(--sunset-hot);
  background: rgba(255, 250, 243, 0.18);
}

.guide-search button {
  border: 0;
  border-radius: 999px;
  background: var(--sunset);
  color: #1a120c;
  font-weight: 700;
  padding: 0 1.2rem;
  cursor: pointer;
}

.guide-section {
  width: min(var(--guide-max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.5rem 0 0;
}

.guide-section h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.guide-section > .section-note {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

.category-grid,
.card-grid {
  display: grid;
  gap: 1rem;
}

.category-card,
.guide-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card {
  padding: 1.25rem 1.3rem;
}

.category-card:hover,
.guide-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 99, 94, 0.35);
}

.category-card h3,
.guide-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.category-card p,
.guide-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.guide-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.guide-card .card-body {
  padding: 1rem 1.15rem 1.2rem;
}

.guide-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lagoon-mid);
}

.search-empty {
  display: none;
  color: var(--muted);
  padding: 1rem 0 2rem;
}

.search-empty.is-visible {
  display: block;
}

@media (min-width: 720px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-grid .category-card:nth-child(4),
  .category-grid .category-card:nth-child(5) {
    grid-column: span 1;
  }

  .card-grid.featured {
    grid-template-columns: repeat(4, 1fr);
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* —— Article layout —— */
.article-shell {
  width: min(var(--guide-max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3.5rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.breadcrumb a {
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb span[aria-hidden="true"] {
  opacity: 0.5;
}

.article-layout {
  display: grid;
  gap: 1.5rem;
}

.article-main {
  min-width: 0;
}

.article-kicker {
  margin: 0 0 0.5rem;
  color: var(--sunset);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-main > h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.article-updated {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-lede {
  margin: 1rem 0 0;
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 44rem;
}

.article-hero {
  margin: 1.4rem 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.article-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-hero figcaption {
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.toc-mobile {
  margin-top: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.toc-mobile summary {
  cursor: pointer;
  list-style: none;
  padding: 0.9rem 1rem;
  font-family: var(--font-display);
  font-weight: 700;
}

.toc-mobile summary::-webkit-details-marker {
  display: none;
}

.toc-mobile nav {
  display: grid;
  gap: 0.45rem;
  padding: 0 1rem 1rem;
}

.toc-mobile a,
.toc-rail a {
  text-decoration: none;
  color: var(--lagoon-mid);
  font-weight: 600;
  font-size: 0.92rem;
}

.toc-rail {
  display: none;
}

.article-body {
  margin-top: 1.75rem;
}

.article-body h2 {
  margin: 2rem 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  scroll-margin-top: 5rem;
}

.article-body h3 {
  margin: 1.35rem 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  scroll-margin-top: 5rem;
}

.article-body p,
.article-body li {
  color: var(--muted);
}

.article-body p {
  margin: 0 0 1rem;
  max-width: 46rem;
}

.article-body ol,
.article-body ul {
  margin: 0 0 1.1rem;
  padding-left: 1.2rem;
  max-width: 46rem;
}

.article-body li + li {
  margin-top: 0.4rem;
}

.article-body .callout {
  margin: 1.2rem 0;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px solid rgba(20, 99, 94, 0.28);
  background: linear-gradient(145deg, rgba(31, 138, 130, 0.1), rgba(255, 255, 255, 0.65));
  max-width: 46rem;
}

.article-body .callout strong {
  color: var(--ink);
}

.article-body .warn {
  border-color: rgba(227, 107, 44, 0.3);
  background: linear-gradient(160deg, rgba(227, 107, 44, 0.12), rgba(255, 255, 255, 0.65));
}

.related,
.article-pager {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.related h2,
.article-pager-label {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.related-grid {
  display: grid;
  gap: 0.75rem;
}

.related-grid a {
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.related-grid a span {
  display: block;
  margin-top: 0.25rem;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.92rem;
}

.article-pager {
  display: grid;
  gap: 0.75rem;
}

.article-pager a {
  text-decoration: none;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
}

.article-pager a strong {
  display: block;
  font-family: var(--font-display);
  margin-top: 0.2rem;
}

.article-pager .dir {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lagoon-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (min-width: 720px) {
  .related-grid,
  .article-pager {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .toc-mobile {
    display: none;
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr) var(--guide-rail);
    align-items: start;
    gap: 2rem;
  }

  .toc-rail {
    display: block;
    position: sticky;
    top: 5.2rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
  }

  .toc-rail h2 {
    margin: 0 0 0.7rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
  }

  .toc-rail nav {
    display: grid;
    gap: 0.5rem;
  }

  .toc-rail a.is-active {
    color: var(--sunset);
  }
}

.guide-home-cta {
  margin: 3.5rem auto 1rem;
  width: min(var(--guide-max), calc(100% - 2rem));
  text-align: center;
  padding: 2rem 1rem 0.5rem;
}

.guide-home-cta h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.guide-home-cta p {
  margin: 0.6rem auto 1.2rem;
  color: var(--muted);
  max-width: 34rem;
}
