/*
 * Two gaps left by the static frontend, and nothing else. Both exist because
 * the upstream CSS only ever described markup its JavaScript produced.
 *
 * This file lives outside web-assets/ on purpose: `frontend:sync` never touches
 * it, so these two rules survive an upstream asset sync.
 */

/* Upstream blog.js rendered page controls as <button>, so blog.css styles
   `.blog-pagination button, .blog-pagination span` and nothing else. Server-
   rendered pagination has to emit real <a href> links. Same declarations as the
   button rule in blog.css, applied to the anchor. */
.content-page--blog .blog-pagination a {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--t), color var(--t), border-color var(--t);
}

.content-page--blog .blog-pagination a:hover,
.content-page--blog .blog-pagination a:focus-visible,
.content-page--blog .blog-pagination span.is-current {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
}

/* The frontend hand-wrote its article images; TinyMCE emits
   `<img class="img-fluid rounded" width="1200">`, and `img-fluid` is a Bootstrap
   class this theme never defines. Without a cap the image grows the grid track
   and the whole page scrolls sideways. */
.blog-inner-page .blog-article-content img,
.blog-inner-page .blog-article-content video,
.blog-inner-page .blog-article-content iframe,
.blog-inner-page .blog-article-content table,
.blog-inner-page .blog-article-content pre {
    max-width: 100%;
}

.blog-inner-page .blog-article-content img {
    height: auto;
}

.blog-inner-page .blog-article-content table,
.blog-inner-page .blog-article-content pre {
    display: block;
    overflow-x: auto;
}

/* The rules below used to be edited straight into web-assets/css/blog.css and
   were wiped by a frontend:sync, because blog.css is not a protected file. They
   style the CRM's own search, loading state and pagination, which upstream
   never had, so they live here now. */
.content-page--blog .blog-search input::-webkit-search-cancel-button,
.content-page--blog .blog-search input::-webkit-search-decoration {
    display: none;
    -webkit-appearance: none;
    appearance: none;
}

.content-page--blog .blog-results {
    position: relative;
    min-height: 320px;
}

.content-page--blog .blog-loader {
    position: absolute;
    inset: 42px 0 0;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding-top: 110px;
    background: rgba(244, 246, 249, 0.82);
    color: rgba(11, 18, 32, 0.68);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    backdrop-filter: blur(3px);
}

.content-page--blog .blog-loader[hidden] {
    display: none !important;
}

.content-page--blog .blog-loader-spinner {
    width: 18px;
    height: 18px;
    margin-top: -3px;
    border: 2px solid rgba(11, 18, 32, 0.16);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: blog-loader-spin 0.7s linear infinite;
}

.content-page--blog .blog-results.is-loading .blog-grid,
.content-page--blog .blog-results.is-loading .blog-pagination {
    pointer-events: none;
}

@keyframes blog-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.content-page--blog .blog-pagination .is-disabled {
    opacity: 0.28;
    cursor: default;
}

.content-page--blog .blog-pagination .blog-pagination-ellipsis {
    cursor: default;
    color: rgba(11, 18, 32, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    .content-page--blog .blog-loader-spinner {
        animation-duration: 1.4s;
    }
}
