/* Auto Glass World - Content (modules/pages/page_content.php): visual editor text + "On this page" list. */
.agw-page-content {
    padding: var(--agw-space-head) 0 var(--agw-space-section);
    border-top: 1px solid var(--agw-color-cool-line);
    background: var(--agw-color-cool);
    counter-reset: agw-h2;
}

.agw-page-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.agw-page-content.has-toc .agw-page-content-grid {
    grid-template-columns: 260px minmax(0, 760px);
    gap: var(--agw-gap);
    align-items: start;
    justify-content: start;
}

/* "On this page": sticky under the compact header (about 68px high). */
.agw-toc {
    position: sticky;
    top: 96px;
}

.admin-bar .agw-toc {
    top: 128px;
}

.agw-toc-title {
    margin: 0 0 6px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--agw-color-cool-line);
    color: var(--agw-color-muted);
    font-family: var(--agw-font-mono);
    font-size: var(--agw-fs-label);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.agw-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.agw-toc a {
    display: flex;
    gap: 12px;
    padding: 9px 0 9px 12px;
    border-bottom: 1px solid var(--agw-color-cool-line);
    box-shadow: inset 0 0 0 var(--agw-color-primary);
    color: var(--agw-color-muted);
    font-size: 15px;
    line-height: 1.35;
    transition: color var(--agw-transition), box-shadow var(--agw-transition);
}

.agw-toc a span {
    padding-top: 2px;
    color: var(--agw-color-primary);
    font-family: var(--agw-font-mono);
    font-size: var(--agw-fs-label);
}

.agw-toc a:hover,
.agw-toc a:focus-visible {
    color: var(--agw-color-text);
}

.agw-toc a.is-active {
    box-shadow: inset 3px 0 0 var(--agw-color-primary);
    color: var(--agw-color-text);
    font-weight: 600;
}

/* Text from the visual editor. Headings inside long copy use the h3 size, not the section-title size. */
.agw-prose {
    min-width: 0;
    color: var(--agw-color-muted);
    font-size: var(--agw-fs-lead);
    line-height: 1.65;
}

/* Pasted HTML may wrap each part in <section>: its first heading also starts flush with the list on the left. */
.agw-prose > :first-child,
.agw-prose > :first-child > :first-child {
    margin-top: 0;
}

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

.agw-prose h2,
.agw-prose h3,
.agw-prose h4 {
    margin: var(--agw-space-head) 0 16px;
    color: var(--agw-color-text);
    line-height: 1.05;
    scroll-margin-top: 96px; /* clears the compact header */
}

.agw-prose h2 {
    font-size: var(--agw-fs-h3);
}

.agw-prose h3 {
    margin-top: 32px;
    font-size: clamp(20px, calc(20px + 4 * (100vw - 1280px) / 640), 24px);
}

.agw-prose h4 {
    margin-top: 28px;
    font-size: 20px;
}

/* "01" above each Heading 2, matching the list on the left. */
.has-toc .agw-prose h2::before {
    content: counter(agw-h2, decimal-leading-zero);
    counter-increment: agw-h2;
    display: block;
    margin-bottom: 10px;
    color: var(--agw-color-primary);
    font-family: var(--agw-font-mono);
    font-size: var(--agw-fs-label);
    font-weight: 500;
    letter-spacing: 0.14em;
}

.agw-prose p,
.agw-prose ul,
.agw-prose ol,
.agw-prose blockquote,
.agw-prose table {
    margin: 0 0 14px;
}

.agw-prose ul,
.agw-prose ol {
    display: grid;
    gap: 10px;
    padding: 0;
}

.agw-prose ul {
    list-style: none;
}

.agw-prose ol {
    padding-left: 1.4em;
}

.agw-prose ul > li {
    position: relative;
    padding-left: 26px;
}

/* Blue tick for bullet lists. */
.agw-prose ul > li::before {
    content: "";
    position: absolute;
    top: 0.62em;
    left: 2px;
    width: 10px;
    height: 6px;
    border-bottom: 1.6px solid var(--agw-color-primary);
    border-left: 1.6px solid var(--agw-color-primary);
    transform: rotate(-45deg);
}

.agw-prose ol > li::marker {
    color: var(--agw-color-primary);
    font-weight: 600;
}

.agw-prose strong,
.agw-prose b {
    color: var(--agw-color-text);
    font-weight: 600;
}

.agw-prose a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.agw-prose blockquote {
    padding-left: 20px;
    border-left: 3px solid var(--agw-color-primary);
    color: var(--agw-color-text);
}

.agw-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.agw-prose th,
.agw-prose td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--agw-color-cool-line);
    text-align: left;
}

.agw-prose hr {
    margin: 32px 0;
    border: 0;
    border-top: 1px solid var(--agw-color-cool-line);
}

.agw-prose img {
    border-radius: 12px;
}

.agw-prose .alignleft {
    float: left;
    margin: 0 24px 16px 0;
}

.agw-prose .alignright {
    float: right;
    margin: 0 0 16px 24px;
}

.agw-prose .aligncenter {
    display: block;
    margin-inline: auto;
}

@media (max-width: 991px) {
    .agw-page-content.has-toc .agw-page-content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .agw-toc {
        display: none;
    }
}

@media (max-width: 575px) {
    .agw-prose .alignleft,
    .agw-prose .alignright {
        float: none;
        margin: 0 0 16px;
    }
}
