.gc {
  padding-block: 56px 40px;
  scroll-margin-top: 80px;
  color: var(--sb-color-ink);
  background: var(--sb-color-yellow);
}

.gc-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.gc-heading h2 {
  margin: 18px 0 0;
  font-size: var(--sb-type-section-title);
  line-height: 1.45;
  letter-spacing: .025em;
}

.gc-intro {
  margin: 0 0 3px;
  font-size: var(--sb-type-detail);
  line-height: 1.9;
}

.gc-sheet {
  padding: 24px 40px 28px;
  background: var(--sb-surface-paper);
  border-top: 4px solid var(--sb-color-blue);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.gc-sheet-heading {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--sb-border-warm);
}

.gc-sample-code {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  color: var(--sb-color-blue);
  font-size: var(--sb-type-detail);
}

.gc-sample-code strong {
  font-size: var(--sb-type-body);
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.gc-sheet-heading h3 {
  margin: 0;
  font-size: var(--sb-type-body);
  line-height: 1.7;
}

.gc-diagram {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  column-gap: 104px;
  max-width: 800px;
  margin: 28px auto 24px;
}

.gc-figure {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 0;
  margin: 0;
}

/* 旗の絵は仕上がりの形で見せる。型紙（--gd-mask）は見本のページ全体に置いた型ごとの共通の部品 */
.gc .gc-art {
  display: block;
  width: auto;
  height: 390px;
  max-width: 100%;
  object-fit: contain;
  mask: var(--gd-mask) center / contain no-repeat;
}

.gc-figure figcaption {
  color: var(--sb-text-muted);
  font-size: var(--sb-type-detail);
  line-height: 1.65;
  text-align: center;
}

.gc-figure figcaption span {
  font-weight: 700;
}

.gc-notes {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gc-note {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;
  min-height: 56px;
  background: var(--sb-surface-paper);
}

.gc-number {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 34px;
  color: var(--sb-color-blue);
  background: var(--sb-color-yellow);
  border: 2px solid var(--sb-color-blue);
  font-size: var(--sb-type-detail);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.gc-note h4 {
  margin: 3px 0 6px;
  color: var(--sb-color-blue);
  font-size: var(--sb-type-body);
  line-height: 1.6;
}

.gc-note p {
  margin: 0;
  font-size: var(--sb-type-detail);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.gc-guides {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.gc-guides path {
  fill: none;
  stroke: var(--sb-color-blue);
  stroke-width: var(--sb-action-icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gc-guides circle {
  fill: var(--sb-surface-paper);
  stroke: var(--sb-color-blue);
  stroke-width: var(--sb-action-icon-stroke);
}

.gc-notes[data-gc-placed] {
  display: block;
}

.gc-notes[data-gc-placed] .gc-note {
  position: absolute;
  inset-inline: 0;
}

.gc-consult {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--sb-border-warm);
}

.gc-consult strong {
  font-size: var(--sb-type-body);
}

.gc-consult p {
  margin: 6px 0 0;
  font-size: var(--sb-type-detail);
  line-height: 1.8;
}

.gc-consult-button {
  --sb-button-bg: var(--sb-color-yellow);
  --sb-button-ink: var(--sb-color-ink);
  --sb-button-line: var(--sb-color-ink);
  flex-shrink: 0;
}

.gc-support {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 28px;
  margin-top: 20px;
}

.gc-size p {
  margin: 0;
  font-size: var(--sb-type-detail);
  line-height: 1.8;
}

.gc-size p span {
  margin-left: 1em;
}

.gc-size > div {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
}

.gc-support a,
.gc-other-options summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: var(--sb-control-min-height);
  color: var(--sb-color-ink);
  font-size: var(--sb-type-detail);
  font-weight: 700;
  line-height: 1.65;
}

.gc-support a:focus-visible,
.gc-other-options summary:focus-visible {
  outline: var(--sb-control-focus-width) solid var(--sb-color-blue);
  outline-offset: var(--sb-control-focus-offset);
}

.gc-example {
  border-bottom: 1px solid currentColor;
}

.gc-other-options {
  grid-column: 1 / -1;
  border-top: 1px solid var(--sb-color-ink);
}

.gc-other-options summary {
  cursor: pointer;
  list-style: none;
}

.gc-other-options summary::-webkit-details-marker {
  display: none;
}

.gc-other-options > a {
  display: flex;
  max-width: 470px;
}

@media (max-width: 800px) {
  .gc {
    padding-block: 36px 28px;
  }

  .gc-heading {
    display: block;
    margin-bottom: 22px;
  }

  .gc-heading h2 {
    margin-top: 18px;
    font-size: var(--sb-type-section-title-mobile);
  }

  .gc-intro {
    margin-top: 14px;
  }

  .gc-intro br {
    display: none;
  }

  .gc-sheet {
    padding: 18px 20px 26px;
  }

  .gc-sheet-heading {
    align-items: start;
    flex-direction: column;
    gap: 7px;
    padding-bottom: 14px;
  }

  .gc-diagram {
    grid-template-columns: minmax(0, .7fr) minmax(0, 1fr);
    column-gap: 42px;
    margin-block: 24px;
  }

  .gc .gc-art {
    width: 100%;
    height: auto;
    max-height: 390px;
  }

  .gc-figure figcaption {
    font-size: var(--sb-type-detail);
  }

  .gc-notes {
    gap: 12px;
  }

  .gc-note {
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 10px;
    min-height: 56px;
  }

  .gc-number {
    height: 28px;
    font-size: var(--sb-type-detail);
  }

  .gc-note h4 {
    margin: 1px 0 5px;
    font-size: var(--sb-type-detail);
  }

  .gc-note p {
    font-size: var(--sb-type-detail);
    line-height: 1.7;
  }

  .gc-consult {
    display: grid;
    gap: 16px;
    padding-top: 18px;
  }

  .gc-consult-button {
    width: 100%;
  }

  .gc-support {
    display: block;
    margin-top: 16px;
  }

  .gc-size p span {
    display: block;
    margin-left: 0;
  }

  .gc-example {
    margin: 3px 0 16px;
  }
}

@media (max-width: 420px) {
  .gc-sheet {
    padding-inline: 14px;
  }

  .gc-diagram {
    grid-template-columns: 76px minmax(0, 1fr);
    column-gap: 28px;
  }

  .gc-note {
    gap: 5px 8px;
  }

  .gc-note > div {
    display: contents;
  }

  .gc-note h4 {
    grid-column: 2;
    margin-top: 0;
  }

  .gc-note p {
    grid-column: 1 / -1;
  }
}
