/**
 * SharePoint Bridge Pro — Front-end Styles
 * Version: 5.10.0
 */

/* ==========================================================================
   1. Wrapper & Layout
   ========================================================================== */

.sp-library-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
}

/* Neutralize theme abbr/acronym styling that can underline capitalized words */
.sp-library-wrapper abbr,
.sp-library-wrapper acronym {
    text-decoration: none;
    border-bottom: none;
    cursor: inherit;
}

.sp-library-heading {
    margin-bottom: 16px;
    font-size: 1.4rem;
}

.sp-library-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* ==========================================================================
   2. Search Form
   ========================================================================== */

.sp-doc-search-form {
    display: flex;
    gap: 10px;
    background: #f1f1f1;
    padding: 16px 20px;
    border-radius: 5px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.sp-search-input {
    flex-grow: 1;
    min-width: 200px;
    border: 1px solid #ccc;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.95rem;
    height: 42px;
    box-sizing: border-box;
}

.sp-search-btn,
.sp-clear-btn {
    height: 42px;
    padding: 0 18px;
    white-space: nowrap;
    box-sizing: border-box;
    line-height: 40px;
    text-decoration: none;
}

.sp-search-tip {
    font-size: 12px;
    color: #888;
    margin: 5px 0 0 0;
}

/* ==========================================================================
   3. Sidebar Facets
   ========================================================================== */

.sp-sidebar {
    flex: 0 0 230px;
    background: #f4f4f4;
    padding: 20px;
    border-radius: 5px;
}

.sp-sidebar-heading {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin-bottom: 14px;
}

fieldset.sp-filter-group {
    border: none;
    padding: 0 0 18px 0;
    margin: 0 0 18px 0;
    min-width: 0;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    width: 100%;
}

fieldset.sp-filter-group legend.sp-filter-group-heading {
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
    padding: 0 0 6px 0;
    margin: 0;
    display: block;
    width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

.sp-filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sp-filter-group-heading {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #444;
    margin: 0 0 8px;
    padding: 0;
    border: none;
}

.sp-filter-label {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.875rem;
    margin: 4px 0;
    cursor: pointer;
    line-height: 1.4;
}

.sp-filter-label input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    position: relative;
    top: 1px;
}

.sp-filter-term {
    flex-grow: 1;
    color: #333;
}

.sp-filter-count {
    color: #999;
    font-size: 0.78rem;
    flex-shrink: 0;
}

/* Collapsible overflow section */
.sp-filter-overflow {
    margin-top: 2px;
}

/* Show more / Show fewer toggle button */
.sp-filter-toggle {
    display: inline-block;
    margin-top: 6px;
    padding: 0;
    background: none;
    border: none;
    color: #0073aa;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sp-filter-toggle:hover {
    color: #005177;
}

.sp-sidebar-empty {
    font-size: 0.85rem;
    color: #999;
    margin-top: 12px;
}

/* ==========================================================================
   4. Results Area
   ========================================================================== */

.sp-results-area {
    flex: 1;
    min-width: 0;
}

.sp-result-count {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.sp-waiting-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    border: 1px dashed #ddd;
    border-radius: 8px;
}

.sp-no-results {
    padding: 20px;
    color: #666;
    text-align: center;
}

/* ==========================================================================
   5. Sort Header
   Scoped tightly to prevent theme uppercase/bold styles bleeding in.
   Uses numeric font-weight and explicit letter-spacing to resist inheritance.
   ========================================================================== */

.sp-sort-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px 6px 48px; /* 48px left aligns with text start after icon */
    border-bottom: 2px solid #ddd;
    margin-bottom: 0;
}

/* Full reset on sort links to fight theme styles */
.sp-library-wrapper .sp-sort-link,
.sp-library-wrapper .sp-sort-link:visited,
.sp-library-wrapper .sp-sort-link:hover,
.sp-library-wrapper .sp-sort-link:focus {
    all: unset;          /* nuclear reset */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    text-decoration: none !important;
    cursor: pointer;
    padding: 4px 2px;
    transition: color 0.15s;
    outline: revert;     /* restore focus ring after all:unset */
}

.sp-library-wrapper .sp-sort-link:hover {
    color: #333;
}

.sp-library-wrapper .sp-sort-link.sp-sort-active {
    color: #1a1a1a;
}

/* CSS-only sort indicators — no icon font, no glyph rendering issues */
.sp-sort-indicator {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    font-style: normal;
    font-weight: 400;
}

.sp-sort-idle {
    opacity: 0.3;
}

/* ==========================================================================
   6. Resource Library — Document List
   ========================================================================== */

.sp-resource-library {
    border-top: 1px solid #ddd;
    max-width: 100%;
}

.sp-resource-library.sp-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* ==========================================================================
   7. Resource Row
   ========================================================================== */

.sp-resource-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none !important;
    color: #333 !important;
    border-bottom: 1px solid #eee;
    transition: background 0.15s ease;
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.sp-resource-row:hover {
    background: #f8f8f8;
}

.sp-icon-wrapper {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-icon-wrapper img {
    width: 100%;
    height: 100%;
    max-width: 24px;
    max-height: 24px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
}

.sp-row-body {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* In non-excerpt rows, sp-row-body behaves as a simple flex pass-through */
.sp-resource-row:not(.sp-resource-row--excerpt) .sp-row-body {
    flex-direction: row;
    align-items: center;
}

/* Excerpt mode — row expands vertically */
.sp-resource-row--excerpt {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
    min-height: auto;
}

.sp-title {
    flex-grow: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1a1a1a;
}

/* In excerpt rows, title doesn't need to truncate — excerpt is below it */
.sp-resource-row--excerpt .sp-title {
    font-size: 15px;
    font-weight: 600;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    color: #1a1a1a;
}

.sp-excerpt {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #f0f0f0;
}

.sp-excerpt mark {
    background: #fff3cd;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
    font-weight: 500;
}

.sp-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #777;
    flex-shrink: 0;
}

.sp-size,
.sp-date {
    width: 80px;
    text-align: right;
}

/* ==========================================================================
   8. Load More
   ========================================================================== */

.sp-load-more-wrap {
    text-align: center;
    margin-top: 24px;
}

.sp-load-more-btn {
    min-height: 44px;
    padding: 0 24px;
}

/* ==========================================================================
   9. Download / View Buttons
   ========================================================================== */

.sp-copy-btn {
    transition: all 0.2s ease;
    border: 1px solid #ccc !important;
    background: white !important;
    color: #444 !important;
}

.sp-copy-btn:hover {
    background: #f0f0f0 !important;
    border-color: #999 !important;
}

.sp-download-link {
    transition: background 0.2s ease;
    display: inline-block;
    font-weight: 500;
}

/* ==========================================================================
   10. Accessibility
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* WCAG 2.1 AA focus indicator — 3px #0066cc has 4.5:1+ contrast on white
   WCAG 2.2 2.4.11 stretch: use focus-visible to avoid outlines on mouse click */
.sp-library-wrapper a:focus-visible,
.sp-library-wrapper button:focus-visible,
.sp-library-wrapper input:focus-visible,
.sp-library-wrapper select:focus-visible,
.sp-library-wrapper a:focus,
.sp-library-wrapper button:focus,
.sp-library-wrapper input:focus,
.sp-library-wrapper select:focus {
    outline: 3px solid #0066cc;
    outline-offset: 3px;
    border-radius: 2px;
}

/* Suppress focus ring for mouse users in browsers that support :focus-visible */
@supports selector(:focus-visible) {
    .sp-library-wrapper a:focus:not(:focus-visible),
    .sp-library-wrapper button:focus:not(:focus-visible),
    .sp-library-wrapper input:focus:not(:focus-visible),
    .sp-library-wrapper select:focus:not(:focus-visible) {
        outline: none;
    }
}

.sp-doc-search-form select,
.sp-doc-search-form button {
    min-height: 44px;
}

.sp-source-attribution {
    font-weight: 700;
}

/* ==========================================================================
   11. Table View (legacy / alternate display)
   ========================================================================== */

.sp-library-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #eee;
}

.sp-library-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #eceeef;
    color: #555;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.sp-library-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* ==========================================================================
   12. Ordered list counter helpers
   ========================================================================== */

ol.start {
    counter-reset: mycounter;
}

ol.start li,
ol.continue li {
    list-style: none;
}

ol.start li::before,
ol.continue li::before {
    content: counter(mycounter) ". ";
    counter-increment: mycounter;
}

/* ==========================================================================
   14. Search Results — Document Section
   ========================================================================== */

.sp-search-results-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ddd;
}

.sp-search-section-heading {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.sp-search-results-footer {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.sp-explore-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0073aa;
    text-decoration: none;
    white-space: nowrap;
}

.sp-explore-link:hover {
    text-decoration: underline;
    color: #005177;
}

@media screen and (max-width: 768px) {
    .sp-search-results-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sp-explore-link {
        white-space: normal;
    }
}

@media screen and (max-width: 768px) {

    .sp-library-container {
        flex-direction: column;
    }

    .sp-sidebar {
        width: 100%;
        flex: none;
        margin-bottom: 20px;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
    }

    .sp-results-area {
        width: 100%;
    }

    .sp-doc-search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .sp-search-input,
    .sp-doc-search-form select,
    .sp-doc-search-form button,
    .sp-search-btn,
    .sp-clear-btn {
        width: 100%;
        box-sizing: border-box;
        margin: 3px 0;
    }

    .sp-resource-row {
        flex-wrap: wrap;
    }

    .sp-title {
        width: calc(100% - 40px);
        white-space: normal;
        margin-bottom: 4px;
    }

    .sp-meta {
        width: 100%;
        margin-left: 36px;
        justify-content: flex-start;
    }

    .sp-size,
    .sp-date {
        width: auto;
        text-align: left;
    }

    .sp-library-table thead {
        display: none;
    }

    .sp-library-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
    }

    .sp-library-table td {
        display: block;
        width: 100%;
        text-align: left !important;
        padding: 8px 0 !important;
        border: none;
    }

    .sp-copy-btn,
    .sp-download-link {
        width: 100%;
        margin: 5px 0 !important;
        box-sizing: border-box;
        text-align: center;
    }
}

/* ==========================================================================
   Archive Section
   ========================================================================== */

.sp-archive-section {
    margin-top: 32px;
    border-top: 2px dashed #ddd;
    padding-top: 16px;
}

.sp-archive-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-archive-toggle:hover {
    color: #1a1a1a;
}

.sp-archive-toggle-icon {
    font-size: 11px;
    transition: transform 0.2s;
}

.sp-archive-count {
    font-weight: 400;
    color: #888;
    font-size: 13px;
}

.sp-archive-list {
    margin-top: 12px;
}

.sp-archive-note {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fffbf0;
    border-left: 3px solid #f0ad4e;
    border-radius: 0 4px 4px 0;
}

/* Provisional badge */
.sp-provisional-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sp-badge-provisional {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.sp-badge-archived {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.sp-remediation-link {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #0073aa;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.sp-remediation-link:hover {
    text-decoration: underline;
    color: #005177;
}

/* Event context — full width, no sidebar */
.sp-library-container--event {
    display: block;
}

.sp-library-container--event .sp-results-area {
    width: 100%;
}

.sp-preset-btn {
    display: inline-block;
    margin: 0 6px 8px 0;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    background: #f0f6fc;
    border: 1px solid #007cba;
    color: #007cba;
    transition: background 0.15s, color 0.15s;
}

.sp-preset-btn:hover {
    background: #007cba;
    color: #fff;
    text-decoration: none;
}


/* Search all related documents link */
.sp-search-all-wrap {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.sp-search-all-link {
    font-size: 14px;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}

.sp-search-all-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Gallery List display style
   Larger icon, prominent filename that wraps fully, no date/excerpt
   ========================================================================== */

.sp-resource-library--gallery-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sp-resource-row--gallery-list {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 8px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s ease;
}

.sp-resource-row--gallery-list:hover {
    background: #f9fafb;
}

.sp-resource-row--gallery-list:last-child {
    border-bottom: none;
}

.sp-resource-row--gallery-list .sp-icon-wrapper {
    flex-shrink: 0;
    width: 48px;
    min-height: 48px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
}

/* File type icon in gallery-list (no thumbnail cached yet) */
.sp-resource-row--gallery-list .sp-icon-wrapper img.sp-doc-icon {
    width: 48px;
    height: 48px;
}

/* Portrait thumbnail in gallery-list — taller than icon, top-aligned */
.sp-resource-row--gallery-list .sp-icon-wrapper img.sp-doc-thumb {
    width: auto;
    height: 72px;
    object-fit: contain;
    object-position: top center;
    border-radius: 2px;
    border: 1px solid #e5e7eb;
}

.sp-title--gallery-list {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    white-space: normal;       /* allow full filename to wrap */
    overflow-wrap: break-word;
    word-break: break-word;
}

.sp-resource-row--gallery-list .sp-row-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}


/* ==========================================================================
   Gallery Tiles display style
   Large icon centred above filename — commanding, good for small document sets
   ========================================================================== */

.sp-resource-library--gallery-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

.sp-gallery-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 20px 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.sp-gallery-tile:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
    border-color: #d1d5db;
}

.sp-gallery-tile__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.sp-gallery-tile__icon img {
    width: 80px;
    height: 80px;
    display: block;
}



.sp-gallery-tile__name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

.sp-gallery-tile__type {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #6b7280;
    text-transform: uppercase;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ==========================================================================
   Compact display style
   ========================================================================== */

.sp-library-container--compact {
    display: block; /* no sidebar grid */
}

.sp-resource-library--compact {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sp-resource-row--compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #1d4ed8;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.1s ease;
}

.sp-resource-row--compact:last-child {
    border-bottom: none;
}

.sp-resource-row--compact:hover {
    color: #1e40af;
    text-decoration: underline;
}

.sp-resource-row--compact .sp-icon-wrapper {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.sp-compact-icon {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}

.sp-resource-row--compact .sp-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* See more link */
.sp-see-more-wrap {
    margin-top: 8px;
    text-align: right;
}

.sp-see-more-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
}

.sp-see-more-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* ==========================================================================
   Gallery display style
   ========================================================================== */

.sp-resource-library--gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

.sp-resource-row--gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    gap: 10px;
}

.sp-resource-row--gallery:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #c7d2fe;
    text-decoration: none;
}

.sp-resource-row--gallery .sp-icon-wrapper {
    flex-shrink: 0;
}

.sp-resource-row--gallery .sp-icon-wrapper img {
    width: 48px;
    height: 48px;
    display: block;
}

.sp-resource-row--gallery .sp-row-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.sp-resource-row--gallery .sp-title--gallery {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    word-break: break-word;
}

@media (max-width: 600px) {
    .sp-resource-library--gallery {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}


/* ==========================================================================
   Compact display style — sidebar-friendly, icon + filename only
   ========================================================================== */

.sp-library-container--compact {
    display: block;
}

.sp-resource-library--compact {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
}

.sp-resource-row--compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: #111827;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.12s ease;
}

.sp-resource-row--compact:last-child {
    border-bottom: none;
}

.sp-resource-row--compact:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.sp-resource-row--compact .sp-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.sp-resource-row--compact .sp-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* See more link */
.sp-see-more-wrap {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.sp-see-more-link {
    font-size: 13px;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}

.sp-see-more-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Document Thumbnails
   ========================================================================== */

/* Gallery list thumbnail */
.sp-resource-row--gallery-list .sp-thumb-wrap {
    width: 64px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 3px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-doc-thumb {
    display: block;
    object-fit: contain;
    object-position: top center;
}

/* Gallery tiles thumbnail — rotated showcase presentation */
.sp-gallery-tile__icon.sp-thumb-wrap {
    width: 100%;
    min-height: 120px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sp-doc-thumb--tile,
.sp-gallery-tile__icon img.sp-doc-thumb--tile {
    width: 45%;
    height: auto;
    object-fit: contain;
    display: block;
    transform: rotate(-15deg);
    filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4));
}

/* Small tile variant — tighter grid, flat thumbnail (no rotation/shadow) */
.sp-resource-library--gallery-tiles.sp-tiles--small {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.sp-resource-library--gallery-tiles.sp-tiles--small .sp-gallery-tile {
    padding: 10px 8px;
    gap: 6px;
}

.sp-resource-library--gallery-tiles.sp-tiles--small .sp-gallery-tile__icon.sp-thumb-wrap {
    min-height: 90px;
    padding: 10px;
}

/* Small tiles — flat thumbnail, no rotation or shadow */
.sp-resource-library--gallery-tiles.sp-tiles--small .sp-doc-thumb--tile,
.sp-resource-library--gallery-tiles.sp-tiles--small .sp-gallery-tile__icon img.sp-doc-thumb--tile {
    width: 50%;
    transform: none;
    filter: none;
    border: 1px solid #e5e7eb;
    border-radius: 2px;
}

/* Small tiles — smaller fallback icon */
.sp-resource-library--gallery-tiles.sp-tiles--small .sp-gallery-tile__icon img.sp-doc-icon {
    width: 40px;
    height: 40px;
}

.sp-resource-library--gallery-tiles.sp-tiles--small .sp-gallery-tile__name {
    font-size: 12px;
}

.sp-resource-library--gallery-tiles.sp-tiles--small .sp-gallery-tile__type {
    font-size: 9px;
    padding: 1px 4px;
}
