/* ============================================================
   Mlemmie · legal documents (privacy / terms)
   Loaded after styles.css; reuses its tokens, capsule header
   and floating footer. The document itself sits on one white
   rounded panel, with a single reading column inside.
   ============================================================ */

/* ---------- 1. Header ---------- */
.legal-nav {
  gap: 2px;
}

.legal-home {
  margin-left: 6px;
}

.legal-home .arrow--left {
  transform: none;
}

.legal-home:hover .arrow--left {
  transform: translateX(-2px);
}

/* ---------- 2. Page shell ---------- */
.legal-main {
  position: relative;
  padding-block: clamp(22px, 3vw, 34px) var(--stack-gap);
}

.legal-shell {
  position: relative;
  width: min(880px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding: clamp(26px, 3.6vw, 54px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

/* ---------- 3. Document head ---------- */
.doc-head {
  position: relative;
  padding-bottom: clamp(26px, 3.4vw, 38px);
  background-image: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.32),
    rgba(15, 23, 42, 0.1) 42%,
    transparent
  );
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 100% 1px;
}

.doc-title {
  margin: 20px 0 0;
  font-size: clamp(33px, 4.6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.09em;
  line-height: 1.7;
}

.doc-meta .mono {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.doc-meta .sep {
  color: var(--line-strong);
}

.doc-lede {
  max-width: 38em;
  margin: 20px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.9;
}

/* ---------- 4. In-page index ---------- */
.doc-index {
  margin-top: clamp(24px, 3.2vw, 36px);
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-tile);
  background: linear-gradient(160deg, #f6f8fc 0%, #eef4fb 100%);
}

.doc-index__title {
  margin: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.5;
}

.doc-index ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.doc-index li {
  min-width: 0;
}

.doc-index a {
  display: flex;
  align-items: baseline;
  gap: 11px;
  min-height: 44px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  transition: color 180ms var(--ease-out);
}

.doc-index a:hover {
  color: var(--ink);
}

.doc-index .n {
  flex: none;
  min-width: 1.5em;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.02em;
  transition: color 180ms var(--ease-out);
}

.doc-index a:hover .n {
  color: var(--accent);
}

.doc-index .t {
  display: block;
  min-width: 0;
}

/* ---------- 5. Sections ---------- */
.doc-body {
  margin-top: clamp(34px, 4.6vw, 56px);
}

.doc-section {
  border-top: 1px solid var(--line);
  padding-top: clamp(24px, 3.2vw, 34px);
}

.doc-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc-section + .doc-section {
  margin-top: clamp(28px, 3.8vw, 44px);
}

.doc-section h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(19px, 2.1vw, 22px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.45;
}

.doc-num {
  margin-right: 8px;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

.doc-section p {
  max-width: 40em;
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.9;
}

.doc-section p + p {
  margin-top: 12px;
}

.doc-list {
  max-width: 40em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-list li {
  position: relative;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.9;
}

.doc-list li + li {
  margin-top: 8px;
}

.doc-list li::before {
  content: "";
  position: absolute;
  top: 0.85em;
  left: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line-strong);
}

/* Wide screens: section numbers hang in the left margin. */
@media (min-width: 920px) {
  .doc-section {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    column-gap: 18px;
    align-items: start;
  }

  .doc-section > h2 {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 54px minmax(0, 1fr);
    column-gap: 18px;
    align-items: baseline;
    margin-bottom: 18px;
  }

  .doc-section > h2 .doc-num {
    margin-right: 0;
    font-size: 21px;
    line-height: 1;
    text-align: left;
  }

  .doc-section > p,
  .doc-section > ul {
    grid-column: 2;
  }
}

/* ---------- 6. Contact & cross-link ---------- */
.doc-contact {
  margin-top: clamp(36px, 4.6vw, 54px);
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-tile);
  background:
    radial-gradient(
      120% 140% at 90% 0%,
      rgba(37, 99, 235, 0.06),
      transparent 60%
    ),
    linear-gradient(165deg, #ffffff, #f6f8fc);
}

.doc-contact__label {
  margin: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  line-height: 1.5;
}

.doc-contact p {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

.doc-contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(17px, 2vw, 20px);
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
  transition:
    gap 240ms var(--ease-out),
    text-decoration-color 180ms var(--ease-out);
}

.doc-contact__mail:hover {
  gap: 14px;
  text-decoration-color: var(--accent-deep);
}

.doc-next {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(30px, 4vw, 46px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.03em;
  line-height: 1.7;
}

.doc-next p {
  margin: 0;
}

.doc-next a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: text-decoration-color 180ms var(--ease-out);
}

.doc-next a:hover {
  text-decoration-color: var(--accent-deep);
}

/* ---------- 7. Responsive ---------- */
@media (max-width: 900px) {
  .legal-home {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .legal-main {
    padding-block: 12px;
  }

  .legal-shell {
    padding: 22px;
    border-radius: var(--radius-panel);
  }

  .doc-title {
    letter-spacing: -0.03em;
  }

  .doc-meta {
    gap: 4px 12px;
    font-size: 10.5px;
  }

  .doc-lede {
    margin-top: 16px;
    font-size: 14.5px;
  }

  .doc-index {
    padding: 16px;
  }

  .doc-index ol {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .doc-section p,
  .doc-list li {
    font-size: 15.5px;
    line-height: 1.85;
  }

  .doc-contact {
    border-radius: var(--radius-tile);
  }

  .doc-next {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 8. Print ---------- */
@media print {
  .site-header,
  .doc-index,
  .doc-next,
  .skip-link,
  .site-footer .footer-top,
  .site-footer .footer-bottom {
    display: none !important;
  }

  .legal-main {
    padding: 0;
  }

  .legal-shell {
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .doc-head {
    background-image: none;
    border-bottom: 1px solid #c8cdd6;
  }

  .doc-section {
    border-color: #c8cdd6;
    break-inside: avoid;
  }

  .doc-section h2 {
    break-after: avoid;
  }

  .doc-contact {
    border: 1px solid #c8cdd6;
    background: #fff;
  }

  .doc-section p,
  .doc-list li {
    color: #0f172a;
  }

  .site-footer {
    padding: 24px 0 0;
  }

  .site-footer > .wrap {
    padding: 0;
    border: 0;
    box-shadow: none;
  }
}
