/* META4 blog: listing + article pages, and the latest-articles cards on the home page.
   Heading sizes use !important because meta4-mobile-typography.php and the theme's Additional CSS
   force every h1–h4 size/weight with !important. */

:root {
    --m4-orange: #F6821B;
    --m4-ink: #141414;
    --m4-body: #555;
    --m4-muted: #8A8A8A;
    --m4-rule: #E5E1DA;
    --m4-paper: #F6F5F2;
}

/* Full-width pages (the theme otherwise boxes .site-main to 1140px) */
body .site-main.m4-blog,
body .site-main.m4-article {
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    font-family: "Poppins", sans-serif;
    color: var(--m4-ink);
}
.m4-blog *, .m4-article *, .m4-pcard * { box-sizing: border-box; }
.m4-blog a, .m4-article a, .m4-pcard a { text-decoration: none; }
.m4-wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 40px); }

/* ---------- Banner (same look as the About page banner) ---------- */
.m4-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 534px;
    padding: 80px 20px;
    background: #222 var(--m4-banner-img) center / cover no-repeat;
    text-align: center;
    color: #fff;
    isolation: isolate;
}
.m4-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(rgba(0, 0, 0, .67) 0%, rgba(0, 0, 0, .44) 100%);
    opacity: .75;
}
.m4-banner-inner { max-width: 900px; }
.m4-banner-eyebrow {
    margin: 0 0 18px;
    font: 600 13px/1 "Space Grotesk", sans-serif;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--m4-orange);
}
body .m4-banner .m4-banner-title {
    display: block;
    margin: 0;
    font-family: "Space Grotesk", sans-serif !important;
    font-size: clamp(30px, 3.4vw, 46px) !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: .04em !important;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}
.m4-banner-sub { max-width: 740px; margin: 18px auto 0; }
.m4-banner-sub p { margin: 0; font: 500 16px/1.55 "Poppins", sans-serif; color: #fff; }

/* ---------- Image cards (like the home page carousel cards) ---------- */
.m4-pcard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.m4-pcard { min-width: 0; }
/* !important: Hello's ".page-content a { text-decoration: underline }" would underline every line of the card */
body .m4-pcard .m4-pcard-link,
body .m4-pcard .m4-pcard-link * { text-decoration: none !important; }
.m4-pcard-link {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 380px;
    border-radius: 16px;
    overflow: hidden;
    background: #2A2C30;
    color: #fff;
    isolation: isolate;
    transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s cubic-bezier(.2, .7, .2, 1);
}
.m4-pcard-img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.m4-pcard-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, .55) 60%, rgba(0, 0, 0, .85) 100%);
}
.m4-pcard-body { display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 24px 22px 22px; }
.m4-pcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 400 13px/1.3 "Poppins", sans-serif; color: rgba(255, 255, 255, .8); }
.m4-pcard-cat {
    padding: 4px 9px;
    background: var(--m4-orange);
    font: 600 11px/1.2 "Space Grotesk", sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
}
body .m4-pcard .m4-pcard-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-family: "Space Grotesk", sans-serif !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #fff;
}
.m4-pcard-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font: 400 15px/1.5 "Poppins", sans-serif;
    color: rgba(255, 255, 255, .88);
}
.m4-pcard-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font: 500 16px/1 "Poppins", sans-serif; color: #fff; transition: color .3s ease; }
.m4-pcard-more span { transition: transform .3s ease; }
.m4-pcard-link:hover { transform: translateY(-4px); box-shadow: 0 24px 44px -24px rgba(0, 0, 0, .55); }
.m4-pcard-link:hover .m4-pcard-img { transform: scale(1.06); }
.m4-pcard-link:hover .m4-pcard-more { color: var(--m4-orange); }
.m4-pcard-link:hover .m4-pcard-more span { transform: translateX(4px); }
.m4-pcard-link:focus-visible { outline: 3px solid var(--m4-orange); outline-offset: 3px; }

/* Home page: latest articles replace the static carousel that follows them */
.m4-home-posts { width: 100%; margin: 46px 0 34px; }
.m4-home-posts + .elementor-element-4a94d60 { display: none !important; }

/* ---------- Listing ---------- */
.m4-blog-list { padding-top: 72px; padding-bottom: 100px; }
.m4-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 64px;
}
.m4-pagination .page-numbers {
    min-width: 44px;
    padding: 13px 14px;
    border: 1px solid var(--m4-rule);
    border-radius: 8px;
    font: 500 14px/1 "Space Grotesk", sans-serif;
    text-align: center;
    color: var(--m4-ink);
}
.m4-pagination a.page-numbers:hover { border-color: var(--m4-orange); color: var(--m4-orange); }
.m4-pagination .page-numbers.current { background: var(--m4-orange); border-color: var(--m4-orange); color: #fff; }
.m4-pagination .page-numbers.dots { border: 0; }

.m4-blog-empty { padding: 20px 0; text-align: center; }
body .m4-blog-empty h2 {
    margin: 0 0 10px;
    font-family: "Space Grotesk", sans-serif !important;
    font-size: 28px !important;
    font-weight: 500 !important;
}
.m4-blog-empty p { margin: 0 0 24px; font-size: 17px; color: var(--m4-body); }
.m4-btn { display: inline-block; padding: 15px 26px; background: var(--m4-orange); font: 500 15px/1 "Space Grotesk", sans-serif; color: #fff; }
.m4-btn:hover { background: var(--m4-ink); color: #fff; }

/* ---------- Article page (magazine style) ---------- */

/* Reading progress bar along the top edge of the window */
.m4-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 100000; height: 3px; pointer-events: none; }
.m4-progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--m4-orange), #FFB36B);
    transform: scaleX(0);
    transform-origin: left;
}

/* Hero: full-width photo, title and meta left-aligned at the bottom */
.m4-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 560px;
    padding: 140px 0 150px; /* bottom space is covered by the overlapping article card */
    background: #1B1D21 var(--m4-hero-img) center / cover no-repeat;
    color: #fff;
    isolation: isolate;
}
.m4-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(10, 12, 15, .25) 0%, rgba(10, 12, 15, .55) 50%, rgba(10, 12, 15, .92) 100%);
}
.m4-hero-inner { width: 100%; max-width: 1240px; }
.m4-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; font: 400 13px/1.4 "Poppins", sans-serif; color: rgba(255, 255, 255, .6); }
.m4-crumbs a { color: rgba(255, 255, 255, .85); }
.m4-crumbs a:hover { color: var(--m4-orange); }
.m4-pill {
    display: inline-block;
    margin-bottom: 18px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--m4-orange);
    font: 600 12px/1 "Space Grotesk", sans-serif;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
}
body .m4-hero .m4-hero-title {
    display: block;
    max-width: 920px;
    margin: 0 0 22px;
    font-family: "Space Grotesk", sans-serif !important;
    font-size: clamp(32px, 4.4vw, 60px) !important;
    font-weight: 500 !important;
    line-height: 1.08 !important;
    letter-spacing: -.02em !important;
    color: #fff;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .3);
}
.m4-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 0; font: 400 14px/1.3 "Poppins", sans-serif; color: rgba(255, 255, 255, .85); }
.m4-hero-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.m4-hero-meta .m4-ico { color: var(--m4-orange); }
.m4-hero-by { padding-left: 24px; border-left: 1px solid rgba(255, 255, 255, .3); }
.m4-ico { flex: none; }

/* Two columns that overlap the bottom of the hero */
.m4-article-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: clamp(28px, 3.5vw, 48px);
    align-items: start; /* lets the sidebar column be shorter than the article so it can stick */
    max-width: 1240px;
    margin-top: -100px;
    padding-bottom: 100px;
}
.m4-article-main {
    min-width: 0;
    padding: clamp(28px, 4vw, 56px);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 30px 80px -40px rgba(20, 20, 20, .35), 0 2px 6px rgba(20, 20, 20, .04);
}
.m4-article-aside { min-width: 0; height: 100%; }
/* Stays in view while the article scrolls; 112px clears the 88px sticky site header. */
.m4-aside-sticky {
    position: sticky;
    top: 112px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: calc(100vh - 132px);
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Sidebar: latest articles */
.m4-aside-box {
    padding: 24px 22px 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px -40px rgba(20, 20, 20, .35), 0 2px 6px rgba(20, 20, 20, .04);
}
body .m4-aside-box .m4-aside-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-family: "Space Grotesk", sans-serif !important;
    font-size: 19px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    letter-spacing: .01em !important;
    color: var(--m4-ink);
}
.m4-aside-title::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--m4-orange); }
.m4-aside-list { list-style: none; margin: 0 0 10px; padding: 0; }
.m4-aside-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin: 0 -10px;
    padding: 9px 10px;
    border-radius: 14px;
    color: var(--m4-ink);
    transition: background-color .3s ease;
}
.m4-aside-item:hover { background: #FFF4EA; }
.m4-aside-thumb { position: relative; display: block; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: #2A2C30; }
.m4-aside-thumb .m4-pcard-img { position: absolute; inset: 0; z-index: auto; transition: transform .5s ease; }
.m4-aside-num {
    position: absolute;
    left: 5px;
    top: 5px;
    min-width: 22px;
    padding: 4px 5px;
    border-radius: 7px;
    background: rgba(20, 20, 20, .78);
    font: 600 10px/1 "Space Grotesk", sans-serif;
    text-align: center;
    color: #fff;
}
.m4-aside-item:hover .m4-aside-num { background: var(--m4-orange); }
.m4-aside-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.m4-aside-text time { font: 400 12px/1.2 "Poppins", sans-serif; color: var(--m4-muted); }
.m4-aside-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font: 500 15px/1.35 "Space Grotesk", sans-serif;
    transition: color .3s ease;
}
.m4-aside-item:hover .m4-aside-name { color: var(--m4-orange); }
.m4-aside-item:hover .m4-aside-thumb .m4-pcard-img { transform: scale(1.08); }
.m4-aside-all { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font: 500 14px/1 "Space Grotesk", sans-serif; color: var(--m4-orange); }
.m4-aside-all .m4-ico { transition: transform .3s ease; }
.m4-aside-all:hover .m4-ico { transform: translateX(4px); }

/* Sidebar: contact box (dark card) */
.m4-aside-cta { padding: 24px; border-radius: 20px; background: #16181B; color: #fff; }
.m4-aside-cta p { margin: 0 0 18px; font: 400 15px/1.6 "Poppins", sans-serif; color: rgba(255, 255, 255, .75); }
.m4-aside-cta .m4-aside-cta-title { margin-bottom: 8px; font: 500 20px/1.25 "Space Grotesk", sans-serif; color: #fff; }
.m4-aside-cta .m4-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 13px 22px; }
.m4-aside-cta .m4-btn:hover { background: #fff; color: var(--m4-ink); }
/* On shorter desktop screens (e.g. 1366×768 laptops) only the article list fits beside the article. */
@media (min-width: 1025px) and (max-height: 820px) {
    .m4-aside-cta { display: none; }
}

/* Article content typography */
.m4-prose { font: 400 18px/1.8 "Poppins", sans-serif; color: #2B2B2B; }
.m4-prose > * { margin-top: 0; margin-bottom: 1.4em; }
.m4-prose > p:first-of-type { font-size: 1.12em; line-height: 1.7; color: var(--m4-ink); }
body .m4-prose h2,
body .m4-prose h3,
body .m4-prose h4 {
    margin: 2em 0 .7em;
    scroll-margin-top: 120px;
    font-family: "Space Grotesk", sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: -.015em !important;
    color: var(--m4-ink);
}
body .m4-prose h2 { font-size: clamp(26px, 2.4vw, 32px) !important; line-height: 1.2 !important; }
body .m4-prose h3 { font-size: clamp(21px, 1.9vw, 25px) !important; line-height: 1.3 !important; }
body .m4-prose h4 { font-size: 19px !important; line-height: 1.35 !important; }
.m4-prose > :first-child, .m4-prose > :first-child > :first-child { margin-top: 0; }
.m4-prose a { color: var(--m4-ink); text-decoration: underline; text-decoration-color: var(--m4-orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.m4-prose a:hover { color: var(--m4-orange); }
.m4-prose ul, .m4-prose ol { padding-left: 1.3em; }
.m4-prose li { margin-bottom: .5em; }
.m4-prose li::marker { color: var(--m4-orange); font-weight: 600; }
.m4-prose blockquote {
    margin: 2em 0;
    padding: 24px 28px;
    border-left: 4px solid var(--m4-orange);
    border-radius: 0 16px 16px 0;
    background: #FFF6EE;
    font: 500 21px/1.5 "Space Grotesk", sans-serif;
    color: var(--m4-ink);
}
.m4-prose blockquote p:last-child { margin-bottom: 0; }
.m4-prose img, .m4-prose video, .m4-prose iframe { max-width: 100%; height: auto; border-radius: 16px; }
.m4-prose iframe { aspect-ratio: 16 / 9; height: auto; width: 100%; }
.m4-prose figure { margin: 2em 0; }
.m4-prose figcaption { margin-top: 10px; font-size: 14px; color: var(--m4-muted); text-align: center; }
.m4-prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.m4-prose th, .m4-prose td { padding: 12px 14px; border-bottom: 1px solid var(--m4-rule); text-align: left; }
.m4-prose th { font-family: "Space Grotesk", sans-serif; font-weight: 600; background: var(--m4-paper); }
.m4-prose code { padding: 2px 6px; border-radius: 6px; background: var(--m4-paper); font-size: .9em; }
.m4-prose hr { border: 0; border-top: 1px solid var(--m4-rule); margin: 2.5em 0; }

.m4-article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; }
.m4-article-tags a { padding: 7px 14px; border-radius: 999px; background: var(--m4-paper); font-size: 13px; color: var(--m4-ink); }
.m4-article-tags a:hover { background: var(--m4-orange); color: #fff; }

/* Share: round icon buttons */
.m4-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 44px;
    padding: 20px 24px;
    border-radius: 16px;
    background: var(--m4-paper);
}
.m4-share-label { font: 500 15px/1.2 "Space Grotesk", sans-serif; color: var(--m4-ink); }
.m4-share-btns { display: flex; gap: 10px; }
.m4-share-btns a, .m4-share-btns button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #E2DDD5;
    border-radius: 50%;
    background: #fff;
    color: var(--m4-ink);
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
.m4-share-btns a:hover, .m4-share-btns button:hover { border-color: var(--m4-orange); background: var(--m4-orange); color: #fff; transform: translateY(-2px); }
.m4-copy-msg {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--m4-ink);
    font: 500 12px/1 "Poppins", sans-serif;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.m4-copy.is-copied .m4-copy-msg { opacity: 1; transform: translate(-50%, 0); }

/* Previous / next: image cards */
.m4-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.m4-post-nav-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 150px;
    padding: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: #2A2C30;
    color: #fff;
    isolation: isolate;
}
.m4-post-nav-next { grid-column: 2; justify-content: flex-end; text-align: right; }
.m4-post-nav-card .m4-pcard-img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.m4-post-nav-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, .82)); }
.m4-post-nav-card:hover .m4-pcard-img { transform: scale(1.06); }
.m4-post-nav-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.m4-post-nav-label { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 "Space Grotesk", sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--m4-orange); }
.m4-post-nav-next .m4-post-nav-label { justify-content: flex-end; }
.m4-post-nav-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font: 500 16px/1.35 "Space Grotesk", sans-serif;
}

.m4-readmore { display: inline-flex; gap: 8px; font: 500 15px/1 "Space Grotesk", sans-serif; color: var(--m4-ink); border-bottom: 1px solid var(--m4-orange); padding-bottom: 4px; }
.m4-readmore:hover { color: var(--m4-orange); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .m4-banner { min-height: 400px; }
    .m4-pcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .m4-home-posts .m4-pcard:nth-child(3) { display: none; } /* keep two balanced columns on tablets */
    .m4-hero { min-height: 460px; padding: 130px 0 130px; }
    /* Article: sidebar drops below the content and stops being sticky */
    .m4-article-layout { grid-template-columns: minmax(0, 1fr); margin-top: -80px; }
    .m4-article-aside { height: auto; }
    .m4-aside-sticky { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    .m4-aside-cta { display: block; }
}
@media (max-width: 640px) {
    .m4-banner { min-height: 320px; padding: 60px 20px; }
    .m4-pcard-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .m4-home-posts .m4-pcard:nth-child(3) { display: block; }
    .m4-pcard-link { height: 340px; }
    .m4-blog-list { padding-top: 48px; padding-bottom: 70px; }
    .m4-hero { min-height: 420px; padding: 110px 0 110px; }
    .m4-hero-meta .m4-hero-by { display: none; }
    .m4-article-layout { margin-top: -60px; padding-bottom: 70px; }
    .m4-article-main { padding: 24px 20px; border-radius: 18px; }
    .m4-aside-sticky { grid-template-columns: minmax(0, 1fr); }
    .m4-prose { font-size: 17px; }
    .m4-share { padding: 16px 18px; }
    .m4-post-nav { grid-template-columns: minmax(0, 1fr); }
    .m4-post-nav-next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .m4-pcard-link, .m4-pcard-img, .m4-pcard-more span, .m4-share-btns a, .m4-share-btns button { transition: none; }
}
