/*
 * Article single (single.php) styles.
 * Scoped to .pl-article root; enqueued only on is_singular('post').
 *
 * Hand-ported from mockups/article/index.html (Tailwind + inline prose CSS).
 * The body content renders via the_content(), so the prose selectors target
 * raw post HTML (paragraphs, h2/h3, lists, blockquote, table, [caption] figures).
 */

.pl-article {
    --pl-teal:        #40A3A1;
    --pl-teal-600:    #349291;
    --pl-ember:       #D16D32;
    --pl-ember-dark:  #b85d2a;
    --pl-bone-50:     #fbfaf6;
    --pl-bone-100:    #f5f2ea;
    --pl-neutral-100: #e5e5e3;
    --pl-neutral-300: #c9c9c5;
    --pl-neutral-600: #616160;
    --pl-neutral-700: #4a4a48;
    --pl-neutral-800: #2b2b2a;
    --pl-neutral-900: #1a1a1a;

    background: var(--pl-bone-50);
    color: var(--pl-neutral-900);
    font-family: 'Cabin', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.pl-article a { color: inherit; }

/* ---------- Layout containers ---------- */
.pl-article-container        { max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.pl-article-container-mid    { max-width: 1024px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.pl-article-container-narrow { max-width: 768px;  margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------- Reading progress bar ---------- */
#pl-article-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50;
}
#pl-article-progress .pl-article-progress-fill {
    height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0);
    background: linear-gradient(to right,#AD1F69,#C42727,#D16D32,#E6B229,#E5D129,#B0C633,#449A46,#40A3A1);
    transition: transform .08s linear;
}


/* ---------- Hero ---------- */
.pl-article-hero { background: var(--pl-bone-50); padding: 64px 0 0; }
.pl-article-eyebrow {
    font-size: 11px; text-transform: uppercase; letter-spacing: .18em;
    color: var(--pl-teal); font-weight: 600;
}
.pl-article-title {
    margin: 16px 0 0; font-weight: 600; line-height: 1.1;
    font-size: 36px; color: var(--pl-neutral-900);
}
@media (min-width: 640px) { .pl-article-title { font-size: 48px; } }
.pl-article-dek {
    margin: 20px 0 0; font-size: 20px; line-height: 1.6; color: var(--pl-neutral-600);
}
.pl-article-meta {
    margin-top: 32px; padding-bottom: 24px;
    border-bottom: 1px solid var(--pl-neutral-100);
    font-size: 12px; color: var(--pl-neutral-600);
}

/* ---------- Cover ---------- */
.pl-article-cover-section { background: var(--pl-bone-50); padding-top: 40px; }
.pl-article-cover {
    position: relative; overflow: hidden; aspect-ratio: 16 / 9;
    background: var(--pl-neutral-800);
    border: 1px solid var(--pl-neutral-100);
}
.pl-article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Body two-column ---------- */
.pl-article-body-section { background: var(--pl-bone-50); padding: 64px 0; }
.pl-article-grid { display: block; }
.pl-article-grid > * { min-width: 0; }
@media (min-width: 1024px) {
    .pl-article-grid {
        display: grid;
        grid-template-columns: 3fr 9fr;
        gap: 40px;
    }
}

/* ---------- Sidebar ---------- */
.pl-article-sidebar-inner { position: static; }
@media (min-width: 1024px) {
    .pl-article-sidebar-inner { position: sticky; top: 132px; }
}
.pl-article-toc-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .18em;
    color: var(--pl-neutral-600); font-weight: 600; margin-bottom: 12px;
}
.pl-article-toc { border-left: 1px solid var(--pl-neutral-100); }
.pl-article-toc a {
    display: block; padding: .35em 0 .35em 12px;
    border-left: 2px solid transparent; margin-left: -1px;
    color: var(--pl-neutral-700); font-size: 13px; line-height: 1.4;
    text-decoration: none; transition: color .12s ease, border-color .12s ease;
}
.pl-article-toc a:hover { color: var(--pl-teal); }
.pl-article-toc a.is-active { color: var(--pl-neutral-900); border-left-color: var(--pl-teal); font-weight: 600; }
.pl-article-toc-empty { display: none; }

/* Share rail (sticky, kept quiet so it doesn't compete with the CTA card) */
.pl-article-share {
    margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--pl-neutral-100);
    display: flex; align-items: center; gap: 8px;
}
.pl-article-share-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .18em;
    color: var(--pl-neutral-600); font-weight: 600; margin-right: 4px;
}
.pl-article-share a, .pl-article-share button {
    width: 32px; height: 32px; padding: 0; border: 0; cursor: pointer;
    background: var(--pl-bone-100); color: var(--pl-neutral-600);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease;
}
.pl-article-share a:hover, .pl-article-share button:hover {
    background: var(--pl-neutral-900); color: #fff;
}

/* ---------- Light-plan CTA boxes ----------
   Same recipe as the project-page LED-retrofit boxes (07-15 call): install
   photo bg + static teal-cast overlay (no flat black, no shimmer), enlarged
   headline, smaller sub, Request a Light Plan as a real teal button.
   Two instances: sidebar card + mid-article (.pl-article-inlinecta). */
.pl-article-boxcta-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgba(15,42,44,0.92), rgba(15,42,44,0.62));
    z-index: -1;
}

/* Sidebar instance */
.pl-article-side-cta {
    position: relative; margin-top: 32px; padding: 28px 24px;
    background: var(--pl-neutral-800); color: #fff;
    overflow: hidden; isolation: isolate;
}
.pl-article-side-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--pl-boxcta-bg);
    background-size: cover;
    background-position: center;
    z-index: -2;
}
.pl-article-side-cta-content { position: relative; }
.pl-article-side-cta-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; color: #fff; }
.pl-article-side-cta-text { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: rgba(255,255,255,0.85); }
.pl-article-side-cta .pl-article-side-cta-btn {
    margin-top: 20px; display: inline-flex; align-items: center;
    padding: 13px 22px; font-size: 14px; font-weight: 600;
    text-decoration: none; border-radius: 0;
    background: var(--pl-teal); color: #fff; border: 1px solid var(--pl-teal);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.pl-article-side-cta .pl-article-side-cta-btn:hover {
    background: var(--pl-ember-dark); border-color: var(--pl-ember-dark); color: #fff;
}

/* ---------- Prose body (the_content) ---------- */
/* Body matches the site standard (project/solutions/KC = 18px/1.6/#616160).
   The 19px/1.7/near-ink "long-form exception" was scrapped 2026-06-15 — a single
   oversized section reads inconsistent to the client and invites per-section rework. */
.pl-article-body { color: var(--pl-neutral-600); font-size: 18px; line-height: 1.6; overflow-wrap: break-word; }
/* Rhythm matches the project/site standard (16px between blocks); heading top
   margins tightened so long articles don't read as "a lot of space" (Camrin 2026-06-15). */
.pl-article-body > * + * { margin-top: 16px; }
.pl-article-body > *:first-child { margin-top: 0; }
.pl-article-body h2 {
    font-weight: 600; font-size: 1.5rem; line-height: 1.2; color: var(--pl-neutral-900);
    margin-top: 1.5em; margin-bottom: .4em; letter-spacing: -.01em; scroll-margin-top: 120px;
}
.pl-article-body h3 {
    font-weight: 600; font-size: 1.25rem; line-height: 1.3; color: var(--pl-neutral-900);
    margin-top: 1.25em; margin-bottom: .35em; scroll-margin-top: 120px;
}
.pl-article-body p { max-width: 68ch; margin: 0 0 16px; }
.pl-article-body p:last-child { margin-bottom: 0; }
/* Links match the site-wide in-content convention: teal, no underline, hover #368A88
   (reversed the article-only underline exception for consistency — Camrin 2026-06-15). */
.pl-article-body a { color: var(--pl-teal); text-decoration: none; }
.pl-article-body a:hover { color: #368A88; }
.pl-article-body strong { font-weight: 700; color: var(--pl-neutral-900); }
.pl-article-body ul, .pl-article-body ol { margin: 0 0 16px; padding-left: 1.5em; max-width: 64ch; }
.pl-article-body ul > li { list-style-type: disc; margin-top: .5em; }
.pl-article-body ol > li { list-style-type: decimal; margin-top: .5em; }
.pl-article-body li { padding-left: .25em; }
/* Markers use the primary brand teal (matches in-content links), not the loud
   ember accent (Camrin 2026-06-15). */
.pl-article-body li::marker { color: var(--pl-teal); }
.pl-article-body blockquote {
    border-left: 3px solid var(--pl-teal); padding-left: 1.25em; margin: 28px 0;
    font-size: 1.25rem; line-height: 1.45; color: var(--pl-neutral-900); font-weight: 500; max-width: 60ch;
}
.pl-article-body table {
    width: 100%; margin: 2em 0; border-collapse: collapse; font-size: 14px;
    border: 1px solid var(--pl-neutral-100); overflow: hidden;
}
.pl-article-body thead { background: var(--pl-bone-100); }
.pl-article-body th {
    text-align: left; padding: .7em 1em; font-weight: 700; color: var(--pl-neutral-900);
    font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
}
.pl-article-body td { padding: .7em 1em; border-top: 1px solid var(--pl-neutral-100); color: var(--pl-neutral-800); }

/* Callout (authors add <div class="callout"><div class="callout-title">..</div>..</div>) */
.pl-article-body .callout {
    background: var(--pl-bone-100); border: 1px solid var(--pl-neutral-100);
    border-left: 3px solid var(--pl-teal); padding: 1.25em 1.5em; margin: 2em 0;
}
.pl-article-body .callout-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: var(--pl-teal); font-weight: 700;
}
.pl-article-body .callout p { margin-top: .4em; }

/* Migrated legacy bodies emit [caption] -> <figure class="wp-caption" style="width:NATIVEpx">.
   Cap media to the body-copy measure (68ch, matching paragraphs) and left-align so
   images never overhang the prose (Caelin 2026-06-15). Lightbox clickthrough preserved.
   (CSS Grid min-width:auto trap mitigated by .pl-article-grid>* above.) */
.pl-article-body img,
.pl-article-body figure,
.pl-article-body .wp-caption {
    /* min(68ch,100%): 68ch caps media to the prose measure on wide screens, but the
       brand font's wide "0" makes 68ch resolve to ~854px, which overflowed the column
       on phones (img is a replaced element capped only by its own max-width, not the
       figure's width) and blew the page out to 878px. The 100% clamp keeps it in-column. */
    max-width: min(68ch, 100%) !important; width: auto !important; height: auto;
    display: block; margin: 1.5em 0;
}
/* Lightbox affordance: only images JS wires up (role=button) get the zoom cursor. */
.pl-article-body img[role="button"] { cursor: zoom-in; }
.pl-article-body figcaption,
.pl-article-body .wp-caption-text {
    font-size: 13px; color: var(--pl-neutral-600); text-align: center; margin-top: .5em; font-style: italic;
}

/* Embedded video ([embed] -> oEmbed iframe). Keep responsive within the column. */
.pl-article-body iframe,
.pl-article-body .wp-block-embed,
.pl-article-body .wp-embed-aspect-16-9 { max-width: 100%; margin: 2em auto; }
.pl-article-body iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; display: block; }

/* ---------- End CTA (dark, featured-image bg) ---------- */
.pl-article-cta-section {
    position: relative; padding: 80px 0; background: var(--pl-neutral-800);
    color: var(--pl-bone-50); overflow: hidden; isolation: isolate;
}
.pl-article-cta-section::before {
    content: ''; position: absolute; inset: 0; z-index: -2;
    background-image: var(--pl-cta-bg); background-size: cover; background-position: center;
}
.pl-article-cta-overlay {
    position: absolute; inset: 0; z-index: -1;
    background: rgba(0,0,0,.65);
}
.pl-article-cta-content { position: relative; max-width: 1024px; text-align: center; }
.pl-article-cta-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 3px; color: #5dc5c3; font-weight: 600; }
.pl-article-cta-heading { margin: 12px auto 0; max-width: 768px; font-size: 32px; font-weight: 600; line-height: 1.2; color: var(--pl-bone-50); }
.pl-article-cta-sub { margin: 16px auto 0; max-width: 640px; font-size: 17px; line-height: 1.55; color: #f5f2ea; text-wrap: balance; }
.pl-article-cta-actions { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; }
.pl-article-cta-btn { display: inline-flex; align-items: center; gap: 8px; padding: 16px 28px; font-size: 15px; font-weight: 600; text-decoration: none; transition: background .3s ease, color .3s ease; }
.pl-article-cta-btn-primary { background: var(--pl-teal); color: #fff; }
.pl-article-cta-btn-primary:hover { background: var(--pl-ember-dark); }
.pl-article-cta-btn-secondary { color: #FBFAF6; border: 1px solid rgba(255,255,255,.3); }
.pl-article-cta-btn-secondary:hover { background: rgba(255,255,255,.1); }

/* ---------- Author bio ---------- */
.pl-article-author-section { background: var(--pl-bone-100); padding: 48px 0; }
.pl-article-author-card { background: #fff; border: 1px solid var(--pl-neutral-100); padding: 24px; display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 640px) { .pl-article-author-card { flex-direction: row; } }
.pl-article-author-photo { width: 80px; height: 80px; flex-shrink: 0; overflow: hidden; background: var(--pl-neutral-100); }
.pl-article-author-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-article-author-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: var(--pl-teal); font-weight: 600; }
.pl-article-author-name { margin-top: 4px; font-size: 18px; font-weight: 600; color: var(--pl-neutral-900); }
.pl-article-author-role { font-size: 14px; color: var(--pl-neutral-600); }
.pl-article-author-blurb { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--pl-neutral-600); }
.pl-article-author-link { margin-top: 12px; display: inline-block; font-size: 14px; font-weight: 600; color: var(--pl-teal); text-decoration: none; }
.pl-article-author-link:hover { color: var(--pl-teal-600); }

/* ---------- Related ---------- */
/* Top padding 0: body-section already supplies 64px below the prose (same bone-50
   bg), so a second 64px doubled the gap before Recommended Reading (Camrin 2026-06-15). */
.pl-article-related-section { background: var(--pl-bone-50); padding: 0 0 64px; }
.pl-article-related-header { margin-bottom: 32px; }
.pl-article-related-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 3px; color: var(--pl-teal); font-weight: 600; }
.pl-article-related-title { margin: 12px 0 0; font-size: 36px; font-weight: 600; line-height: 1.15; color: var(--pl-neutral-900); }
@media (max-width: 640px) { .pl-article-related-title { font-size: 28px; } }
.pl-article-related-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) { .pl-article-related-grid { grid-template-columns: repeat(3, 1fr); } }
.pl-article-related-card { display: block; background: #fff; border: 1px solid var(--pl-neutral-100); overflow: hidden; text-decoration: none; transition: border-color .3s ease, box-shadow .3s ease; }
.pl-article-related-card:hover { border-color: var(--pl-teal); box-shadow: 0 10px 25px -10px rgba(0,0,0,.18); }
.pl-article-related-cover { aspect-ratio: 16 / 10; background: var(--pl-neutral-800); overflow: hidden; }
.pl-article-related-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.pl-article-related-card:hover .pl-article-related-cover img { transform: scale(1.05); }
.pl-article-related-body { padding: 20px; }
.pl-article-related-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .18em; color: var(--pl-teal); font-weight: 600; }
.pl-article-related-dot { opacity: .4; }
.pl-article-related-read { color: var(--pl-neutral-600); }
.pl-article-related-name { margin-top: 8px; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--pl-neutral-900); transition: color .15s ease; }
.pl-article-related-card:hover .pl-article-related-name { color: var(--pl-teal); }
.pl-article-related-link { margin-top: 16px; font-size: 14px; font-weight: 600; color: var(--pl-teal); }

/* ---------- Reveal ---------- */
.pl-article-reveal {
    opacity: 0; transform: translateY(16px);
    transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
    transition-delay: var(--reveal-delay, 0ms);
}
.pl-article-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .pl-article-reveal, .pl-article-reveal.is-visible { opacity: 1; transform: none; transition: none; }
    #pl-article-progress { display: none; }
}

/* ---------- Body image lightbox (ported from project-detail; dependency-free) ---------- */
.pl-article-lightbox {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 32px; background: rgba(15, 15, 14, 0.92);
    opacity: 0; transition: opacity 0.2s ease;
}
.pl-article-lightbox.is-open { opacity: 1; }
.pl-article-lightbox img {
    max-width: 100%; max-height: 100%; object-fit: contain; display: block;
    box-shadow: 0 24px 60px -12px rgba(0,0,0,0.6);
}
.pl-article-lightbox-fig {
    margin: 0; max-width: 100%; max-height: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.pl-article-lightbox-cap { color: rgba(245, 242, 234, 0.85); font-size: 14px; text-align: center; max-width: 720px; }
.pl-article-lightbox-btn {
    position: absolute; background: rgba(0,0,0,0); border: none; border-radius: 0;
    color: #fff; cursor: pointer; line-height: 1; padding: 12px; font-size: 28px;
    opacity: 0.8; transition: opacity 0.15s ease, color 0.15s ease;
    -webkit-appearance: none; appearance: none;
}
/* Hello Elementor reset paints bare <button> hover/focus magenta; out-specify it. */
.pl-article-lightbox-btn:hover,
.pl-article-lightbox-btn:focus,
.pl-article-lightbox-btn:active {
    background: rgba(0,0,0,0); border: none; box-shadow: none; color: var(--pl-teal); opacity: 1;
}
.pl-article-lightbox-close { top: 12px; right: 16px; font-size: 36px; }
.pl-article-lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); font-size: 44px; }
.pl-article-lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); font-size: 44px; }
.pl-article-lightbox-nav-hidden { display: none; }

/* ---------- Mid-article inline CTA (same recipe as the project module) ----------
   Lives inside .pl-article-body, so the button colours are scoped under the parent
   to out-specify `.pl-article-body a` (0,1,1) and keep the labels white. */
.pl-article-inlinecta {
    position: relative;
    margin: 36px 0;
    padding: 36px 32px;
    border-radius: 0;
    background: var(--pl-neutral-800);
    overflow: hidden;
    isolation: isolate;
}
.pl-article-inlinecta::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--pl-boxcta-bg);
    background-size: cover;
    background-position: center;
    z-index: -2;
}
.pl-article-inlinecta-content { position: relative; }
.pl-article-inlinecta-heading {
    margin: 0; max-width: none;
    font-size: 26px; font-weight: 700; line-height: 1.25; color: #fff;
}
/* .pl-article-body p (0,1,1) outranks a single class — keep this at 0,2,0 */
.pl-article-inlinecta .pl-article-inlinecta-sub {
    margin: 16px 0 0; font-size: 15px; line-height: 1.5; color: rgba(255,255,255,0.85);
}
.pl-article-inlinecta-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.pl-article-inlinecta .pl-article-inlinecta-btn {
    display: inline-flex; align-items: center; padding: 14px 24px;
    font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 0;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pl-article-inlinecta .pl-article-inlinecta-btn-primary { background: var(--pl-teal); color: #fff; border: 1px solid var(--pl-teal); }
.pl-article-inlinecta .pl-article-inlinecta-btn-primary:hover { background: var(--pl-ember-dark); border-color: var(--pl-ember-dark); color: #fff; }
.pl-article-inlinecta .pl-article-inlinecta-btn-ghost { background: rgba(0,0,0,0); border: 1px solid rgba(255,255,255,0.55); color: #fff; }
.pl-article-inlinecta .pl-article-inlinecta-btn-ghost:hover { background: rgba(0,0,0,0); border-color: #fff; color: #fff; }
