/* Typography
 * All typography styling lives here.
 * DO NOT add typography styling to individual blocks.
 *
 * Brand: The Copy Column (Lilli Foreman)
 *   Archivo        - headlines (condensed black for the wordmark and titles, normal width for mixed headlines)
 *   DM Serif Display - the soft half of a mixed headline, drop caps, big numbers\n *   DM Serif Text  - italic asides, ledes, pull quotes and serif titles (sturdier at smaller sizes)
 *   Source Serif 4 - body copy (optical sizes, built for reading on screen)
 *   Courier Prime  - datelines, labels, navigation, buttons
 * Fonts are self-hosted in /assets/fonts via /assets/css/fonts.css.
 *
 * Heading sizes are defined in rem (html is 62.5%, so 1rem = 10px).
 * All headings scale proportionally at four breakpoints.
 */

:root {
    --base-type-spacing: 8rem;

    /* Font stacks */
    --font-display: 'Archivo', 'Arial Narrow', sans-serif;
    --font-serif-display: 'DM Serif Display', Georgia, serif;
    --font-serif-text: 'DM Serif Text', Georgia, serif;
    --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-mono: 'Courier Prime', 'Courier New', monospace;

    /* Base typography sizes */
    --body-size: 1.9rem;
    --h1-size: 9.6rem;
    --h2-size: 6.4rem;
    --h3-size: 4.4rem;
    --h4-size: 2.8rem;
    --h5-size: 2.2rem;
    --h6-size: 1.8rem;

    /* Line heights */
    --body-line-height: 1.55;
    --h1-line-height: 0.88;
    --h2-line-height: 0.9;
    --h3-line-height: 0.95;
    --h4-line-height: 1.15;
    --h5-line-height: 1.2;
    --h6-line-height: 1.25;

    /* Global type scale */
    --type-scale: 1;
}

body { font-family: var(--font-body); font-size: var(--body-size); line-height: var(--body-line-height); }

/* Headings */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: var(--brand-2);
}

h1, h2, h3, .h1, .h2, .h3 {
    font-family: var(--font-display);
    font-weight: 900;
    font-stretch: 62%;
    text-transform: uppercase;
    letter-spacing: -0.005em;
}

h4, h5, h6, .h4, .h5, .h6 {
    font-family: var(--font-body);
    font-weight: 600;
}

h1, .h1 {
    font-size: calc(var(--h1-size) * var(--type-scale));
    line-height: var(--h1-line-height);
}

h2, .h2 {
    font-size: calc(var(--h2-size) * var(--type-scale));
    line-height: var(--h2-line-height);
}

h3, .h3 {
    font-size: calc(var(--h3-size) * var(--type-scale));
    line-height: var(--h3-line-height);
}

h4, .h4 {
    font-size: calc(var(--h4-size) * var(--type-scale));
    line-height: var(--h4-line-height);
}

h5, .h5 {
    font-size: calc(var(--h5-size) * var(--type-scale));
    line-height: var(--h5-line-height);
}

h6, .h6 {
    font-size: calc(var(--h6-size) * var(--type-scale));
    line-height: var(--h6-line-height);
}

/* Responsive typography */

/* Small desktop - 90% */
@media (max-width: 1200px) {
    :root {
        --type-scale: 0.9;
    }
}

/* Tablet landscape - 80% */
@media (max-width: 992px) {
    :root {
        --type-scale: 0.8;
    }
}

/* Tablet portrait - 70% */
@media (max-width: 768px) {
    :root {
        --type-scale: 0.7;
        --body-size: 1.8rem;
    }
}

/* Mobile - 60% */
@media (max-width: 480px) {
    :root {
        --type-scale: 0.6;
        --body-size: 1.7rem;
    }
}
/* Long heading protection */
h1, .h1, h2, .h2, h3, .h3 { overflow-wrap: break-word; }

/* Heading links */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: inherit; }
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { color: var(--brand-1); }


/* Paragraphs */
p { margin: 0; }
p + p { margin-top: calc(var(--base-type-spacing) / 4); }
p:last-of-type:not(:only-child) { margin-bottom: calc(var(--base-type-spacing) / 3); }
p.narrow-para { width: 75%; margin-left: auto; margin-right: auto; }
p, li { font-size: var(--body-size); line-height: var(--body-line-height); }
p.small-para { font-size: calc(var(--body-size) * .8); }
p.med-para { font-size: calc(var(--body-size) * 1.3); }
p.larger-para { font-size: calc(var(--body-size) * 1.6); }
p.extra-large-para { font-size: calc(var(--body-size) * 2); }
/*  These use the body size variable to increase the size of the paragraph where needed. */

/* SPACING Headings */
:is(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6) { margin-top: clamp(1.5rem, 4vw, 3rem); }
:is(h1, h2, h3, h4, h5, h6).no-m { margin-top: 0; }

/* Heading colours */
.white-text :is(h1, h2, h3, h4, h5, h6) { color: #fff !important; }

/* SPACING Headings & Paragraphs */
h1 + p, h1 + .section-description { margin-top: calc(var(--base-type-spacing) / 2); }
h2 + p, h2 + .section-description { margin-top: calc(var(--base-type-spacing) / 2.5); }
h3 + p, h3 + .section-description { margin-top: calc(var(--base-type-spacing) / 3); }
h4 + p, h4 + .section-description { margin-top: calc(var(--base-type-spacing) / 3.5); }
h5 + p, h5 + .section-description { margin-top: calc(var(--base-type-spacing) / 4); }
h6 + p, h6 + .section-description { margin-top: calc(var(--base-type-spacing) / 4.5); }

p + h1 { margin-top: calc(var(--base-type-spacing) / 1); }
p + h2 { margin-top: calc(var(--base-type-spacing) / 1.25); }
p + h3 { margin-top: calc(var(--base-type-spacing) / 1.5); }
p + h4 { margin-top: calc(var(--base-type-spacing) / 1.75); }
p + h5 { margin-top: calc(var(--base-type-spacing) / 2); }
p + h6 { margin-top: calc(var(--base-type-spacing) / 2.25); }

/* SPACING Images */
img + p, p + img, picture + p, p + picture, figure + p, p + figure { margin-top: calc(var(--base-type-spacing) / 2); }
:is(h1, h2, h3, h4, h5, h6, p) + img { margin-top: calc(var(--base-type-spacing) / 1.5); }
img + :is(h1, h2, h3, h4, h5, h6, p) { margin-top: calc(var(--base-type-spacing) / 1.5); }
picture { display: block; }

/* SPACING Lists */
:is(h1, h2, h3, h4, h5, h6, p) + ol, :is(h1, h2, h3, h4, h5, h6, p) + ul { margin-top: calc(var(--base-type-spacing) / 4); }
ol + :is(h1, h2, h3, h4, h5, h6, p), ul + :is(h1, h2, h3, h4, h5, h6, p) { margin-top: calc(var(--base-type-spacing) / 4); }
ol.toast-boxed-list + :is(h1, h2, h3, h4, h5, h6, p), ul.toast-boxed-list + :is(h1, h2, h3, h4, h5, h6, p) { margin-top: calc(var(--base-type-spacing) / 1); }

/* Headings on backgrounds */
.has-bg h1, .has-bg .h1, .has-bg h2, .has-bg .h2, .has-bg h3, .has-bg .h3, .has-bg h4, .has-bg .h4, .has-bg h5, .has-bg .h5, .has-bg h6, .has-bg .h6 { color: inherit; }

/* Lists */
ul { margin-left: 1rem; padding-left: 2rem; list-style: disc outside; }
ol { margin-left: 1rem; padding-left: 2rem; }
li { margin: 0; margin-bottom: calc(var(--base-type-spacing) / 6); }
main li a { color: var(--brand-1); }
main li a:hover { color: var(--brand-2); }

/* Links */
a { text-decoration: none; color: inherit; }
p a { color: var(--brand-1); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
p a:hover { color: var(--brand-2); }

/* Tables */
p + table, table + p { margin-top: 4rem; }
table { width: 100%; border-collapse: collapse; margin-bottom: calc(var(--base-type-spacing) / 2); text-align: left; border: none; }
thead th { background-color: var(--brand-2); font-family: var(--font-mono); font-weight: 400; text-transform: uppercase; letter-spacing: .08em; text-align: left; padding: 1rem; color: var(--brand-4); }
tbody tr:nth-child(even) { background-color: var(--brand-8); }
tbody tr:nth-child(odd) { background-color: var(--brand-4); }
tbody td, tbody th { padding: 1rem; }
td { border: .1rem solid var(--brand-2); }
th { border-width: .1rem; border-style: solid; border-color: var(--brand-2); }


/* Blockquotes: a Tutu pull quote in DM Serif Text italic */
blockquote { margin: calc(var(--base-type-spacing) / 1.5) 0; padding: 3rem; background: var(--brand-3); font-family: var(--font-serif-text); font-style: italic; font-weight: 400; font-size: 3rem; line-height: 1.15; }
blockquote p { font-size: inherit; line-height: inherit; }
blockquote p:last-of-type { margin-bottom: 0; }


/* ===================================================================
 * Editorial type utilities (The Copy Column)
 * Reusable across blocks; blocks handle layout only.
 * =================================================================== */

/* Mixed headline: heavy capitals, with <em> in DM Serif Display italic */
.lf-mixed { font-family: var(--font-display); font-weight: 900; font-stretch: 100%; text-transform: uppercase; letter-spacing: -0.025em; line-height: 0.94; color: var(--brand-2); }
.lf-mixed em { font-family: var(--font-serif-display); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: -0.01em; padding-right: 0.04em; }
.lf-mixed .lf-stop { color: var(--brand-1); margin-left: -0.03em; }\n.lf-mixed em + .lf-stop { margin-left: -0.08em; }
.lf-mixed-xl { font-size: clamp(4.6rem, 7.6vw, 11.4rem); }
.lf-mixed-l { font-size: clamp(3.6rem, 4.8vw, 6.8rem); }

/* Serif title for clippings and features */
.lf-serif-title { font-family: var(--font-serif-text); font-weight: 400; font-stretch: 100%; text-transform: none; letter-spacing: -0.01em; line-height: 1.05; font-size: 3.2rem; }
.is-featured .lf-serif-title { font-size: clamp(3.6rem, 4vw, 5.2rem); }

/* Datelines, labels and margin notes */
.lf-dateline, .lf-label { font-family: var(--font-mono); font-size: 1.4rem; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.1em; }
.lf-number { font-family: var(--font-mono); font-size: 1.5rem; color: var(--brand-1); }

/* Standfirst: bold sentence-case grotesque, as in a 90s magazine spread */
.lf-standfirst { font-family: var(--font-display); font-weight: 900; font-stretch: 100%; font-size: clamp(2.4rem, 2.5vw, 3.4rem); line-height: 1.05; letter-spacing: -0.015em; color: var(--brand-2); }

/* Serif drop cap on the first paragraph */
.lf-dropcap > p:first-of-type::first-letter { float: left; font-family: var(--font-serif-display); font-weight: 400; font-size: 9.2rem; line-height: 0.78; padding: 0.6rem 0.6rem 0 0; color: var(--brand-2); }

/* Pink edit marks (available in the WYSIWYG Formats menu) */
.lf-underline { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10' preserveAspectRatio='none'%3E%3Cpath d='M1 6 C 20 2, 45 9, 70 4 S 95 5, 99 3' fill='none' stroke='%23C2255C' stroke-width='2.4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 0.45em; padding-bottom: 0.18em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lf-strike { text-decoration: line-through; text-decoration-color: var(--brand-1); text-decoration-thickness: 0.14em; color: var(--brand-6); }
.lf-highlight { background: var(--brand-3); padding: 0 0.2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lf-note { font-family: var(--font-mono); font-size: 1.4rem; color: var(--brand-1); }

/* Big condensed display headline (the homepage H1) */
.lf-display { font-family: var(--font-display); font-weight: 900; font-stretch: 62%; text-transform: uppercase; letter-spacing: -0.01em; line-height: 0.82; color: var(--brand-2); }
.lf-display-xl { font-size: clamp(6.4rem, 11.6vw, 18.4rem); }

/* Pink Bodoni italic aside under a headline */
.lf-aside { font-family: var(--font-serif-text); font-style: italic; font-weight: 400; color: var(--brand-1); font-size: clamp(2.6rem, 3vw, 4.4rem); line-height: 1.12; padding-bottom: 0.08em; }

/* Bodoni italic lede */
.lf-lede { font-family: var(--font-serif-text); font-style: italic; font-weight: 400; font-size: clamp(2.2rem, 2vw, 2.8rem); line-height: 1.25; }

/* Small uppercase 'read more' link with an arrow in the text */
.lf-more { display: inline-block; align-self: flex-start; padding: 0.8rem 0; font-family: var(--font-mono); font-size: 1.5rem; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand-1); text-decoration: none; }
.lf-more:hover { color: var(--brand-2); text-decoration: underline; text-underline-offset: 0.4em; }
.lf-more-ink { color: var(--brand-2); }
.lf-more-ink:hover { color: var(--brand-1); }

/* Tablet */
@media screen and (max-width: 768px) {
	table { overflow-x: auto; width: 100%; }
	:root { --base-type-spacing: 4.5rem; }
}

/* Mobile */
@media screen and (max-width: 576px) {
	:root { --base-type-spacing: 3rem; }
	.lf-dropcap > p:first-of-type::first-letter { font-size: 7rem; }
}
