/* ============================================================
   Devders Blogs — Style 1 "Blue Modern"
   Ported from post1.html. Class prefix dd-ps1- preserved.
   Color/Font/Size are driven by Appearance settings via CSS vars
   injected in Style_1::inline_css_vars().
   ============================================================ */

:root {
    /* These are overridden at runtime by inline vars; defaults kept for safety. */
    --dd-ps1-primary: #2563eb;
    --dd-ps1-primary-hover: #1d4ed8;
    --dd-ps1-primary-active: #1e40af;
    --dd-ps1-primary-light: #dbeafe;
    --dd-ps1-primary-lighter: #eff6ff;
    --dd-ps1-primary-lightest: #f5f9ff;
    --dd-ps1-bg: #f8fafc;
    --dd-ps1-surface: #ffffff;
    --dd-ps1-border: #e2e8f0;
    --dd-ps1-border-light: #f1f5f9;
    --dd-ps1-text: #0f172a;
    --dd-ps1-text-muted: #64748b;
    --dd-ps1-text-light: #94a3b8;

    --dd-ps1-radius-sm: 6px;
    --dd-ps1-radius-md: 10px;
    --dd-ps1-radius-lg: 16px;
    --dd-ps1-radius-xl: 20px;

    --dd-ps1-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --dd-ps1-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --dd-ps1-shadow-md: 0 10px 28px rgba(15, 23, 42, 0.09);
    --dd-ps1-shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.14);

    --dd-ps1-transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);

    --dd-ps1-skeleton-base: #e2e8f0;
    --dd-ps1-skeleton-highlight: #f1f5f9;

    --dd-ps1-level-1: #1e40af;
    --dd-ps1-level-2: #2563eb;
    --dd-ps1-level-3: #3b82f6;
    --dd-ps1-level-1-bg: #eff6ff;
    --dd-ps1-level-2-bg: #f0f7ff;
    --dd-ps1-level-3-bg: #f5f9ff;

    /* Appearance-driven (overridden by inline vars). */
    --dd-ps1-card-title-size: 16px;
    --dd-ps1-card-excerpt-size: 14px;
    --dd-ps1-badge-size: 12px;
    --dd-ps1-font: inherit;
}

/* ============================================================
   THEME ISOLATION RESET
   Scoped to .dd-ps1-app so it never leaks into the theme.
   Many themes apply aggressive global styles to bare HTML elements
   (h1-h6 margins, ul/li padding, button backgrounds, a underlines,
   img borders) that can distort this component. These resets normalize
   those to browser defaults inside the component, then the component's
   own .dd-ps1-* rules layer on top.
   ============================================================ */
.dd-ps1-app,
.dd-ps1-app *,
.dd-ps1-app *::before,
.dd-ps1-app *::after,
.dd-ps1-offcanvas-host,
.dd-ps1-offcanvas-host *,
.dd-ps1-offcanvas-host *::before,
.dd-ps1-offcanvas-host *::after {
    box-sizing: border-box;
}

/* Off-canvas host: while the mobile drawer is open, JS moves the drawer and
   overlay into this body-level host. As a direct child of <body> it cannot be
   trapped under a theme wrapper's stacking context, so sticky theme headers
   can never paint above the drawer. */
.dd-ps1-offcanvas-host {
    position: relative;
    z-index: 999999;
}

.dd-ps1-app,
.dd-ps1-offcanvas-host {
    margin: 0;
    padding: 0;
    font-family: 'Inter', var(--dd-ps1-font), system-ui, -apple-system, sans-serif;
    color: var(--dd-ps1-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.5;
    /* Prevent theme text-size-adjust from distorting layout on mobile. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    word-wrap: break-word;
}

/* Normalize lists — themes often add bullets + left padding.
   Use :where() (zero specificity) so component classes override by source order. */
.dd-ps1-app :where(ul, ol),
.dd-ps1-offcanvas-host :where(ul, ol) {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dd-ps1-app :where(li),
.dd-ps1-offcanvas-host :where(li) {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Normalize headings + paragraphs — themes add large margins.
   Use :where() (zero specificity) so component classes override by source order. */
.dd-ps1-app :where(h1, h2, h3, h4, h5, h6, p),
.dd-ps1-offcanvas-host :where(h1, h2, h3, h4, h5, h6, p) {
    margin: 0;
    padding: 0;
}

/* Normalize links — themes add underline/underline offsets. */
.dd-ps1-app a,
.dd-ps1-offcanvas-host a {
    text-decoration: none;
}

/* Normalize images — themes add borders/shadows/max-width rules. */
.dd-ps1-app img,
.dd-ps1-offcanvas-host img {
    max-width: 100%;
    height: auto;
    display: block;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Normalize SVGs — ensure they behave as inline icons. */
.dd-ps1-app svg,
.dd-ps1-offcanvas-host svg {
    display: block;
    flex-shrink: 0;
}

/* Normalize buttons — themes style <button> globally.
   CRITICAL: Only reset font-family/cursor/appearance here.
   Do NOT reset margin/color/font-size/background/border/padding because
   .dd-ps1-app button (specificity 0,1,1) overrides component classes (0,1,0).
   Component classes set ALL their own visual + spacing properties explicitly. */
.dd-ps1-app button,
.dd-ps1-offcanvas-host button {
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* Normalize form inputs — themes set global input styles.
   Same specificity caveat as buttons: only reset font-family.
   Component input classes (.dd-ps1-search-input) set their own color/font-size/margin. */
.dd-ps1-app input,
.dd-ps1-app select,
.dd-ps1-app textarea,
.dd-ps1-offcanvas-host input,
.dd-ps1-offcanvas-host select,
.dd-ps1-offcanvas-host textarea {
    font-family: inherit;
}
.dd-ps1-app input[type="search"],
.dd-ps1-offcanvas-host input[type="search"] {
    appearance: none;
    -webkit-appearance: none;
}
.dd-ps1-app input[type="search"]::-webkit-search-cancel-button,
.dd-ps1-app input[type="search"]::-webkit-search-decoration,
.dd-ps1-offcanvas-host input[type="search"]::-webkit-search-cancel-button,
.dd-ps1-offcanvas-host input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

/* Normalize <label>, <span>, <nav>, <fieldset> — themes may add global styles.
   Use :where() for zero specificity. */
.dd-ps1-app :where(label, span, nav, fieldset),
.dd-ps1-offcanvas-host :where(label, span, nav, fieldset) {
    margin: 0;
    padding: 0;
}
.dd-ps1-app fieldset,
.dd-ps1-offcanvas-host fieldset {
    border: none;
}

/* === App Layout === */
.dd-ps1-app {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 28px;
    margin: 0 auto;
    min-height: 400px; /* Reasonable minimum; 100vh in reference was for a full-page demo, not an embedded component. */
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.dd-ps1-sidebar {
    position: sticky;
    top: 32px;
    align-self: start;
    background: var(--dd-ps1-surface);
    border: 1px solid var(--dd-ps1-border);
    border-radius: var(--dd-ps1-radius-lg);
    padding: 24px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: var(--dd-ps1-shadow-xs);
}

.dd-ps1-sidebar::-webkit-scrollbar { width: 6px; }
.dd-ps1-sidebar::-webkit-scrollbar-track { background: transparent; }
.dd-ps1-sidebar::-webkit-scrollbar-thumb { background: var(--dd-ps1-border); border-radius: 3px; }
.dd-ps1-sidebar::-webkit-scrollbar-thumb:hover { background: var(--dd-ps1-text-light); }

.dd-ps1-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dd-ps1-border-light);
}

.dd-ps1-sidebar-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    color: var(--dd-ps1-text);
    letter-spacing: -0.02em;
}

.dd-ps1-sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--dd-ps1-bg);
    border-radius: 9px;
    cursor: pointer;
    color: var(--dd-ps1-text-muted);
    align-items: center;
    justify-content: center;
    transition: var(--dd-ps1-transition);
}
.dd-ps1-sidebar-close:hover {
    background: var(--dd-ps1-border-light);
    color: var(--dd-ps1-text);
}

/* ===== Search ===== */
.dd-ps1-search { position: relative; margin-bottom: 20px; }
.dd-ps1-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dd-ps1-text-light);
    pointer-events: none;
    display: flex;
}
.dd-ps1-search-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--dd-ps1-border);
    border-radius: var(--dd-ps1-radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--dd-ps1-text);
    background: var(--dd-ps1-bg);
    transition: var(--dd-ps1-transition);
    outline: none;
}
.dd-ps1-search-input:focus {
    border-color: var(--dd-ps1-primary);
    background: var(--dd-ps1-surface);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.dd-ps1-search-input::placeholder { color: var(--dd-ps1-text-light); }

/* ===== Quick Filters ===== */
.dd-ps1-quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--dd-ps1-border-light);
}
.dd-ps1-quick-pill {
    padding: 6px 12px;
    background: var(--dd-ps1-bg);
    border: 1px solid var(--dd-ps1-border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--dd-ps1-text-muted);
    cursor: pointer;
    transition: var(--dd-ps1-transition);
}
.dd-ps1-quick-pill:hover {
    border-color: var(--dd-ps1-primary);
    color: var(--dd-ps1-primary);
    background: var(--dd-ps1-primary-lightest);
}
.dd-ps1-quick-pill.dd-ps1-active {
    background: var(--dd-ps1-primary);
    border-color: var(--dd-ps1-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* ===== Filter Section ===== */
.dd-ps1-filter-section { margin-bottom: 16px; }
.dd-ps1-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.dd-ps1-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--dd-ps1-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dd-ps1-filter-label-icon { width: 14px; height: 14px; color: var(--dd-ps1-primary); }
.dd-ps1-filter-clear {
    background: none;
    border: none;
    color: var(--dd-ps1-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--dd-ps1-transition);
    font-family: inherit;
}
.dd-ps1-filter-clear:hover { background: var(--dd-ps1-primary-lighter); }

/* ===== Category Tree ===== */
.dd-ps1-category-tree { list-style: none; padding: 0; margin: 0; }
.dd-ps1-category-tree .dd-ps1-category-tree {
    padding-left: 14px;
    margin-left: 8px;
    overflow: hidden;
    max-height: 2000px;
    opacity: 1;
    transition: max-height 320ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
    position: relative;
}
.dd-ps1-category-tree .dd-ps1-category-tree.dd-ps1-collapsed { max-height: 0; opacity: 0; }
.dd-ps1-category-tree .dd-ps1-category-tree::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 12px;
    width: 1.5px;
    background: var(--dd-ps1-border);
    border-radius: 1px;
}
.dd-ps1-category-item { position: relative; margin-bottom: 2px; }
.dd-ps1-category-tree .dd-ps1-category-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 16px;
    width: 8px;
    height: 1.5px;
    background: var(--dd-ps1-border);
    border-radius: 1px;
}
.dd-ps1-category-tree > .dd-ps1-category-item::before { display: none; }

.dd-ps1-category-row {
    display: flex;
    align-items: flex-start;
    padding: 4px 6px;
    border-radius: 8px;
    transition: background var(--dd-ps1-transition);
    position: relative;
}
.dd-ps1-category-row:hover { background: var(--dd-ps1-bg); }

.dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row { padding: 6px 8px; border-radius: 10px; }
.dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row:hover { background: var(--dd-ps1-level-1-bg); }
.dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row { padding: 5px 8px; }
.dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row:hover { background: var(--dd-ps1-level-2-bg); }
.dd-ps1-category-tree .dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row { padding: 4px 8px; }
.dd-ps1-category-tree .dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row:hover { background: var(--dd-ps1-level-3-bg); }

.dd-ps1-category-toggle {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dd-ps1-text-muted);
    border-radius: 5px;
    transition: var(--dd-ps1-transition);
    flex-shrink: 0;
    padding: 0;
    margin-top: 2px;
}
.dd-ps1-category-toggle:hover { background: var(--dd-ps1-border-light); color: var(--dd-ps1-text); }
.dd-ps1-category-toggle-icon { transition: transform var(--dd-ps1-transition); }
.dd-ps1-category-toggle.dd-ps1-collapsed .dd-ps1-category-toggle-icon { transform: rotate(-90deg); }
.dd-ps1-category-toggle-spacer { width: 22px; flex-shrink: 0; }

/* ===== Custom Checkbox ===== */
.dd-ps1-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    padding: 5px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--dd-ps1-text);
    user-select: none;
    min-width: 0;
}
.dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row > .dd-ps1-checkbox { font-size: 14.5px; font-weight: 700; color: var(--dd-ps1-level-1); }
.dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row > .dd-ps1-checkbox { font-weight: 600; color: var(--dd-ps1-level-2); }
.dd-ps1-category-tree .dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row > .dd-ps1-checkbox { font-weight: 500; color: var(--dd-ps1-text); }

.dd-ps1-checkbox-input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.dd-ps1-checkbox-box {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--dd-ps1-border);
    border-radius: 5px;
    background: var(--dd-ps1-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--dd-ps1-transition);
    flex-shrink: 0;
    position: relative;
    margin-top: 2px;
}
.dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row .dd-ps1-checkbox:hover .dd-ps1-checkbox-box { border-color: var(--dd-ps1-level-1); }
.dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row .dd-ps1-checkbox:hover .dd-ps1-checkbox-box { border-color: var(--dd-ps1-level-2); }
.dd-ps1-category-tree .dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row .dd-ps1-checkbox:hover .dd-ps1-checkbox-box { border-color: var(--dd-ps1-level-3); }

.dd-ps1-checkbox-input:checked + .dd-ps1-checkbox-box { background: var(--dd-ps1-primary); border-color: var(--dd-ps1-primary); }
.dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row .dd-ps1-checkbox-input:checked + .dd-ps1-checkbox-box { background: var(--dd-ps1-level-1); border-color: var(--dd-ps1-level-1); }
.dd-ps1-category-tree .dd-ps1-category-tree > .dd-ps1-category-item > .dd-ps1-category-row .dd-ps1-checkbox-input:checked + .dd-ps1-checkbox-box { background: var(--dd-ps1-level-2); border-color: var(--dd-ps1-level-2); }
.dd-ps1-checkbox-input:checked + .dd-ps1-checkbox-box::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}
.dd-ps1-checkbox-input:indeterminate + .dd-ps1-checkbox-box { background: var(--dd-ps1-primary); border-color: var(--dd-ps1-primary); }
.dd-ps1-checkbox-input:indeterminate + .dd-ps1-checkbox-box::after {
    content: '';
    width: 10px;
    height: 2px;
    background: white;
    border-radius: 1px;
}

.dd-ps1-checkbox-label { flex: 1; word-break: break-word; overflow-wrap: anywhere; line-height: 1.4; white-space: normal; }
.dd-ps1-checkbox-count {
    font-size: 11px;
    color: var(--dd-ps1-text-light);
    background: var(--dd-ps1-bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1.5;
    margin-top: 1px;
}
.dd-ps1-checkbox-input:checked ~ .dd-ps1-checkbox-count { background: var(--dd-ps1-primary-lighter); color: var(--dd-ps1-primary); }

/* ===== Sidebar footer (mobile apply) ===== */
.dd-ps1-sidebar-footer { display: none; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--dd-ps1-border-light); }
.dd-ps1-sidebar-apply {
    width: 100%;
    padding: 12px;
    background: var(--dd-ps1-primary);
    color: white;
    border: none;
    border-radius: var(--dd-ps1-radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--dd-ps1-transition);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.dd-ps1-sidebar-apply:hover { background: var(--dd-ps1-primary-hover); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.dd-ps1-main { min-width: 0; }

.dd-ps1-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.dd-ps1-toolbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
/* Standalone search (rendered into the toolbar when show_filters="false"). */
.dd-ps1-search-toolbar { margin-bottom: 0; width: 240px; max-width: 100%; }
@media (max-width: 640px) {
    .dd-ps1-search-toolbar { width: 100%; }
}
.dd-ps1-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--dd-ps1-surface);
    border: 1.5px solid var(--dd-ps1-border);
    border-radius: var(--dd-ps1-radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--dd-ps1-text);
    cursor: pointer;
    transition: var(--dd-ps1-transition);
}
.dd-ps1-filter-toggle:hover {
    border-color: var(--dd-ps1-primary);
    color: var(--dd-ps1-primary);
    background: var(--dd-ps1-primary-lightest);
}

.dd-ps1-results-info { font-size: 14px; color: var(--dd-ps1-text-muted); }
.dd-ps1-results-info strong { color: var(--dd-ps1-text); font-weight: 700; }

.dd-ps1-toolbar-right { display: flex; align-items: center; gap: 12px; }

.dd-ps1-view-toggle {
    display: inline-flex;
    background: var(--dd-ps1-surface);
    border: 1.5px solid var(--dd-ps1-border);
    border-radius: var(--dd-ps1-radius-md);
    padding: 4px;
    gap: 2px;
}
.dd-ps1-view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--dd-ps1-text-muted);
    cursor: pointer;
    transition: var(--dd-ps1-transition);
}
.dd-ps1-view-toggle-btn:hover { color: var(--dd-ps1-text); }
.dd-ps1-view-toggle-btn.dd-ps1-active {
    background: var(--dd-ps1-primary);
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Active filter chips */
.dd-ps1-active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.dd-ps1-active-filters:empty { display: none; }
.dd-ps1-active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 12px;
    background: var(--dd-ps1-primary-lighter);
    color: var(--dd-ps1-primary);
    border: 1px solid var(--dd-ps1-primary-light);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    animation: ddPs1ChipIn 200ms ease;
}
@keyframes ddPs1ChipIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.dd-ps1-active-filter-remove {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--dd-ps1-primary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--dd-ps1-transition);
}
.dd-ps1-active-filter-remove:hover { background: var(--dd-ps1-primary-light); }

/* ============================================================
   POSTS GRID
   ============================================================ */
.dd-ps1-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.dd-ps1-posts.dd-ps1-view-list { grid-template-columns: 1fr; gap: 14px; }

.dd-ps1-card {
    background: var(--dd-ps1-surface);
    border: 1px solid var(--dd-ps1-border);
    border-radius: var(--dd-ps1-radius-lg);
    overflow: hidden;
    transition: transform var(--dd-ps1-transition), box-shadow var(--dd-ps1-transition), border-color var(--dd-ps1-transition);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    animation: ddPs1FadeIn 450ms ease backwards;
}
@keyframes ddPs1FadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.dd-ps1-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--dd-ps1-primary);
    transition: transform var(--dd-ps1-transition);
    z-index: 2;
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transform-origin: top;
}
.dd-ps1-card:hover { transform: translateY(-4px); box-shadow: var(--dd-ps1-shadow-md); border-color: var(--dd-ps1-primary-light); }
.dd-ps1-card:hover::before { transform: scaleY(1); }

.dd-ps1-card-image { position: relative; width: 100%; aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, #eef2f7, #e2e8f0); }
.dd-ps1-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1); display: block; }
.dd-ps1-card:hover .dd-ps1-card-image img { transform: scale(1.06); }
.dd-ps1-card-image-placeholder { width: 100%; height: 100%; }
/* Image + title link to the article (same destination as "Read more"),
   styled to look identical to the non-linked versions. */
.dd-ps1-card-image-link { display: block; width: 100%; height: 100%; }
/* display:block makes the whole title block (not just the glyphs) clickable;
   verified not to affect the 2-line -webkit-line-clamp. */
.dd-ps1-card-title a { display: block; color: inherit; text-decoration: none; }
.dd-ps1-card-image-link:focus-visible,
.dd-ps1-card-title a:focus-visible { outline: 2px solid var(--dd-ps1-primary); outline-offset: 2px; }

.dd-ps1-card-content { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.dd-ps1-card-categories { display: flex; flex-wrap: wrap; gap: 6px; }

.dd-ps1-badge {
    display: inline-block;
    vertical-align: middle;
    padding: 3px 10px;
    background: var(--dd-ps1-primary-lighter);
    color: var(--dd-ps1-primary);
    border-radius: 999px;
    font-size: var(--dd-ps1-badge-size, 11.5px);
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    letter-spacing: 0.01em;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background var(--dd-ps1-transition), color var(--dd-ps1-transition), transform var(--dd-ps1-transition), box-shadow var(--dd-ps1-transition);
}
.dd-ps1-badge:hover { background: var(--dd-ps1-primary-light); color: var(--dd-ps1-primary-hover); transform: scale(1.06); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22); }
.dd-ps1-badge:active { transform: scale(0.97); }
.dd-ps1-badge:focus-visible { outline: 2px solid var(--dd-ps1-primary); outline-offset: 2px; }

.dd-ps1-card-title {
    font-size: var(--dd-ps1-card-title-size, 16px);
    font-weight: 700;
    line-height: 1.45;
    margin: 0;
    color: var(--dd-ps1-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.015em;
    transition: color var(--dd-ps1-transition);
}
.dd-ps1-card:hover .dd-ps1-card-title { color: var(--dd-ps1-primary); }

.dd-ps1-card-excerpt {
    font-size: var(--dd-ps1-card-excerpt-size, 13.5px);
    line-height: 1.6;
    color: var(--dd-ps1-text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dd-ps1-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--dd-ps1-border-light);
}
.dd-ps1-card-meta { font-size: 12px; color: var(--dd-ps1-text-light); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.dd-ps1-card-link { font-size: 13px; font-weight: 600; color: var(--dd-ps1-primary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: gap var(--dd-ps1-transition); }
.dd-ps1-card:hover .dd-ps1-card-link { gap: 8px; }

/* List view */
.dd-ps1-view-list .dd-ps1-card { flex-direction: row; max-height: 220px; }
.dd-ps1-view-list .dd-ps1-card-image { width: 280px; flex-shrink: 0; aspect-ratio: 16/10; max-height: 220px; }
.dd-ps1-view-list .dd-ps1-card-content { padding: 20px 24px; gap: 10px; }
.dd-ps1-view-list .dd-ps1-card-title { font-size: 18px; }
.dd-ps1-view-list .dd-ps1-card-excerpt { -webkit-line-clamp: 2; }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.dd-ps1-skeleton-card {
    background: var(--dd-ps1-surface);
    border: 1px solid var(--dd-ps1-border);
    border-radius: var(--dd-ps1-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: ddPs1FadeIn 450ms ease backwards;
}
@keyframes ddPs1Shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.dd-ps1-skeleton-image,
.dd-ps1-skeleton-badge,
.dd-ps1-skeleton-title,
.dd-ps1-skeleton-text,
.dd-ps1-skeleton-meta,
.dd-ps1-skeleton-link {
    background: linear-gradient(90deg, var(--dd-ps1-skeleton-base) 25%, var(--dd-ps1-skeleton-highlight) 50%, var(--dd-ps1-skeleton-base) 75%);
    background-size: 200% 100%;
    animation: ddPs1Shimmer 1.5s infinite;
    border-radius: 4px;
}
.dd-ps1-skeleton-image { width: 100%; aspect-ratio: 16/10; border-radius: 0; }
.dd-ps1-skeleton-content { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.dd-ps1-skeleton-badges { display: flex; gap: 6px; }
.dd-ps1-skeleton-badge { width: 70px; height: 18px; border-radius: 999px; }
.dd-ps1-skeleton-title { height: 16px; width: 100%; margin-top: 4px; }
.dd-ps1-skeleton-title:last-of-type { width: 75%; }
.dd-ps1-skeleton-text { height: 10px; width: 100%; margin-top: 4px; }
.dd-ps1-skeleton-text:nth-of-type(3) { width: 90%; }
.dd-ps1-skeleton-text:nth-of-type(4) { width: 95%; }
.dd-ps1-skeleton-text:nth-of-type(5) { width: 70%; }
.dd-ps1-skeleton-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--dd-ps1-border-light); display: flex; justify-content: space-between; align-items: center; }
.dd-ps1-skeleton-meta { width: 60px; height: 12px; }
.dd-ps1-skeleton-link { width: 60px; height: 12px; }

.dd-ps1-view-list .dd-ps1-skeleton-card { flex-direction: row; max-height: 220px; }
.dd-ps1-view-list .dd-ps1-skeleton-image { width: 280px; flex-shrink: 0; aspect-ratio: 16/10; max-height: 220px; }
.dd-ps1-view-list .dd-ps1-skeleton-content { padding: 20px 24px; }

/* Empty State */
.dd-ps1-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 20px;
    background: var(--dd-ps1-surface);
    border: 1.5px dashed var(--dd-ps1-border);
    border-radius: var(--dd-ps1-radius-lg);
}
.dd-ps1-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--dd-ps1-primary-lighter);
    color: var(--dd-ps1-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.dd-ps1-empty-title { font-size: 17px; font-weight: 700; margin: 0 0 6px; color: var(--dd-ps1-text); }
.dd-ps1-empty-text { font-size: 14px; color: var(--dd-ps1-text-muted); margin: 0; }

/* ============================================================
   PAGINATION
   ============================================================ */
.dd-ps1-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.dd-ps1-pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1.5px solid var(--dd-ps1-border);
    background: var(--dd-ps1-surface);
    border-radius: var(--dd-ps1-radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--dd-ps1-text);
    cursor: pointer;
    transition: var(--dd-ps1-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.dd-ps1-pagination-btn:hover:not(:disabled):not(.dd-ps1-active) {
    border-color: var(--dd-ps1-primary);
    color: var(--dd-ps1-primary);
    background: var(--dd-ps1-primary-lightest);
}
.dd-ps1-pagination-btn.dd-ps1-active {
    background: var(--dd-ps1-primary);
    border-color: var(--dd-ps1-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.dd-ps1-pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dd-ps1-pagination-ellipsis { padding: 0 6px; color: var(--dd-ps1-text-light); font-weight: 600; }

/* Overlay */
.dd-ps1-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    /* Must sit above sticky theme headers (commonly z-index 999–99999),
       but below the mobile filter drawer. */
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dd-ps1-transition);
}
.dd-ps1-overlay.dd-ps1-visible { opacity: 1; pointer-events: auto; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .dd-ps1-posts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .dd-ps1-app { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
    .dd-ps1-sidebar {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%;
        max-width: none;
        /* dvh (where supported) keeps the drawer inside the visible viewport
           on iOS/Android instead of extending behind the browser UI. */
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        border-right: none;
        /* Above the overlay (100000) and above sticky theme headers so the
           full-screen drawer is never covered by the site header on mobile. */
        z-index: 100001;
        transform: translateY(-100%);
        transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
        padding: 20px;
        padding-top: 16px;
        display: flex;
        flex-direction: column;
    }
    .dd-ps1-sidebar.dd-ps1-open { transform: translateY(0); }
    .dd-ps1-sidebar-close { display: inline-flex; }
    .dd-ps1-filter-toggle { display: inline-flex; }
    .dd-ps1-sidebar > .dd-ps1-search,
    .dd-ps1-sidebar > .dd-ps1-filter-section { flex-shrink: 0; }
    .dd-ps1-sidebar { -ms-overflow-style: none; scrollbar-width: none; }
    .dd-ps1-sidebar::-webkit-scrollbar { display: none; }
    .dd-ps1-sidebar-footer {
        display: block;
        position: sticky;
        bottom: 0; left: 0; right: 0;
        padding: 16px 0 4px;
        margin-top: 16px;
        background: linear-gradient(to top, var(--dd-ps1-surface) 80%, transparent 100%);
    }
    .dd-ps1-posts { grid-template-columns: 1fr; gap: 16px; }
    .dd-ps1-toolbar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 10px;
        row-gap: 6px;
        margin-bottom: 12px;
    }
    .dd-ps1-toolbar-left { display: contents; }
    .dd-ps1-filter-toggle { grid-column: 1; grid-row: 1; }
    .dd-ps1-results-info { grid-column: 1 / -1; grid-row: 2; font-size: 12.5px; }
    .dd-ps1-toolbar-right { grid-column: 3; grid-row: 1; }
}

@media (max-width: 480px) {
    .dd-ps1-view-list .dd-ps1-card,
    .dd-ps1-view-list .dd-ps1-skeleton-card { flex-direction: column; max-height: none; }
    .dd-ps1-view-list .dd-ps1-card-image,
    .dd-ps1-view-list .dd-ps1-skeleton-image { width: 100%; max-height: 200px; }
    .dd-ps1-view-toggle-btn span { display: none; }
}

/* Respect reduced-motion preference. Scoped to the component so page-wide
   transitions from the theme or other plugins are never affected. */
@media (prefers-reduced-motion: reduce) {
    .dd-ps1-card,
    .dd-ps1-skeleton-card,
    .dd-ps1-active-filter-chip { animation: none !important; }
    .dd-ps1-card:hover { transform: none; }
    .dd-ps1-card:hover .dd-ps1-card-image img { transform: none; }
    .dd-ps1-card:hover .dd-ps1-card-link { gap: 4px; }
    .dd-ps1-app,
    .dd-ps1-app *,
    .dd-ps1-offcanvas-host,
    .dd-ps1-offcanvas-host * { transition-duration: 0.01ms !important; }
}
