/*
 * Enerpize hub article page.
 * Everything is scoped under .enh so the shared /themed/style.css rules that
 * daftra and online-invoices rely on are left untouched.
 */

.enh {
    --enh-ink: #0C2532;
    --enh-body: #415565;
    --enh-muted: #7C8B99;
    --enh-line: #E6EBF2;
    --enh-tint: #F6F8FA;
    --enh-brand: #026BFF;
    --enh-cta: #29B80B;
    --enh-radius: 14px;
    padding: 0 0 70px;
    color: var(--enh-body);
}

/* ---------------------------------------------------------------- hero --- */

.enh-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 520px;
    overflow: hidden;
    background-color: #061420;
    isolation: isolate;
}

.enh-hero__img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* a touch of scale so the crop never shows a hairline edge */
    transform: scale(1.02);
}

/* two stacked gradients: a vertical one so the text always has contrast, and a
   directional one that keeps the illustration side of the photo readable */
.enh-hero__scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to top, rgba(6, 20, 32, .92) 0%, rgba(6, 20, 32, .70) 36%, rgba(6, 20, 32, .22) 74%, rgba(6, 20, 32, .10) 100%),
        linear-gradient(to var(--enh-scrim-side, left), rgba(6, 20, 32, .74) 0%, rgba(6, 20, 32, .24) 58%, rgba(6, 20, 32, 0) 100%);
}

[dir="ltr"] .enh-hero__scrim {
    --enh-scrim-side: right;
}

.enh-hero__inner {
    position: relative;
    width: 100%;
    padding-top: 90px;
    padding-bottom: 46px;
    color: #fff;
}

.enh-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    font-size: 14px;
    color: rgba(255, 255, 255, .72);
}

.enh-crumbs a {
    color: rgba(255, 255, 255, .72);
    transition: color .2s ease;
}

.enh-crumbs a:hover,
.enh-crumbs a:last-child {
    color: #fff;
    text-decoration: none;
}

.enh-crumbs span {
    opacity: .45;
}

.enh-chip {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    transition: background .2s ease, border-color .2s ease;
}

.enh-chip:hover {
    background: rgba(255, 255, 255, .22);
    border-color: rgba(255, 255, 255, .7);
    color: #fff;
    text-decoration: none;
}

.enh h1.intro__title.enh-hero__title {
    max-width: 900px;
    font-family: inherit;
    margin: 18px 0 0;
    color: #fff;
    font-size: 42px !important;
    font-weight: 800;
    line-height: 1.45 !important;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}

.enh-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 28px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.enh-meta__person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.enh-meta__avatar {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .45);
    object-fit: cover;
    background: rgba(255, 255, 255, .12);
}

.enh-meta__label {
    display: block;
    font-size: 12px;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .62);
}

.enh-meta__value,
.enh .enh-meta__value {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

a.enh-meta__value:hover {
    color: #fff;
    text-decoration: underline;
}

.enh-meta__date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, .88);
}

.enh-meta__date svg {
    width: 17px;
    height: 17px;
    opacity: .75;
}

/* share ------------------------------------------------------------------ */

.enh-share {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-inline-start: auto;
}

.enh-share__label {
    font-size: 13px;
    color: rgba(255, 255, 255, .62);
}

.enh-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 14px;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.enh-share a:hover {
    background: #fff;
    border-color: #fff;
    color: var(--enh-ink);
    text-decoration: none;
    transform: translateY(-2px);
}

.enh-share a.is-copied::after {
    content: attr(data-copied);
    position: absolute;
    transform: translateY(-42px);
    padding: 4px 9px;
    border-radius: 6px;
    background: var(--enh-ink);
    font-size: 11px;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- body --- */

.enh-body {
    margin-top: 56px;
}

.enh-layout {
    display: grid;
    /* the rail widens with the page so the prose column does not run to an
       unreadable measure */
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 64px;
    align-items: start;
}

.enh-main {
    min-width: 0;
}

/* the article's opening paragraph reads as a stand-first */
.enh .article-details__content > p:first-child,
.enh .article-details .article-details__content > p:first-child {
    margin-bottom: 30px;
    padding-inline-start: 18px;
    border-inline-start: 3px solid var(--enh-brand);
    color: var(--enh-ink);
    font-size: 19px;
    font-weight: 600;
    line-height: 2;
}

/* table of contents ------------------------------------------------------ */

.enh-toc {
    margin: 0 0 40px;
    padding: 24px 28px 26px;
    border: 1px solid var(--enh-line);
    border-radius: var(--enh-radius);
    background: var(--enh-tint);
}

.enh .enh-toc__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    color: var(--enh-ink);
    font-size: 17px !important;
    font-weight: 800;
}

.enh-toc__title svg {
    width: 18px;
    height: 18px;
    color: var(--enh-brand);
}

.enh .enh-toc ol {
    counter-reset: enh-toc;
    margin: 0;
    padding: 0;
    list-style: none;
}

.enh .enh-toc li {
    counter-increment: enh-toc;
    margin: 0;
    border-top: 1px dashed #DCE3EC;
}

.enh .enh-toc li:first-child {
    border-top: 0;
}

.enh .enh-toc a {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    color: var(--enh-body);
    font-size: 15px;
    line-height: 1.8;
    transition: color .2s ease;
}

.enh .enh-toc a::before {
    content: counter(enh-toc);
    flex: 0 0 24px;
    color: var(--enh-brand);
    font-weight: 700;
    font-size: 13px;
    line-height: inherit;
}

.enh .enh-toc a:hover {
    color: var(--enh-brand);
    text-decoration: none;
}

/* article content -------------------------------------------------------- */

.enh .article-details__content {
    color: var(--enh-body);
    font-size: 17px;
    line-height: 2.1;
}

.enh .article-details__content > h2 {
    margin: 48px 0 18px;
    color: var(--enh-ink);
    font-size: 28px !important;
    font-weight: 800;
    line-height: 1.6 !important;
    scroll-margin-top: 90px;
}

.enh .article-details__content > h3 {
    margin: 34px 0 14px;
    color: var(--enh-ink);
    font-size: 21px !important;
    font-weight: 700;
    line-height: 1.7 !important;
}

.enh .article-details__content > h4 {
    margin: 26px 0 12px;
    color: var(--enh-ink);
    font-size: 18px;
    font-weight: 700;
}

/* themed/style.css sizes and colours `.article-details p/ul/> div` on their own
   (18px, --mainColor), which beat the container above, so paragraphs read at a
   different size and colour from the list items beside them. Pin the whole
   prose block to one scale. */
.enh .article-details__content p,
.enh .article-details__content ul,
.enh .article-details__content ol,
.enh .article-details__content li,
.enh .article-details__content td,
.enh .article-details__content th {
    color: var(--enh-body);
    font-size: 17px;
    line-height: 2.1;
}

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

.enh .article-details__content a {
    color: var(--enh-brand);
    font-weight: 600;
}

.enh .article-details__content a:hover {
    text-decoration: underline;
}

.enh .article-details__content ul,
.enh .article-details__content ol {
    margin: 0 0 24px;
    padding-inline-start: 22px;
}

.enh .article-details__content li {
    margin-bottom: 10px;
}

.enh .article-details__content img {
    border-radius: var(--enh-radius);
}

.enh .article-details__content figure {
    margin: 32px 0;
}

.enh .article-details__content blockquote {
    margin: 32px 0;
    padding: 20px 26px;
    border-inline-start: 4px solid var(--enh-brand);
    border-radius: 0 var(--enh-radius) var(--enh-radius) 0;
    background: var(--enh-tint);
    font-size: 18px;
    font-weight: 600;
    color: var(--enh-ink);
}

[dir="ltr"] .enh .article-details__content blockquote {
    border-radius: var(--enh-radius) 0 0 var(--enh-radius);
}

.enh .article-details table {
    margin: 28px 0;
    border-collapse: collapse;
    border-radius: var(--enh-radius);
    overflow: hidden;
}

.enh .article-details table,
.enh .article-details table tr,
.enh .article-details table td,
.enh .article-details table th {
    border: 1px solid var(--enh-line);
}

.enh .article-details table th,
.enh .article-details table tr:first-child td {
    background: var(--enh-tint);
    color: var(--enh-ink);
    font-weight: 700;
}

.enh .article-details table td {
    padding: 12px 14px;
    font-size: 15px;
}

/* ---------------------------------------------------------------- rail --- */

/* --enh-rail-top is recomputed in the view: 24px while the rail fits the
   viewport, and a negative offset once it is taller, so the rail scrolls with
   the article until its bottom edge lands and only then holds. */
.enh-rail {
    position: sticky;
    top: var(--enh-rail-top, 24px);
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

.enh-rail__block {
    padding: 22px 22px 8px;
    border: 1px solid var(--enh-line);
    border-radius: var(--enh-radius);
    background: #fff;
}

.enh .enh-rail__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--enh-line);
    color: var(--enh-ink);
    font-size: 16px !important;
    font-weight: 800;
}

.enh .enh-rail__title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--enh-brand);
}

.enh .enh-rail__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.enh .enh-rail__list li {
    margin: 0;
    border-bottom: 1px solid var(--enh-line);
}

.enh .enh-rail__list li:last-child {
    border-bottom: 0;
}

.enh-rail__item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
}

.enh-rail__item:hover {
    text-decoration: none;
}

/* .article-details img forces width:100% on everything inside the article
   wrapper, so the rail thumbnails have to win it back */
.enh .enh-rail__thumb {
    flex: 0 0 82px;
    width: 82px !important;
    height: 62px !important;
    border-radius: 8px;
    object-fit: cover;
    background: var(--enh-tint);
}

.enh .enh-rail__item h3 {
    margin: 0 0 6px;
    color: var(--enh-ink);
    font-size: 14px !important;
    font-weight: 700;
    line-height: 1.7 !important;
    transition: color .2s ease;
}

.enh .enh-rail__item:hover h3 {
    color: var(--enh-brand);
}

.enh-rail__date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--enh-muted);
    font-size: 12px;
}

.enh-rail__date svg {
    width: 13px;
    height: 13px;
}

/* The CMS-authored promo card that sits under the rail.
   The shared sheet starts it at display:none and hub_layout.ctp reveals it from
   a 3s window.onload timer; on enerpize it is the rail's banner, so show it from
   first paint instead of leaving a hole in the column. */
.enh .article-details .card-desktop {
    position: static;
    display: block;
    margin: 0;
    padding: 0;
    border: 1px solid var(--enh-line);
    border-radius: var(--enh-radius);
    box-shadow: none;
    overflow: hidden;
}

.enh .article-details .card-desktop .card-body {
    padding: 18px;
}

/* a card whose whole content is one banner drops its padding so the image is
   the card — the usual case on enerpize, where desktop_card holds just a promo */
.enh .article-details .card-desktop .card-body:has(> a:only-child),
.enh .article-details .card-desktop .card-body:has(> img:only-child),
.enh .article-details .card-desktop .card-body:has(> figure:only-child),
.enh .article-details .card-desktop .card-body:has(> p:only-child > a:only-child),
.enh .article-details .card-desktop .card-body:has(> p:only-child > img:only-child) {
    padding: 0;
}

/* a banner leading a card that also has copy bleeds to the card edges instead */
.enh .article-details .card-desktop .card-body > a:first-child:not(:only-child) > img,
.enh .article-details .card-desktop .card-body > img:first-child:not(:only-child) {
    width: calc(100% + 36px) !important;
    max-width: none;
    margin: -18px -18px 16px;
}

.enh .article-details .card-desktop .card-body a > img,
.enh .article-details .card-desktop .card-body > img {
    display: block;
}

.enh .article-details .card-desktop .card-body > :last-child {
    margin-bottom: 0;
}

/* the banner is the link, so give the whole card the affordance */
.enh .article-details .card-desktop:has(.card-body > a:only-child) {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.enh .article-details .card-desktop:has(.card-body > a:only-child):hover {
    transform: translateY(-3px);
    border-color: transparent;
    box-shadow: 0 16px 34px rgba(12, 37, 50, .16);
}

.enh .article-details .card-mobile .card-body > a:first-child > img,
.enh .article-details .card-mobile .card-body > img:first-child {
    display: block;
    max-width: 260px !important;
    margin: 0 auto 12px;
}

/* -------------------------------------------------------- social ------- */

.enh-social__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 0 20px;
}

.enh .enh-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--enh-social-bg, var(--enh-ink));
    color: #fff;
    box-shadow: 0 4px 10px rgba(12, 37, 50, .14);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.enh .enh-social__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 18px rgba(12, 37, 50, .22);
    filter: brightness(1.08);
    text-decoration: none;
}

.enh .enh-social__link svg {
    width: 18px;
    height: 18px;
}

.enh #article-details-sidebar a.btn.btn-primary,
.enh .article-details .card-mobile p a.btn {
    background-color: var(--enh-cta) !important;
    border-color: var(--enh-cta) !important;
    border-radius: 8px;
    color: #fff !important;
    font-weight: 700;
}

/* -------------------------------------------------------- read next ----- */

.enh-next {
    margin-top: 72px;
    padding-top: 48px;
    border-top: 1px solid var(--enh-line);
}

.enh .enh-next__title {
    margin: 0 0 28px;
    color: var(--enh-ink);
    font-size: 26px !important;
    font-weight: 800;
}

.enh-next__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.enh-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--enh-line);
    border-radius: var(--enh-radius);
    background: #fff;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.enh-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: 0 16px 34px rgba(12, 37, 50, .12);
    text-decoration: none;
}

.enh-card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--enh-tint);
}

.enh-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.enh-card__tag {
    position: absolute;
    inset-block-end: 12px;
    inset-inline-start: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(6, 20, 32, .78);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.enh-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 12px;
    padding: 18px 20px 20px;
}

.enh .enh-card__body h3 {
    margin: 0;
    color: var(--enh-ink);
    font-size: 17px !important;
    font-weight: 700;
    line-height: 1.7 !important;
}

.enh-card__more {
    margin-block-start: auto;
    color: var(--enh-brand);
    font-size: 14px;
    font-weight: 700;
}

/* --------------------------------------------------------- responsive --- */

@media (max-width: 1199px) {
    .enh-layout {
        grid-template-columns: minmax(0, 1fr) 290px;
        gap: 36px;
    }

    .enh h1.intro__title.enh-hero__title {
        font-size: 36px !important;
    }
}

@media (max-width: 991px) {
    .enh-hero {
        min-height: 400px;
    }

    .enh-hero__inner {
        padding-top: 70px;
        padding-bottom: 36px;
    }

    .enh h1.intro__title.enh-hero__title {
        font-size: 30px !important;
    }

    .enh-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 44px;
    }

    .enh-rail {
        position: static;
    }

    .enh-next__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* the shared stylesheet hides the desktop card below 991px and swaps in the
       fixed bottom banner; keep that behaviour */
    .enh .article-details .card-desktop {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .enh {
        padding-bottom: 50px;
    }

    .enh-hero {
        min-height: 340px;
    }

    .enh-hero__inner {
        padding-top: 56px;
        padding-bottom: 30px;
    }

    .enh h1.intro__title.enh-hero__title {
        font-size: 24px !important;
        line-height: 1.6 !important;
    }

    .enh-meta {
        gap: 12px 18px;
        margin-top: 22px;
        padding-top: 18px;
    }

    .enh-share {
        margin-inline-start: 0;
        width: 100%;
    }

    .enh-body {
        margin-top: 36px;
    }

    .enh .article-details__content > p:first-child {
        font-size: 17px;
    }

    .enh-toc {
        padding: 20px;
    }

    .enh .article-details__content,
    .enh .article-details__content p,
    .enh .article-details__content ul,
    .enh .article-details__content ol,
    .enh .article-details__content li {
        font-size: 16px;
        line-height: 2;
    }

    .enh .article-details__content > h2 {
        margin: 34px 0 14px;
        font-size: 22px !important;
    }

    .enh .article-details__content > h3 {
        font-size: 19px !important;
    }

    .enh-next {
        margin-top: 48px;
        padding-top: 34px;
    }

    .enh-next__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}
