/* ==========================================================================
   HYP ERP v4: section rhythm, bands and the approved designer refinements (13 Oct review).
   Every Elementor widget's outer element carries .hyp-block. The theme marks neighbours
   server-side (inc/elementor/rhythm.php) and in the editor (main.js), so the spacing never
   depends on Elementor's wrapper markup.
   ========================================================================== */

/* ---------- Spacing system: one token ---------- */
:root { --gap-section: 56px; }
@media (min-width: 700px) { :root { --gap-section: 72px; } }
@media (min-width: 1200px) { :root { --gap-section: 96px; } }

.hyp-block.hyp-block { padding-block: calc(var(--gap-section) / 2); margin-block: 0; }
.hyp-block.hyp-block.is-band { padding-block: var(--gap-section); }
.hyp-block.hyp-block.gap-t { padding-top: var(--gap-section); }
.hyp-block.hyp-block.gap-b { padding-bottom: var(--gap-section); }
.hyp-block.hyp-block.gap-mt { margin-top: var(--gap-section); }
/* Spacing overrides chosen in Elementor (Section style → Spacing) */
.hyp-block.hyp-block.pad-t-0 { padding-top: 0; }
.hyp-block.hyp-block.pad-b-0 { padding-bottom: 0; }
.hyp-block.hyp-block.pad-t-l { padding-top: var(--gap-section); }
.hyp-block.hyp-block.pad-b-l { padding-bottom: var(--gap-section); }
/* Heroes, the sticky menu and the form panels keep their own spacing */
.hyp-block.hyp-block.hyp-block--hero { padding-top: var(--space-4); padding-bottom: 0; }
.hyp-block.hyp-block.hyp-block--hero.gap-b { padding-bottom: calc(var(--gap-section) / 2); }
.hyp-block.hyp-block.subnav { padding-block: 0; }

/* ---------- Section backgrounds (Elementor: Section style → Background) ---------- */
.section--white { background: var(--color-page); }
.section--mist { background: var(--color-mist); }
.section--sand { background: var(--color-sand); }
.section--night { background: var(--color-night) url("../img/art/night-waves.webp") center / cover no-repeat; color: var(--color-on-night); }
.section--night h2, .section--night h3, .section--night .section-head__title { color: #fff; }
.section--night .section-head__text, .section--night .muted, .section--night p { color: var(--color-on-night-muted); }
.section--night .eyebrow { color: #FF8A70; }
.section--night .hyp-s--band { background: none; padding: 0; border-radius: 0; overflow: visible; }
.section--night .hyp-s--band::before { display: none; }
.section--night .hyp-s--band:not(.has-media) h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); line-height: 1.2; max-width: 26ch; font-weight: 400; }
.section--night .hyp-s--band:not(.has-media) .hyp-s__text { max-width: 62ch; }
.section--night .panel--night { background: none; border-radius: 0; box-shadow: none; padding-inline: 0; }
.section--mist .hyp-s--text.has-media { align-items: center; }

/* ---------- Hero background artwork (Elementor: Hero → Background art) ---------- */
.hero[class*="hero--bg-"]::before { opacity: .3; mix-blend-mode: normal; background-position: right center; background-size: cover; background-repeat: no-repeat; }
.hero--bg-arches::before { background-image: url("../img/art/light-arches.webp"); }
.hero--bg-contour::before, .hero--bg-contour-light::before { background-image: url("../img/art/light-contour.webp"); }
.hero--bg-lines::before { background-image: url("../img/art/light-lines.webp"); }
.hero--bg-circles::before { background-image: url("../img/art/light-circles.webp"); }
.hero--bg-spheres::before { background-image: url("../img/art/light-spheres.webp"); }
.hero--bg-none::before { display: none; }

/* ---------- Card grids: max 3 per row (2 when there are exactly 4) ---------- */
@media (min-width: 1000px) {
  .hyp-s--cards .hyp-items, .hyp-s--highlights .hyp-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hyp-s--cards .hyp-items:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Cards without icons */
.hyp-s--cards .hyp-item.hyp-icon-none::before { display: none; }

/* ---------- Benefits: heading (+ photo) in a sticky aside ---------- */
.hyp-s--benefits > .hyp-s__aside > h2 { position: static; }
.hyp-s--benefits .hyp-s__aside { z-index: 1; }

/* ---------- Capability tabs with a screenshot under each panel ---------- */
.hyp-s--tabs.has-shots .tabs__art { display: none; }
@media (min-width: 900px) { .hyp-s--tabs.has-shots .tabs__panel { grid-template-columns: 1fr; } }
.tabs__shot { margin: var(--space-5) 0 0; }
.tabs__shot .media__frame { aspect-ratio: 16 / 9; }

/* ---------- Client logos ---------- */
.trusted__logos { gap: var(--space-5) var(--space-7); }
.trusted__logos img { max-height: 36px; width: auto; }
.trusted__logos .logo-ph { display: grid; place-items: center; min-width: 150px; height: 44px; padding: 0 1rem; border: 1px dashed var(--color-line-strong); border-radius: var(--radius-sm); color: var(--color-muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Stats row ---------- */
.stats .grid--4 { row-gap: var(--space-6); }

/* ---------- Text section: checklist beside the text, bold lead-ins, labelled facts ---------- */
.hyp-s--text:not(.has-media):has(> .checks) { max-width: none; display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 1000px) { .hyp-s--text:not(.has-media):has(> .checks) { grid-template-columns: 1fr 1fr; column-gap: var(--space-7); } }
.hyp-s--text .checks strong { color: var(--color-ink); font-weight: 600; }
.hyp-s .checks { margin: var(--space-4) 0 0; }
.hyp-s--text .kpi-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: var(--space-4) 0 0; }
@media (min-width: 700px) { .hyp-s--text .kpi-row { grid-template-columns: 1fr 1fr; } .hyp-s--text .kpi-card:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.hyp-s--text .kpi-card { box-shadow: none; border: 1px solid var(--color-line); }
.hyp-s--text .kpi-card b { font-size: 1.0625rem; font-weight: 500; overflow-wrap: anywhere; }
.hyp-s--text .kpi-card a { color: inherit; }

/* ---------- Products overview: intro + photo row ---------- */
.overview > .hyp-s--text.has-media { align-items: center; }
.overview-wrap .overview { padding-block: 0; }

/* ---------- Heading + list with a photo in the header ---------- */
.split:has(> .section-head > .media) { grid-template-columns: minmax(0, 1fr); }
.split > .section-head:has(> .media) { display: contents; }
.split > .section-head:has(> .media) .media { margin-top: 0; max-width: none; }
@media (min-width: 1000px) {
  .split:has(> .section-head > .media) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-8); align-items: center; }
  .split > .section-head:has(> .media) > .section-head__copy { grid-column: 1 / -1; }
}

/* ---------- KPI cards: heading + text left, 2x2 rich cards right ---------- */
.kpis .container { display: grid; gap: var(--space-6); }
.kpis .section-head { margin: 0; }
.kpis .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin: 0; }
.kpis .kpi-card { position: relative; gap: .5rem; padding: var(--space-5) var(--space-5) calc(var(--space-5) + 28px); border: 1px solid var(--color-line); box-shadow: none; overflow: hidden; }
.kpis .kpi-card span { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; color: var(--color-muted); }
.kpis .kpi-card span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-brand); flex: none; }
.kpis .kpi-card b { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.kpis .kpi-card small { color: var(--color-text); font-size: .875rem; line-height: 1.5; }
.kpis .kpi-card::after { content: ""; position: absolute; left: var(--space-5); right: var(--space-5); bottom: var(--space-4); height: 22px; opacity: .35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 22' preserveAspectRatio='none'%3E%3Cpolyline points='0,18 25,15 50,16 75,11 100,13 125,8 150,9 175,5 200,3' fill='none' stroke='%23E51E25' stroke-width='2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.kpis .container > p.muted { margin: 0; }
@media (min-width: 1000px) {
  .kpis .container { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); grid-template-rows: auto 1fr; column-gap: var(--space-8); row-gap: var(--space-4); align-items: start; }
  .kpis .section-head { grid-column: 1; grid-row: 1; }
  .kpis .container > p.muted { grid-column: 1; grid-row: 2; align-self: start; }
  .kpis .kpi-row { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 559px) { .kpis .kpi-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Demo / contact: split panel (photo + dark overlay behind the copy, form right) ---------- */
.demo__contact { display: grid; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-5); border-top: 1px solid var(--color-line-strong); }
.demo.demo--split { gap: 0; padding: 0; overflow: hidden; align-items: stretch; }
@media (min-width: 1000px) { .demo.demo--split { grid-template-columns: 1fr 1fr; } }
.demo--split .demo__copy { position: relative; isolation: isolate; align-content: start; padding: var(--panel-pad); color: var(--color-on-night); }
.demo--split .demo__media { position: absolute; inset: 0; z-index: -2; margin: 0; max-width: none; }
.demo--split .demo__media .media__frame { height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.demo--split .demo__media img { width: 100%; height: 100%; object-fit: cover; }
.demo--split .demo__media .ph { display: none; }
.demo--split .demo__copy::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(13, 26, 33, .84), rgba(13, 26, 33, .93)); }
.demo--split .demo__copy :is(h1, h2, .demo__subtitle) { color: #fff; }
.demo--split .demo__copy :is(.lead, p, .muted, address, address span) { color: var(--color-on-night-muted); }
.demo--split .demo__copy a { color: #fff; }
.demo--split .crumbs, .demo--split .crumbs a, .demo--split .crumbs span { color: var(--color-on-night-muted); }
.demo--split .demo__copy .icon { color: #FF8A70; }
.demo--split .demo__contact { border-top-color: rgba(255, 255, 255, .2); }
.demo--split .demo__form { align-self: center; margin: clamp(1rem, .5rem + 2vw, var(--panel-pad)); box-shadow: none; }
/* Editors: say which photo goes behind the copy */
.demo--split .demo__media-note { position: absolute; right: 1rem; bottom: 1rem; z-index: 1; padding: .3rem .6rem; border-radius: var(--radius-xs); background: rgba(255, 255, 255, .14); color: #fff; font-size: var(--text-xs); }

/* ---------- FAQ: heading left (sticky), hairline rows right ---------- */
.hyp-s--faq { display: grid; gap: 0; padding: 0; border-radius: 0; background: none; }
.hyp-s--faq > h2 { margin: 0 0 var(--space-5); font-size: clamp(2rem, 1.4rem + 2vw, 3rem); font-weight: 400; line-height: 1.08; letter-spacing: -.025em; max-width: 9ch; align-self: start; }
.hyp-s--faq > details:first-of-type { border-top: 1px solid var(--color-line); }
.hyp-s--faq .wp-block-details { margin: 0 !important; background: none; border: 0; border-bottom: 1px solid var(--color-line); border-radius: 0; }
.hyp-s--faq .wp-block-details summary { padding: 1.35rem 0; font-weight: 500; font-size: 1.0625rem; color: var(--color-ink); }
.hyp-s--faq .wp-block-details summary::after { content: "+"; width: auto; height: auto; border: 0; transform: none; margin: 0; font-size: 1.375rem; font-weight: 300; line-height: 1; color: var(--color-action); }
.hyp-s--faq .wp-block-details[open] summary::after { content: "×"; transform: none; margin: 0; }
.hyp-s--faq .wp-block-details > :not(summary) { padding: 0 3rem 1.5rem 0; color: var(--color-text); font-size: 1rem; line-height: 1.7; }
[dir="rtl"] .hyp-s--faq .wp-block-details > :not(summary) { padding: 0 0 1.5rem 3rem; }
@media (min-width: 1000px) {
  .hyp-s--faq { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--space-8); row-gap: 0; align-items: start; }
  .hyp-s--faq > h2 { grid-column: 1; grid-row: 1 / span 30; position: sticky; top: calc(var(--sticky-top, var(--header-h)) + 4.5rem); margin: 0; }
  .hyp-s--faq > :not(h2) { grid-column: 2; }
}

/* ---------- Footer: 5 columns, newsletter on its own row ---------- */
@media (min-width: 1100px) { .site-footer__grid--wide { grid-template-columns: 1.3fr repeat(4, 1fr); } }
.site-footer__grid--wide > #footer-newsletter { grid-column: 1 / -1; display: grid; gap: var(--space-3); max-width: 560px; }
.site-footer__base .social { margin: 0; }
.site-footer__base { flex-wrap: wrap; gap: var(--space-4); }

/* ---------- Editor-only notes ---------- */
.hyp-draft-note { margin: 0 0 var(--space-4); padding: .6rem 1rem; border: 1px dashed #E9A23B; border-radius: var(--radius-sm); background: #FFF8EC; color: #6B4A10; font-size: var(--text-sm); }

/* ---------- Hero without a visual ---------- */
.hero.hero--text { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.hero.hero--text .hero__copy { max-width: 820px; }

/* ---------- Open positions ---------- */
.jobs { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.jobs__item { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6); border: 1px solid var(--color-line); border-radius: var(--radius-md); background: #fff; }
.jobs__item h3 { font-size: var(--text-h3); }
.jobs__item p { margin: .35rem 0 0; color: var(--color-text); max-width: 70ch; }
.jobs__meta { color: var(--color-muted) !important; font-size: var(--text-sm); }
.jobs__empty { display: grid; gap: var(--space-4); justify-items: start; }

/* ---------- Partner directory ---------- */
.partner .card__body { gap: var(--space-2); }
.partner__logo { height: 44px; margin-bottom: var(--space-2); }
.partner__logo img { max-height: 44px; width: auto; }

/* ---------- Login / workspace router ---------- */
.login { display: grid; gap: var(--space-6); padding: var(--panel-pad); }
@media (min-width: 1000px) { .login { grid-template-columns: 1fr minmax(0, 460px); column-gap: var(--space-8); align-items: center; } .login > .crumbs { grid-column: 1 / -1; } }
.login__copy { display: grid; gap: var(--space-4); }
.login__form { display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-card); }
.login__form .btn { justify-content: center; }
.login__links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin: 0; padding: 0; list-style: none; }
.login__links a { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.login__links .icon { width: 18px; height: 18px; }
.login__error { color: var(--color-brand-text); font-size: var(--text-sm); margin: 0; }

/* ---------- ROI calculator ---------- */
.calc { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 1000px) { .calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: var(--space-8); } }
.calc__form { display: grid; gap: var(--space-4); }
.calc__result { display: grid; gap: var(--space-5); padding: var(--panel-pad); }
.calc__figures { display: grid; gap: var(--space-5); }
@media (min-width: 700px) { .calc__figures { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.calc__figures .stat__value { font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); }
.calc__assume { margin: 0; color: var(--color-on-night-muted); font-size: var(--text-sm); }
.calc__note { margin-top: var(--space-4); }

/* ---------- ERP configurator ---------- */
.config { display: grid; gap: var(--space-6); }
.config__step { margin: 0; padding: 0; border: 0; display: grid; gap: var(--space-4); }
.config__step legend { display: flex; align-items: center; gap: .6rem; margin-bottom: var(--space-4); font-size: var(--text-h3); font-weight: 600; color: var(--color-ink); }
.config__step legend span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--color-action); color: #fff; font-size: var(--text-sm); }
.config__opts { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.config__opt { position: relative; }
.config__opt input { position: absolute; opacity: 0; inset: 0; }
.config__opt span { display: flex; align-items: center; gap: .6rem; height: 100%; padding: .9rem 1rem; border: 1px solid var(--color-line-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; font-weight: 500; transition: border-color .15s, background .15s; }
.config__opt .icon { width: 20px; height: 20px; color: var(--color-action); flex: none; }
.config__opt input:checked + span { border-color: var(--color-action); background: var(--color-action-tint); box-shadow: inset 0 0 0 1px var(--color-action); }
.config__opt input:focus-visible + span { box-shadow: var(--focus-ring); }
.config__summary { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-6); }
.config__count { margin: 0; font-weight: 500; color: var(--color-ink); }

/* ---------- Legal text ---------- */
.legal h2 { scroll-margin-top: var(--scroll-offset, 140px); }

/* ---------- Search page ---------- */
.search-form--page { display: flex; align-items: center; gap: var(--space-3); max-width: 760px; padding: .5rem .5rem .5rem 1rem; border: 1px solid var(--color-line-strong); border-radius: var(--radius-md); background: #fff; }
.search-form--page input { flex: 1; min-width: 0; border: 0; font: inherit; font-size: var(--text-md); background: none; }
.search-form--page input:focus { outline: none; }
.search-form--page .icon { color: var(--color-muted); }
.search-sec__count { margin: var(--space-6) 0 var(--space-4); color: var(--color-muted); }
.search-results { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; max-width: 900px; }
.search-results li { padding: var(--space-5) 0; border-bottom: 1px solid var(--color-line); }
.search-results h2 { font-size: var(--text-h3); margin: .25rem 0; }
.search-results p { margin: 0; }
@media (max-width: 999px) { .demo--split .demo__media-note { position: static; display: inline-block; margin-top: var(--space-4); } }
