/*
 * TC Articles shared content stylesheet.
 *
 * Load this file:
 *   1. inside the TC Articles TinyMCE editor; and
 *   2. on the public article detail page.
 *
 * Article HTML should use tc-article-* classes rather than inline styles.
 */

.tc-article-content {
    color: #20252b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

body.tc-article-content {
    box-sizing: border-box;
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 22px 40px;
    background: #fff;
}

.tc-article-content *,
body.tc-article-content * {
    box-sizing: border-box;
}

/*
 * Base article typography.
 *
 * TinyMCE supplies similar defaults internally. Defining them here makes the
 * public article page render the same way instead of inheriting conflicting
 * list, paragraph, heading, and link rules from the SunShop storefront theme.
 */
.tc-article-content h1,
.tc-article-content h2,
.tc-article-content h3,
.tc-article-content h4,
.tc-article-content h5,
.tc-article-content h6,
body.tc-article-content h1,
body.tc-article-content h2,
body.tc-article-content h3,
body.tc-article-content h4,
body.tc-article-content h5,
body.tc-article-content h6 {
    margin: 1.4em 0 0.55em;
    color: #20252b;
    font-family: inherit;
    font-weight: 700;
    line-height: 1.2;
}

.tc-article-content h1,
body.tc-article-content h1 {
    font-size: 2rem;
}

.tc-article-content h2,
body.tc-article-content h2 {
    font-size: 1.55rem;
}

.tc-article-content h3,
body.tc-article-content h3 {
    font-size: 1.25rem;
}

.tc-article-content h4,
body.tc-article-content h4 {
    font-size: 1.05rem;
}

.tc-article-content h5,
.tc-article-content h6,
body.tc-article-content h5,
body.tc-article-content h6 {
    font-size: 1rem;
}

.tc-article-content p,
body.tc-article-content p {
    margin: 0 0 1rem;
}

.tc-article-content ul,
.tc-article-content ol,
body.tc-article-content ul,
body.tc-article-content ol {
    display: block;
    margin: 0 0 1rem;
    padding-left: 2rem;
}

.tc-article-content ul,
body.tc-article-content ul {
    list-style: disc outside;
}

.tc-article-content ol,
body.tc-article-content ol {
    list-style: decimal outside;
}

.tc-article-content li,
body.tc-article-content li {
    display: list-item;
    margin: 0.25rem 0;
    padding: 0;
}

.tc-article-content li > ul,
.tc-article-content li > ol,
body.tc-article-content li > ul,
body.tc-article-content li > ol {
    margin-top: 0.35rem;
    margin-bottom: 0.35rem;
}

.tc-article-content ul ul,
body.tc-article-content ul ul {
    list-style-type: circle;
}

.tc-article-content ul ul ul,
body.tc-article-content ul ul ul {
    list-style-type: square;
}

.tc-article-content a,
body.tc-article-content a {
    color: #1f679f;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tc-article-content a:hover,
.tc-article-content a:focus,
body.tc-article-content a:hover,
body.tc-article-content a:focus {
    color: #174f80;
}

.tc-article-content blockquote,
body.tc-article-content blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #9eabb6;
    background: #f5f7f8;
    color: #3d4750;
}

.tc-article-content hr,
body.tc-article-content hr {
    height: 0;
    margin: 1.75rem 0;
    border: 0;
    border-top: 1px solid #cbd2d9;
}

.tc-article-content pre,
body.tc-article-content pre {
    max-width: 100%;
    margin: 1rem 0;
    padding: 1rem;
    overflow: auto;
    border: 1px solid #cbd2d9;
    border-radius: 4px;
    background: #f4f6f7;
    white-space: pre-wrap;
}

.tc-article-content code,
body.tc-article-content code {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.92em;
}

.tc-article-content figure,
body.tc-article-content figure {
    max-width: 100%;
}

.tc-article-content::after,
body.tc-article-content::after,
.tc-article-clear::after {
    display: table;
    clear: both;
    content: "";
}

.tc-article-content img,
body.tc-article-content img {
    max-width: 100%;
    height: auto;
}

.tc-article-content table,
body.tc-article-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

.tc-article-content th,
.tc-article-content td,
body.tc-article-content th,
body.tc-article-content td {
    padding: 9px 10px;
    border: 1px solid #cbd2d9;
    vertical-align: top;
}

.tc-article-content th,
body.tc-article-content th {
    background: #f1f4f6;
    text-align: left;
}

.tc-article-section {
    margin: 0 0 2rem;
}

.tc-article-section > :first-child,
.tc-article-callout > :first-child,
.tc-article-download > :first-child,
.tc-article-figure > :first-child {
    margin-top: 0;
}

.tc-article-section > :last-child,
.tc-article-callout > :last-child,
.tc-article-download > :last-child,
.tc-article-figure > :last-child {
    margin-bottom: 0;
}

.tc-article-lead {
    margin: 0 0 1.5rem;
    color: #34495a;
    font-size: 1.18em;
    line-height: 1.55;
}

.tc-article-callout {
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem;
    border: 1px solid #b9c8d5;
    border-left: 5px solid #1f679f;
    border-radius: 5px;
    background: #f3f7fa;
}

.tc-article-callout--info {
    border-left-color: #1f679f;
    background: #edf5fb;
}

.tc-article-callout--warning {
    border-color: #d5bd78;
    border-left-color: #b98516;
    background: #fff8e8;
}

.tc-article-callout h1,
.tc-article-callout h2,
.tc-article-callout h3,
.tc-article-callout h4,
.tc-article-callout h5,
.tc-article-callout h6 {
    margin-top: 0;
}

.tc-article-grid {
    display: grid;
    gap: 1.5rem;
    margin: 1.5rem 0;
    align-items: start;
}

.tc-article-grid > * {
    min-width: 0;
}

.tc-article-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tc-article-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/*
 * Optional equal-height grid rows.
 *
 * The base grid keeps align-items: start so unrelated columns may retain
 * natural heights. Add tc-article-grid--equal when all items in the same
 * desktop grid row should stretch to the height of the tallest item.
 */
.tc-article-grid--equal {
    align-items: stretch;
}

.tc-article-grid--equal > * {
    align-self: stretch;
}

.tc-article-figure {
    margin: 1.5rem auto;
    text-align: center;
}

.tc-article-figure img {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

.tc-article-figure figcaption {
    margin-top: 0.55rem;
    color: #66717c;
    font-size: 0.9em;
    line-height: 1.45;
}

.tc-article-image-left {
    float: left;
    width: auto;
    max-width: 45% !important;
    margin: 0.25rem 1.4rem 1rem 0;
}

.tc-article-image-right {
    float: right;
    width: auto;
    max-width: 45% !important;
    margin: 0.25rem 0 1rem 1.4rem;
}

.tc-article-image-center {
    display: block;
    margin: 1rem auto;
}

/*
 * User-selectable article banner image.
 * The class name is intentionally "banner" because it is exposed in TinyMCE.
 */
.tc-article-content img.banner,
body.tc-article-content img.banner,
img.banner {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto 1.5rem;
    object-fit: contain;
}

.tc-article-download {
    margin: 1.25rem 0;
    padding: 1rem 1.15rem;
    border: 1px solid #b9c8d5;
    border-radius: 5px;
    background: #f4f7f9;
}

.tc-article-download a {
    font-weight: bold;
}

.tc-article-button {
    display: inline-block;
    padding: 0.7rem 1.1rem;
    border: 1px solid #174f80;
    border-radius: 4px;
    background: #1f679f;
    color: #fff !important;
    font-weight: bold;
    line-height: 1.25;
    text-decoration: none !important;
}

.tc-article-button:hover,
.tc-article-button:focus {
    background: #174f80;
}

.tc-article-button--secondary {
    background: #fff;
    color: #1f679f !important;
}

.tc-article-button--secondary:hover,
.tc-article-button--secondary:focus {
    background: #edf4f9;
}

.tc-article-clear {
    clear: both;
}

.tc-article-text-left,
.alignleft {
    text-align: left;
}

.tc-article-text-center,
.aligncenter {
    text-align: center;
}

.tc-article-text-right,
.alignright {
    text-align: right;
}

@media (max-width: 760px) {
    .tc-article-grid--two,
    .tc-article-grid--three {
        grid-template-columns: 1fr;
    }

    .tc-article-image-left,
    .tc-article-image-right {
        float: none;
        display: block;
        width: auto;
        max-width: 100% !important;
        margin: 1rem auto;
    }
}


/* SunShop product cards embedded directly in TC Articles content. */
.tc-article-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
    align-items: stretch;
}

.tc-article-product-card {
    display: inline-block;
    box-sizing: border-box;
    width: min(100%, 300px);
    margin: 1rem;
    padding: 0;
    vertical-align: top;
    text-align: center;
}

.tc-article-product-grid .tc-article-product-card {
    display: block;
    width: 100%;
    margin: 0;
}

.tc-article-product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.tc-article-product-card__image {
    display: block;
    width: 100%;
    max-width: 285px;
    height: 285px;
    margin: 0 auto 1rem;
    object-fit: contain;
}

.tc-article-product-card__image-placeholder {
    display: flex;
    width: 100%;
    max-width: 285px;
    height: 285px;
    margin: 0 auto 1rem;
    align-items: center;
    justify-content: center;
    background: #f1f4f6;
    color: #68727d;
}

.tc-article-product-card__title {
    margin: 0 0 0.5rem;
    color: #233b52;
    font-size: 1.18rem;
    line-height: 1.35;
}

.tc-article-product-card__action {
    margin: auto 0 0;
    padding-top: 0.25rem;
    font-weight: 700;
    text-decoration: underline;
}


.tc-article-product-card__link:hover .tc-article-product-card__title,
.tc-article-product-card__link:focus .tc-article-product-card__title {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .tc-article-product-card {
        display: block;
        width: 100%;
        margin: 1rem 0;
    }

    .tc-article-product-card__image,
    .tc-article-product-card__image-placeholder {
        height: auto;
        min-height: 220px;
    }
}
