/* Plum & Kite · Invitation Guide */

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
}

.help-header > a:last-child {
  color: var(--plum);
  font-weight: 700;
}

.help-page {
  padding: 32px 0 100px;
}

.help-hero {
  max-width: 850px;
  margin: 0 auto 72px;
  text-align: center;
}

.help-hero h1 {
  margin: 12px 0 20px;
  color: var(--plum);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  line-height: 1.1;
}

.help-hero > p:not(.eyebrow) {
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 1.1rem;
  line-height: 1.7;
}

.help-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  gap: clamp(28px, 5vw, 64px);
}

.help-toc {
  position: sticky;
  top: 125px;
  display: grid;
  gap: 4px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.help-toc h2 {
  margin: 0 0 14px;
  color: var(--plum);
  font-size: 1.05rem;
}

.help-toc a {
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.help-toc a:hover,
.help-toc a:focus-visible {
  background: var(--light-lime);
}

.help-content {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.help-chapter {
  padding: clamp(26px, 4vw, 42px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  scroll-margin-top: 32px;
}

.help-chapter h2 {
  margin: 0 0 28px;
  color: var(--plum);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.2;
}

.help-topic + .help-topic {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.help-topic h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

.help-topic p {
  margin: 0;
  line-height: 1.8;
}

.help-steps {
  display: grid;
  gap: 16px;
  margin: 0;
  padding-left: 25px;
  line-height: 1.7;
}

.help-steps li {
  padding-left: 8px;
}

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

@media (max-width: 850px) {
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-toc h2 {
    grid-column: 1 / -1;
  }

  .help-hero {
    margin-bottom: 44px;
  }
}

@media (max-width: 520px) {
  .help-header .brand-logo {
    width: 155px;
  }

  .help-header > a:last-child {
    font-size: 0.85rem;
  }

  .help-toc {
    grid-template-columns: 1fr;
  }

  .help-chapter {
    padding: 24px 20px;
  }
}

/* Invitation guide: customer support */
.help-support {
  padding: clamp(28px, 4vw, 44px);
  background: linear-gradient(135deg, var(--light-lime), var(--ivory));
  border: 1px solid var(--line);
  border-radius: 24px;
}

.help-support h2 {
  margin: 10px 0 16px;
  color: var(--plum);
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.2;
}

.help-support > p:not(.eyebrow) {
  max-width: 600px;
  margin: 0 0 24px;
  line-height: 1.75;
}

.help-support .button {
  display: inline-flex;
  max-width: 100%;
}

@media (max-width: 520px) {
  .help-support .button {
    width: 100%;
  }
}

/* Invitation guide: editor screenshots */
.help-screenshots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.help-screenshot {
  min-width: 0;
  margin: 0;
  padding: 14px;
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.help-screenshot a {
  display: block;
  overflow: hidden;
  border-radius: 10px;
}

.help-screenshot a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.help-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.help-screenshot figcaption {
  margin-top: 12px;
  color: var(--plum);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 600px) {
  .help-screenshots {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .help-screenshot {
    max-width: 440px;
    margin-inline: auto;
  }
}

/* Active chapter in sticky table of contents */
.help-toc a.is-active {
  background: var(--light-lime);
  color: var(--plum);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--plum);
}

.help-chapter {
  scroll-margin-top: 140px;
}

@media (max-width: 850px) {
  .help-chapter {
    scroll-margin-top: 28px;
  }
}

/* Invitation guide: screenshot lightbox */
.help-lightbox {
  width: min(960px, calc(100% - 32px));
  max-width: 960px;
  max-height: 92dvh;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}

.help-lightbox::backdrop {
  background: rgba(24, 24, 24, 0.78);
  backdrop-filter: blur(5px);
}

.help-lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px 20px;
}

.help-lightbox-inner img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 65dvh;
  object-fit: contain;
  border-radius: 10px;
}

.help-lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--light-lime);
  color: var(--plum);
  font-size: 1.5rem;
  cursor: pointer;
}

.help-lightbox-caption {
  margin: 0;
  text-align: center;
  color: var(--plum);
  font-size: 0.9rem;
}

.help-lightbox-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.help-lightbox-controls button {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ivory);
  color: var(--plum);
  font-weight: 700;
  cursor: pointer;
}

.help-lightbox button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .help-lightbox-inner {
    padding: 48px 12px 16px;
  }

  .help-lightbox-inner img {
    max-height: 60dvh;
  }
}

/* Lightbox refinements */
.help-lightbox {
  width: min(1100px, calc(100% - 24px));
  max-width: 1100px;
  max-height: 96dvh;
}

.help-lightbox-inner {
  padding: 16px 16px 14px;
}

.help-lightbox-inner img {
  max-height: 78dvh;
  max-width: 100%;
}

.help-lightbox-close {
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

@media (max-width: 600px) {
  .help-lightbox-inner {
    padding: 48px 8px 12px;
  }

  .help-lightbox-inner img {
    max-height: 72dvh;
  }
}

/* Lightbox: actual-size zoom */
.help-lightbox.is-zoomed .help-lightbox-inner {
  max-height: 96dvh;
  overflow: auto;
}

.help-lightbox.is-zoomed img {
  width: max-content;
  max-width: none;
  max-height: none;
  object-fit: initial;
}

.help-lightbox-zoom[aria-pressed="true"] {
  background: var(--light-lime);
  border-color: var(--plum);
}

@media (max-width: 600px) {
  .help-lightbox-controls {
    flex-wrap: wrap;
  }
}

/* Screenshots placed directly below instructions */
.help-inline-screenshot {
  width: 100%;
  max-width: 640px;
  margin: 22px 0 6px;
  padding: 14px;
}

.help-inline-screenshot img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.help-inline-screenshot figcaption {
  margin-top: 12px;
}

@media (max-width: 600px) {
  .help-inline-screenshot {
    max-width: 100%;
    margin-top: 18px;
    padding: 10px;
  }
}

/* Keep wide screenshots fully visible inside the lightbox */
.help-lightbox {
  position: fixed;
  overflow: hidden;
}

.help-lightbox-inner {
  max-height: 96dvh;
  overflow: auto;
  scrollbar-width: thin;
}

.help-lightbox-inner img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72dvh;
  object-fit: contain;
}

.help-lightbox.is-zoomed .help-lightbox-inner {
  overflow: auto;
}

.help-lightbox.is-zoomed img {
  width: auto;
  max-width: 100%;
  max-height: 72dvh;
  object-fit: contain;
}

/* Keep close button fixed above scrollable content */
.help-lightbox-close {
  position: fixed;
  z-index: 100;
  top: max(16px, 3dvh);
  right: max(16px, calc((100vw - 1100px) / 2 + 16px));
}

@media (max-width: 600px) {
  .help-lightbox-close {
    right: 20px;
    top: 20px;
  }
}

/* Lightbox: separate fit-to-screen and actual-size modes */
.help-lightbox:not(.is-zoomed) .help-lightbox-inner img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 72dvh;
  object-fit: contain;
}

.help-lightbox.is-zoomed .help-lightbox-inner {
  display: block;
  max-height: 96dvh;
  overflow: auto;
  text-align: center;
}

.help-lightbox.is-zoomed .help-lightbox-inner img {
  display: block;
  width: max-content;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0 auto;
  object-fit: initial;
}

.help-lightbox.is-zoomed .help-lightbox-caption,
.help-lightbox.is-zoomed .help-lightbox-controls {
  position: sticky;
  left: 0;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Lightbox: spacing and navigation refinement */
.help-lightbox-inner {
  padding-bottom: 24px;
}

.help-lightbox-caption {
  margin: 16px auto 8px;
  padding: 0 16px;
  text-align: center;
  line-height: 1.5;
}

.help-lightbox-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 4px;
}

.help-lightbox.is-zoomed .help-lightbox-caption {
  margin-top: 24px;
}

.help-lightbox.is-zoomed .help-lightbox-controls {
  margin-top: 8px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .help-lightbox-inner {
    padding-bottom: 20px;
  }

  .help-lightbox-controls {
    gap: 8px;
  }
}
