/* =====================================================================
   EvolveCorteX — blog article page
   Loaded after core.css, so it uses the same tokens (colours, fonts, radii).
     Hero · Cover · Layout (share rail | article | contents)
     Article typography (WordPress blocks) · End of article · Related
   ===================================================================== */

/* ---------- Hero ---------- */
.ecx-art__hero { position: relative; overflow: hidden; background: var(--bg); padding-top: clamp(28px, 5vh, 64px); padding-bottom: clamp(120px, 18vh, 200px); }
.ecx-art__hero .ecx-hero__grid-bg { -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent); mask-image: linear-gradient(180deg, #000 30%, transparent); }
.ecx-art__hero::after { content: ""; position: absolute; right: -10%; top: -30%; width: 55%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(7, 75, 186, .12), transparent); pointer-events: none; }
.ecx-art__head { position: relative; z-index: 1; max-width: min(980px, var(--container)); }
.ecx-art__head .ecx-crumbs { flex-wrap: wrap; }
.ecx-art__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; font-size: .9rem; color: var(--muted); }
.ecx-art__meta > span { display: inline-flex; align-items: center; gap: 7px; }
.ecx-art__meta svg { width: 16px; height: 16px; color: var(--blue); }
.ecx-art__meta a.ecx-tag { text-decoration: none; }
.ecx-art__title { margin-top: 22px; font-size: clamp(2rem, 1.1rem + 3vw, 3.9rem); line-height: 1.08; letter-spacing: -.032em; text-wrap: balance; }
.ecx-art__lead { margin-top: 22px; max-width: 62ch; font-size: var(--t-lead); color: #475467; line-height: 1.6; }
.ecx-art__by { display: flex; align-items: center; gap: 12px; margin-top: 30px; }
.ecx-art__by > span:last-child { display: grid; line-height: 1.3; }
.ecx-art__by small { color: var(--muted); font-size: .84rem; }
.ecx-art__avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .04em; box-shadow: 0 0 0 4px #fff, var(--sh-1); }

/* ---------- Cover image (overlaps the hero) ---------- */
.ecx-art__cover { position: relative; z-index: 2; margin-top: clamp(-160px, -14vh, -90px); border-radius: var(--r-xl); overflow: hidden; background: var(--blue-50); box-shadow: var(--sh-3); aspect-ratio: 16 / 8; }
.ecx-art__cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Layout: share rail | article | contents ---------- */
.ecx-art__layout { display: grid; grid-template-columns: 56px minmax(0, 720px) minmax(220px, 280px); justify-content: space-between; gap: clamp(24px, 4vw, 64px); padding-block: clamp(48px, 8vh, 96px) var(--section-y); align-items: start; }
.ecx-art__layout--solo { grid-template-columns: 56px minmax(0, 760px); justify-content: center; }
.ecx-art__share, .ecx-art__side { position: sticky; top: calc(var(--hh) + 28px); }
.ecx-art__share { display: grid; gap: 10px; justify-items: center; }
.ecx-art__share small { font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ecx-art__share a, .ecx-art__share button, .ecx-art__sharerow a, .ecx-art__sharerow button {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--ease); }
.ecx-art__share a:hover, .ecx-art__share button:hover, .ecx-art__sharerow a:hover, .ecx-art__sharerow button:hover { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-2px); }
.ecx-art__share svg, .ecx-art__sharerow svg { width: 18px; height: 18px; }
.ecx-art__copied { position: absolute; left: calc(100% + 8px); top: 50%; translate: 0 -50%; white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; }
.ecx-art__copied:not(:empty) { opacity: 1; }

/* Contents list */
.ecx-art__toc details { border-left: 1px solid var(--border); padding-left: 20px; }
.ecx-art__toc summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; font-size: var(--t-label); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ecx-art__toc summary::-webkit-details-marker { display: none; }
.ecx-art__toc summary svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.ecx-art__toc details:not([open]) summary svg { transform: rotate(-90deg); }
.ecx-art__toc ol { display: grid; gap: 2px; margin-top: 16px; }
.ecx-art__toc a { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 6px; padding: 7px 0; font-size: .92rem; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .25s; }
.ecx-art__toc a span { font-size: .75rem; font-weight: 600; padding-top: 2px; color: #98A2B3; font-variant-numeric: tabular-nums; }
.ecx-art__toc a::before { content: ""; position: absolute; left: -21px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--blue); transform: scaleY(0); transition: transform .3s var(--ease); }
.ecx-art__toc a:hover { color: var(--ink); }
.ecx-art__toc a.is-on { color: var(--blue); font-weight: 600; }
.ecx-art__toc a.is-on span { color: var(--blue); }
.ecx-art__toc a.is-on::before { transform: scaleY(1); }

/* ---------- Article typography (WordPress block content) ---------- */
.ecx-art__body { min-width: 0; }
.ecx-art__text { font-size: clamp(1.02rem, .98rem + .2vw, 1.12rem); line-height: 1.8; color: #344054; }
.ecx-art__text > * + * { margin-top: 1.25em; }
.ecx-art__text > :first-child { margin-top: 0; }
.ecx-art__text h2, .ecx-art__text h3, .ecx-art__text h4 { color: var(--ink); letter-spacing: -.02em; scroll-margin-top: calc(var(--hh) + 24px); }
.ecx-art__text h2 { margin-top: 2.2em; font-size: clamp(1.5rem, 1.15rem + 1.1vw, 2.1rem); line-height: 1.2; }
.ecx-art__text h2 + * { margin-top: .9em; }
.ecx-art__text h3 { margin-top: 1.8em; font-size: clamp(1.2rem, 1.05rem + .5vw, 1.45rem); line-height: 1.3; }
.ecx-art__text h4 { margin-top: 1.6em; font-size: 1.1rem; line-height: 1.35; }
.ecx-art__text h3 + *, .ecx-art__text h4 + * { margin-top: .6em; }
.ecx-art__text strong, .ecx-art__text b { color: var(--ink); font-weight: 600; }
.ecx-art__text a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(7, 75, 186, .35); transition: text-decoration-color .2s; }
.ecx-art__text a:hover { text-decoration-color: currentColor; }

/* lists: blue dots / numbered circles */
.ecx-art__text ul, .ecx-art__text ol { display: grid; gap: .55em; padding: 0; list-style: none; }
.ecx-art__text ul > li { position: relative; padding-left: 1.6em; }
.ecx-art__text ul > li::before { content: ""; position: absolute; left: .3em; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-50); }
.ecx-art__text ol { counter-reset: ecx-ol; }
.ecx-art__text ol > li { position: relative; padding-left: 2.4em; counter-increment: ecx-ol; }
.ecx-art__text ol > li::before { content: counter(ecx-ol); position: absolute; left: 0; top: .2em; display: grid; place-items: center; width: 1.65em; height: 1.65em; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-size: .82em; font-weight: 700; line-height: 1; }
.ecx-art__text li > ul, .ecx-art__text li > ol { margin-top: .55em; }

/* images, captions, embeds */
.ecx-art__text figure { margin-inline: 0; }
.ecx-art__text .wp-block-image, .ecx-art__text figure:has(> img) { margin-block: 2em; }
.ecx-art__text img { border-radius: var(--r-l); height: auto; }
.ecx-art__text .aligncenter, .ecx-art__text .aligncenter img { margin-inline: auto; }
.ecx-art__text .alignwide, .ecx-art__text .alignfull { width: 100%; }
.ecx-art__text figcaption, .ecx-art__text .wp-element-caption { margin-top: 12px; font-size: .86rem; color: var(--muted); text-align: center; line-height: 1.5; }
.ecx-art__text iframe, .ecx-art__text video { width: 100%; border: 0; border-radius: var(--r-l); }
.ecx-art__text .wp-block-embed__wrapper iframe { aspect-ratio: 16 / 9; height: auto; }

/* quotes */
.ecx-art__text blockquote, .ecx-art__text .wp-block-quote, .ecx-art__text .wp-block-pullquote { margin: 2em 0; padding: 26px 30px; border: 0; border-left: 3px solid var(--blue); border-radius: 0 var(--r-l) var(--r-l) 0; background: var(--blue-50); }
.ecx-art__text blockquote p { font-family: var(--f-serif); font-style: italic; font-size: 1.25em; line-height: 1.5; color: var(--blue-900); }
.ecx-art__text blockquote cite { display: block; margin-top: 12px; font-size: .85rem; font-style: normal; color: var(--muted); }

/* tables, code, separators */
.ecx-art__text table { width: 100%; border-collapse: collapse; font-size: .94em; }
.ecx-art__text .wp-block-table { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-m); }
.ecx-art__text th, .ecx-art__text td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ecx-art__text th, .ecx-art__text thead td { background: var(--bg); color: var(--ink); font-weight: 600; }
.ecx-art__text tr:last-child td { border-bottom: 0; }
.ecx-art__text code { padding: .15em .4em; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); font-size: .88em; }
.ecx-art__text pre { overflow-x: auto; padding: 20px 22px; border-radius: var(--r-m); background: var(--dark); color: #E5E7EB; font-size: .88em; line-height: 1.6; }
.ecx-art__text pre code { padding: 0; border: 0; background: none; color: inherit; }
.ecx-art__text hr { height: 1px; border: 0; background: var(--border); margin: 2.5em 0; }

/* Gutenberg leftovers: buttons and columns */
.ecx-art__text .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.ecx-art__text .wp-block-button__link { display: inline-flex; padding: 13px 22px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; }
.ecx-art__text .wp-block-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }

/* ---------- End of article ---------- */
.ecx-art__end { display: grid; gap: 28px; margin-top: clamp(48px, 7vh, 72px) !important; padding-top: 36px; border-top: 1px solid var(--border); }
.ecx-art__endshare { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.ecx-art__endshare strong { color: var(--ink); font-size: 1rem; }
.ecx-art__sharerow { display: flex; gap: 10px; }
.ecx-art__sharerow .ecx-art__copied { left: 50%; top: auto; bottom: calc(100% + 8px); translate: -50% 0; }
.ecx-art__expert { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px 22px; padding: clamp(22px, 3vw, 32px); border-radius: var(--r-xl); background: var(--dark); color: #fff; line-height: 1.55; position: relative; overflow: hidden; isolation: isolate; }
.ecx-art__expert::after { content: ""; position: absolute; z-index: -1; right: -60px; top: -80px; width: 260px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(141, 180, 245, .3), transparent); }
.ecx-art__expert strong { display: block; color: #fff; font-size: 1.12rem; }
.ecx-art__expert p { margin-top: 4px; font-size: .94rem; color: rgba(255, 255, 255, .72); }
.ecx-art__expert-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-m); background: rgba(141, 180, 245, .16); color: var(--blue-300); }
.ecx-art__expert-ic svg { width: 24px; height: 24px; }
.ecx-art__expert .ecx-btn { text-decoration: none; }
.ecx-art__pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ecx-art__pn a { display: grid; gap: 8px; padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--r-l); text-decoration: none; color: var(--ink); line-height: 1.4; transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.ecx-art__pn a:hover { border-color: var(--blue-300); box-shadow: var(--sh-2); transform: translateY(-2px); }
.ecx-art__pn small { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.ecx-art__pn small svg { width: 14px; height: 14px; }
.ecx-art__pn strong { font-size: 1rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ecx-art__pn-next { text-align: right; justify-items: end; grid-column: 2; }

/* ---------- Related articles ---------- */
.ecx-art__more-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(28px, 5vh, 52px); }
.ecx-art__more .ecx-media { background: var(--blue-50); }

/* ---------- Smaller screens ---------- */
@media (max-width: 1099.98px) {
  .ecx-art__layout, .ecx-art__layout--solo { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin-inline: auto; padding-top: clamp(32px, 6vh, 56px); }
  .ecx-art__share { display: none; }
  .ecx-art__side { position: static; order: -1; }
  .ecx-art__toc details { border: 1px solid var(--border); border-radius: var(--r-l); padding: 16px 20px; background: var(--bg); }
  .ecx-art__toc a::before { display: none; }
}
@media (max-width: 899.98px) { .ecx-posts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 639.98px) {
  .ecx-art__hero { padding-bottom: 96px; }
  .ecx-art__cover { aspect-ratio: 4 / 3; border-radius: var(--r-l); margin-top: -72px; }
  .ecx-art__expert { grid-template-columns: 1fr; }
  .ecx-art__expert-ic { display: none; }
  .ecx-art__pn { grid-template-columns: 1fr; }
  .ecx-art__pn-next { grid-column: auto; }
  .ecx-posts { grid-template-columns: minmax(0, 1fr); }
  .ecx-art__text blockquote, .ecx-art__text .wp-block-quote { padding: 20px 22px; }
}
@media print {
  .ecx-header, .ecx-footer, .ecx-art__share, .ecx-art__side, .ecx-art__end, .ecx-art__more, .ecx-skip { display: none !important; }
  .ecx-art__layout { display: block; padding: 0; }
  .ecx-art__cover { margin-top: 0; box-shadow: none; }
}
