/* W-LEGAL-01 / W-LEGAL-02 — public legal article layout */

.legal-page {
  position: relative;
  width: 100%;
  padding: 1.5rem 0 2.5rem;
}

.legal-page__shell {
  position: relative;
  max-width: 80rem;
  margin: 0 auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .legal-page__shell {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .legal-page {
    padding: 2rem 0 3rem;
  }

  .legal-page__shell {
    padding-inline: 2rem;
  }
}

.legal-page__glow {
  pointer-events: none;
  position: absolute;
  top: 3rem;
  left: 50%;
  z-index: 0;
  width: min(600px, 90vw);
  height: 360px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    rgba(15, 107, 92, 0.06) 0%,
    rgba(31, 58, 69, 0.04) 45%,
    transparent 100%
  );
  filter: blur(48px);
}

.legal-page__paper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 0.75rem;
  background: var(--hm-surface-elevated);
  box-shadow:
    0 1px 2px rgba(20, 33, 43, 0.05),
    0 4px 16px -4px rgba(20, 33, 43, 0.08);
}

@media (min-width: 640px) {
  .legal-page__paper {
    padding: 2rem;
  }
}

.legal-page__meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (min-width: 576px) {
  .legal-page__meta-row {
    flex-direction: row;
    align-items: center;
  }
}

.legal-page__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hm-text-secondary);
}

.legal-page__breadcrumb a {
  color: var(--hm-text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.legal-page__breadcrumb a:hover {
  color: var(--hm-primary);
}

.legal-page__breadcrumb-sep {
  color: var(--hm-border);
  font-weight: 400;
}

.legal-page__breadcrumb-current {
  color: var(--hm-primary);
  font-weight: 700;
}

.legal-page__updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  background: #eceeed;
  color: var(--hm-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.legal-page__updated-badge .bi {
  font-size: 0.85rem;
}

.legal-page__header h1 {
  margin: 0;
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--hm-ink);
}

.legal-page__title-rule {
  width: 3.5rem;
  height: 0.25rem;
  margin-top: 0.5rem;
  border-radius: 9999px;
  background: var(--hm-primary);
}

.legal-page__identity {
  margin: 0;
  padding: 1rem 1.15rem;
  border: none;
  border-radius: 0.75rem;
  background: #f2f4f3;
}

.legal-page__identity-heading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--hm-primary);
}

.legal-page__identity-heading .bi {
  font-size: 1.15rem;
}

.legal-page__identity-note {
  margin: 0 0 1rem;
  color: var(--hm-text-secondary);
  font-size: 0.8125rem;
  line-height: 1.65;
}

.legal-page__identity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .legal-page__identity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.legal-page__identity-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 0.5rem;
  background: var(--hm-surface-elevated);
  box-shadow: 0 1px 2px rgba(20, 33, 43, 0.05);
}

.legal-page__identity-card dt {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--hm-secondary);
}

.legal-page__identity-card dd {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hm-ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.legal-page__lead {
  margin: 0;
  padding: 1rem;
  border-radius: 0.5rem;
  background: linear-gradient(
    to left,
    rgba(15, 107, 92, 0.06) 0%,
    transparent 55%
  );
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.75;
  color: var(--hm-ink);
}

[dir="ltr"] .legal-page__lead {
  background: linear-gradient(
    to right,
    rgba(15, 107, 92, 0.06) 0%,
    transparent 55%
  );
}

.legal-page__intro p {
  margin: 0 0 1rem;
  line-height: 1.75;
  color: var(--hm-text-secondary);
}

.legal-page__intro p:last-child {
  margin-bottom: 0;
}

.legal-page__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.legal-page__section-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.35rem;
}

.legal-page__section-index {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--hm-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.legal-page__section h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--hm-secondary);
}

.legal-page__section p {
  margin: 0;
  padding-inline-start: 2.4rem;
  line-height: 1.75;
  color: var(--hm-text-secondary);
}

.legal-page__section:not(:has(.legal-page__section-index)) p {
  padding-inline-start: 0;
}

.legal-page__related {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 0.75rem;
  background: #f2f4f3;
}

@media (min-width: 576px) {
  .legal-page__related {
    flex-direction: row;
    align-items: center;
  }
}

.legal-page__related-copy {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.legal-page__related-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: rgba(15, 107, 92, 0.1);
  color: var(--hm-primary);
}

.legal-page__related-label {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--hm-secondary);
}

.legal-page__related-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--hm-ink);
}

.legal-page__related-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--hm-primary);
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(20, 33, 43, 0.05);
  transition: background-color 0.15s ease;
}

.legal-page__related-link:hover {
  background: #0c564a;
  color: #fff !important;
}

[dir="rtl"] .legal-page__related-link .bi {
  transform: scaleX(-1);
}
