/*
 * Privacy and GDPR, and Copyright and legal pages (page-legal.php): the page behind the layout's sections, and the
 * free legal text that follows them (.legal-text, finished by includes/legal.php).
 */

.legal-page {
  margin: 0;
  padding: 0;
  background: var(--white);
}

.legal-page__article {
  margin: 0;
}

/*
 * The legal text: the contents list down the left beside the text, as in the wireframe, with the same side room
 * as the sections above. The text keeps a readable width on wide screens.
 */

.wp-block-group.legal-text {
  margin: 0;
  padding: 48px clamp(24px, 5vw, 64px) 56px;
  background: var(--white);
}

.legal-text .wp-block-group__inner-container {
  display: contents;
}

.legal-text .legal-text__layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 960px);
  gap: 48px;
  align-items: start;
}

/* The Copyright page's notice has no contents list, so the text starts at the left */

.legal-text .legal-text__layout:not(:has(.legal-text__contents)) {
  grid-template-columns: minmax(0, 960px);
}

/* The contents list: on cream, staying in view while the policy scrolls past */

.legal-text .legal-text__contents {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: 16px;
  background: #f4f3ee;
  font-size: 15px;
}

.legal-text .legal-text__contents-label {
  margin: 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-text .legal-text__contents-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-text .legal-text__contents-list a {
  color: var(--teal-darker);
}

.legal-text .legal-text__contents-list a:hover {
  color: #0d3d39;
}

/* The text: the title, then each numbered section under a fine rule */

.legal-text .legal-text__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}

.legal-text .legal-text__body p,
.legal-text .legal-text__body ul,
.legal-text .legal-text__body ol {
  margin: 0;
}

.legal-text .legal-text__body strong {
  color: #0d3d39;
}

.legal-text .legal-text__body a {
  color: var(--teal-darker);
}

.legal-text .legal-text__title {
  margin: 0 0 6px;
  color: #0d3d39;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: none;
}

.legal-text .legal-text__section {
  margin: 6px 0 0;
  padding-top: 22px;
  border-top: 1px solid #e8ebe5;
  color: #0d3d39;
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
  scroll-margin-top: 120px;
}

/* As in the wireframe, the rules fall between sections: none between the title and the first */

.legal-text .legal-text__title + .legal-text__section {
  padding-top: 0;
  border-top: 0;
}

.legal-text .legal-text__body h3 {
  margin: 4px 0 0;
  color: #0d3d39;
  font-family: inherit;
  font-size: 17px;
  text-transform: none;
}

/* Tables: fine rules, a pale teal heading row, and sideways scrolling inside the table on narrow screens */

.legal-text .wp-block-table {
  margin: 0;
  overflow-x: auto;
}

.legal-text .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

.legal-text .wp-block-table table:has(thead) {
  min-width: 520px;
}

.legal-text .wp-block-table thead {
  border-bottom: 0;
}

.legal-text .wp-block-table th,
.legal-text .wp-block-table td {
  padding: 10px 12px;
  border: 1px solid #e8ebe5;
  text-align: left;
  vertical-align: top;
}

.legal-text .wp-block-table th {
  background: var(--teal-pale);
  color: #0d3d39;
  font-weight: 600;
}

/* The closing line with its address, on pale teal */

.legal-text .legal-text__closing {
  margin-top: 8px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--teal-pale);
  color: var(--text);
}

/* Tablets and phones: the contents list sits above the text */

@media (max-width: 899px) {
  .legal-text .legal-text__layout,
  .legal-text .legal-text__layout:not(:has(.legal-text__contents)) {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .legal-text .legal-text__contents {
    position: static;
  }
}

@media (max-width: 600px) {
  .wp-block-group.legal-text {
    padding: 40px 16px 48px;
  }
}

/*
 * Large screens: the wireframe is drawn for laptop widths, so on bigger monitors the whole page is drawn larger,
 * keeping its proportions instead of stretching thin. The same steps as the other pages.
 */

@media (min-width: 1800px) {
  .legal-page {
    zoom: 1.2;
  }
}

@media (min-width: 2400px) {
  .legal-page {
    zoom: 1.5;
  }
}

@media (min-width: 3400px) {
  .legal-page {
    zoom: 2;
  }
}
