
/*
|--------------------------------------------------------------------------
| HASTEC BLOG ARTICLE STYLES
|--------------------------------------------------------------------------
| Applies to:
| <div class="rich-content article-body article-content">
|     <?= $post['body_html'] ?>
| </div>
|
| Brand colours: Royal Blue, Gold and White
|--------------------------------------------------------------------------
*/

/* ARTICLE BODY */
.article-content {
    --article-blue: #17288f;
    --article-blue-dark: #101c66;
    --article-gold: #d9a928;
    --article-text: #263047;
    --article-muted: #65708a;
    --article-border: #e5e9f2;

    width: 100%;
    max-width: 100%;
    color: var(--article-text);
    font-size: 17px;
    line-height: 1.85;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: normal;
}

.article-content *,
.article-content *::before,
.article-content *::after {
    box-sizing: border-box;
}

.article-content > *:first-child {
    margin-top: 0;
}

.article-content > *:last-child {
    margin-bottom: 0;
}

/* PARAGRAPHS */
.article-content p {
    margin: 0 0 1.35em;
    color: var(--article-text);
}

/* HEADINGS */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: var(--article-blue-dark);
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin: 1.7em 0 0.65em;
    scroll-margin-top: 100px;
}

.article-content h1 {
    font-size: clamp(28px, 4vw, 40px);
}

.article-content h2 {
    position: relative;
    font-size: clamp(24px, 3vw, 31px);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--article-border);
}

.article-content h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 65px;
    height: 3px;
    background: var(--article-gold);
}

.article-content h3 {
    font-size: clamp(21px, 2.5vw, 25px);
}

.article-content h4 {
    font-size: 20px;
}

.article-content h5 {
    font-size: 18px;
}

.article-content h6 {
    font-size: 16px;
}

/* LINKS */
.article-content a {
    color: var(--article-blue);
    text-decoration: underline;
    text-decoration-color: rgba(23, 40, 143, 0.4);
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    transition: color 0.2s ease;
}

.article-content a:hover {
    color: var(--article-gold);
}

/* BOLD AND ITALIC TEXT */
.article-content strong,
.article-content b {
    color: #18245f;
    font-weight: 800;
}

.article-content em,
.article-content i {
    color: inherit;
}

/* LISTS */
.article-content ul,
.article-content ol {
    margin: 0 0 1.5em;
    padding-left: 1.7em;
}

.article-content li {
    margin: 0.45em 0;
    padding-left: 0.15em;
}

.article-content ul li::marker {
    color: var(--article-gold);
}

.article-content ol li::marker {
    color: var(--article-blue);
    font-weight: 800;
}

.article-content li > ul,
.article-content li > ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* BLOCKQUOTES */
.article-content blockquote {
    margin: 1.7em 0;
    padding: 1.2em 1.4em;
    border-left: 5px solid var(--article-gold);
    border-radius: 0 12px 12px 0;
    background: #f7f8fc;
    color: #46516b;
    font-size: 1.05em;
}

.article-content blockquote > *:last-child {
    margin-bottom: 0;
}

/* HORIZONTAL DIVIDER */
.article-content hr {
    border: 0;
    border-top: 1px solid var(--article-border);
    margin: 2em 0;
}

/* IMAGES */
.article-content img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(20, 35, 85, 0.10);
}

/* Images inserted as standalone content */
.article-content p > img:only-child {
    max-width: 100%;
}

/* IMAGE ALIGNMENT: CENTER */
.article-content img[style*="margin-left: auto"],
.article-content img[style*="margin-right: auto"] {
    display: block;
}

/* IMAGE ALIGNMENT: LEFT */
.article-content img[style*="float: left"],
.article-content img[style*="float:left"] {
    margin: 0.35em 1.4em 1em 0;
}

/* IMAGE ALIGNMENT: RIGHT */
.article-content img[style*="float: right"],
.article-content img[style*="float:right"] {
    margin: 0.35em 0 1em 1.4em;
}

/* IMAGE FIGURES AND CAPTIONS */
.article-content figure {
    max-width: 100%;
    margin: 1.7em auto;
    text-align: center;
}

.article-content figure img {
    max-width: 100%;
    height: auto;
}

.article-content figcaption,
.article-content .image-caption {
    margin-top: 0.65em;
    color: var(--article-muted);
    font-size: 14px;
    line-height: 1.6;
    font-style: italic;
    text-align: center;
}

/* TABLES */
.article-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 15px;
    border: 1px solid var(--article-border);
}

.article-content th,
.article-content td {
    padding: 12px 14px;
    border: 1px solid var(--article-border);
    text-align: left;
    vertical-align: top;
}

.article-content th {
    background: #f0f3ff;
    color: var(--article-blue-dark);
    font-weight: 800;
}

.article-content tr:nth-child(even) td {
    background: #fbfcff;
}

/* Allow wide tables to scroll on small screens */
.article-content table {
    display: block;
    overflow-x: auto;
}

/* INLINE CODE */
.article-content code {
    font-family: Consolas, Monaco, monospace;
    background: #f0f2f8;
    color: #17288f;
    padding: 0.15em 0.4em;
    border-radius: 5px;
    font-size: 0.9em;
}

/* CODE BLOCKS */
.article-content pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 1.1em;
    border-radius: 10px;
    background: #10172f;
    color: #f3f5ff;
    line-height: 1.65;
    white-space: pre;
}

.article-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

/* CALLOUT BOXES
   Optional HTML classes: tip, notice, callout, warning, success
*/
.article-content .tip,
.article-content .notice,
.article-content .callout {
    margin: 1.5em 0;
    padding: 1em 1.2em;
    border: 1px solid #dbe3ff;
    border-left: 4px solid var(--article-blue);
    border-radius: 10px;
    background: #f4f6ff;
}

.article-content .warning {
    background: #fff8e8;
    border-color: #f2dfae;
    border-left-color: var(--article-gold);
}

.article-content .success {
    background: #effaf3;
    border-color: #ccebd7;
    border-left-color: #24834b;
}

/* VIDEO AND EMBEDDED CONTENT */
.article-content iframe,
.article-content video {
    max-width: 100%;
}

.article-content iframe {
    width: 100%;
    border: 0;
    border-radius: 12px;
}

/* TEXT ALIGNMENT */
.article-content [style*="text-align: center"] {
    text-align: center;
}

.article-content [style*="text-align: right"] {
    text-align: right;
}

.article-content [style*="text-align: justify"] {
    text-align: justify;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .article-content {
        font-size: 16px;
        line-height: 1.8;
    }

    .article-content h1 {
        font-size: 29px;
    }

    .article-content h2 {
        font-size: 25px;
        margin-top: 1.45em;
    }

    .article-content h3 {
        font-size: 21px;
    }

    .article-content figure {
        margin: 1.3em 0;
    }

    .article-content table {
        font-size: 14px;
    }

    .article-content th,
    .article-content td {
        padding: 9px 10px;
    }

    /* Prevent floated images from breaking the mobile layout */
    .article-content img[style*="float: left"],
    .article-content img[style*="float:left"],
    .article-content img[style*="float: right"],
    .article-content img[style*="float:right"] {
        float: none !important;
        display: block;
        width: auto;
        max-width: 100% !important;
        height: auto;
        margin: 1em auto;
    }
}

@media (max-width: 480px) {
    .article-content {
        font-size: 15.5px;
    }

    .article-content blockquote {
        padding: 1em;
    }

    .article-content ul,
    .article-content ol {
        padding-left: 1.35em;
    }

    .article-content pre {
        padding: 0.8em;
        font-size: 13px;
    }
}
