/* Public user guide (/huong-dan/**) — layered on top of /styles.css and
   reusing its theme tokens. Pages are generated by
   landing/_build/build-guide.mjs; this file is hand-written. */

.g-main {
  padding-top: 0.5rem;
  padding-bottom: 1rem;
}

.g-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.g-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.g-breadcrumb a:hover {
  color: var(--accent);
}

.g-head {
  padding: 1.5rem 0 2rem;
  max-width: 48rem;
}

.g-head-center {
  margin: 0 auto;
  text-align: center;
}

.g-head h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0.5rem 0 0.75rem;
}

.g-head .lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.g-updated {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--faint);
}

/* ---------- Index cards ---------- */

.g-cards {
  display: grid;
  gap: 1.25rem;
}

.g-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--card-bg);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease;
}

.g-card:hover {
  border-color: var(--accent);
}

.g-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.g-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.g-card ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.g-card-more {
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Guide layout ---------- */

.g-layout {
  display: grid;
  gap: 2rem;
}

.g-toc {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  font-size: 0.9rem;
}

.g-toc-title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

.g-toc-other {
  margin-top: 1.25rem;
}

.g-toc ol,
.g-toc ul {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.g-toc a {
  color: var(--muted);
  text-decoration: none;
}

.g-toc a:hover {
  color: var(--accent);
}

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

.g-section {
  padding: 0 0 2.5rem;
}

/* Clears the sticky top menu (~5.2rem) when jumping to a section;
   matches the specificity of the landing's `main section[id]` so it wins. */
main section.g-section {
  scroll-margin-top: 6.5rem;
}

.g-section + .g-section {
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
}

.g-section h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

.g-anchor {
  text-decoration: none;
  color: inherit;
}

.g-anchor:hover::after {
  content: " #";
  color: var(--faint);
}

.g-summary {
  margin: 0.35rem 0 1.25rem;
  color: var(--muted);
}

.g-section h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
}

.g-section p,
.g-section li {
  line-height: 1.7;
}

.g-section > p {
  margin: 0.75rem 0;
}

.g-steps,
.g-list {
  margin: 0.75rem 0;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.g-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.g-list li::marker {
  color: var(--faint);
}

.g-note {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid;
  font-size: 0.95rem;
}

.g-note-info {
  background: var(--bg-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.g-note-warn {
  background: color-mix(in srgb, #f59e0b 12%, var(--card-bg));
  border-color: color-mix(in srgb, #f59e0b 45%, transparent);
}

.g-figure {
  margin: 1.25rem 0;
}

/* Natural size, only ever scaled down — small crops (the login card) stay
   sharp instead of being stretched to the column width. */
.g-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.08);
}

.g-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.g-faq h3 {
  margin-top: 1.25rem;
}

.g-faq h3 + p {
  margin-top: 0.35rem;
}

.g-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.g-pager a {
  color: var(--accent);
  text-decoration: none;
}

.g-pager-next {
  margin-left: auto;
  text-align: right;
}

.g-cta {
  margin-top: 3rem;
}

/* ---------- Wider screens ---------- */

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

@media (min-width: 960px) {
  .g-head h1 {
    font-size: 2.5rem;
  }

  .g-layout {
    grid-template-columns: 16rem minmax(0, 1fr);
    align-items: start;
  }

  .g-toc {
    position: sticky;
    /* Below the sticky top menu. */
    top: 6.5rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
  }
}

.g-toc summary {
  cursor: pointer;
  list-style: none;
}

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

.g-toc summary::after {
  content: " ▾";
  color: var(--faint);
}

.g-toc[open] summary::after {
  content: " ▴";
}

.g-toc summary .g-toc-title {
  display: inline;
}

@media (min-width: 960px) {
  .g-toc summary {
    pointer-events: none;
  }

  .g-toc summary::after,
  .g-toc[open] summary::after {
    content: none;
  }
}

/* Phones: keep the nav on one row — the guide link and login are
   redundant here (footer has both), the CTA and theme toggle stay. */
@media (max-width: 520px) {
  .nav {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-links .link {
    display: none;
  }

  .g-head h1 {
    font-size: 1.75rem;
  }
}

/* Enlarged screenshot (the lightbox script in each guide page). */
.g-figure a.g-zoom {
  display: inline-block;
  cursor: zoom-in;
}

.g-lightbox {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1rem;
  border: 0;
  background: transparent;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.g-lightbox[open] {
  display: flex;
}

.g-lightbox::backdrop {
  background: rgb(15 23 42 / 0.85);
}

.g-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.4);
  background: #fff;
}

.g-lightbox-close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.g-lightbox-close:hover {
  background: rgb(255 255 255 / 0.3);
}

/* ---------- Legal pages (terms, privacy) ---------- */

.g-legal {
  max-width: 48rem;
}

.g-legal .g-section {
  padding-bottom: 1.75rem;
}

.g-legal .g-section + .g-section {
  padding-top: 1.75rem;
}

.g-legal .g-section h2 {
  font-size: 1.25rem;
}
