/* UK Law Explorer: shared styles for every page in this folder. */

@font-face {
    font-family: "Open Sans";
    src: url("fonts/OpenSans-latin.woff2") format("woff2");
    font-weight: 400 800;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;

    /* Colour */
    --ink: #17191e;
    --ink-2: #5f636c;
    --ink-3: #868a93;
    --paper: #ffffff;
    --mist: #f1f3f6;
    --line: #d6d9df;
    --blue: #1c5fd4;
    --blue-hover: #164db0;
    --link: #1a5bc9;
    --night: #0b0d12;
    --night-ink: #eef0f4;
    --night-ink-2: #a3a8b3;
    --selection: #c9dbfb;
    --focus: rgba(28, 95, 212, 0.5);

    /* Type */
    --face: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Space */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 72px;
    --space-9: 112px;

    /* Layout */
    --page: 980px;
    --gutter: max(22px, env(safe-area-inset-left));
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--face);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body > main {
    flex: 1 0 auto;
}

::selection {
    background: var(--selection);
    color: var(--ink);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 20;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
}

.skip-link:focus {
    top: 10px;
}

.wrap {
    width: 100%;
    max-width: calc(var(--page) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ---------- Product nav ---------- */

.product-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(23, 25, 30, 0.1);
    /* Content scrolls under the bar, so it is translucent with a blur to stay legible. */
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}

.product-nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 52px;
}

.product-nav .title {
    color: var(--ink);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.product-nav .title:hover {
    text-decoration: none;
}

.product-nav nav {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    font-size: 13px;
    white-space: nowrap;
}

.product-nav nav a:not(.pill) {
    color: var(--ink);
}

.product-nav nav a[aria-current="page"] {
    color: var(--ink-2);
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pill:hover {
    background: var(--blue-hover);
    text-decoration: none;
}

.pill-lg {
    min-height: 46px;
    padding: 11px 24px;
    font-size: 16px;
}

/* ---------- Footer ---------- */

.site-foot {
    background: var(--mist);
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.4;
}

.site-foot .wrap {
    padding-top: var(--space-5);
    padding-bottom: var(--space-6);
}

.site-foot .disclaimer {
    max-width: 75em;
    margin: 0 0 var(--space-4);
    line-height: 1.5;
}

.site-foot .legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-5);
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
}

.site-foot nav {
    display: flex;
    flex-wrap: wrap;
}

.site-foot nav a {
    padding: 0 10px;
    border-left: 1px solid var(--line);
    color: var(--ink-2);
}

.site-foot nav a:first-child {
    padding-left: 0;
    border-left: 0;
}

.site-foot p {
    margin: 0;
}

/* ---------- Simple pages: contact, thanks, privacy ---------- */

.doc {
    max-width: calc(692px + 2 * var(--gutter));
    margin: 0 auto;
    padding: var(--space-8) var(--gutter) var(--space-9);
}

.doc h1 {
    margin: 0 0 var(--space-3);
    font-size: 46px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.doc .lede {
    margin: 0 0 var(--space-7);
    color: var(--ink-2);
    font-size: 20px;
    line-height: 1.45;
    text-wrap: pretty;
}

.doc h2 {
    margin: var(--space-7) 0 var(--space-2);
    font-size: 23px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.doc p {
    margin: 0 0 var(--space-4);
}

.doc address {
    font-style: normal;
}

/* Form fields */

.field {
    margin-bottom: var(--space-4);
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.field input,
.field textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--ink-3);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    caret-color: var(--blue);
    font: inherit;
    font-size: 17px;
    line-height: 1.35;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
    min-height: 168px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--ink-2);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(28, 95, 212, 0.18);
}

@media (max-width: 734px) {
    .product-nav .title {
        font-size: 17px;
    }

    .product-nav nav {
        gap: var(--space-3);
    }

    .doc {
        padding-top: var(--space-7);
        padding-bottom: var(--space-8);
    }

    .doc h1 {
        font-size: 32px;
        line-height: 1.15;
    }

    .doc .lede {
        font-size: 18px;
    }

    .doc h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .site-foot nav a,
    .site-foot nav a:first-child {
        padding: 0 16px 0 0;
        border-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
