/* CreceWP Digital Library — theme-neutral library and gallery components. */
.cwdl {
    --cwdl-accent: #3157f6;
    --cwdl-text: #1d2939;
    --cwdl-muted: #667085;
    --cwdl-surface: #ffffff;
    --cwdl-border: #e0e6f0;
    --cwdl-radius: 12px;
    --cwdl-gap: 22px;
    box-sizing: border-box;
    width: 100%;
    color: var(--cwdl-text);
}
.cwdl *, .cwdl *::before, .cwdl *::after { box-sizing: border-box; }
.cwdl [hidden] { display: none !important; }
.cwdl a { text-decoration: none; }
.cwdl :is(a,button,input,select):focus-visible { outline: 2px solid var(--cwdl-accent); outline-offset: 2px; }
.cwdl-grid { display: grid; grid-template-columns: repeat(var(--cwdl-cols, 3), minmax(0,1fr)); gap: var(--cwdl-gap); }
.cwdl-card { min-width:0; overflow:hidden; display:flex; flex-direction:column; background:var(--cwdl-surface); border:1px solid var(--cwdl-border); border-radius:var(--cwdl-radius); box-shadow:0 8px 22px rgba(16,24,40,.035); }
.cwdl-cover { position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; aspect-ratio:16/10; background:linear-gradient(145deg,#eef2ff,#f8faff); color:#849be6; }
.cwdl-cover img.cwdl-cover-img { width:100%; height:100%; object-fit:cover; transition:transform .2s ease; }
.cwdl-cover > .dashicons { font-size:54px; width:54px; height:54px; }
@media (hover:hover) { .cwdl-cover:hover img { transform:scale(1.035); } }
.cwdl-card-body { display:flex; flex-direction:column; flex:1; gap:10px; padding:18px 20px 21px; }
.cwdl-card-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:12px; color:var(--cwdl-muted); }
.cwdl-kind { display:inline-flex; padding:4px 9px; border:1px solid #cfe3ff; border-radius:6px; background:#edf4ff; color:#175cd3; font-weight:700; line-height:1.3; font-size:12px; }
.cwdl-card h3 { margin:0; font-weight:700; font-size:19px; line-height:1.3; overflow-wrap:anywhere; }
.cwdl-card h3 a { color:var(--cwdl-text); }
.cwdl-card h3 a:hover { color:var(--cwdl-accent); }
.cwdl-description { margin:0; color:var(--cwdl-muted); font-size:14px; line-height:1.65; }
.cwdl-text-link { display:inline-flex; align-items:center; gap:6px; margin-top:auto; padding-top:5px; color:var(--cwdl-accent); font-weight:700; font-size:14px; }
.cwdl-text-link:hover { text-decoration:underline; }
.cwdl-filter { display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px; margin-bottom:24px; padding:16px; background:#f8faff; border:1px solid var(--cwdl-border); border-radius:var(--cwdl-radius); }
.cwdl-filter-item { display:flex; flex-direction:column; gap:5px; flex:1 1 175px; min-width:140px; margin:0; }
.cwdl-filter-item > span { font-weight:700; font-size:12px; color:var(--cwdl-muted); }
.cwdl-filter-item :is(input,select) { display:block; width:100%; min-width:0; min-height:43px; margin:0; padding:8px 12px; border:1px solid #d0d5dd; border-radius:7px; background:#fff; color:var(--cwdl-text); font:inherit; font-size:14px; }
.cwdl-filter-reset { min-height:43px; border:1px solid var(--cwdl-border); border-radius:7px; padding:9px 15px; background:#fff; color:var(--cwdl-accent); cursor:pointer; font:inherit; font-size:13px; font-weight:700; }
.cwdl-count { margin:17px 0 0; color:var(--cwdl-muted); font-size:13px; }
.cwdl-empty { grid-column:1/-1; padding:32px; border:1px dashed var(--cwdl-border); border-radius:var(--cwdl-radius); text-align:center; color:var(--cwdl-muted); }
.cwdl-detail { max-width:1100px; margin:0 auto; }
.cwdl-detail-heading { margin-bottom:24px; }
.cwdl-detail-heading h2 { font-size:clamp(25px,3.5vw,36px); line-height:1.25; color:var(--cwdl-text); margin:10px 0 0; }
.cwdl-detail-cover { overflow:hidden; margin-bottom:23px; border-radius:var(--cwdl-radius); }
.cwdl-detail-cover img { display:block; width:100%; height:auto; max-height:550px; object-fit:cover; }
.cwdl-detail-description { font-size:16px; line-height:1.8; color:var(--cwdl-text); margin-bottom:24px; }
.cwdl-detail-description p { margin:0 0 13px; }
.cwdl-video-embed { position:relative; width:100%; aspect-ratio:16/9; overflow:hidden; margin-bottom:25px; border-radius:var(--cwdl-radius); background:#0b1220; }
.cwdl-video-embed iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.cwdl-detail-media { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--cwdl-gap); }
.cwdl-detail-media-item { overflow:hidden; border-radius:var(--cwdl-radius); background:#f3f5f9; }
.cwdl-detail-media-item img { display:block; width:100%; height:auto; object-fit:cover; }
.cwdl-detail-media-item video { display:block; width:100%; height:auto; }
.cwdl-detail-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:20px; }
.cwdl-button { display:inline-flex; align-items:center; gap:8px; padding:12px 20px; border:1px solid var(--cwdl-accent); border-radius:8px; background:var(--cwdl-accent); color:#fff; font-weight:700; }
.cwdl-button-outline { background:transparent; color:var(--cwdl-accent); }
.cwdl-button:hover { opacity:.9; }
@media (max-width: 900px) { .cwdl-grid { grid-template-columns:repeat(min(2,var(--cwdl-cols,3)),minmax(0,1fr)); } }
@media (max-width: 600px) { .cwdl-grid, .cwdl-detail-media { grid-template-columns:minmax(0,1fr); } .cwdl-filter-item { flex-basis:100%; } .cwdl-filter-reset { width:100%; } .cwdl-card-body { padding:16px; } }

.cwdl-resource-video { display:block; width:100%; max-height:600px; margin-bottom:20px; background:#111827; border-radius:var(--cwdl-radius); }
.cwdl-pdf-preview { margin:20px 0; border:1px solid var(--cwdl-border); border-radius:var(--cwdl-radius); overflow:hidden; }
.cwdl-pdf-preview > summary { cursor:pointer; padding:13px 16px; color:var(--cwdl-accent); font-weight:700; }
.cwdl-pdf-preview > div { aspect-ratio:4/3; min-height:320px; }
.cwdl-pdf-preview iframe { display:block; width:100%; height:100%; border:0; }

/* Optional bibliographic information shown in a resource detail. */
.cwdl-resource-metadata { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 18px 0 24px; }
.cwdl-resource-metadata > div { min-width: 130px; max-width: 100%; }
.cwdl-resource-metadata dt { margin: 0 0 3px; color: #667085; font-size: .85em; }
.cwdl-resource-metadata dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }

.cwdl-cover img.cwdl-pdf-cover { object-fit: contain; padding: 9px; }
.cwdl-detail-cover.cwdl-pdf-cover-detail img { object-fit: contain; background: #f7f9fc; }

/* v1.2.0 — multimedia gallery layouts (also available for catalog cards). */
.cwdl-gallery-view { width: 100%; min-width: 0; }
.cwdl-gallery-media {
    display: grid;
    grid-template-columns: repeat(var(--cwdl-cols, 3), minmax(0, 1fr));
    gap: var(--cwdl-gap);
}
.cwdl-media-tile {
    display: flex;
    flex-direction: column;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--cwdl-border);
    border-radius: var(--cwdl-radius);
    background: var(--cwdl-surface);
}
.cwdl-media-launch {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e8edf6;
    cursor: zoom-in;
}
.cwdl-media-launch > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}
@media (hover: hover) {
    .cwdl-media-launch:hover > img { transform: scale(1.045); }
}
.cwdl-play-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
    background: rgba(0, 0, 0, .65);
    color: white;
    font-size: 22px;
}
.cwdl-media-placeholder { font-size: 54px; color: #637ca8; }
.cwdl-media-caption {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px 15px;
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    color: var(--cwdl-muted);
}
.cwdl-media-caption strong { font-size: 15px; color: var(--cwdl-text); }
.cwdl-media-caption small { font-size: 12px; }

/* Native CSS columns are a resilient, dependency-free Masonry layout. */
.cwdl-layout-masonry > .cwdl-grid,
.cwdl-layout-masonry > .cwdl-gallery-media {
    display: block;
    columns: var(--cwdl-cols, 3);
    column-gap: var(--cwdl-gap);
}
.cwdl-layout-masonry > .cwdl-grid > :not([hidden]),
.cwdl-layout-masonry > .cwdl-gallery-media > :not([hidden]) {
    display: inline-flex;
    width: 100%;
    margin: 0 0 var(--cwdl-gap);
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    vertical-align: top;
}
.cwdl-layout-masonry .cwdl-media-launch,
.cwdl-layout-masonry .cwdl-cover { aspect-ratio: auto; }
.cwdl-layout-masonry .cwdl-media-launch > img,
.cwdl-layout-masonry .cwdl-cover > img.cwdl-cover-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Carousels retain native touch scrolling and scroll snapping if JavaScript is off. */
.cwdl-layout-carrusel > .cwdl-grid,
.cwdl-layout-carrusel > .cwdl-gallery-media {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--cwdl-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 12px;
}
.cwdl-layout-carrusel > .cwdl-grid > :not(.cwdl-empty),
.cwdl-layout-carrusel > .cwdl-gallery-media > :not(.cwdl-empty) {
    flex: 0 0 calc((100% - (var(--cwdl-cols, 3) - 1) * var(--cwdl-gap)) / var(--cwdl-cols, 3));
    min-width: 0;
    scroll-snap-align: start;
}
.cwdl-carousel-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 0 0 13px;
}
.cwdl-carousel-arrow {
    border: 1px solid var(--cwdl-border);
    border-radius: 8px;
    background: var(--cwdl-surface);
    color: var(--cwdl-text);
    padding: 10px 14px;
    min-height: 42px;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}
.cwdl-carousel-arrow:disabled { opacity: .4; cursor: not-allowed; }
.cwdl-carousel-progress { font-size: 13px; color: var(--cwdl-muted); min-width: 48px; text-align: center; }

/* The modal is appended outside theme and Elementor clipping containers. */
.cwdl-lightbox {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2vw, 24px);
    background: rgba(10, 16, 27, .95);
    color: #fff;
}
.cwdl-lightbox-panel {
    width: 100%;
    max-width: 1300px;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.cwdl-lightbox-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 42px; font-size: 14px; }
.cwdl-lightbox button {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 8px;
    padding: 9px 15px;
    font: inherit;
    font-size: 14px;
    color: white;
    cursor: pointer;
    min-height: 42px;
}
.cwdl-lightbox button:disabled { opacity: .28; cursor: not-allowed; }
.cwdl-lightbox-stage { display: flex; flex: 1 1 auto; min-height: 0; align-items: center; gap: 12px; }
.cwdl-lightbox-stage > button { flex: 0 0 auto; font-size: 20px; padding-inline: 12px; }
.cwdl-lightbox-content { display: flex; justify-content: center; align-items: center; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; }
.cwdl-lightbox-content > img,
.cwdl-lightbox-content > video { display: block; max-width: 100%; max-height: min(76vh, 900px); width: auto; height: auto; object-fit: contain; }
.cwdl-lightbox-content > iframe { width: min(100%, 1100px); border: 0; aspect-ratio: 16 / 9; max-height: min(76vh, 900px); }
.cwdl-lightbox-info { padding: 12px 55px 8px; text-align: center; overflow-y: auto; font-size: 14px; line-height: 1.45; }
.cwdl-lightbox-info strong { display: block; font-size: 16px; }
.cwdl-lightbox-info p { color: #e2e8f0; margin: 5px 0; }
.cwdl-lightbox-info small { color: #cbd5e1; }
.cwdl-lightbox :is(a,button,video):focus-visible { outline: 2px solid white; outline-offset: 3px; }

@media (max-width: 900px) {
    .cwdl-gallery-media { grid-template-columns: repeat(min(2, var(--cwdl-cols, 3)), minmax(0, 1fr)); }
    .cwdl-layout-masonry > .cwdl-grid,
    .cwdl-layout-masonry > .cwdl-gallery-media { column-count: 2; }
    .cwdl-layout-carrusel > .cwdl-grid,
    .cwdl-layout-carrusel > .cwdl-gallery-media { --cwdl-cols: 2; }
}
@media (max-width: 600px) {
    .cwdl-gallery-media { grid-template-columns: minmax(0, 1fr); }
    .cwdl-layout-masonry > .cwdl-grid,
    .cwdl-layout-masonry > .cwdl-gallery-media { column-count: 1; }
    .cwdl-layout-carrusel > .cwdl-grid,
    .cwdl-layout-carrusel > .cwdl-gallery-media { --cwdl-cols: 1; }
    .cwdl-lightbox { padding: 6px; }
    .cwdl-lightbox-stage { gap: 4px; }
    .cwdl-lightbox-stage > button { padding: 8px; }
    .cwdl-lightbox-info { padding: 10px 8px; }
    .cwdl-lightbox-content > img,
    .cwdl-lightbox-content > video,
    .cwdl-lightbox-content > iframe { max-height: 67vh; }
    .cwdl-carousel-arrow { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .cwdl-media-launch > img { transition: none; }
    .cwdl-layout-carrusel > .cwdl-grid,
    .cwdl-layout-carrusel > .cwdl-gallery-media { scroll-behavior: auto; }
}

/* v1.3.0 — global AJAX search, sorting and page navigation. */
.cwdl-filter-direction { flex-basis: 140px; flex-grow: 0; }
.cwdl-catalog-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 15px; margin: 20px 0 0; }
.cwdl-catalog-footer .cwdl-count { margin: 0; }
.cwdl-pagination-nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; align-items: center; }
.cwdl-page-link, .cwdl-page-current, .cwdl-load-more {
    display: inline-flex; align-items: center; justify-content: center; min-width: 41px;
    min-height: 42px; padding: 9px 13px; border: 1px solid var(--cwdl-border);
    border-radius: 7px; background: var(--cwdl-surface); color: var(--cwdl-text);
    font-size: 14px; font-weight: 600; line-height: 1.25; text-align: center;
}
.cwdl-page-current { color: #fff; background: var(--cwdl-accent); border-color: var(--cwdl-accent); }
.cwdl-page-link:hover, .cwdl-load-more:hover { color: var(--cwdl-accent); border-color: var(--cwdl-accent); }
.cwdl-load-more { color: #fff; background: var(--cwdl-accent); border-color: var(--cwdl-accent); gap: 6px; }
.cwdl-load-more:hover { color: #fff; filter: brightness(.95); }
.cwdl-page-ellipsis { padding: 5px; color: var(--cwdl-muted); }
.cwdl-feedback { margin: 12px 0 0; padding: 11px 15px; border-radius: 7px; background: #eff6ff; color: #175cd3; font-size: 13px; }
.cwdl-feedback-error { background: #fef3f2; color: #b42318; }
.cwdl-catalog.cwdl-loading .cwdl-grid { opacity: .5; transition: opacity .12s ease; }
.cwdl-catalog.cwdl-loading .cwdl-pagination { opacity: .6; pointer-events: none; }
@media (max-width: 600px) {
    .cwdl-filter-direction { flex: 1 1 100%; }
    .cwdl-catalog-footer { align-items: stretch; flex-direction: column; }
    .cwdl-pagination-nav { justify-content: flex-start; }
    .cwdl-pagination { width: 100%; }
    .cwdl-load-more { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .cwdl-catalog.cwdl-loading .cwdl-grid { transition: none; } }

/* v1.4.0 — standalone PDF viewer and editable Elementor presentation. */
.cwdl-pdf-viewer {
    min-width: 0;
    width: 100%;
}
.cwdl-pdf-title {
    font-size: clamp(18px, 2vw, 26px);
    line-height: 1.3;
    color: var(--cwdl-text);
    margin: 0 0 16px;
    overflow-wrap: anywhere;
}
.cwdl-pdf-frame {
    width: 100%;
    height: var(--cwdl-pdf-height, 650px);
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--cwdl-border);
    border-radius: var(--cwdl-radius);
    background: #f2f5fa;
}
.cwdl-pdf-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.cwdl-pdf-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
.cwdl-pdf-actions .cwdl-button {
    min-height: 44px;
    justify-content: center;
    text-align: center;
}
.cwdl-editor-notice {
    padding: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--cwdl-muted);
    border: 1px dashed var(--cwdl-border);
    border-radius: var(--cwdl-radius);
    background: #f8faff;
}
.cwdl-media-gallery-widget { min-width: 0; }
@media (max-width: 600px) {
    .cwdl-pdf-frame { height: min(var(--cwdl-pdf-height, 650px), 500px); }
    .cwdl-pdf-actions { flex-direction: column; align-items: stretch; }
    .cwdl-pdf-actions .cwdl-button { width: 100%; }
}

/* v1.5.0 — PDF.js document toolbar and one-page canvas rendering. */
.cwdl-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(1px, 1px, 1px, 1px) !important; white-space: nowrap !important; }
.cwdl-pdf-shell { overflow: hidden; border: 1px solid var(--cwdl-border); border-radius: var(--cwdl-radius); background: #f3f5fa; }
.cwdl-pdf-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 9px 10px; border-bottom: 1px solid #dfe5ef; background: #fff; }
.cwdl-pdf-toolgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.cwdl-pdf-tool { display: inline-flex; justify-content: center; align-items: center; width: 36px; min-width: 36px; height: 36px; padding: 0; border: 1px solid var(--cwdl-border); border-radius: 7px; background: #f8faff; color: var(--cwdl-text); font: inherit; font-size: 21px; line-height: 1; cursor: pointer; }
.cwdl-pdf-tool:hover:not(:disabled) { border-color: var(--cwdl-accent); color: var(--cwdl-accent); }
.cwdl-pdf-tool:disabled { opacity: .4; cursor: not-allowed; }
.cwdl-pdf-page-label { display: inline-flex; align-items: center; white-space: nowrap; color: var(--cwdl-muted); gap: 4px; font-size: 13px; }
.cwdl-pdf-page-label input { width: 48px; min-width: 0; height: 36px; margin: 0; padding: 3px 2px; border: 1px solid #d2d8e4; border-radius: 7px; background: #fff; color: var(--cwdl-text); font: inherit; text-align: center; appearance: textfield; -moz-appearance: textfield; }
.cwdl-pdf-page-label input::-webkit-inner-spin-button, .cwdl-pdf-page-label input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cwdl-pdf-zoom-label { display: inline-block; text-align: center; min-width: 48px; color: var(--cwdl-text); font-size: 13px; font-weight: 700; }
.cwdl-pdf-fit { min-height: 36px; max-width: 190px; margin: 0; padding: 5px 24px 5px 9px; border: 1px solid #d2d8e4; border-radius: 7px; background: #fff; color: var(--cwdl-text); font: inherit; font-size: 13px; cursor: pointer; }
.cwdl-pdf-shell .cwdl-pdf-frame { position: relative; height: var(--cwdl-pdf-height,650px); min-height: 260px; width: 100%; max-width: 100%; overflow: auto; border: 0; border-radius: 0; background: #dfe4ec; overscroll-behavior: contain; }
.cwdl-pdf-canvas-wrap { width: max-content; min-width: min(100%, 250px); max-width: none; margin: 0 auto; padding: 13px; }
.cwdl-pdf-canvas-wrap canvas { display: block; max-width: none; margin: 0 auto; background: #fff; box-shadow: 0 3px 20px rgba(31,45,70,.16); }
.cwdl-pdf-frame .cwdl-pdf-native { display: block; width: 100%; height: 100%; min-height: 100%; border: 0; background: #fff; }
.cwdl-pdf-frame .cwdl-pdf-status { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(90%, 390px); margin: 0; padding: 13px 18px; border-radius: 9px; background: #fff; color: var(--cwdl-muted); text-align: center; font-size: 14px; box-shadow: 0 5px 24px rgba(0,0,0,.12); z-index: 1; pointer-events: none; }
.cwdl-pdf-frame .cwdl-pdf-status.cwdl-pdf-error { color: #a12624; }
.cwdl-pdf-is-expanded { position: fixed !important; inset: 0 !important; z-index: 999999 !important; width: 100vw !important; max-width: none !important; min-width: 0 !important; padding: 12px !important; background: #fff !important; overflow: hidden !important; display: flex !important; flex-direction: column !important; }
.cwdl-pdf-is-expanded .cwdl-pdf-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cwdl-pdf-is-expanded .cwdl-pdf-shell > .cwdl-pdf-frame { flex: 1; min-height: 0; height: auto !important; }
.cwdl-pdf-is-expanded .cwdl-pdf-actions { margin: 8px 0 0; }
.cwdl-pdf-preview > div { aspect-ratio: auto; min-height: 0; }
@media (max-width: 620px) {
    .cwdl-pdf-toolbar { justify-content: center; padding: 7px; }
    .cwdl-pdf-toolgroup { justify-content: center; }
    .cwdl-pdf-is-expanded .cwdl-pdf-shell .cwdl-pdf-frame { height: auto !important; }
    .cwdl-pdf-fit { max-width: 138px; }
}
@media (prefers-reduced-motion: reduce) { .cwdl-pdf-tool { transition: none; } }


/* v1.6.0 — full-width search, configurable field background and selective second-row filters. */
.cwdl .cwdl-filter {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    min-width: 0;
}
.cwdl .cwdl-filter-search-row { width: 100%; min-width: 0; border-radius: 8px; background-color: var(--cwdl-search-zone-bg, transparent); }
.cwdl .cwdl-filter-search { display: flex; width: 100%; min-width: 0; margin: 0; }
.cwdl .cwdl-filter-search input[type="search"] {
    width: 100%; max-width: none; min-width: 0; min-height: 48px;
    background-color: var(--cwdl-search-input-bg, #fff); color: var(--cwdl-search-input-color, var(--cwdl-text));
    -webkit-text-fill-color: currentColor;
}
.cwdl .cwdl-filter-search input[type="search"]::placeholder { color: var(--cwdl-search-placeholder-color, var(--cwdl-muted)); opacity: 1; }
.cwdl .cwdl-filter-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
    gap: 12px; width: 100%; align-items: end; min-width: 0;
}
.cwdl .cwdl-filter-row .cwdl-filter-item { min-width: 0; width: 100%; }
.cwdl .cwdl-filter-row .cwdl-filter-direction { flex-basis: auto; flex-grow: 1; }
.cwdl .cwdl-filter-row .cwdl-filter-reset { width: auto; margin: 0; align-self: end; }
@media (max-width: 600px) {
    .cwdl .cwdl-filter-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
    .cwdl .cwdl-filter-row .cwdl-filter-reset { width: 100%; }
}
.cwdl-media-tile .cwdl-live-badge {
    position: absolute; left: 10px; top: 10px; z-index: 1;
    padding: 5px 9px; border-radius: 5px; background: #ba1824;
    color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
.cwdl-media-tile .cwdl-playlist-badge {
    position: absolute; top: 10px; left: 10px; z-index: 1;
    padding: 5px 9px; border-radius: 5px; background: #223f6b;
    color: #fff; font-size: 11px; font-weight: 750;
}
.cwdl-yt-featured { margin-bottom: 22px; }
.cwdl-yt-featured-heading { margin: 0 0 10px; font-size: 17px; font-weight: 700; }
.cwdl-yt-featured .cwdl-live-badge { display: inline-flex; background: #ba1824; color: #fff; padding: 3px 8px; border-radius: 5px; font-size: 11px; margin-left: 8px; }
.cwdl-yt-featured .cwdl-video-embed { margin-bottom: 0; }
