/* Additions for the merged automationnation.us build: language switch, WhatsApp button, blog, legal pages and Arabic (RTL). */
.brand-logo { height: 40px; width: auto; }
.nav .lang-switch { margin-inline-start: .35rem; border: 1px solid var(--ink-line); color: var(--ink-fg); font-weight: 600; }
.nav .lang-switch:hover { border-color: var(--signal); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink-fg); }
.foot-bottom a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.wa-float { position: fixed; right: 22px; bottom: 96px; z-index: 50; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: transform .2s; }
.wa-float:hover { transform: translateY(-3px); }
.wa-float svg { width: 28px; height: 28px; }

/* Blog list */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }
.post-card { display: grid; grid-template-rows: auto 1fr; background: #fff; border: 1px solid var(--paper-line); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: var(--paper-fg); transition: transform .25s, box-shadow .25s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px rgba(29, 27, 41, .12); }
.post-card .thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--ink-3), var(--ink-2)); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 1.25rem 1.35rem 1.5rem; display: grid; gap: .6rem; align-content: start; }
.post-card time { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--signal-ink); }
.post-card h3 { font-size: 1.2rem; line-height: 1.25; }
.post-card p { color: var(--paper-muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pager { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 3rem; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 .9rem; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--paper-line); text-decoration: none; color: var(--paper-fg); font-weight: 600; }
.pager span[aria-current] { background: var(--paper-fg); color: var(--paper); border-color: var(--paper-fg); }
.pager a:hover { border-color: var(--signal-ink); color: var(--signal-ink); }

/* Article and legal pages */
.article-meta { font-family: var(--font-mono); font-size: var(--step--1); color: var(--ink-muted); letter-spacing: .06em; text-transform: uppercase; }
.article-cover { margin: 0 auto 2.5rem; max-width: 860px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--paper-line); }
.article-cover img { width: 100%; height: auto; }
.article { max-width: 760px; margin: 0 auto; font-size: 1.12rem; line-height: 1.8; color: var(--paper-fg); }
.article > * + * { margin-top: 1.2em; }
.article h2, .article h3, .article h4 { margin-top: 1.8em; line-height: 1.2; }
.article h2 { font-size: var(--step-2); }
.article h3 { font-size: var(--step-1); }
.article a { color: var(--signal-ink); }
.article ul, .article ol { padding-inline-start: 1.4em; }
.article li + li { margin-top: .4em; }
.article img { height: auto; border-radius: var(--r-md); }
.article figure { margin: 1.5em 0; }
.article figcaption { font-size: .85rem; color: var(--paper-muted); margin-top: .5rem; }
.article blockquote { margin: 1.5em 0; padding: 1rem 1.25rem; border-inline-start: 3px solid var(--signal-ink); background: var(--paper-2); border-radius: var(--r-sm); }
.article-foot { max-width: 760px; margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--paper-line); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.source-note { font-size: .9rem; color: var(--paper-muted); }

/* Contact form result */
.static-form-success { padding: 1.25rem !important; border-radius: var(--r-md) !important; background: rgba(24, 223, 196, .12) !important; border: 1px solid rgba(24, 223, 196, .35); }

/* ---------- Arabic / RTL ---------- */
html[lang="ar"] {
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; line-height: 1.3; }
html[lang="ar"] .eyebrow, html[lang="ar"] .article-meta, html[lang="ar"] .post-card time { letter-spacing: 0; text-transform: none; font-family: var(--font-body); }
html[lang="ar"] body { line-height: 1.8; }
html[lang="ar"] .hero h1, html[lang="ar"] .page-hero h1 { letter-spacing: 0; line-height: 1.3; font-size: clamp(2.2rem, 1.1rem + 4.2vw, 4.4rem); }
[dir="rtl"] .wrap { padding-left: var(--gutter-r); padding-right: var(--gutter); }
[dir="rtl"] .ind-tab { text-align: right; }
[dir="rtl"] .process li::after { left: auto; right: 0; }
[dir="rtl"] .status { margin-left: 0; margin-right: .35rem; }
[dir="rtl"] .vx-defs--checks > div::before { left: auto; right: 0; }
[dir="rtl"] .pf-quote { border-left: 0; border-right: 3px solid var(--signal); border-radius: var(--r-md) 0 0 var(--r-md); }
[dir="rtl"] .pf-m-close { right: auto; left: .9rem; }
[dir="rtl"] .quote::before { right: auto; left: 1rem; }
[dir="rtl"] .marquee, [dir="rtl"] .clients-track, [dir="rtl"] .fx-slider, [dir="rtl"] .pf-slider { direction: ltr; }
[dir="rtl"] .fx-slider > *, [dir="rtl"] .pf-slider > * { direction: rtl; }
[dir="rtl"] .console, [dir="rtl"] code, [dir="rtl"] .url { direction: ltr; }


/* Arabic typography: Arabic letters must never be letter-spaced, and the display headings need taller lines */
html[lang="ar"] { --font-mono: "IBM Plex Sans Arabic", "Geist Mono", ui-monospace, monospace; }
html[lang="ar"] body * { letter-spacing: 0 !important; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.35 !important; }
html[lang="ar"] .section-head h2, html[lang="ar"] .prose h2, html[lang="ar"] .cta-band h2 { font-size: clamp(1.8rem, 1.1rem + 2.6vw, 3rem); }
html[lang="ar"] .pillar h3 { font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); }
html[lang="ar"] .work-art .mono, html[lang="ar"] .pf-art .mono, html[lang="ar"] .pf-slide-art .mono, html[lang="ar"] .launch-art .mono { font-family: "Bricolage Grotesque", sans-serif; }
[dir="rtl"] .ind-tab[aria-selected="true"]::after { content: "←"; }
[dir="rtl"] .work-art .mono, [dir="rtl"] .pf-art .mono, [dir="rtl"] .pf-slide-art .mono, [dir="rtl"] .launch-art .mono { right: auto; left: -0.06em; }
[dir="rtl"] .pf-art .url, [dir="rtl"] .launch-art .url { left: auto; right: 1rem; }
.post-card { grid-template-rows: 1fr; min-height: 200px; }
.post-card .body { padding: 1.5rem; align-content: space-between; height: 100%; }
.post-card .more { font-weight: 600; font-size: .9rem; color: var(--signal-ink); }
.page-hero h1.post-title { font-size: var(--step-4); max-width: 26ch; }
.article .hero-actions { margin-top: 1.5rem; }
[dir="rtl"] .site-footer li[dir="ltr"] { text-align: right; }
html[lang="ar"] .page-hero h1.post-title { font-size: clamp(1.7rem, 1rem + 2.4vw, 2.8rem); }

.svc-grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.svc .pillar-k { display: block; margin-bottom: .6rem; }
.svc .ticks { margin-top: 1rem; }
.ticks--muted li { opacity: .7; }
.mini-stats { display: flex; gap: 1.5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.mini-stats div { display: flex; flex-direction: column-reverse; gap: .2rem; }
.mini-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: var(--signal); }
.mini-stats dt { font-size: .85rem; color: var(--ink-muted); }
.band--ink .process h3, .band--ink2 .process h3 { color: var(--ink-fg); }
.band--ink .process p, .band--ink2 .process p { color: var(--ink-muted); }
.band--ink .process li::after, .band--ink2 .process li::after { background: var(--signal); }
.blog-empty { max-width: 640px; margin: 0 auto; text-align: center; display: grid; gap: 1rem; justify-items: center; padding: 2rem 0; }
.blog-empty h2 { font-size: var(--step-3); }
.blog-empty p { color: var(--paper-muted); font-size: var(--step-1); }
.post-grid:empty { display: none; }
