/* ───────────────────────────────────────────────────────────────────
   PDF Related List + Carousel widgets. Cards reuse the .pdftopost-card
   markup (styled by post-actions.css / recommended-posts.css); this file
   only lays out the list grid + the carousel rail/arrows.
   ───────────────────────────────────────────────────────────────── */

.pdftopost-related { width: 100%; }

/* Thumb image — a real <img> (indexable, alt text, native lazy-load),
   cover-cropped inside .pdftopost-card-thumb (the aspect box). */
.pdftopost-related-card .pdftopost-card-thumb-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Card title is rendered as <h3> for SEO (the document title is the
   meaningful heading on the card). Force it back to the compact card-title
   look so theme h3 styles (.entry-content h3 etc.) don't blow it up. */
.pdftopost-related-card h3.pdftopost-card-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    color: #19172b !important;
}

/* Rendered as <h3> for a clean section-heading hierarchy, but sized to
   match the FAQs title (1.5em / 700). !important + element-qualified
   selector so theme h3 styles (e.g. .entry-content h3) don't override. */
.pdftopost-related-heading {
    margin: 0 0 12px !important;
    padding: 0 !important;
    font-size: 1.05em !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: inherit;
}

/* ── List (grid) ── */
.pdftopost-related-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

/* Taller, portrait-style thumbnails (document-cover proportions) on BOTH
   the list and carousel related cards. Overrides the base
   .pdftopost-card-thumb 14:9 ratio with higher specificity. */
.pdftopost-related-card .pdftopost-card-thumb {
    aspect-ratio: 3 / 4 !important;
}

/* ── Card meta: byline + a nowrap stat group ────────────────────────
   .pdftopost-card-meta = [ .pdftopost-card-byline ][ .pdftopost-card-substats ]
   The byline stays one line (ellipsis). The substats group is inline-flex
   nowrap, so its chips (views / pages / category / language) never wrap
   apart. Each visible stat carries a leading CSS middot separator (so the
   first one also separates it from the byline); hidden stats render no dot.
   Per context we show + order a different subset. */
.pdftopost-related-card .pdftopost-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0 !important;
    gap: 0 6px;               /* space (not a dot) between the uploader and the stats */
    overflow: hidden;
}
.pdftopost-related-card .pdftopost-card-byline {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdftopost-related-card .pdftopost-card-author { color: #312e56; font-weight: 500; }
.pdftopost-related-card .pdftopost-card-substats {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;          /* pages + views always stay inline */
    flex: 0 0 auto;
}
.pdftopost-related-card .pdftopost-card-stat {
    white-space: nowrap;
}
.pdftopost-related-card .pdftopost-card-substats .pdftopost-card-stat::before {
    content: "·";
    margin: 0 6px;
    color: #b9bdd6;
}
/* No leading dot on the first stat — the uploader is separated by a space
   (the meta column-gap), not a middot. Default cards show only pages, so
   suppress its dot explicitly (views may sit hidden before it in the DOM).
   NOTE: the LIST view keeps its middot after the uploader (see below); only
   the default related/carousel + grid views use a plain space. */
.pdftopost-related:not(.pdftopost-search-results) .pdftopost-card-pages::before { content: none; }

/* Default (related list/carousel): only byline + pages. */
.pdftopost-related-card .pdftopost-card-views,
.pdftopost-related-card .pdftopost-card-category,
.pdftopost-related-card .pdftopost-card-language { display: none; }

/* Inline document-type badge (after the title) — hidden unless a context
   opts in (search list). */
.pdftopost-card-type-inline { display: none; }
.pdftopost-search-results--list .pdftopost-card-type-inline {
    display: inline-block;
    flex: 0 0 auto;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 5px;
    background: #f0eff5;
    color: #312e56;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

/* ── Search GRID meta: Title / byline (own line) / Pages · Views ──── */
/* Pull the meta up under the title instead of pinning it to the bottom,
   and tighten the body's internal spacing. */
.pdftopost-search-results--grid .pdftopost-related-card .pdftopost-card-body {
    gap: 4px;
}
.pdftopost-search-results--grid .pdftopost-related-card .pdftopost-card-footer {
    margin-top: 0;          /* was auto — removed the big gap below the title */
}
.pdftopost-search-results--grid .pdftopost-related-card .pdftopost-card-meta {
    flex-wrap: wrap;
    overflow: visible;
    row-gap: 4px;           /* little gap below the author line */
}
.pdftopost-search-results--grid .pdftopost-card-byline {
    flex: 0 0 100%;         /* author on its own line */
    margin-bottom: 1px;
}
.pdftopost-search-results--grid .pdftopost-card-substats {
    flex: 0 0 100%;         /* Pages · Views together on line 2 */
}
.pdftopost-search-results--grid .pdftopost-card-views    { display: inline; order: 2; }
.pdftopost-search-results--grid .pdftopost-card-pages    { order: 1; }
.pdftopost-search-results--grid .pdftopost-card-category { display: none; }  /* no category in grid */
.pdftopost-search-results--grid .pdftopost-card-language { display: none; }
/* Pages is the first chip on line 2 — drop its leading middot. (Scoped
   through .pdftopost-card-substats so it out-specifies the base separator
   rule; otherwise the dot reappears between the author line and Pages.) */
.pdftopost-search-results--grid .pdftopost-card-substats .pdftopost-card-pages::before { content: none; }

/* ── Search LIST meta: author · views · pages · language (one line) */
.pdftopost-search-results--list .pdftopost-related-card .pdftopost-card-meta {
    flex-wrap: wrap;
    overflow: visible;
    column-gap: 0;   /* the middot after the uploader provides the separation */
}
.pdftopost-search-results--list .pdftopost-card-views    { display: inline; order: 1; }
.pdftopost-search-results--list .pdftopost-card-pages    { order: 2; }
.pdftopost-search-results--list .pdftopost-card-language { display: inline; order: 3; }
.pdftopost-search-results--list .pdftopost-card-category { display: none; }

/* Related carousel edge-fade gradient → brand light navy-200 (#F2F4FE)
   instead of white. These ::before/::after overlays sit at the left/right
   ends of the rail and fade in when there's more to scroll. Scoped to the
   related carousel so the Recommended widget keeps its white fade. */
.pdftopost-related--carousel .pdftopost-recommended-rail-wrap::before {
    background: linear-gradient(
        to right,
        rgba(242, 244, 254, 1) 0%,
        rgba(242, 244, 254, 0.85) 40%,
        rgba(242, 244, 254, 0) 100%
    ) !important;
}
.pdftopost-related--carousel .pdftopost-recommended-rail-wrap::after {
    background: linear-gradient(
        to left,
        rgba(242, 244, 254, 1) 0%,
        rgba(242, 244, 254, 0.85) 40%,
        rgba(242, 244, 254, 0) 100%
    ) !important;
}

/* In the in-viewer Related + Overview drawers the background is white, so the
   carousel edge-fade must be white too (overriding the light-navy fade above).
   Scoped to those drawers so it only affects them, never the page-level
   related carousels. */
.pdftopost-related-drawer .pdftopost-related--carousel .pdftopost-recommended-rail-wrap::before,
.pdftopost-overview-drawer .pdftopost-related--carousel .pdftopost-recommended-rail-wrap::before {
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.85) 40%,
        rgba(255, 255, 255, 0) 100%
    ) !important;
}
.pdftopost-related-drawer .pdftopost-related--carousel .pdftopost-recommended-rail-wrap::after,
.pdftopost-overview-drawer .pdftopost-related--carousel .pdftopost-recommended-rail-wrap::after {
    background: linear-gradient(
        to left,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.85) 40%,
        rgba(255, 255, 255, 0) 100%
    ) !important;
}

/* Light border around the card cover image inside the viewer drawers, so the
   thumbnails read as framed cards against the white drawer background. */
.pdftopost-related-drawer .pdftopost-card-thumb-image,
.pdftopost-overview-drawer .pdftopost-card-thumb-image {
    border: 1px solid #e9e9ef;
}

/* ── Carousel rail ── */
.pdftopost-related-rail-wrap {
    position: relative;
}
.pdftopost-related-rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 8px;
}
.pdftopost-related-rail::-webkit-scrollbar { display: none; }
.pdftopost-related-rail:focus-visible { outline: 2px solid #312e56; outline-offset: 2px; }
.pdftopost-related-rail .pdftopost-card {
    flex: 0 0 190px;
    width: 190px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* ── Related CAROUSEL cards — force small ─────────────────────────────
   The carousel reuses .pdftopost-recommended-rail and its width is set by
   the Elementor "Card width" control via
     {{WRAPPER}} .pdftopost-recommended-rail .pdftopost-card { ... !important }
   (3-class specificity). To win regardless of the saved slider value we use
   a 5-class selector (.pdftopost-related.pdftopost-related--carousel +
   rail-wrap + rail + card) plus !important. */
.pdftopost-related.pdftopost-related--carousel .pdftopost-recommended-rail-wrap .pdftopost-recommended-rail .pdftopost-card {
    flex: 0 0 150px !important;
    width: 150px !important;
}

@media (max-width: 600px) {
    .pdftopost-related.pdftopost-related--carousel .pdftopost-recommended-rail-wrap .pdftopost-recommended-rail .pdftopost-card {
        flex: 0 0 130px !important;
        width: 130px !important;
    }
}

/* Arrows — desktop only; on touch devices users swipe. */
.pdftopost-related-arrow {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #312e56;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: opacity 0.15s ease, transform 0.1s ease;
}
.pdftopost-related-arrow svg { width: 18px; height: 18px; }
.pdftopost-related-arrow:hover { opacity: 0.92; }
.pdftopost-related-arrow:active { transform: translateY(-50%) scale(0.94); }
.pdftopost-related-arrow--prev { left: -12px; }
.pdftopost-related-arrow--next { right: -12px; }

@media (max-width: 768px) {
    .pdftopost-related-arrow { display: none; } /* swipe on mobile */
}

/* ── Search Results widget ──────────────────────────────────────────
   Card grid replacement for the default WP search loop. Cards + grid
   reuse the related-list styles above; these rules add the no-results
   message and the pagination control. */
.pdftopost-search-no-results {
    margin: 8px 0;
    padding: 24px;
    text-align: center;
    color: #6b7280;
    background: #f4f4f7;
    border-radius: 12px;
    font-size: 15px;
}
.pdftopost-search-no-results-text { margin: 0; }
.pdftopost-search-reset {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    background: #312e56;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.pdftopost-search-reset:hover { opacity: 0.9; color: #fff; }

.pdftopost-search-pagination {
    margin-top: 24px;
}
.pdftopost-search-pagination .page-numbers {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    justify-content: center;
}
.pdftopost-search-pagination .page-numbers li { margin: 0; }
.pdftopost-search-pagination a.page-numbers,
.pdftopost-search-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #312e56;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    background: #fff;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.pdftopost-search-pagination a.page-numbers:hover {
    border-color: #312e56;
}
.pdftopost-search-pagination .page-numbers.current {
    background: #312e56;
    border-color: #312e56;
    color: #fff;
}
.pdftopost-search-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* ── Search Results: List (rows) layout ─────────────────────────────
   One card per row, flipped horizontal: portrait thumb on the left,
   title + meta on the right (library list view). Scoped to the search
   widget's --list modifier so the related list/carousel are untouched. */
.pdftopost-search-results--list .pdftopost-related-list {
    grid-template-columns: 1fr !important;
}
.pdftopost-search-results--list .pdftopost-related-card {
    grid-template-columns: 92px minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 14px !important;
    align-items: start;            /* title + bookmark aligned to the top */
    padding: 12px 14px !important;
    position: relative;
}
.pdftopost-search-results--list .pdftopost-related-card .pdftopost-card-thumb {
    aspect-ratio: 3 / 4 !important;
}
/* Title row: text + inline type badge on one line; reserve room on the
   right so the long title doesn't run under the top-right bookmark. */
.pdftopost-search-results--list .pdftopost-related-card .pdftopost-card-title {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 15px !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    white-space: normal !important;
    padding-right: 34px;
}
.pdftopost-search-results--list .pdftopost-card-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Body stacks title then meta from the top. */
.pdftopost-search-results--list .pdftopost-related-card .pdftopost-card-body {
    justify-content: flex-start;
}
.pdftopost-search-results--list .pdftopost-related-card .pdftopost-card-footer {
    margin-top: 6px;
}
/* Bookmark pinned to the top-right of the row. */
.pdftopost-search-results--list .pdftopost-related-card .pdftopost-card-save {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
}
/* In list, the inline type badge replaces the image badge. */
.pdftopost-search-results--list .pdftopost-card-type-badge {
    display: none;
}

/* Mobile: list title + type badge stack (badge drops below the title)
   instead of sitting inline. */
@media (max-width: 768px) {
    .pdftopost-search-results--list .pdftopost-related-card .pdftopost-card-title {
        display: block !important;
        padding-right: 30px;
    }
    .pdftopost-search-results--list .pdftopost-card-title-text {
        display: block;
        white-space: normal;       /* allow the title to wrap */
        overflow: visible;
        text-overflow: clip;
    }
    .pdftopost-search-results--list .pdftopost-card-type-inline {
        margin-left: 0;
        margin-top: 5px;
    }

    /* List (mobile): the "by uploader" sits on its OWN line above the meta
       (views · pages · language), not inline within it. */
    .pdftopost-search-results--list .pdftopost-card-byline {
        flex: 0 0 100%;
        margin-bottom: 3px;
    }
    .pdftopost-search-results--list .pdftopost-card-substats {
        flex: 0 0 100%;
    }
    /* No leading dot before the first stat now that the author is above. */
    .pdftopost-search-results--list .pdftopost-card-substats .pdftopost-card-stat:first-child::before {
        content: none;
    }
}

/* ── Search Results: layout ─────────────────────────────────────────
   Row 1: filter dropdowns + "Clear all".
   Row 2: results heading (left) + grid/list toggle (right). */
.pdftopost-search-filterbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    min-width: 0;
}
.pdftopost-search-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    min-width: 0;
}

/* Mobile filter-icon button (opens the drawer) — hidden on desktop. */
.pdftopost-filter-drawer-toggle {
    display: none;
    position: relative;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #312e56;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pdftopost-filter-drawer-toggle:hover { border-color: #312e56; background: rgba(49, 46, 86, 0.06); }
/* Force the inline SVG to render (themes/Elementor often reset svg
   width + stroke, collapsing the icon to a dot). */
.pdftopost-filter-drawer-toggle svg {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    display: block;
    flex: 0 0 auto;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2;
}
/* Dot badge when one or more filters are active. */
.pdftopost-filter-drawer-toggle.has-active::after {
    content: "";
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #312e56;
    border: 1.5px solid #fff;
}

@media (max-width: 768px) {
    .pdftopost-filter-drawer-toggle { display: inline-flex; }
    /* Horizontally scrollable filter row on phones. */
    .pdftopost-search-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex: 1 1 auto;
        padding-bottom: 2px;
    }
    .pdftopost-search-filters::-webkit-scrollbar { display: none; }
    .pdftopost-search-filters > .pdftopost-cdrop,
    .pdftopost-search-filters > .pdftopost-search-clear { flex: 0 0 auto; }
}

/* ── Mobile filter drawer ───────────────────────────────────────────── */
.pdftopost-filter-drawer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    visibility: hidden;
    pointer-events: none;
}
.pdftopost-filter-drawer.is-open { visibility: visible; pointer-events: auto; }
.pdftopost-filter-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.pdftopost-filter-drawer.is-open .pdftopost-filter-drawer-overlay { opacity: 1; }
.pdftopost-filter-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 340px;
    max-width: 88vw;
    background: #fff;
    box-shadow: -10px 0 36px rgba(0, 0, 0, 0.22);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pdftopost-filter-drawer.is-open .pdftopost-filter-drawer-panel { transform: translateX(0); }
.pdftopost-filter-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    flex: 0 0 auto;
}
.pdftopost-filter-drawer-title { font-size: 18px; font-weight: 700; color: #19172b; }
.pdftopost-filter-drawer-close {
    background: none;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
}
.pdftopost-filter-drawer-close:hover { color: #19172b; }
.pdftopost-filter-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 18px 24px;
}
.pdftopost-filter-group { padding: 12px 0; border-bottom: 1px solid #f0f0f4; }
.pdftopost-filter-group:last-of-type { border-bottom: 0; }
.pdftopost-filter-group-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9aa0b3;
}

/* Drawer dropdowns — full width, and the menu expands INLINE (accordion)
   instead of floating, so it works inside the scrolling drawer. */
.pdftopost-filter-drawer-body .pdftopost-cdrop { display: block; width: 100%; position: static; }
.pdftopost-filter-drawer-body .pdftopost-cdrop-btn {
    width: 100%;
    max-width: none;          /* override the inline-bar 200px cap */
    height: 44px;
    justify-content: space-between;
}
.pdftopost-filter-drawer-body .pdftopost-cdrop-menu {
    position: static;
    display: none;
    min-width: 0;
    max-width: none;
    max-height: 320px;
    margin: 6px 0 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-color: #ececf2;
}
.pdftopost-filter-drawer-body .pdftopost-cdrop.is-open .pdftopost-cdrop-menu { display: block; }
.pdftopost-filter-drawer-clear {
    display: block;
    margin-top: 16px;
    text-align: center;
    padding: 11px;
    border-radius: 8px;
    background: #f4f4f7;
    color: #312e56;
    font-weight: 600;
    text-decoration: none;
}
.pdftopost-filter-drawer-clear:hover { background: #e9e9f0; }
body.pdftopost-filter-lock { overflow: hidden; }
.pdftopost-search-clear {
    margin-left: 8px;
    padding-left: 14px;
    border-left: 1px solid #e0e3f5;   /* vertical divider before "Clear all" */
    font-size: 13px;
    font-weight: 600;
    color: #9aa0b3;                    /* light gray (clickable) */
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease;
}
.pdftopost-search-clear:hover { color: #312e56; }            /* hover */
.pdftopost-search-clear:active { color: #1f1d38; }           /* clicked */
/* Disabled — no filter applied, so nothing to clear. */
.pdftopost-search-clear.is-empty {
    color: #d4d6e0;
    pointer-events: none;
    cursor: default;
}

.pdftopost-search-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin: 0 0 16px;
}
.pdftopost-search-toolbar .pdftopost-related-heading { margin: 0 !important; min-width: 0; }
.pdftopost-search-toolbar .pdftopost-view-toggle { flex: 0 0 auto; margin-left: auto; }

/* A filter with an active (non-default) value reads as selected. */
.pdftopost-cdrop.is-selected .pdftopost-cdrop-btn {
    border-color: #312e56;
    color: #312e56;
    font-weight: 600;
}

/* ── Custom dropdown (Language / Type / Sort) ──────────────────────── */
.pdftopost-cdrop {
    position: relative;
    display: inline-block;
}
.pdftopost-cdrop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    max-width: 200px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #19172b;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pdftopost-cdrop-btn:hover {
    border-color: #312e56;
    background: rgba(49, 46, 86, 0.06);
    color: #312e56;
}
.pdftopost-cdrop-btn:hover .pdftopost-cdrop-caret { color: #312e56; }
.pdftopost-cdrop-btn:active { transform: translateY(0.5px); }
/* Clicked / open state — filled brand colour so it reads as "active". */
.pdftopost-cdrop.is-open .pdftopost-cdrop-btn {
    background: #312e56;
    border-color: #312e56;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(49, 46, 86, 0.18);
}
.pdftopost-cdrop.is-open .pdftopost-cdrop-caret { color: #fff; }
.pdftopost-cdrop-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pdftopost-cdrop-caret {
    flex: 0 0 auto;
    color: #6b7280;
    transition: transform 0.15s ease;
}
.pdftopost-cdrop.is-open .pdftopost-cdrop-caret { transform: rotate(180deg); }

.pdftopost-cdrop-menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    max-width: 260px;
    max-height: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(25, 23, 43, 0.14);
    /* Custom scrollbar (Firefox). */
    scrollbar-width: thin;
    scrollbar-color: #c4c6d6 transparent;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
}
.pdftopost-cdrop.is-open .pdftopost-cdrop-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Custom scrollbar (WebKit / Chrome / Safari). */
.pdftopost-cdrop-menu::-webkit-scrollbar {
    width: 8px;
}
.pdftopost-cdrop-menu::-webkit-scrollbar-track {
    background: transparent;
}
.pdftopost-cdrop-menu::-webkit-scrollbar-thumb {
    background: #c4c6d6;
    border-radius: 8px;
    border: 2px solid #fff;          /* inset so the thumb looks slimmer */
}
.pdftopost-cdrop-menu::-webkit-scrollbar-thumb:hover {
    background: #9aa0b3;
}
.pdftopost-cdrop-menu li { margin: 0; }
.pdftopost-cdrop-opt {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    color: #19172b;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.pdftopost-cdrop-opt:hover { background: #f4f4f7; }
.pdftopost-cdrop-opt.is-active {
    background: #312e56;
    color: #fff;
    font-weight: 600;
}
/* Right-most dropdown (Sort) opens flush to its right edge. */
.pdftopost-cdrop:last-child .pdftopost-cdrop-menu { left: auto; right: 0; }
.pdftopost-view-toggle {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: #f1f1f5;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    line-height: 0;
}
.pdftopost-view-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 6px;
    background: transparent;
    color: #9398a8;
    cursor: pointer;
    line-height: 0;
    box-shadow: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}
/* Force the inline SVG icons to render at a fixed small size with a
   visible stroke — themes/Elementor often reset svg width + stroke,
   which collapsed the icons to dots. */
.pdftopost-view-btn svg {
    width: 16px !important;
    height: 16px !important;
    display: block;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2;
}
.pdftopost-view-btn:hover {
    background: rgba(49, 46, 86, 0.08);
    color: #312e56;
}
/* Clicked / active feedback. */
.pdftopost-view-btn:active { transform: scale(0.9); }
/* Selected (current view). */
.pdftopost-view-btn[aria-pressed="true"] {
    background: #ffffff;
    color: #312e56;
    box-shadow: 0 1px 3px rgba(49, 46, 86, 0.18);
}

/* ── Document-type badge on the card image ──────────────────────────
   Rendered into every card but hidden by default; shown only in the
   Search Results GRID view, anchored to the bottom-right of the thumb. */
.pdftopost-card-type-badge {
    display: none;
}
.pdftopost-search-results--grid .pdftopost-card-type-badge {
    display: inline-block;
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    max-width: calc(100% - 12px);
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(25, 23, 43, 0.78);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(2px);
    pointer-events: none;
}
