/* Digital You CIC — legal & policy pages. Scoped to .legal-hero / .legal-body, not per-page IDs. Author: lukeduff.co.uk */
:root{--blue:#144e8c;--blue-deep:#144e8c;--turquoise:#16becf;--turq-deep:#0e93a1;--heather:#7961aa;--mist:#f4f7fb;--ink:#144e8c;--ink-soft:#37689d;--radius:20px}

.legal-hero,.legal-body{font-family:"Source Sans 3",sans-serif;color:var(--ink)}
.legal-hero .elementor-widget,.legal-body .elementor-widget{margin-block-end:0!important}
.legal-hero,.legal-body,.legal-hero .e-con-inner,.legal-body .e-con-inner,.legal-hero .e-con,.legal-body .e-con{--padding-block-start:0px;--padding-block-end:0px;--padding-inline-start:0px;--padding-inline-end:0px}
.legal-hero .e-con-inner,.legal-body .e-con-inner{max-width:none;width:100%}
.legal-hero,.legal-body,.legal-hero .e-con,.legal-body .e-con{gap:0}

/* compact hero */
.legal-hero{background:var(--blue);color:#fff;position:relative;overflow:hidden}
.legal-hero::before{content:"";position:absolute;inset:0;background:radial-gradient(120% 90% at 75% 0%,#1c63ad 0%,#144e8c 60%);z-index:0}
.legal-hero-inner{position:relative;z-index:1;max-width:820px;margin:0 auto;padding:88px 24px 72px;text-align:center;align-items:center}
.legal-hero .eyebrow{display:block;font-size:13px;font-weight:700;letter-spacing:.15em;text-transform:uppercase;color:var(--turquoise);margin-bottom:12px}
.legal-hero .eyebrow .elementor-heading-title{color:var(--turquoise)!important}
.legal-hero h1,.legal-hero .elementor-heading-title{color:#fff;font-size:clamp(34px,5vw,54px);font-weight:700;line-height:1.08;letter-spacing:-.01em}

/* prose body */
.legal-body{background:#fff;padding:64px 0 88px}
.legal-inner{max-width:760px;margin:0 auto;padding:0 24px;align-items:flex-start}
.legal-inner > .elementor-widget{width:100%;max-width:100%}
.legal-body .lead{font-size:20px;line-height:1.55;color:var(--blue);font-weight:600;margin-bottom:20px}
.legal-updated{display:inline-block;font-size:13.5px;font-weight:700;letter-spacing:.02em;color:var(--turq-deep);background:var(--mist);border:1px solid rgba(20,78,140,.10);padding:6px 14px;border-radius:999px;margin:0 0 30px}
.legal-body h2{font-family:"Source Sans 3",sans-serif;color:var(--blue);font-size:24px;font-weight:700;margin:34px 0 10px;line-height:1.2}
.legal-body h3{font-family:"Source Sans 3",sans-serif;color:var(--blue);font-size:19px;font-weight:700;margin:26px 0 8px;line-height:1.25}
.legal-body p{font-size:17px;line-height:1.7;color:var(--ink-soft);margin-bottom:14px}
.legal-body ul{margin:0 0 16px;padding-left:22px}
.legal-body li{font-size:17px;line-height:1.6;color:var(--ink-soft);margin-bottom:8px}
.legal-body strong{color:var(--blue)}
.legal-body a{color:var(--blue);text-decoration:underline;font-weight:600}
.legal-body a:hover{color:var(--turquoise)}
.legal-note{margin-top:28px;padding:16px 20px;background:var(--mist);border-radius:14px;color:var(--ink-soft);font-size:15px}

/* tables (cookie list, processor list, retention schedule) */
.legal-body .cookie-table{width:100%;border-collapse:collapse;margin:6px 0 22px;font-size:15.5px;background:#fff;border:1px solid rgba(20,78,140,.14);border-radius:12px;overflow:hidden}
.legal-body .cookie-table th{text-align:left;background:var(--mist);color:var(--blue);font-weight:700;padding:11px 14px;border-bottom:1px solid rgba(20,78,140,.14);font-size:14.5px}
.legal-body .cookie-table td{padding:11px 14px;border-bottom:1px solid rgba(20,78,140,.08);color:var(--ink-soft);vertical-align:top;line-height:1.5}
.legal-body .cookie-table tr:last-child td{border-bottom:0}

/* policies hub link list */
.legal-body ul.policy-list{list-style:none;padding-left:0;margin:6px 0 26px}
.legal-body ul.policy-list li{background:var(--mist);border:1px solid rgba(20,78,140,.10);border-radius:14px;padding:15px 18px;margin-bottom:10px;font-size:16.5px;line-height:1.55}
.legal-body ul.policy-list li a{font-size:17.5px;font-weight:700;text-decoration:none}
.legal-body ul.policy-list li a:hover{text-decoration:underline}

html{scroll-behavior:smooth}body{overflow-x:clip}

@media(max-width:680px){
  .legal-hero-inner{padding:64px 20px 52px}
  .legal-inner{padding:0 20px}
  .legal-body{padding:48px 0 64px}

  /* §M1 tables on mobile — fixed 8 Sep 2026.
     The old rule was `display:block;overflow-x:auto;white-space:nowrap`.
     nowrap stopped the Purpose column wrapping, which forced the 4-column
     cookie table to 463px inside a 390px viewport. Because body is
     overflow-x:clip the page could not scroll to reveal it, so mobile Safari
     widened the layout viewport to 473px instead and rendered the WHOLE
     Cookie Policy at ~82% zoom. Never reintroduce nowrap here. */
  .legal-body .cookie-table{
    display:block;width:100%;max-width:100%;
    overflow-x:auto;-webkit-overflow-scrolling:touch;
    white-space:normal;font-size:14.5px
  }
  .legal-body .cookie-table th,
  .legal-body .cookie-table td{padding:9px 11px;overflow-wrap:break-word}
}

/* §M2 four-column tables stack into labelled cards on phones.
   Four columns are unreadable as a grid at 390px. Scoped with :has() to
   tables that actually have a 4th header — i.e. only the two cookie lists on
   /cookie-policy/. The Privacy Policy reuses .cookie-table for TWO-column
   tables with different headings ("Who / What they do", "Information / Kept
   for"), and the hardcoded labels below would be wrong on those, so they must
   keep the normal table layout. If :has() is unsupported the whole block is
   dropped and §M1 above still renders a correct, scrollable table. */
@media(max-width:600px){
  .legal-body .cookie-table:has(thead th:nth-child(4)){
    display:block;overflow:visible;border:0;background:transparent;border-radius:0
  }
  .legal-body .cookie-table:has(thead th:nth-child(4)) thead{display:none}
  .legal-body .cookie-table:has(thead th:nth-child(4)) tbody,
  .legal-body .cookie-table:has(thead th:nth-child(4)) tr,
  .legal-body .cookie-table:has(thead th:nth-child(4)) td{display:block;width:auto}
  .legal-body .cookie-table:has(thead th:nth-child(4)) tr{
    background:#fff;border:1px solid rgba(20,78,140,.14);border-radius:12px;
    margin:0 0 12px;overflow:hidden
  }
  /* transparent, so the row's white card shows through. A theme-level
     tbody td:nth-of-type(odd) stripe was otherwise painting the first card
     grey and the second white, which read as a rendering fault. */
  .legal-body .cookie-table:has(thead th:nth-child(4)) td{
    border-bottom:1px solid rgba(20,78,140,.08);padding:10px 14px;
    background:transparent
  }
  .legal-body .cookie-table:has(thead th:nth-child(4)) tr td:last-child{border-bottom:0}
  .legal-body .cookie-table:has(thead th:nth-child(4)) td::before{
    display:block;font-weight:700;color:var(--blue);font-size:12px;
    letter-spacing:.04em;text-transform:uppercase;margin:0 0 3px
  }
  .legal-body .cookie-table:has(thead th:nth-child(4)) td:nth-of-type(1)::before{content:"Cookie"}
  .legal-body .cookie-table:has(thead th:nth-child(4)) td:nth-of-type(2)::before{content:"Provider"}
  .legal-body .cookie-table:has(thead th:nth-child(4)) td:nth-of-type(3)::before{content:"Purpose"}
  .legal-body .cookie-table:has(thead th:nth-child(4)) td:nth-of-type(4)::before{content:"Duration"}
}
