/* ==========================================================================
   Portal page content — article styles
   Apply to the rich-text container that wraps API-rendered HTML:
   <div class="page-content"> ... </div>
   ========================================================================== */

/* Base */
.page-content {
    font-size: 1rem;
    line-height: 1.618;
    color: hsl(220, 15%, 88%);
    padding: 0;
}

/* Images never overflow their container */
.page-content img {
    max-width: 100%;
    height: auto;
}

/* Headings */
.page-content h1,
.page-content h2,
.page-content h3 {
    font-weight: 700;
    letter-spacing: -0.015em;
}

.page-content h1 {
    font-size: 2.27rem;
    line-height: 1.1;
    margin: 1em 0;
}

.page-content h2 {
    font-size: 2.02rem;
    line-height: 1.15;
    margin: 1em 0;
}

.page-content h3 {
    font-size: 1.618rem;
    line-height: 1.25;
    font-weight: 600;
    margin: 1em 0;
}

/* Paragraphs (Trix wraps plain text blocks in <div>) */
.page-content > div {
    margin: 0 0 1em;
    font-size: 1rem;
    line-height: 1.618;
}

.page-content > div + div {
    margin-top: 0.382em;
}

.page-content > div:last-child {
    margin-bottom: 0;
}

/* Also keep <p> styled for nested contexts */
.page-content p {
    margin: 0 0 1em;
    font-size: 1rem;
    line-height: 1.618;
}

.page-content p:last-child {
    margin-bottom: 0;
}

/* Lists — shared */
.page-content ul,
.page-content ol {
    margin: 0 0 1em;
    padding-left: 2em;
    line-height: 1.618;
}

.page-content ul li,
.page-content ol li {
    margin-bottom: 0.618em;
    padding-left: 0.382em;
}

.page-content ul li:last-child,
.page-content ol li:last-child {
    margin-bottom: 0;
}

/* Unordered list bullets */
.page-content ul {
    list-style: disc outside;
}

.page-content ul ul {
    list-style: circle outside;
    margin: 0.618em 0;
}

.page-content ul ul ul {
    list-style: square outside;
}

/* Ordered list numbers */
.page-content ol {
    list-style: decimal outside;
}

.page-content ol ol {
    list-style: lower-alpha outside;
    margin: 0.618em 0;
}

.page-content ol ol ol {
    list-style: lower-roman outside;
}

/* Paragraphs and lists directly following a heading sit closer to it */
.page-content h1 + ul, .page-content h1 + ol,
.page-content h1 + div, .page-content h1 + p,
.page-content h2 + ul, .page-content h2 + ol,
.page-content h2 + div, .page-content h2 + p,
.page-content h3 + ul, .page-content h3 + ol,
.page-content h3 + div, .page-content h3 + p {
    margin-top: 0;
}

/* Remove top margin when a heading is the first element */
.page-content h1:first-child,
.page-content h2:first-child,
.page-content h3:first-child,
.page-content > div:first-child,
.page-content > p:first-child {
    margin-top: 0;
}

/* Remove trailing margin on last child for clean container bottom */
.page-content > *:last-child {
    margin-bottom: 0;
}
