/* ==========================================================================
   legal.css
   Reading layout for 服務條款 (terms.html) and 隱私權政策 (privacy.html).
   The pages are built on the site's own header, footer and stylesheets;
   this only sets the long-form typography they need. Loaded after
   site-fixes.css.

   Note: no <header> inside the content - two platform stylesheets make
   every <header> a sticky bar on phones.
   ========================================================================== */
.page_legal {
  padding: 32px 0 64px;
  color: #333;
}

.legal {
  max-width: 44em;            /* about 40 CJK characters a line */
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  line-break: strict;         /* never open a line with 。，、 */
}

.legal p {
  margin: 0 0 12px;           /* the platform zeroes paragraph margins */
}

.legal a {
  color: #43565f;
  text-decoration: underline;
  text-decoration-color: rgba(67, 86, 95, 0.35);
  text-underline-offset: 3px;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.legal a:hover {
  color: #263238;
  text-decoration-color: currentColor;
}

/* --------------------------------------------------------------------------
   Title block
   -------------------------------------------------------------------------- */
.legal__head {
  text-align: center;
  margin-bottom: 32px;
}

.legal__title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.12em;
  color: #263238;
}

.legal__updated {
  margin: 0;
  font-size: 13px;
  color: #777;
}

.legal__lede {
  margin: 24px 0 0;
  text-align: start;
}

/* --------------------------------------------------------------------------
   Table of contents
   -------------------------------------------------------------------------- */
.legal__toc {
  margin: 0 0 40px;
  padding: 16px 20px;
  border: 1px solid #e8e2da;
  border-radius: 8px;
  background: #fbf8f4;
}

.legal__toc-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #6b5a4e;
}

.legal__toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 32px;
}

.legal__toc li {
  break-inside: avoid;
}

.legal__toc a {
  display: block;
  padding: 3px 0;
  text-decoration: none;
}

@media (max-width: 600px) {
  .legal__toc ol {
    columns: 1;
  }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.legal__section {
  scroll-margin-top: 24px;
}

.legal__section + .legal__section {
  margin-top: 36px;
}

.legal__section h2 {
  margin: 0 -10px 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #263238;
}

/* Arriving from the contents list: the heading glows once, then settles,
   so the eye finds where the jump landed. */
.legal__section:target h2 {
  animation: legal-arrive 1600ms cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes legal-arrive {
  from {
    background-color: rgba(255, 193, 7, 0.3);
  }
  to {
    background-color: transparent;
  }
}

/* （一）（二） items with a hanging marker: the text wraps under itself,
   not under the number, and the numbers stay in the copied text. */
.legal__items {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.legal__items > li {
  display: grid;
  grid-template-columns: 3em 1fr;
  margin-bottom: 6px;
}

.legal__bullets {
  margin: 0 0 12px;
  padding-left: 1.4em;
  list-style-type: disc;      /* the platform sets ul { list-style-type: none } */
}

.legal__bullets > li {
  margin-bottom: 4px;
}

.legal__bullets > li::marker {
  color: #b09a8a;
}

/* --------------------------------------------------------------------------
   Contact card
   -------------------------------------------------------------------------- */
.legal__contact {
  margin-top: 48px;
  padding: 20px 24px;
  border-radius: 8px;
  background: #f7f1ea;
}

.legal__contact h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #263238;
}

.legal__contact dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 0;
}

.legal__contact dt {
  font-weight: 700;
  color: #6b5a4e;
}

.legal__contact dd {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Phones
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .page_legal {
    padding: 20px 0 48px;
  }

  .legal__title {
    font-size: 24px;
  }

  /* clear the sticky header pill when jumping to a section */
  .legal__section {
    scroll-margin-top: 76px;
  }

  .legal__contact {
    padding: 16px 18px;
  }
}

@media (max-width: 480px) {
  .legal__contact dl {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal__contact dd {
    margin-bottom: 8px;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion: a steady marker instead of the glow
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .legal__section:target h2 {
    animation: none;
    box-shadow: inset 3px 0 0 #ffc107;
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */
@media print {
  .legal__toc {
    display: none;
  }

  .legal {
    max-width: none;
    font-size: 11pt;
    color: #000;
  }

  .legal__contact {
    background: none;
    border: 1px solid #999;
  }
}
