/* ==========================================================================
   Oeby site styles — layered on top of Bootstrap 5.3
   Carries over the type scale, container widths, colours and section rhythm
   of the previous Neve/Gutenberg build so the site looks unchanged.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
    --brand-navy: #072273;
    --brand-sky: #38a7dc;
    --brand-text: #272626;
    --brand-muted: #636363;
    --footer-navy: #062272;
    --tint: #f8f8f8;
    --tint-alt: #f6f6f6;
    --border: #e7e7e7;

    /* Section rhythm — replaces the old stack of fixed-height spacer divs. */
    --section-y: 80px;

    /* Bootstrap overrides */
    --bs-body-font-family: Arial, Helvetica, sans-serif;
    --bs-body-font-size: 15px;
    --bs-body-line-height: 1.6;
    --bs-body-color: var(--brand-text);
    --bs-link-color: var(--brand-navy);
    --bs-link-hover-color: var(--brand-sky);
    --bs-border-color: var(--border);
}

@media (min-width: 576px) {
    :root {
        --bs-body-font-size: 16px;
    }
}

@media (min-width: 960px) {
    :root {
        --bs-body-line-height: 1.7;
    }
}

/* --- Typography ----------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

@media (min-width: 576px) {
    h1 { font-size: 40px; }
    h2 { font-size: 32px; }
    h3 { font-size: 24px; }
    h4 { font-size: 20px; }
}

@media (min-width: 960px) {
    h3 { font-size: 28px; }
    h4 { font-size: 24px; }
}

/* The old build coloured nearly every heading with the primary accent. */
h1, h2, h3 {
    color: var(--brand-navy);
}

.lead {
    font-size: 1.125em;
    font-weight: 400;
}

.text-muted-brand {
    color: var(--brand-muted);
}

/* --- Containers ----------------------------------------------------------- */
/* Neve's breakpoints were 576 / 960, not Bootstrap's 576/768/992/1200/1400.
   Override every step so line lengths match the previous build. */

.container {
    max-width: 748px;
}

@media (min-width: 576px) {
    .container { max-width: 992px; }
}

@media (min-width: 960px) {
    .container { max-width: 1060px; }
}

/* --- Buttons -------------------------------------------------------------- */

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-navy);
    --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-sky);
    --bs-btn-hover-border-color: var(--brand-sky);
    --bs-btn-focus-shadow-rgb: 56, 167, 220;
    --bs-btn-border-radius: 3px;
    --bs-btn-padding-x: 15px;
    --bs-btn-padding-y: 10px;
    --bs-btn-font-weight: 600;
}

@media (min-width: 960px) {
    .btn-brand {
        --bs-btn-padding-y: 13px;
    }
}

/* The login pill in the header, reproduced from its old inline style. */
.btn-login {
    background-color: rgba(56, 167, 220, 0.2);
    border: 1px solid #fff;
    box-shadow: 0 0 0 2pt var(--footer-navy);
    border-radius: 5px;
    padding: 4px 8px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    color: var(--brand-navy);
    font-weight: 500;
}

.btn-login:hover,
.btn-login:focus-visible {
    color: var(--brand-sky);
}

/* --- Header --------------------------------------------------------------- */

.site-header {
    background: #fff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.site-header .navbar-brand img {
    width: 40px;
    height: auto;
}

@media (min-width: 576px) {
    .site-header .navbar-brand img { width: 48px; }
}

@media (min-width: 960px) {
    .site-header .navbar-brand img { width: 147px; }
}

.site-nav .nav-link {
    color: var(--brand-navy);
    font-weight: 500;
    font-size: 1em;
    line-height: 1.6;
    padding-left: 10px;
    padding-right: 10px;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible {
    color: var(--brand-sky);
}

.site-nav .nav-link.active {
    color: var(--brand-navy);
}

/* Skip link — visible only once focused. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1080;
    background: #fff;
    color: var(--brand-navy);
    padding: 10px 15px;
}

.skip-link:focus {
    left: 0;
}

/* --- Hero ----------------------------------------------------------------- */
/* The old cover block carried a gradient overlay at opacity 0, i.e. invisible.
   Only the image shows, centred and cropped. */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 630px;
    padding: 1em;
    overflow: hidden;
    color: #fff;
}

/* The background is a real <img> so it keeps its srcset, as in the old build. */
.hero__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero > .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 56px;
    color: #fff;
}

.hero p {
    color: #fff;
}

@media (max-width: 782px) {
    .hero h1 { font-size: 40px; }
}

/* --- Sections ------------------------------------------------------------- */

.section {
    padding-top: var(--section-y);
    padding-bottom: var(--section-y);
}

.section--sm { --section-y: 43px; }
.section--lg { --section-y: 107px; }
.section--xl { --section-y: 140px; }

.section--tint { background-color: var(--tint); }
.section--alt { background-color: var(--tint-alt); }

/* --- Media rows ----------------------------------------------------------- */
/* Reproduces .wp-block-media-text: a two-column grid that stacks at 600px with
   the image first. Kept as its own grid rather than the Bootstrap row/col so
   the split ratios and breakpoint match the previous build exactly. */

.media-row {
    display: grid;
    grid-template-columns: 50% 1fr;
    grid-template-rows: auto;
    align-items: center;
}

.media-row__media {
    grid-column: 1;
    grid-row: 1;
}

.media-row__content {
    grid-column: 2;
    grid-row: 1;
    padding: 0 8%;
    word-break: break-word;
}

.media-row--right {
    grid-template-columns: 1fr 50%;
}

.media-row--right .media-row__media {
    grid-column: 2;
    grid-row: 1;
}

.media-row--right .media-row__content {
    grid-column: 1;
    grid-row: 1;
}

/* Ratio variants used by the old inline grid-template-columns. */
.media-row--54 { grid-template-columns: auto 54%; }
.media-row--56 { grid-template-columns: 56% auto; }
.media-row--56r { grid-template-columns: auto 56%; }

.media-row__media img {
    width: 100%;
    height: auto;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .media-row,
    .media-row--right,
    .media-row--54,
    .media-row--56,
    .media-row--56r {
        grid-template-columns: 100%;
    }

    .media-row__media {
        grid-column: 1;
        grid-row: 1;
    }

    .media-row__content {
        grid-column: 1;
        grid-row: 2;
        padding: 2em 8%;
    }
}

/* --- Split rows (image cover beside text) --------------------------------- */

.split-row {
    display: flex;
    flex-wrap: wrap;
}

.split-row__media,
.split-row__content {
    flex: 1 1 50%;
    min-width: 0;
}

.split-row__media {
    position: relative;
    min-height: 600px;
    background-color: var(--tint-alt);
    overflow: hidden;
}

.split-row__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.split-row__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1em;
}

@media (max-width: 782px) {
    .split-row__media,
    .split-row__content {
        flex: 1 1 100%;
    }

    .split-row__media {
        min-height: 320px;
    }
}

/* --- Read-more disclosures ------------------------------------------------ */

.read-link {
    font-weight: 400;
    color: #0a2574;
    background: #fff;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #0a2574;
    box-shadow: none !important;
    transition: none !important;
}

.read-link:hover {
    color: var(--brand-sky);
    border-bottom-color: #0a2574;
}

.read-link:focus-visible {
    outline: 2px solid var(--brand-sky);
    outline-offset: 2px;
}

/* --- Partner / badge galleries -------------------------------------------- */

.logo-grid img {
    width: 100%;
    height: auto;
}

.badge-grid img {
    max-width: 100%;
    height: auto;
}

/* --- Prose (legal pages) -------------------------------------------------- */

.prose {
    max-width: 82ch;
    margin-inline: auto;
    /* Long addresses and URLs must not push the column sideways on a phone. */
    overflow-wrap: break-word;
}

/* Bootstrap's 12px gutter is tight for a wall of legal text on a small screen. */
@media (max-width: 575.98px) {
    .prose {
        padding-inline: 0.5rem;
    }
}

.prose > h1 {
    margin-bottom: 1rem;
}

.prose .lead {
    color: var(--brand-muted);
    margin-bottom: 2rem;
}

/* Section headings. The privacy policy sets its top-level titles in capitals and
   the EULA in sentence case, so keep them mid-sized and letter-spaced — a size
   that carries both without the capitals shouting. */
.prose h2 {
    font-size: 22px;
    letter-spacing: 0.01em;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    scroll-margin-top: 1.5rem;
}

.prose h3 {
    font-size: 19px;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

/* The privacy policy's section titles are already capitals, so the third level
   separates itself by weight and colour instead of another transform. */
.prose h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-text);
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
}

.prose p {
    margin-bottom: 1rem;
}

/* The documents carry their own clause numbering ("1.1.", "a)", "●") in
   data-list-text. Render that verbatim rather than renumbering with counters —
   the source numbering is irregular and legally meaningful. A two-column grid
   lets the marker gutter size itself, so "●" and "12.2." both line up. */
.prose ol,
.prose ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.75rem;
}

.prose li[data-list-text] {
    display: grid;
    grid-template-columns: minmax(1.6rem, auto) 1fr;
    column-gap: 0.7rem;
}

@media (max-width: 575.98px) {
    .prose li[data-list-text] {
        grid-template-columns: minmax(1.3rem, auto) 1fr;
        column-gap: 0.5rem;
    }

    /* Deeply numbered clauses would otherwise indent off the screen. */
    .prose li ol,
    .prose li ul {
        margin-left: -0.4rem;
    }
}

.prose li[data-list-text]::before {
    content: attr(data-list-text);
    grid-column: 1;
    color: var(--brand-navy);
    font-weight: 600;
}

.prose li[data-list-text] > * {
    grid-column: 2;
    min-width: 0;
}

.prose li > :last-child {
    margin-bottom: 0;
}

/* Nested lists start a fresh gutter rather than compounding the indent. */
.prose li ol,
.prose li ul {
    margin-top: 0.75rem;
}

/* --- Table of contents ---------------------------------------------------- */

.prose-toc {
    background: var(--tint);
    border-left: 3px solid var(--brand-sky);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}

.prose-toc h2 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--brand-muted);
    margin: 0 0 0.75rem;
    padding-top: 0;
    border-top: 0;
}

.prose-toc ol {
    counter-reset: toc;
    margin-bottom: 0;
}

.prose-toc li {
    counter-increment: toc;
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    margin-bottom: 0.35rem;
}

/* Navy, not the sky accent: these counters are content, and sky on the tint
   only reaches 2.6:1. The sky accent stays on the decorative left border. */
.prose-toc li::before {
    content: counter(toc) ".";
    color: var(--brand-navy);
    font-weight: 600;
}

.prose-toc a {
    text-decoration: none;
}

.prose-toc a:hover,
.prose-toc a:focus-visible {
    text-decoration: underline;
}

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

/* The banner keeps the artwork's 3:1 proportions, capped at the height the old
   build used, and crops from the centre outside that range. */
.harbour {
    position: relative;
    display: block;
    line-height: 0;
    aspect-ratio: 2048 / 683;
    max-height: 618px;
    min-height: 150px;
    overflow: hidden;
}

.harbour svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Settle the water into the footer instead of cutting it off at a hard edge. */
.harbour::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px 0;
    height: 24%;
    background: linear-gradient(to bottom, rgba(6, 34, 114, 0), var(--footer-navy));
    pointer-events: none;
}

.site-footer {
    background-color: var(--footer-navy);
    color: #fff;
}

.footer-grid {
    padding-top: 3.5rem;
    padding-bottom: 2.5rem;
    row-gap: 2.5rem;
}

.footer-brand img {
    width: 132px;
    height: auto;
    margin-bottom: 1rem;
}

.footer-brand p {
    max-width: 30ch;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* Column headings are quiet labels rather than competing with page headings. */
.footer-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--brand-sky);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.footer-links li + li {
    margin-top: 0.5rem;
}

.site-footer a {
    color: #fff;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: var(--brand-sky);
    text-decoration: underline;
}

.footer-address {
    font-style: normal;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-bottom p {
    margin-bottom: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* The header pill's navy ring reads as a border against white. On navy that
   trick collapses, so the footer uses a single soft outline instead. */
.site-footer .btn-login {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: none;
    padding: 7px 18px;
}

.site-footer .btn-login:hover,
.site-footer .btn-login:focus-visible {
    color: #fff;
    background-color: rgba(56, 167, 220, 0.45);
    text-decoration: none;
}

/* The three full-width section headings the old build rendered with
   .has-x-large-font-size (42px). Semantically h2, visually the page's largest type. */
.section-title {
    font-size: 42px;
}

@media (max-width: 782px) {
    .section-title { font-size: 30px; }
}
