/* ===== Product page base ===== */
body.pp-body--footer-bg {
  &::after {
    background: url(/assets@photopuzzle/img/bg/bg-footer.webp) no-repeat center bottom;
  }
}
html[lang="en"] {
  .pp-hero-copy__title {
    line-height: 1;
    margin-bottom: 16px;
  }
}
body {
  background: url(/assets@photopuzzle/img/bg/bg-header.webp) no-repeat center top;
  background-size: 100% auto;
  background-attachment: scroll;
  @media (min-width: 961px) {
    background-attachment: fixed;
  }
  &:after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 600px;
    z-index: -1;
    background-size: 100% auto;
    background-attachment: scroll;
    cursor: default;
    pointer-events: none;
    @media (min-width: 961px) {
      background-attachment: fixed;
    }
  }
}


/* ===== Layout ===== */
.pp-container {
  width: 100%;
  max-width: var(--container-max);
  padding: 0 16px;
  margin-inline: auto;
  @media (max-width: 768px) {
    max-width: 480px;
  }
}

/* ===== Page head (contact, terms, privacy, etc.) ===== */
.pp-page-head {
  padding: 56px 0;
  text-align: center;
  @media (max-width: 768px) {
    padding: 40px 0;
  }
  .pp-page-head__inner {
    max-width: var(--container-max);
    width: 100%;
    padding-inline: 16px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .pp-page-head__title {
    font-size: var(--fs-3xl);
    font-weight: var(--weight-bold);
    line-height: 1.2;
    @media (max-width: 960px) {
      font-size: var(--fs-30);
    }
    @media (max-width: 768px) {
      font-size: var(--fs-2xl);
    }
  }
  .pp-page-head__lead {
    max-width: 560px;
    margin-inline: auto;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.9;
  }
}


/* ===== Shared section head ===== */
.pp-section-head {
  color: var(--text-primary);
  text-align: center;
}
.pp-section-head__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px;
  border-radius: var(--r-pill);
  background: var(--c-mint-soft);
  color: var(--c-mint);
  font-size: clamp(var(--fs-sm), 0.5vw + var(--fs-xs), var(--fs-md));
  font-weight: var(--weight-extra-bold);
  line-height: 1.2;
  margin-bottom: 0;
  @media (max-width: 768px) {
    padding: 8px 24px;
  }
  + .pp-section-head__title {
    margin-top: clamp(var(--fs-xs), 0.5vw + 8px, var(--fs-md));
  }
}
.pp-section-head__eyebrow--download {
  background: var(--pp-mint-soft);
  color: var(--pp-mint-base);
}
.pp-section-head__title {
  font-size: clamp(var(--fs-2xl), 2vw + var(--fs-md), var(--fs-5xl));
  font-weight: var(--weight-extra-bold);
  line-height: 1.3;
  .pp-section-head__title-accent {
    color: var(--c-mint);
  }
  + .pp-section-head__lead {
    margin-top: clamp(var(--fs-sm), 0.5vw + 8px, var(--fs-md));
  }
}
.pp-section-head__lead {
  font-size: clamp(var(--fs-sm), 0.5vw + var(--fs-xs), var(--fs-md));
  font-weight: var(--weight-medium);
  line-height: 1.8;
  margin-bottom: 0;
  @media (max-width: 768px) {
    font-size: clamp(var(--fs-xs), 0.5vw + var(--fs-sm), var(--fs-sm));
    br {
      display: none;
    }
  }
}


/* ===== Shared store CTA ===== */
.pp-store-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  @media (max-width: 960px) {
    justify-content: center;
    margin-inline: auto;
  }
  @media (max-width: 480px) {
    width: 100%;
    flex-wrap: nowrap;
    > [data-store-download-button] {
      width: 0;
      flex: 1 1 0;
    }
  }
}
.pp-store-cta--center {
  justify-content: center;
  width: 100%;
}

/* ===== Site Header ===== */
.pp-header {
  position: sticky;
  top: 0;
  z-index: 50;
}
.pp-header__inner {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  @media screen and (max-width: 1200px) {
    padding: 24px 16px;
  }
  @media screen and (max-width: 1024px) {
    padding: 8px 16px;
  }
}
.pp-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  img {
    object-fit: contain;
    @media screen and (max-width: 768px) {
      height: 24px;
      width: auto;
    }
  }
}
.pp-header__right {
  display: flex;
  align-items: center;
  margin-left: auto;
  @media screen and (max-width: 1024px) {
    display: none;
  }
}
.pp-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  @media screen and (max-width: 1200px) {
    gap: 16px;
  }
  a {
    color: var(--text-primary);
    font-weight: var(--weight-bold);
    line-height: 1.55;
    white-space: nowrap;
    text-decoration: none !important;
    position: relative;
    &:hover {
      color: var(--c-mint-deep);
    }
  }
  .pp-header__download {
    font-size: var(--fs-md);
    font-weight: var(--weight-bold);
    background: var(--c-mint);
    color: var(--text-inverse);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 24px;
    text-decoration: none;
    border-radius: var(--r-sm);
    &:hover {
      transform: translateY(2px);
      color: var(--text-inverse);
      &:after {
        display: none;
      }
    }
    span {
      text-decoration: none !important;
    }
    img {
      width: 16px;
      height: 16px;
      filter: brightness(0) invert(1);
    }
  }
}
.pp-hamburger {
  display: none;
  border-radius: var(--r-md);
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  cursor: pointer;
  flex-shrink: 0;
  @media (max-width: 1024px) {
    display: inline-flex;
  }
}
/* ===== Mobile nav drawer (controlled by the Photo Puzzle site script) ===== */
.pp-mobile-nav {
  position: fixed;
  inset: 0;
  background: var(--overlay-dark);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  justify-content: flex-end;
  &.pp-mobile-nav--open {
    opacity: 1;
    pointer-events: auto;
    .pp-mobile-nav__panel {
      transform: translateX(0);
    }
  }
}
.pp-mobile-nav__panel {
  width: min(90%, 360px);
  background: var(--bg-base);
  padding: 8px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-drawer);
  .pp-nav-list {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .pp-nav-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px dashed var(--pp-mint-base);
    text-decoration: none !important;
    color: var(--text-primary);
    &:last-child {
      border-bottom: none;
    }
    &:hover {
      color: var(--c-mint-deep);
    }
  }
  .pp-nav-list__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    font-weight: var(--weight-bold);
    line-height: 1.6;
  }
  .pp-nav-list__arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
  }
}
.pp-mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  span {
    font-weight: var(--weight-bold);
    font-size: var(--fs-xs);
    color: var(--text-muted);
  }
}
.pp-mobile-nav__close {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  background: var(--bg-base);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-primary);
  .pp-icon {
    width: 16px;
    height: 16px;
    fill: var(--c-mint);
  }
}

/* ===== Footer / mobile navigation list ===== */
.pp-nav-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 400px;
  flex-shrink: 0;
}
.pp-nav-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--pp-mint-base);
  text-decoration: none !important;
  color: var(--text-primary);
  &:last-child {
    border-bottom: none;
  }
  &:hover {
    color: var(--c-mint-deep);
  }
}
.pp-nav-list__label {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-md);
  font-weight: var(--weight-bold);
  line-height: 1.6;
}
.pp-nav-list__arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* ===== Footer ===== */
.pp-footer {
  position: relative;
  z-index: 1;
  margin: 120px auto;
  width: 100%;
  @media (max-width: 768px) {
    margin: 64px auto;
  }
  .pp-footer__card {
    background: var(--bg-base);
    border-radius: var(--r-2xl);
    padding: 64px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 56px;
    @media (max-width: 960px) {
      flex-direction: column;
      padding: 48px 16px;
      gap: 32px;
      border-radius: var(--r-lg);
    }
  }
  .pp-footer__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 48px;
    @media (max-width: 960px) {
      flex-direction: column;
      align-items: center;
      gap: 32px;
    }
  }
  .pp-footer__brand {
    display: flex;
    flex-direction: column;
    gap: clamp(var(--fs-sm), 0.5vw + 8px, var(--fs-md));
    max-width: 496px;
  }
  .pp-footer__logo {
    display: inline-flex;
    line-height: 0;
    text-decoration: none !important;
    img {
      height: 40px;
      object-fit: contain;
    }
  }
  .pp-footer__desc {
    font-size: clamp(var(--fs-xs), 0.5vw + var(--fs-xs), var(--fs-md));
    font-weight: var(--weight-bold);
    line-height: 1.8;
    color: var(--text-primary);
  }
  .pp-footer__divider {
    border: 0;
    border-top: 1px solid var(--border-light);
    margin: 0;
  }
  .pp-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    @media (max-width: 960px) {
      flex-direction: column-reverse;
    }
  }
  .pp-footer__copy {
    font-size: var(--fs-xs);
    font-weight: var(--weight-bold);
    color: var(--text-primary);
  }
  .pp-footer__meta {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    @media (max-width: 960px) {
      justify-content: center;
    }
    a {
      font-size: var(--fs-xs);
      font-weight: var(--weight-bold);
      color: var(--text-primary);
      text-decoration: none !important;
      &:hover {
        color: var(--c-mint-deep);
      }
    }
  }
}
/* ===== Document layout (privacy, terms, blog articles) ===== */
.pp-doc__layout {
  position: relative;
  max-width: var(--container-max);
  width: 100%;
  padding-inline: 16px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
  @media (max-width: 1024px) {
    grid-template-columns: minmax(0, 1fr);
  }
  @media (max-width: 768px) {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 56px;
  }
  .pp-doc-toc {
    position: sticky;
    top: 96px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    @media (max-width: 1024px) {
      display: none;
    }
    .pp-doc-toc__title {
      font-size: var(--fs-xs);
      text-transform: uppercase;
      color: var(--text-muted);
      font-weight: var(--weight-bold);
      padding-left: 16px;
    }
    ol {
      font-size: var(--fs-sm);
      display: flex;
      flex-direction: column;
      li {
        position: relative;
        line-height: 1.75;
      }
      a {
        color: var(--text-primary);
        font-weight: var(--weight-bold);
        font-size: var(--fs-xs);
        transition: var(--transition-base);
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        border-radius: 50rem;

        &:hover {
          background: var(--bg-warm-deep);
          text-decoration: none;
        }
      }
    }
  }
  .pp-doc-wrapper {
    padding: 48px;
    background: var(--bg-base);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-card);
    @media (max-width: 768px) {
      padding: 16px;
    }
  }
  .pp-doc-intro {
    background: #fafafa;
    border-radius: var(--r-md);
    padding: 24px;
    line-height: 1.8;
    margin-bottom: 24px;
    font-size: clamp(var(--fs-sm), 0.5vw + var(--fs-xs), var(--fs-md));
    color: var(--text-primary);
    @media (max-width: 768px) {
      padding: 16px;
      border-radius: var(--r-lg);
    }
  }

  .pp-doc-block {
    scroll-margin-top: 96px;
    font-size: clamp(var(--fs-sm), 0.5vw + var(--fs-xs), var(--fs-md));
    h2 {
      font-size: var(--fs-xl);
      font-weight: var(--weight-bold);
      margin-top: 32px;
      line-height: 1.45;
    }
    h2 + * {
      margin-top: 16px;
    }
    p {
      line-height: 1.8;
      color: var(--text-primary);
    }
    ul,
    ol {
      padding: 0;
      list-style: none;
      line-height: 1.8;
      color: var(--text-primary);
      list-style-type: disc;
      list-style-position: outside;
      padding: 0 0 0 24px;
    }
    li + li {
      margin-top: 8px;
    }
    li ul,
    li ol {
      margin-top: 8px;
      padding-left: 1em;
    }
    a {
      color: inherit;
    }
    strong {
      font-weight: var(--weight-bold);
    }
  }
  .pp-doc-meta {
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    margin-top: 32px;
    padding-top: 32px;
  }
  .pp-doc__retry {
    margin-top: 16px;
    padding: 8px 16px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--c-mint);
    color: var(--text-inverse);
    font: inherit;
    font-weight: var(--weight-bold);
    cursor: pointer;
  }
}
