/*
 * Base layer. Deliberately small: the blocks bring their own styling, this is
 * only the page frame, typography and the container.
 */

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

body {
    background: var(--lr-white);
    color: var(--lr-ink);
    font-family: var(--body-font);
    font-size: var(--lr-body-size);
    line-height: var(--lr-body-lh);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    color: var(--lr-ink);
    margin: 0 0 var(--lr-space-md);
}

h1 { font-size: var(--lr-h1-size); font-weight: var(--lr-h1-weight); line-height: var(--lr-h1-lh); }
h2 { font-size: var(--lr-h2-size); font-weight: var(--lr-h2-weight); line-height: var(--lr-h2-lh); }
h3 {
    color: var(--lr-ink-deep);
    font-size: var(--lr-h3-size);
    font-weight: var(--lr-h3-weight);
    letter-spacing: var(--lr-h3-ls);
    line-height: var(--lr-h3-lh);
}

p { font-size: var(--lr-body-size); line-height: var(--lr-body-lh); margin: 0 0 var(--lr-space-md); }
p:last-child { margin-bottom: 0; }

a { color: var(--lr-red); }
a:hover { color: var(--lr-red-dark); }

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

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--lr-focus);
    outline-offset: 2px;
}

/* ---- layout ---- */

.lr-container {
    margin-inline: auto;
    max-width: var(--lr-container);
    width: 100%;
}

@media (max-width: 1200px) {
    .lr-container { padding-inline: var(--lr-space-md); }
}

.lr-main { padding-block: var(--lr-space-xl); }

/* Blocks generated by the course conversion. */
.wp-block-group.lr-course-section { margin-block: 0 var(--lr-space-xl); }
.wp-block-group.lr-course-section > :last-child { margin-bottom: 0; }

.wp-block-columns { display: flex; flex-wrap: wrap; gap: var(--lr-space-lg); }
.wp-block-column { flex: 1 1 0; min-width: 0; }

.wp-block-details {
    border-bottom: 1px solid var(--lr-border);
    padding: var(--lr-space-sm) 0;
}
.wp-block-details summary {
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 700;
    padding: var(--lr-space-xs) 0;
}
.wp-block-details[open] summary { color: var(--lr-red); }

.wp-block-list { padding-left: 1.25em; }
.wp-block-list li {
    color: var(--lr-ink-deep);
    font-size: var(--lr-list-size);
    letter-spacing: var(--lr-list-ls);
    line-height: var(--lr-list-lh);
    margin-bottom: var(--lr-space-xs);
}

.wp-block-button__link,
.wp-element-button {
    background: var(--lr-red);
    border-radius: var(--lr-radius-pill);
    color: var(--lr-white);
    display: inline-block;
    font-weight: 700;
    min-height: 48px;
    padding: 13px 30px;
    text-decoration: none;
}
.wp-block-button__link:hover { background: var(--lr-red-dark); color: var(--lr-white); }

@media (max-width: 767px) {
    .wp-block-columns { flex-direction: column; }
}

/* ---- browser surfaces ----
 * The parts we did not draw still belong to the design: selection, caret,
 * scrollbars and the focus ring all ship with defaults that match no brand.
 */

::selection {
    background: var(--lr-red);
    color: var(--lr-white);
}

:is(input, textarea) { caret-color: var(--lr-red); }

* {
    scrollbar-color: var(--lr-border-strong) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar { height: 8px; width: 10px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
    background: var(--lr-border-strong);
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover { background: var(--lr-ink-muted); }

a { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Dark and red bands need a selection that is still legible on them. */
.lr-course-section.is-red ::selection,
.lr-course-section.is-dark ::selection,
.lr-course-section.is-cta ::selection {
    background: var(--lr-white);
    color: var(--lr-ink-deep);
}
