/* Rich text from the admin editor (every `.prose` block on the public site).
   The views use Tailwind `prose` classes but the typography plugin is not in the build,
   so this file supplies the styling. Selectors start with `body.antialiased section` so they
   outrank the global `body.antialiased section h2 { font-size: clamp(...3rem); line-height: 1.12 }`
   rule that made headings huge and squeezed Lao glyphs into each other. */

body.antialiased section .prose {
    color: #3e4852;
    font-size: 1.04rem;
    line-height: 1.85;
    overflow-wrap: break-word;
}

body.antialiased section .prose > :first-child {
    margin-top: 0;
}

body.antialiased section .prose > :last-child {
    margin-bottom: 0;
}

/* headings */
body.antialiased section .prose h1,
body.antialiased section .prose h2 {
    margin: 2rem 0 .8rem;
    font-size: 1.35rem;
    line-height: 1.55;
    font-weight: 700;
    letter-spacing: 0;
    color: #1f2933;
}

body.antialiased section .prose h3,
body.antialiased section .prose h4,
body.antialiased section .prose h5 {
    margin: 1.6rem 0 .6rem;
    font-size: 1.12rem;
    line-height: 1.6;
    font-weight: 700;
    letter-spacing: 0;
    color: #1f2933;
}

/* paragraphs */
body.antialiased section .prose p {
    margin: 0 0 1rem;
    font-size: 1.04rem;
    line-height: 1.85;
}

/* editor leaves runs of empty <p>&nbsp;</p>: collapse them */
body.antialiased section .prose p:empty,
body.antialiased section .prose p:has(> br:only-child) {
    display: none;
}

body.antialiased section .prose strong {
    font-weight: 700;
    color: #1f2933;
}

/* lists */
body.antialiased section .prose ul,
body.antialiased section .prose ol {
    margin: 0 0 1.15rem;
    padding: 0;
    list-style: none;
}

body.antialiased section .prose li {
    position: relative;
    margin: .5rem 0;
    padding-left: 1.5rem;
    font-size: 1.04rem;
    line-height: 1.85;
}

body.antialiased section .prose ul > li::before {
    content: '';
    position: absolute;
    left: .3rem;
    top: .74em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff632a;
}

body.antialiased section .prose ul ul {
    margin: .3rem 0 .4rem;
}

body.antialiased section .prose ul ul > li::before {
    width: 6px;
    height: 6px;
    background: transparent;
    border: 1.5px solid #ff632a;
}

body.antialiased section .prose ol {
    counter-reset: kpg-ol;
}

body.antialiased section .prose ol > li {
    counter-increment: kpg-ol;
}

body.antialiased section .prose ol > li::before {
    content: counter(kpg-ol) '.';
    position: absolute;
    left: 0;
    font-weight: 700;
    color: #ff632a;
}

/* links */
body.antialiased section .prose a {
    color: #e85520;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(232, 85, 32, .3);
}

body.antialiased section .prose a:hover {
    border-bottom-color: currentColor;
}

/* images and figures from the editor */
body.antialiased section .prose img {
    max-width: 100%;
    height: auto;
    border-radius: .85rem;
}

body.antialiased section .prose figure {
    margin: 1.6rem 0;
}

body.antialiased section .prose figure img {
    display: block;
    margin: 0 auto;
}

body.antialiased section .prose figcaption {
    margin-top: .5rem;
    text-align: center;
    font-size: .9rem;
    color: #8a939c;
}

/* quotes */
body.antialiased section .prose blockquote {
    margin: 1.5rem 0;
    padding: .9rem 1.2rem;
    border-left: 4px solid #ff632a;
    border-radius: 0 .6rem .6rem 0;
    background: #fff6f1;
    color: #3e4852;
}

body.antialiased section .prose blockquote p:last-child {
    margin-bottom: 0;
}

/* tables */
body.antialiased section .prose table {
    width: 100%;
    margin: 1.4rem 0;
    border-collapse: collapse;
    font-size: .96rem;
    display: block;
    overflow-x: auto;
}

body.antialiased section .prose th,
body.antialiased section .prose td {
    padding: .6rem .8rem;
    border: 1px solid #eceef1;
    text-align: left;
    vertical-align: top;
}

body.antialiased section .prose th {
    background: #f7f8fa;
    font-weight: 700;
    color: #1f2933;
}

body.antialiased section .prose hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid #eceef1;
}

/* text blocks that sit on a dark band keep their own light colours */
body.antialiased section.bg-dark-900 .prose,
body.antialiased section.bg-dark-800 .prose {
    color: rgba(255, 255, 255, .85);
}

@media (max-width: 640px) {
    body.antialiased section .prose,
    body.antialiased section .prose p,
    body.antialiased section .prose li {
        font-size: 1rem;
    }

    body.antialiased section .prose h1,
    body.antialiased section .prose h2 {
        font-size: 1.22rem;
    }
}
