/*
 * Article components — the single source of truth for CMS article body styling.
 *
 * Design: "Content tool design options" handoff (2026-08-21), built on the
 * @okay/myokay-ui token system (okayStyles.txt). Every hex comes from the
 * style guide — canonical teals #085963 identity / #08888C action / #018190
 * link / #52C1B9 hover; gold #BC9408/#E1C678/#F8EBC3 is exclusives-only;
 * crimson #B61229 is contact-only. Sharp corners (radius 0 buttons, 4px cards).
 *
 * Consumed by:
 *   1. The Content Tool editor (.rte-content .ProseMirror gets .article-body)
 *   2. The AI Compose preview (.compose-body gets .article-body)
 *   3. okay.com article detail pages (the article body container gets .article-body)
 *
 * Fonts (Open Sans / Lato via Google, Freight Neo Pro / Chronicle Display from
 * fonts.okay.com) are loaded by each consumer, not by this file — okay.com
 * already loads them via /res/fonts/css/external.css; the editor entry HTMLs
 * load the same sources so the preview matches.
 *
 * Everything is scoped under .article-body. Markup is semantic and class-based
 * (classes prefixed art-, variants via data-variant) — no inline styles.
 */

.article-body {
    --ok-teal-identity: #085963;
    --ok-teal-action: #08888C;
    --ok-teal-link: #018190;
    --ok-teal-hover: #52C1B9;
    --ok-text: #333;
    --ok-text-caption: #666;
    --ok-text-casual: #999;
    --ok-line-light: #EEE;
    --ok-line: #DDD;
    --ok-bg-lift: #F9F9F9;
    --ok-gold: #BC9408;
    --ok-gold-btn: #E1C678;
    --ok-gold-pale: #F8EBC3;
    --ok-maroon: #6B3135;
    --ok-crimson: #B61229;
    --ok-body-font: 'Open Sans', 'Noto Sans TC', sans-serif;
    --ok-ui-font: Lato, 'Noto Sans TC', sans-serif;
    --ok-display-font: 'Freight Neo Pro', 'Noto Sans TC', sans-serif;
    --ok-serif-font: 'Chronicle Display', Georgia, 'Noto Sans TC', serif;

    font-family: var(--ok-body-font);
    color: var(--ok-text);
    font-size: 15px;
    line-height: 1.6;
}

/* ---------- Base typography ---------- */

.article-body p {
    margin: 0 0 20px;
}

.article-body b,
.article-body strong {
    font-weight: 600;
}

.article-body h2 {
    font-family: var(--ok-display-font);
    font-size: 22px;
    font-weight: 300;
    color: var(--ok-teal-identity);
    line-height: 1.35;
    margin: 26px 0 10px;
}

.article-body h3 {
    font-family: var(--ok-body-font);
    font-size: 17px;
    font-weight: 600;
    color: var(--ok-text);
    line-height: 1.4;
    margin: 22px 0 8px;
}

.article-body h2:first-child,
.article-body h3:first-child {
    margin-top: 0;
}

/* Inline links: link teal, no underline (news-article pattern). */
.article-body a {
    color: var(--ok-teal-link);
    text-decoration: none;
}

/* Markers are declared explicitly — okay.com's global reset (ul li { list-style: none })
   would otherwise strip them. Component lists (.art-steps, .art-highlights) keep their
   own `list-style: none` and are unaffected. */
.article-body ul,
.article-body ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body ul li,
.article-body ol li {
    list-style: inherit;
}

.article-body li {
    margin-bottom: 6px;
}

.article-body hr {
    border: 0;
    border-top: 1px solid var(--ok-line);
    margin: 26px 0;
}

.article-body blockquote {
    border-left: 2px solid var(--ok-teal-action);
    margin: 0 0 22px;
    padding: 4px 0 4px 20px;
    color: var(--ok-text-caption);
    font-style: italic;
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Full-width media, sharp corners. The site strips inline styles from
   img/video/table at hydration — sizing must come from here. */
.article-body img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.article-body video {
    width: 100%;
}

/* ---------- Section kicker (Lato uppercase label above a heading) ---------- */

.article-body .art-kicker {
    font-family: var(--ok-ui-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ok-teal-link);
    margin: 26px 0 4px;
}

.article-body .art-kicker:first-child {
    margin-top: 0;
}

.article-body .art-kicker + h2 {
    margin-top: 0;
}

/* ---------- Key figures (data-variant: cards [default] | strip) ---------- */

.article-body .art-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 0 0 26px;
}

.article-body .art-stat {
    background: #FFF;
    border: 1px solid var(--ok-line-light);
    border-top: 2px solid var(--ok-teal-action);
    border-radius: 0 0 4px 4px;
    box-shadow: 1px 2px 4px -2px #999;
    padding: 18px 16px;
}

.article-body .art-stat-value {
    font-size: 28px;
    font-weight: 300;
    color: var(--ok-teal-identity);
    line-height: 1.2;
    margin-bottom: 4px;
}

.article-body .art-stat-label {
    font-family: var(--ok-ui-font);
    font-size: 13px;
    color: var(--ok-text-caption);
}

/* Strip variant (7b): lifted grey band between rules, label above value. */
.article-body .art-stats[data-variant="strip"] {
    background: var(--ok-bg-lift);
    border-top: 1px solid var(--ok-line);
    border-bottom: 1px solid var(--ok-line);
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0;
}

.article-body .art-stats[data-variant="strip"] .art-stat {
    background: none;
    border: 0;
    border-right: 1px solid var(--ok-line-light);
    border-radius: 0;
    box-shadow: none;
    padding: 16px 14px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
}

.article-body .art-stats[data-variant="strip"] .art-stat:last-child {
    border-right: 0;
}

.article-body .art-stats[data-variant="strip"] .art-stat-value {
    font-size: 20px;
    margin-bottom: 0;
}

.article-body .art-stats[data-variant="strip"] .art-stat-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

@media (max-width: 560px) {
    .article-body .art-stats {
        grid-template-columns: 1fr;
    }

    .article-body .art-stats[data-variant="strip"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Numbered steps (identity-teal discs, #DDD connector) ---------- */

.article-body .art-steps {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
    counter-reset: art-step;
}

.article-body .art-steps > li {
    counter-increment: art-step;
    position: relative;
    margin: 0;
    padding: 0 0 24px 45px;
}

.article-body .art-steps > li:last-child {
    padding-bottom: 14px;
}

.article-body .art-steps > li::before {
    content: counter(art-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 29px;
    height: 29px;
    border-radius: 100%;
    background: var(--ok-teal-identity);
    color: #FFF;
    font-family: var(--ok-ui-font);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-body .art-steps > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 30px;
    bottom: -2px;
    width: 1px;
    background: var(--ok-line);
}

.article-body .art-steps > li > p {
    margin: 0;
    font-size: 14px;
    color: var(--ok-text-caption);
}

.article-body .art-steps > li > p:first-child {
    font-size: 15px;
    font-weight: 600;
    color: var(--ok-teal-identity);
    margin-bottom: 2px;
}

/* ---------- Tables (Lato uppercase headers on lifted grey) ---------- */

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 22px;
    font-size: 14px;
}

.article-body th {
    text-align: left;
    font-family: var(--ok-ui-font);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ok-text-caption);
    font-weight: 600;
    background: var(--ok-bg-lift);
    border-bottom: 1px solid var(--ok-line);
    padding: 8px 12px;
}

.article-body td {
    border-bottom: 1px solid var(--ok-line-light);
    padding: 8px 12px;
    vertical-align: top;
}

.article-body th p,
.article-body td p {
    margin: 0;
}

@media (max-width: 640px) {
    .article-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ---------- Figure with caption (caption over a light rule) ---------- */

.article-body .art-figure {
    margin: 0 0 20px;
}

.article-body .art-figure figcaption {
    font-family: var(--ok-ui-font);
    font-size: 12px;
    color: var(--ok-text-caption);
    padding: 6px 0 20px;
    border-bottom: 1px solid var(--ok-line-light);
}

/* A cleared caption leaves no stray rule on the published page.
   (The editor keeps a minimal caret area so the caption stays editable.) */
.article-body .art-figure figcaption:empty {
    display: none;
}

.rte-content .article-body .art-figure figcaption:empty {
    display: block;
    min-height: 14px;
}

/* ---------- Highlights checklist (teal ticks) ---------- */

.article-body .art-highlights {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    line-height: 1.7;
}

.article-body .art-highlights > li {
    position: relative;
    margin: 0 0 8px;
    padding-left: 26px;
}

.article-body .art-highlights > li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--ok-teal-action);
    font-weight: 600;
}

/* ---------- Listing spec sheet (lifted card, zebra rows) ---------- */

.article-body .art-spec {
    border: 1px solid var(--ok-line-light);
    border-radius: 4px;
    box-shadow: 1px 2px 4px -2px #999;
    overflow: hidden;
    margin: 0 0 24px;
}

.article-body .art-spec-title {
    background: var(--ok-bg-lift);
    padding: 10px 16px;
    font-family: var(--ok-ui-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ok-teal-identity);
    border-bottom: 1px solid var(--ok-line);
}

.article-body .art-spec-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 16px;
    font-size: 14px;
}

.article-body .art-spec-row:nth-child(odd) {
    background: var(--ok-bg-lift);
}

.article-body .art-spec-label {
    color: var(--ok-text-caption);
}

.article-body .art-spec-value {
    text-align: right;
}

/* Editors bold the price value; emphasis renders in identity teal. */
.article-body .art-spec-value b,
.article-body .art-spec-value strong {
    color: var(--ok-teal-identity);
}

.article-body .art-spec-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-top: 1px solid var(--ok-line);
    font-size: 13px;
    color: var(--ok-text-caption);
    background: #FFF;
}

/* The phone link in the footer renders as the crimson contact button. */
.article-body .art-spec-footer a {
    border: 1px solid var(--ok-crimson);
    color: var(--ok-crimson);
    font-size: 12px;
    padding: 5px 18px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-radius: 0;
}

/* ---------- Agent card (photo, name/role, contact + listing buttons) ---------- */

.article-body .art-agent {
    background: var(--ok-bg-lift);
    border: 1px solid var(--ok-line-light);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 24px;
}

.article-body .art-agent-photo {
    width: 48px;
    height: 48px;
    max-width: 48px;
    border-radius: 100%;
    border: 1px solid var(--ok-line);
    object-fit: cover;
    flex: none;
}

.article-body .art-agent-info {
    flex: 1;
    min-width: 170px;
}

.article-body .art-agent-name {
    font-weight: 600;
}

.article-body .art-agent-role {
    font-family: var(--ok-ui-font);
    font-size: 12px;
    color: var(--ok-text-caption);
}

.article-body .art-agent-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.article-body .art-btn-phone {
    border: 1px solid var(--ok-crimson);
    color: var(--ok-crimson);
    font-size: 12px;
    padding: 6px 16px;
    white-space: nowrap;
    border-radius: 0;
}

.article-body .art-btn-listing {
    background: var(--ok-teal-action);
    color: #FFF;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    white-space: nowrap;
    border-radius: 0;
}

.article-body .art-btn-listing:hover {
    background: var(--ok-teal-hover);
}

/* ---------- Call to action (data-variant: end [default] | mid | exclusive) ---------- */

.article-body .art-cta {
    border-radius: 4px;
    overflow: hidden;
    margin: 0 0 24px;
    background: var(--ok-teal-identity);
    padding: 28px 32px;
}

.article-body .art-cta-kicker {
    display: none;
}

.article-body .art-cta h3 {
    font-family: var(--ok-serif-font);
    font-size: 24px;
    font-weight: 600;
    color: #FFF;
    margin: 0 0 8px;
}

.article-body .art-cta p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0 0 18px;
}

.article-body .art-cta-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.article-body .art-btn {
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    padding: 9px 25px;
    letter-spacing: 0.03em;
    border-radius: 0;
    white-space: nowrap;
}

.article-body .art-btn-primary {
    background: var(--ok-gold-btn);
    color: #FFF;
    font-weight: 600;
}

.article-body .art-btn-secondary {
    border: 1px solid #FFF;
    color: #FFF;
}

/* Mid-article variant (12c): white card, teal top rule, solid action button. */
.article-body .art-cta[data-variant="mid"] {
    background: #FFF;
    border: 1px solid var(--ok-line-light);
    border-top: 2px solid var(--ok-teal-action);
    border-radius: 4px;
    box-shadow: 1px 2px 4px -2px #999;
    padding: 24px 30px;
}

.article-body .art-cta[data-variant="mid"] h3 {
    font-family: var(--ok-display-font);
    font-size: 19px;
    font-weight: 300;
    color: var(--ok-teal-identity);
    margin-bottom: 6px;
}

.article-body .art-cta[data-variant="mid"] p {
    color: var(--ok-text-caption);
    margin-bottom: 16px;
}

.article-body .art-cta[data-variant="mid"] .art-cta-actions {
    gap: 16px;
}

.article-body .art-cta[data-variant="mid"] .art-btn-primary {
    background: var(--ok-teal-action);
    box-shadow: 2px 2px 3px -1px #CCC;
}

.article-body .art-cta[data-variant="mid"] .art-btn-primary:hover {
    background: var(--ok-teal-hover);
}

.article-body .art-cta[data-variant="mid"] .art-btn-secondary {
    border: 0;
    padding: 0;
    color: var(--ok-teal-identity);
}

/* Exclusives variant (12g): pale-gold panel, gold kicker, maroon serif. */
.article-body .art-cta[data-variant="exclusive"] {
    background: var(--ok-gold-pale);
    padding: 26px 32px;
}

.article-body .art-cta[data-variant="exclusive"] .art-cta-kicker {
    display: block;
    font-family: var(--ok-ui-font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ok-gold);
    margin: 0 0 6px;
}

.article-body .art-cta[data-variant="exclusive"] h3 {
    font-size: 22px;
    font-weight: 400;
    color: var(--ok-maroon);
}

.article-body .art-cta[data-variant="exclusive"] p {
    font-size: 13px;
    color: var(--ok-text-caption);
    margin-bottom: 16px;
}

.article-body .art-cta[data-variant="exclusive"] .art-btn-primary {
    box-shadow: 2px 2px 3px -1px #CCC;
}

.article-body .art-cta[data-variant="exclusive"] .art-btn-secondary {
    border-color: var(--ok-maroon);
    color: var(--ok-maroon);
}

/* ---------- Video embed (16:9, sharp corners) ---------- */

.article-body .video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin: 0 0 22px;
    background: #000;
}

.article-body .video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
