/* Better StudyPlace — Guide & Tutorials Page (guide.html)
   Clean GitHub/Handbook documentation layout in Option C Cobalt-on-Sand palette.
*/

.gd-shell {
  padding-block: clamp(1.75rem, 3.5vw, 3rem) clamp(4rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(1.75rem, 3vw, 2.75rem);
  align-items: start;
  max-width: 1200px;
}

.gd-main-col {
  min-width: 0;
}

.gd-toc-desktop {
  position: sticky;
  top: 5.5rem;
  background: var(--paper);
  padding: 1.35rem 1.25rem;
}

.gd-toc-title {
  font-size: var(--step-body);
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: var(--ink);
}

.gd-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gd-toc-list a {
  display: block;
  padding: 0.42rem 0.65rem;
  text-decoration: none;
  font-size: var(--step-small);
  color: var(--muted);
  transition: background-color 140ms ease, color 140ms ease;
}

.gd-toc-list a:hover {
  background: var(--bg);
  color: var(--ink);
}

.gd-toc-list a.is-active {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.gd-toc-mobile {
  display: none;
  background: var(--paper);
  padding: 0.9rem 1.15rem;
  margin-bottom: 1.25rem;
}

.gd-toc-mobile summary {
  font-weight: 600;
  font-size: var(--step-body);
  cursor: pointer;
}

.gd-toc-mobile ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.35rem 0.75rem;
}

.gd-toc-mobile a {
  display: block;
  padding: 0.35rem 0;
  font-size: var(--step-small);
  text-decoration: none;
  color: var(--ink);
}

/* Main Reading Sheet */
.gd-article {
  background: var(--paper);
  padding: clamp(1.4rem, 3vw, 2.5rem);
  min-width: 0;
}

.gd-article p,
.gd-hero .lead {
  max-width: 68ch;
}

.gd-hero {
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.gd-hero h1 {
  margin-bottom: 0.9rem;
}

.gd-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  margin-top: 1.35rem;
}

.gd-section + .gd-section {
  margin-top: clamp(3rem, 5.5vw, 4.25rem);
}

.gd-section h2 {
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.gd-section h3 {
  font-size: clamp(1.2rem, 1.5vw, 1.4rem);
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.gd-steps {
  margin: 1rem 0 1.5rem;
  padding-left: 1.35rem;
  max-width: 66ch;
}

.gd-steps li + li {
  margin-top: 0.5rem;
}

.gd-callout {
  background: var(--bg);
  color: var(--ink);
  padding: 1rem 1.2rem;
  margin-block: 1.25rem 1.65rem;
  max-width: 100%;
}

.gd-callout strong {
  display: block;
  margin-bottom: 0.25rem;
}

.gd-figure {
  margin-top: 1.35rem;
  max-width: 100%;
  background: var(--bg);
  padding: 0.65rem;
}

.gd-figure img {
  width: 100%;
  display: block;
}

.gd-figure-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.gd-caption {
  margin-top: 0.6rem;
  font-size: var(--step-small);
  color: var(--muted);
}

/* Clean Reference Tables */
.gd-table-wrap {
  width: 100%;
  margin-block: 1.25rem 1.65rem;
}

.gd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
  background: var(--paper);
}

.gd-table th,
.gd-table td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(6, 43, 138, 0.2);
  vertical-align: top;
}

.gd-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 1024px) {
  .gd-shell {
    grid-template-columns: 1fr;
  }
  .gd-toc-desktop {
    display: none;
  }
  .gd-toc-mobile {
    display: block;
  }
}

@media (max-width: 640px) {
  .gd-figure-pair {
    grid-template-columns: 1fr;
  }
  .gd-table th,
  .gd-table td {
    padding: 0.45rem 0.4rem;
    font-size: 0.8125rem;
    overflow-wrap: break-word;
    word-break: normal;
  }
}
