/* =====================================================================
   Blog templates: single post, category / tag / author archives, search.
   Elementor Theme Builder templates "… – Atlas5" put these classes in
   their CSS Classes fields. Layout follows the reference blog; colours,
   type and radii are atlas5.co's (tokens in custom-frontend.css).
   ===================================================================== */

/* Anchor jumps (table of contents) land below the floating nav. */
html { scroll-padding-top: calc(var(--a5-nav-offset) + 1rem); }

/* ---------- Header band (hero of single post and archives) ---------- */
.a5-band { position: relative; }
.a5-band .elementor-heading-title,
.a5-post-title .elementor-heading-title { text-transform: none; }

.a5-band__row { align-items: center; }

/* Icon-only back button: ink circle with a pixel arrow (pixelarticons). */
.a5-back .elementor-button {
    position: relative;
    width: 44px; height: 44px; min-width: 44px; padding: 0 !important;
    border-radius: var(--a5-radius-full) !important;
    background: var(--a5-ink) !important; color: #fff !important;
    font-size: 0 !important; line-height: 0;
}
.a5-back .elementor-button::before {
    content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 11v2H8v2H6v-2H4v-2h2V9h2v2h12zM10 7H8v2h2V7zm0 0h2V5h-2v2zm0 10H8v-2h2v2zm0 0h2v2h-2v-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.a5-back .elementor-button:hover { background: var(--a5-ink-soft) !important; transform: translateY(-2px); }
.a5-back .elementor-button-content-wrapper { display: none; }

/* Archive eyebrow sits right above the title. */
.a5-band .a5-eyebrow .elementor-heading-title { color: var(--a5-ink); }

/* Byline: avatar · author / date · read time ([a5_post_byline]) */
.a5-byline {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.625rem;
    font-size: var(--a5-text-small); color: var(--a5-muted-subtle);
}
.a5-byline__author {
    display: inline-flex; align-items: center; gap: 0.5rem;
    color: var(--a5-ink); font-weight: 600;
}
.a5-byline__author:hover { color: var(--a5-primary); }
.a5-byline__avatar { width: 28px; height: 28px; border-radius: 50%; display: block; }
.a5-byline__sep { color: var(--a5-purple-300); }

/* Featured image in the post hero */
.a5-feat-img img {
    width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
    border-radius: var(--a5-radius-lg) !important; display: block;
}
.a5-feat-img.a5-ph { border-radius: var(--a5-radius-lg); }

/* ---------- Body: article + sidebar ---------- */
.a5-article .elementor-widget-theme-post-content { max-width: 46.25rem; }
.a5-article .elementor-widget-theme-post-content p:first-of-type { font-size: var(--a5-text-lead); color: var(--a5-ink-mid); }
.a5-article .elementor-widget-theme-post-content strong { color: var(--a5-ink); }

/* Post headings: sentence case, as written (matches the table of contents) */
.a5-article .post-content h2,
.a5-article .post-content h3,
.a5-article .post-content h4 { text-transform: none; }

/* Sidebar cards */
.a5-side-card {
    background: #fff; border: 1px solid var(--a5-border) !important;
    border-radius: var(--a5-radius-md) !important;
}
.a5-side-title .elementor-heading-title {
    padding-bottom: 0.75rem; border-bottom: 2px solid var(--a5-primary-soft);
    text-transform: none;
}

/* "Featured posts": Posts widget, classic skin, thumbnail left */
.a5-feat-list .elementor-posts-container { row-gap: 1.25rem !important; }
.a5-feat-list .elementor-post { align-items: center; gap: 0.875rem; }
.a5-feat-list .elementor-post__thumbnail__link { margin: 0 !important; flex: 0 0 6rem; width: 6rem !important; }
.a5-feat-list .elementor-post__thumbnail {
    border-radius: var(--a5-radius-sm); overflow: hidden; background: var(--a5-primary-soft);
}
.a5-feat-list .elementor-post__thumbnail img { transition: transform .4s var(--a5-ease); }
.a5-feat-list .elementor-post:hover .elementor-post__thumbnail img { transform: translate(-50%, -50%) scale(1.06); }
.a5-feat-list .elementor-post__title { margin: 0 !important; }
.a5-feat-list .elementor-post__title a {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--a5-ink); font-family: var(--a5-font-display); font-size: 0.9375rem; font-weight: 600; line-height: 1.35;
    text-transform: none; transition: color .2s var(--a5-ease);
}
.a5-feat-list .elementor-post__title a:hover { color: var(--a5-primary); }

/* "Explore more": category list ([a5_explore_cats]) */
.a5-cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.a5-cat-list li + li { border-top: 1px solid var(--a5-border); }
.a5-cat-list a {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.75rem 0; color: var(--a5-ink);
    font-size: var(--a5-text-small); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    transition: color .2s var(--a5-ease);
}
.a5-cat-list a:hover,
.a5-cat-list a.is-active { color: var(--a5-primary); }
.a5-cat-list__count {
    min-width: 1.75rem; padding: 0.125rem 0.5rem; border-radius: var(--a5-radius-full);
    background: var(--a5-surface); color: var(--a5-muted-subtle);
    font-size: var(--a5-text-caption); font-weight: 600; text-align: center; letter-spacing: 0;
}
.a5-cat-list a:hover .a5-cat-list__count,
.a5-cat-list a.is-active .a5-cat-list__count { background: var(--a5-primary-soft); color: var(--a5-primary-dark); }

/* Table of contents (Elementor Pro widget) */
.a5-toc .elementor-widget-table-of-contents,
.a5-toc .elementor-widget-table-of-contents .elementor-widget-container,
.a5-toc .elementor-toc { border: 0 !important; background: transparent !important; padding: 0 !important; border-radius: 0 !important; }
.a5-toc .elementor-toc__header-title { margin: 0; }
.a5-toc .elementor-toc__header { padding: 0 0 0.75rem !important; border-bottom: 2px solid var(--a5-primary-soft) !important; }
.a5-toc .elementor-toc__header-title {
    font-family: var(--a5-font-display); font-size: 1.25rem; font-weight: 600; color: var(--a5-ink); text-transform: none;
}
.a5-toc .elementor-toc__body { padding: 0.75rem 0 0 !important; max-height: 50vh; overflow-y: auto; }
.a5-toc .elementor-toc__list-wrapper { margin: 0; padding: 0; }
.a5-toc .elementor-toc__list-item { margin: 0 !important; font-size: var(--a5-text-small); line-height: 1.45; }
.a5-toc .elementor-toc__list-item-text-wrapper { padding: 0.375rem 0; }
.a5-toc .elementor-toc__list-item-text-wrapper::before { color: var(--a5-purple-300) !important; }
.a5-toc .elementor-toc__list-item-text { color: var(--a5-muted) !important; transition: color .2s var(--a5-ease); }
.a5-toc .elementor-toc__list-item-text:hover,
.a5-toc .elementor-toc__list-item-text.elementor-item-active { color: var(--a5-primary) !important; text-decoration: none !important; }
.a5-toc .elementor-toc__list-item-text.elementor-item-active { font-weight: 600; }
.a5-toc .elementor-toc__list-wrapper .elementor-toc__list-wrapper { padding-left: 0.875rem; border-left: 1px solid var(--a5-border); margin-left: 0.25rem; }
.a5-toc.is-empty { display: none !important; }

/* Dark CTA under the article (atlas5.co final CTA) */
.a5-cta-dark {
    position: relative; overflow: hidden; isolation: isolate;
    background-color: var(--a5-ink);
    border-radius: var(--a5-radius-lg) !important;
}
.a5-cta-dark::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        radial-gradient(circle at 85% 0%, rgba(124, 92, 230, .35), transparent 55%),
        radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: auto, 0.5625rem 0.5625rem;
}
.a5-cta-dark .elementor-heading-title { color: #fff; text-transform: none; }
.a5-cta-dark .a5-cta-dark__text,
.a5-cta-dark .a5-cta-dark__text .elementor-heading-title { color: var(--a5-muted-inverse); }

/* Author box (Elementor Pro widget) */
.a5-author-box .elementor-author-box {
    align-items: flex-start; gap: 1.25rem;
    padding: var(--a5-space-xl); background: var(--a5-surface); border-radius: var(--a5-radius-md);
}
.a5-author-box .elementor-author-box__avatar { margin: 0 !important; flex: 0 0 auto; }
.a5-author-box .elementor-author-box__avatar img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
.a5-author-box .elementor-author-box__text::before {
    content: "Written by"; display: block; margin-bottom: 0.25rem;
    font-size: var(--a5-text-caption); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--a5-primary);
}
.a5-author-box .elementor-author-box__name {
    margin: 0 0 0.375rem !important; font-family: var(--a5-font-display); font-size: var(--a5-text-title); font-weight: 600; color: var(--a5-ink);
    text-transform: none;
}
.a5-author-box .elementor-author-box__name a { color: inherit; }
.a5-author-box .elementor-author-box__bio { margin: 0 0 0.75rem; color: var(--a5-muted); font-size: var(--a5-text-body); line-height: 1.6; }
.a5-author-box .elementor-author-box__button {
    padding: 0 !important; border: 0 !important; background: none !important;
    color: var(--a5-primary) !important; font-family: var(--a5-font-display); font-size: var(--a5-text-small); font-weight: 700;
}
.a5-author-box .elementor-author-box__button:hover { color: var(--a5-primary-dark) !important; }
@media (max-width: 40rem) {
    .a5-author-box .elementor-author-box { flex-direction: column; }
}

/* ---------- Grids (Loop Grid with "Loop Item – Post Card") ---------- */
.a5-grid .e-loop-nothing-found-message,
.a5-grid .elementor-posts-nothing-found {
    padding: 3rem; border-radius: var(--a5-radius-md);
    background: var(--a5-surface); border: 1px dashed var(--a5-purple-300);
    color: var(--a5-muted); text-align: center;
}

/* Section heading of "Explore similar posts" */
.a5-related .elementor-heading-title { text-transform: none; }

/* ---------- Search card + empty-search guard ---------- */
.a5-search.is-error .elementor-search-form__input {
    border-color: #B3261E !important; box-shadow: 0 0 0 3px rgba(179, 38, 30, .12);
}
.a5-search-msg {
    margin-top: 0.5rem; font-size: var(--a5-text-caption); font-weight: 600; color: #B3261E;
}

/* ---------- Responsive ---------- */
@media (max-width: 53.75rem) {
    .a5-sidebar { position: static; }
}
