/* Legal policy cluster (/resources/legal/*).
   Page-cluster styles, deliberately NOT in base.css: this is the sticky-TOC
   document layout, used only by the five policy pages. Everything else the
   pages need (.custom-grid, .custom-col-*, .checklist-dot, .blue-buttons,
   .button-group, type, colours) is composed from base.css.
   Ported from the Beaver Builder `.bb-custom-legal` block, retokenised. */

/* Document layout (the 25/75 split and its stack below 992px) comes from the
   .custom-grid.sticky-nav modifier in base.css. Nothing to declare here. */

/* ── Sticky table of contents ── */
.sm-legal .legal-nav {
  position: sticky;
  /* Clears the shared header, which is position:fixed at --nav-h. */
  top: calc(var(--nav-h) + var(--space-4));
  max-height: fit-content;
  overflow-y: auto;
}

.sm-legal .nav-title {
  font-size: var(--font-sm);
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.sm-legal .legal-nav ul {
  margin-left: 0;
  padding-left: 0;
}

.sm-legal .legal-nav li {
  line-height: 1.25;
  margin-left: 0;
}

.sm-legal .legal-nav a {
  font-size: var(--font-xs);
  color: var(--sm-text);
  transition: color 0.2s ease;
}

.sm-legal .legal-nav a:hover {
  color: var(--sm-blue);
}

/* ── Document body ── */
.sm-legal-body h1,
.sm-legal-body h2 {
  text-transform: none;
}

.sm-legal-body h2 {
  margin-top: var(--space-4);
}

.sm-legal-body h3 {
  margin-top: var(--space-3);
}

/* Jump-link offset so a jumped-to heading clears the fixed header. */
.sm-legal-body h2[id],
.sm-legal-body h3[id] {
  scroll-margin-top: calc(var(--nav-h) + var(--space-3));
}

.sm-legal-body .doc-meta {
  color: var(--sm-text-body);
  font-size: var(--font-sm);
  margin-top: 0;
}

.sm-legal-body .doc-intro {
  font-weight: 700;
  font-size: var(--font-sm);
}

/* ── Clause lists: hanging indent so "(a)" sits in the gutter ── */
.sm-legal-body ul.legal-list {
  list-style: none;
  margin-left: 0;
  padding-left: 1.4em;
  color: var(--sm-text-body);
}

.sm-legal-body ul.legal-list > li {
  margin-left: 0;
  padding-left: 0.25em;
  text-indent: -1.4em;
  color: var(--sm-text-body);
}

.sm-legal-body ul.legal-list ul.legal-list {
  margin-top: var(--space-1);
  padding-left: 1.6em;
}

.sm-legal-body .label {
  display: inline-block;
  min-width: 1.4em;
  text-indent: 0;
  margin-right: 0.5em;
  padding: 0;
  font-weight: 400;
  color: var(--sm-text-body);
}

.sm-legal-body ul:not(.legal-list) {
  color: var(--sm-text-body);
}

/* ── Tables inside a policy (e.g. the DPA permitted-purposes matrix) ── */
.sm-legal-body .legal-table-wrap {
  overflow-x: auto;
}

.sm-legal-body .legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
  color: var(--sm-text-body);
}

.sm-legal-body .legal-table th,
.sm-legal-body .legal-table td {
  border: 1px solid var(--sm-border);
  padding: var(--space-2);
  text-align: left;
  vertical-align: top;
}

.sm-legal-body .legal-table th {
  color: var(--sm-text);
  font-weight: 700;
}

/* ── Callout ── */
.sm-legal-body .legal-note {
  background: var(--sm-grey-1);
  border-radius: var(--space-1);
  padding: var(--space-3);
  margin: var(--space-3) 0;
}

.sm-legal-body .legal-note p:last-child {
  margin-bottom: 0;
}

/* ── Version history table (MKTGDSGN-678) ── */
.sm-legal-versions td:first-child {
  white-space: nowrap;
}

/* Footnote under the version table: how to obtain a superseded document now
   that they are no longer published. */
.sm-legal-body .legal-versions-note {
  font-size: var(--font-sm);
  color: var(--sm-text-body);
  margin-top: var(--space-2);
}

.sm-legal-versions .is-current {
  color: var(--sm-text);
  font-weight: 700;
}

/* ── Hub hero band ── */
/* Full-bleed gradient-light section. It keeps base.css's standard 64px section
   rhythm on both sides: zeroing the top put the h1 hard against the breadcrumb.
   No rule needed here -- the class stays as a hook. */

/* ── Hub cards ── */
/* Matches the live /legal hub: centred icon over a centred title, and a hover
   that goes to the full brand blue with the standard lifted shadow. Composes
   .bento-col.is-linkcard for the card chrome and only adds the delta.
   The :hover needs .bento-col in the selector to outrank
   .bento-col.is-linkcard:hover, which otherwise wins with its paler border. */
.legal-card {
  align-items: center;
  justify-content: center;
  text-align: center;
  /* .bento-col pads 16; the live hub pads 24 and reads better with the icon. */
  padding: var(--space-3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.bento-col.legal-card:hover {
  border-color: var(--sm-blue);
  box-shadow: var(--soft-shadow);
}

/* 20px to match the live hub. The DS --font-h3 clamp resolves to 24px at
   desktop, which is a step too loud for a one-line card title. 20px is that
   clamp's own floor, not an off-scale value. */
.legal-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

/* Pinned 40x40 so a card cannot reflow before the SVG decodes. */
.legal-card-icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-2);
}

/* ── Tablet & down: TOC is dropped, body goes full width ── */
/* Tablet & down: sticky-nav already stacks the columns full-width, so the TOC
   only needs hiding -- it would otherwise sit as a stray list above the policy. */
@media (max-width: 992px) {
  .sm-legal .custom-col-3 {
    display: none;
  }
}
