/* =====================================================================
   Atlas5 Blog — design tokens and front-end styles.

   Tokens mirror atlas5.co app/globals.css (@theme) so the blog and the
   marketing site read as one system. Elementor's Kit holds the same colours
   and fonts as globals; these variables are for the PHP chrome, the
   shortcodes and the helper classes Elementor templates use (a5-*).
   ===================================================================== */

:root {
    /* Colour */
    --a5-bg: #FFFFFF;
    --a5-surface: #F6F3FB;
    --a5-ink: #211C55;
    --a5-ink-soft: #2C2566;
    --a5-ink-mid: #3A3178;
    --a5-muted: #55516B;
    --a5-muted-subtle: #6E6A87;
    --a5-muted-inverse: rgba(255, 255, 255, 0.62);
    --a5-hover-ghost: #E7E3F2;
    --a5-primary: #7C5CE6;
    --a5-primary-dark: #6A47D1;
    --a5-primary-soft: #EAE2FA;
    --a5-purple-300: #C9BBF0;
    --a5-lavender-200: #E8E1F5;
    --a5-border: #E7E5EE;
    --a5-border-inverse: rgba(255, 255, 255, 0.14);

    /* Type */
    --a5-font-sans: 'Anybody', system-ui, -apple-system, sans-serif;
    --a5-font-display: 'Archivo', 'Anybody', system-ui, -apple-system, sans-serif;
    --a5-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    --a5-text-caption: 0.75rem;
    --a5-text-small: 0.875rem;
    --a5-text-body: clamp(0.875rem, 0.832rem + 0.217vw, 1rem);
    --a5-text-lead: clamp(1.05rem, 0.998rem + 0.261vw, 1.2rem);
    --a5-text-title: clamp(1.26rem, 1.197rem + 0.313vw, 1.44rem);
    --a5-text-title-lg: clamp(1.512rem, 1.437rem + 0.376vw, 1.728rem);
    --a5-text-heading: clamp(1.8144rem, 1.724rem + 0.451vw, 2.0736rem);
    --a5-text-h2: clamp(2.1773rem, 2.069rem + 0.541vw, 2.4883rem);
    --a5-text-h1: clamp(2rem, 1.657rem + 1.715vw, 2.986rem);

    /* Space */
    --a5-space-sm: 0.5rem;
    --a5-space-md: clamp(0.75rem, 0.663rem + 0.435vw, 1rem);
    --a5-space-lg: clamp(1rem, 0.826rem + 0.870vw, 1.5rem);
    --a5-space-xl: clamp(1.25rem, 0.989rem + 1.304vw, 2rem);
    --a5-space-2xl: clamp(1.75rem, 1.315rem + 2.174vw, 3rem);
    --a5-space-3xl: clamp(2.5rem, 1.978rem + 2.609vw, 4rem);
    --a5-section-y: clamp(4.75rem, 3.793rem + 4.783vw, 7.5rem);
    --a5-container: 76.25rem; /* 1220px */

    /* Shape */
    --a5-radius-xs: 0.5rem;
    --a5-radius-sm: 0.625rem;
    --a5-radius-md: 1rem;
    --a5-radius-lg: 1.25rem;
    --a5-radius-full: 999px;
    --a5-shadow-xs: 0 0.125rem 0.5rem -0.25rem rgba(33, 28, 85, 0.10);
    --a5-shadow-sm: 0 0.5rem 1.5rem -0.375rem rgba(33, 28, 85, 0.08);
    --a5-shadow-md: 0 1rem 2.75rem -0.875rem rgba(33, 28, 85, 0.12);
    --a5-shadow-hover: 0 1.125rem 2.5rem -1.125rem rgba(33, 28, 85, 0.35);
    --a5-shadow-focus: 0 0 0 0.1875rem rgba(124, 92, 230, 0.35);

    /* Motion */
    --a5-ease: cubic-bezier(.2, .8, .2, 1);

    /* Header height reserved at the top of every page */
    --a5-nav-offset: 6.5rem;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--a5-bg);
    color: var(--a5-ink);
    font-family: var(--a5-font-sans);
    font-size: var(--a5-text-body);
    line-height: 1.5; /* the site's leading-normal */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--a5-font-display);
    color: var(--a5-ink);
    font-weight: 500;
    text-transform: capitalize;
}
a { color: inherit; text-decoration: none; }
a:hover, a:active { color: inherit; }
img, svg { max-width: 100%; }
button { font-family: inherit; }
::selection { background: var(--a5-primary-soft); color: var(--a5-ink); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 0.125rem solid var(--a5-primary);
    outline-offset: 0.125rem;
}

.a5-main { padding-top: var(--a5-nav-offset); min-height: 60vh; }
/* As on atlas5.co, an Elementor template starts at the very top, under the
   glass nav, and its first section clears the nav with its own padding
   (the site's hero uses 9.375rem), so its background shows through the pill. */
.a5-main:has(> .elementor[class*="elementor-location-"]) { padding-top: 0; }

.a5-skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 2000;
    padding: 0.5rem 1rem; border-radius: var(--a5-radius-sm);
    background: var(--a5-ink); color: #fff;
    transition: top .2s var(--a5-ease);
}
.a5-skip-link:focus { top: 1rem; color: #fff; }

.a5-container {
    max-width: var(--a5-container);
    margin-inline: auto;
    /* 1.25rem gutter, 1180px content: lines up with the header pill
       (.a5-nav max-width 73.75rem inside .a5-nav-float's 1.25rem padding). */
    padding-inline: 1.25rem;
    box-sizing: border-box;
}

.a5-icon-1em { width: 1em; height: 1em; flex: 0 0 auto; display: block; }

/* ---------- Buttons (atlas5.co components/ui/button.tsx) ---------- */
.a5-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--a5-space-sm);
    font-family: var(--a5-font-display); font-weight: 600; text-transform: capitalize; white-space: nowrap;
    border: 1px solid transparent; border-radius: var(--a5-radius-sm); cursor: pointer;
    padding: var(--a5-space-sm) var(--a5-space-lg); font-size: var(--a5-text-small); line-height: 1.5;
    transition: background-color .2s var(--a5-ease), transform .2s var(--a5-ease), color .2s var(--a5-ease);
}
@media (min-width: 860px) { .a5-btn { font-size: var(--a5-text-body); line-height: 1.6; } }
.a5-btn:hover { transform: translateY(-2px); }
.a5-btn--primary, .a5-btn--primary:visited { background: var(--a5-ink); color: #fff; }
.a5-btn--primary:hover, .a5-btn--primary:focus { background: var(--a5-ink-soft); color: #fff; }
.a5-btn--accent, .a5-btn--accent:visited { background: var(--a5-primary); color: #fff; }
.a5-btn--accent:hover, .a5-btn--accent:focus { background: var(--a5-primary-dark); color: #fff; }
.a5-btn--ghost, .a5-btn--ghost:visited { background: var(--a5-surface); color: var(--a5-ink); }
.a5-btn--ghost:hover, .a5-btn--ghost:focus { background: var(--a5-hover-ghost); color: var(--a5-ink); }
/* button.tsx `sm` (nav CTA): text-body at every width; font-semibold wins over its font-bold. */
.a5-btn--sm { padding: var(--a5-space-sm) var(--a5-space-md); font-size: var(--a5-text-body); line-height: 1.6; }

/* Elementor buttons pick up the same treatment */
.elementor-button {
    font-family: var(--a5-font-display);
    text-transform: capitalize;
    transition: background-color .2s var(--a5-ease), transform .2s var(--a5-ease), color .2s var(--a5-ease) !important;
}
.elementor-button:hover { transform: translateY(-2px); }

/* =====================================================================
   Blog components — used by the Elementor templates (CSS Classes field)
   and by the shortcodes in functions.php. Layout follows the "Beyond the
   Bid" design; colours, type and radii are atlas5.co's.
   ===================================================================== */

/* Hero glow (atlas5.co home hero) */
.a5-hero-glow {
    background-image:
        radial-gradient(50% 60% at 28% 0%, rgba(124, 92, 230, .10), transparent 70%),
        radial-gradient(40% 50% at 85% 8%, rgba(201, 187, 240, .10), transparent 70%);
}
.a5-accent { color: var(--a5-primary); }

/* Eyebrow: uppercase label with a purple dot (components/ui/section-head.tsx) */
.a5-eyebrow,
.a5-eyebrow .elementor-heading-title {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--a5-font-sans); font-size: var(--a5-text-small); font-weight: 500;
    letter-spacing: .04em; text-transform: uppercase; color: var(--a5-ink);
}
.a5-eyebrow .elementor-heading-title::before,
span.a5-eyebrow::before {
    content: ""; width: 7px; height: 7px; background: var(--a5-primary); flex: 0 0 auto;
}

/* Dotted placeholder art for posts without a featured image */
.a5-ph {
    background-color: var(--a5-primary-soft);
    background-image: radial-gradient(var(--a5-purple-300) 1.1px, transparent 1.4px);
    background-size: 14px 14px;
}

/* Cards: lift on hover */
.a5-card {
    transition: transform .2s var(--a5-ease), box-shadow .2s var(--a5-ease);
}
.a5-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--a5-shadow-hover);
}
.a5-card img { transition: transform .4s var(--a5-ease); }
.a5-card:hover img { transform: scale(1.03); }

/* Category tiles */
.a5-tile {
    transition: transform .2s var(--a5-ease), border-color .2s var(--a5-ease), box-shadow .2s var(--a5-ease);
}
.a5-tile:hover {
    transform: translateY(-3px);
    border-color: var(--a5-primary) !important;
    box-shadow: var(--a5-shadow-sm);
}

/* Category pills ([a5_post_cats]) */
.a5-tags { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.a5-tag {
    display: inline-block; padding: 0.25rem 0.625rem; border-radius: var(--a5-radius-full);
    background: var(--a5-primary-soft); color: var(--a5-ink);
    font-family: var(--a5-font-sans); font-size: var(--a5-text-caption); font-weight: 700; line-height: 1.4;
    position: relative; z-index: 2;
    transition: background-color .2s var(--a5-ease), color .2s var(--a5-ease);
}
a.a5-tag:hover { background: var(--a5-primary); color: #fff; }
.a5-tags--outline .a5-tag { background: #fff; border: 1px solid var(--a5-purple-300); color: var(--a5-primary-dark); }

/* Date · read time ([a5_post_meta]) */
.a5-post-meta {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
    font-size: var(--a5-text-small); color: var(--a5-muted-subtle);
}
.a5-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--a5-purple-300); display: inline-block; }

/* "Read article →" */
.a5-read-more .elementor-button,
.a5-read-more a {
    color: var(--a5-primary) !important; font-weight: 700;
}

/* ---------- Loop Grid filter (chips) ---------- */
.elementor-widget-taxonomy-filter .e-filter { gap: 0.625rem; flex-wrap: wrap; }
.elementor-widget-taxonomy-filter .e-filter-item {
    min-height: 44px; padding: 0 1.125rem !important;
    border-radius: var(--a5-radius-full) !important;
    border: 1px solid var(--a5-border) !important;
    background: #fff !important; color: var(--a5-ink) !important;
    font-family: var(--a5-font-display) !important; font-size: var(--a5-text-small) !important; font-weight: 600 !important;
    transition: background-color .2s var(--a5-ease), color .2s var(--a5-ease), border-color .2s var(--a5-ease);
}
.elementor-widget-taxonomy-filter .e-filter-item:hover { border-color: var(--a5-primary) !important; }
.elementor-widget-taxonomy-filter .e-filter-item[aria-pressed="true"] {
    background: var(--a5-ink) !important; border-color: var(--a5-ink) !important; color: #fff !important;
}

/* ---------- Search form ---------- */
.a5-search .elementor-search-form__container,
.a5-search .e-search-form {
    border-radius: var(--a5-radius-full) !important; overflow: hidden;
}
.a5-search input[type="search"],
.a5-search .elementor-search-form__input {
    font-family: var(--a5-font-sans) !important; color: var(--a5-ink) !important;
}
.a5-search input::placeholder { color: var(--a5-muted-subtle); }

/* ---------- Pagination (Loop Grid / Posts / Archive Posts) ---------- */
.elementor-pagination {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.625rem;
}
.elementor-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 44px; padding: 0 0.875rem; box-sizing: border-box; margin: 0 !important;
    border-radius: var(--a5-radius-full); border: 1px solid var(--a5-border); background: #fff;
    color: var(--a5-ink); font-family: var(--a5-font-display); font-size: var(--a5-text-small); font-weight: 600;
    transition: background-color .2s var(--a5-ease), border-color .2s var(--a5-ease), color .2s var(--a5-ease);
}
.elementor-pagination a.page-numbers:hover { border-color: var(--a5-primary); color: var(--a5-primary); }
.elementor-pagination .page-numbers.current {
    background: var(--a5-primary); border-color: var(--a5-primary); color: #fff;
}
.elementor-pagination .page-numbers.dots { border: 0; background: transparent; }
.elementor-pagination .page-numbers.prev.disabled,
.elementor-pagination span.page-numbers.prev,
.elementor-pagination span.page-numbers.next { color: var(--a5-muted-subtle); }

/* ---------- Loop Carousel (featured) ---------- */
.a5-featured .elementor-swiper-button {
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid var(--a5-border); background: #fff; color: var(--a5-ink);
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .2s var(--a5-ease), color .2s var(--a5-ease);
}
.a5-featured .elementor-swiper-button:hover { border-color: var(--a5-primary); color: var(--a5-primary); }
.a5-featured .elementor-swiper-button svg { width: 18px; height: 18px; fill: currentColor; }
.a5-featured .swiper-pagination-bullet {
    width: 8px; height: 8px; border-radius: 999px; background: var(--a5-purple-300); opacity: 1;
    transition: width .25s var(--a5-ease), background-color .25s var(--a5-ease);
}
.a5-featured .swiper-pagination-bullet-active { width: 28px; background: var(--a5-primary); }

/* ---------- Blog home helpers (Elementor templates) ---------- */
.a5-max-1200 { max-width: 1200px; margin-inline: auto; }
.a5-push-bottom { margin-top: auto; }
a.a5-card, a.a5-card:hover, a.a5-tile, a.a5-tile:hover { color: var(--a5-ink); }
/* Featured card: the image fills its half of the card */
.a5-featured-card .a5-fill-img,
.a5-featured-card .a5-fill-img .elementor-widget-container { height: 100%; }
.a5-featured-card .a5-fill-img img { width: 100%; height: 100% !important; object-fit: cover; display: block; }
.a5-post-card .elementor-widget-theme-post-featured-image img { display: block; }
.a5-featured .swiper-slide { height: auto; }

/* Blog home follows the design's sentence case: post titles such as
   "Prebid.js" or "ads.txt" must not be title-cased. */
.elementor-location-archive .elementor-heading-title,
.e-loop-item .elementor-heading-title { text-transform: none; }
.a5-featured-card .a5-fill-img img { object-position: left center !important; }

/* Featured carousel: arrows sit outside the card, as in the design */
.a5-featured .elementor-widget-loop-carousel .swiper { width: calc(100% - 136px) !important; margin-inline: auto !important; }
.a5-featured .elementor-widget-loop-carousel .elementor-swiper-button {
    position: absolute; top: 50%; transform: translateY(-50%) !important; z-index: 3; cursor: pointer;
    width: 48px !important; height: 48px !important; padding: 0 !important; border-radius: 50% !important;
    border: 1px solid #DCD5F5 !important; background: #fff !important; display: inline-flex; align-items: center; justify-content: center;
    --arrow-normal-color: var(--a5-ink); --arrow-hover-color: var(--a5-primary);
}
.a5-featured .elementor-widget-loop-carousel .elementor-swiper-button:hover { border-color: var(--a5-primary) !important; }
.a5-featured .elementor-widget-loop-carousel .elementor-swiper-button svg { width: 18px !important; height: 18px !important; fill: currentColor; }
.a5-featured .elementor-swiper-button-prev { left: 0 !important; }
.a5-featured .elementor-swiper-button-next { right: 0 !important; }
.a5-featured .elementor-swiper-button svg { fill: var(--a5-ink); }
.a5-featured .elementor-widget-loop-carousel .swiper-pagination { position: static !important; width: 100% !important; margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 6px; transform: none !important; inset: auto !important; }
.a5-featured .swiper-pagination-bullet { background: var(--a5-purple-300) !important; opacity: 1 !important; margin: 0 !important; }
.a5-featured .swiper-pagination-bullet-active { background: var(--a5-primary) !important; }
.a5-featured .elementor-widget-loop-carousel .swiper-pagination-bullet { width: 8px !important; height: 8px !important; border-radius: 999px !important; }
.a5-featured .elementor-widget-loop-carousel .swiper-pagination-bullet-active { width: 28px !important; }
@media (max-width: 767px) {
    .a5-featured .elementor-widget-loop-carousel .swiper { width: 100% !important; }
    .a5-featured .elementor-widget-loop-carousel .elementor-swiper-button { display: none !important; }
}

/* Search: pill input + round purple button */
.a5-search .elementor-search-form__container { gap: 8px; background: transparent !important; border: 0 !important; overflow: visible; min-height: 48px; }
.a5-search .elementor-search-form__input {
    height: 48px; padding: 0 18px !important; border: 1px solid #DCD5F5 !important;
    border-radius: var(--a5-radius-full) !important; background: #fff !important; font-size: 16px !important;
}
.a5-search .elementor-search-form__input:focus { outline: 2px solid var(--a5-primary); outline-offset: 1px; }
.a5-search .elementor-search-form__submit { flex: 0 0 48px; width: 48px !important; min-width: 48px !important; height: 48px; border-radius: 50% !important; }

/* ---------- Empty results ---------- */
.a5-empty {
    padding: 3rem; border-radius: var(--a5-radius-md);
    background: var(--a5-surface); border: 1px dashed var(--a5-purple-300); text-align: center;
}

/* =====================================================================
   Article prose — post content (atlas5.co lib/prose.ts, extended for
   blog content: h2–h4, blockquote, images, tables, code).
   ===================================================================== */
.a5-prose,
.elementor-widget-theme-post-content {
    color: var(--a5-muted);
    font-size: var(--a5-text-body);
    line-height: 1.75;
}
.a5-prose p,
.elementor-widget-theme-post-content p { margin: 0 0 1.25rem; }
.a5-prose h2,
.elementor-widget-theme-post-content h2 {
    font-size: var(--a5-text-title-lg); line-height: 1.25; margin: 2.75rem 0 0.875rem;
}
.a5-prose h3,
.elementor-widget-theme-post-content h3 {
    font-size: var(--a5-text-title); line-height: 1.3; margin: 2rem 0 0.75rem;
}
.a5-prose h4,
.elementor-widget-theme-post-content h4 {
    font-size: var(--a5-text-body); font-weight: 600; margin: 1.75rem 0 0.625rem;
}
.a5-prose > :first-child,
.elementor-widget-theme-post-content .elementor-widget-container > :first-child { margin-top: 0; }
.a5-prose a,
.elementor-widget-theme-post-content a {
    font-weight: 600; color: var(--a5-ink); text-decoration: underline; text-underline-offset: 2px;
    text-decoration-color: var(--a5-purple-300);
    transition: color .2s var(--a5-ease), text-decoration-color .2s var(--a5-ease);
}
.a5-prose a:hover,
.elementor-widget-theme-post-content a:hover { color: var(--a5-primary); text-decoration-color: var(--a5-primary); }
.a5-prose strong,
.elementor-widget-theme-post-content strong { font-weight: 600; color: var(--a5-ink); }
.a5-prose ul,
.elementor-widget-theme-post-content ul {
    list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem;
}
.a5-prose ul li,
.elementor-widget-theme-post-content ul li { position: relative; padding-left: 1.25rem; line-height: 1.7; }
.a5-prose ul li::before,
.elementor-widget-theme-post-content ul li::before {
    content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; background: var(--a5-primary);
}
.a5-prose ol,
.elementor-widget-theme-post-content ol { margin: 0 0 1.25rem; padding-left: 1.25rem; }
.a5-prose ol li,
.elementor-widget-theme-post-content ol li { padding-left: 0.25rem; margin-bottom: 0.5rem; line-height: 1.7; }
.a5-prose ol li::marker,
.elementor-widget-theme-post-content ol li::marker { color: var(--a5-primary); font-weight: 700; }
.a5-prose blockquote,
.elementor-widget-theme-post-content blockquote {
    margin: 2rem 0; padding: 1.25rem 1.5rem; border-left: 3px solid var(--a5-primary);
    background: var(--a5-surface); border-radius: 0 var(--a5-radius-md) var(--a5-radius-md) 0;
    color: var(--a5-ink); font-size: var(--a5-text-lead); line-height: 1.6;
}
.a5-prose blockquote p:last-child,
.elementor-widget-theme-post-content blockquote p:last-child { margin-bottom: 0; }
.a5-prose code,
.elementor-widget-theme-post-content code {
    background: var(--a5-surface); color: var(--a5-ink); padding: 0.125rem 0.375rem;
    border-radius: var(--a5-radius-xs); font-family: var(--a5-font-mono); font-size: 0.9em;
}
.a5-prose pre,
.elementor-widget-theme-post-content pre {
    background: var(--a5-ink); color: #F6F3FB; padding: 1.25rem 1.5rem; border-radius: var(--a5-radius-md);
    overflow-x: auto; margin: 0 0 1.5rem; font-size: 0.875rem; line-height: 1.6;
}
.a5-prose pre code,
.elementor-widget-theme-post-content pre code { background: none; color: inherit; padding: 0; }
.a5-prose img,
.elementor-widget-theme-post-content img { border-radius: var(--a5-radius-md); height: auto; }
.a5-prose figure,
.elementor-widget-theme-post-content figure { margin: 2rem 0; }
.a5-prose figcaption,
.elementor-widget-theme-post-content figcaption {
    margin-top: 0.625rem; font-size: var(--a5-text-small); color: var(--a5-muted-subtle); text-align: center;
}
.a5-prose table,
.elementor-widget-theme-post-content table {
    width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: var(--a5-text-small);
}
.a5-prose th, .a5-prose td,
.elementor-widget-theme-post-content th,
.elementor-widget-theme-post-content td { padding: 0.75rem; border-bottom: 1px solid var(--a5-border); text-align: left; }
.a5-prose th,
.elementor-widget-theme-post-content th { color: var(--a5-ink); font-weight: 600; background: var(--a5-surface); }
.a5-prose hr,
.elementor-widget-theme-post-content hr { border: 0; border-top: 1px solid var(--a5-border); margin: 2.5rem 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
    }
    html { scroll-behavior: auto; }
}
