/* ==========================================================
   DTP SEARCH — Styles
========================================================== */

/* ---------- LIVE SEARCH WIDGET ---------- */
.dtps-live-wrap {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.dtps-live-form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .2s;
}
.dtps-live-form:focus-within {
    border-color: #111;
}

.dtps-live-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 14px;
    font-size: 14px;
    background: transparent;
    color: #111;
}
.dtps-live-input::placeholder { color: #aaa; }

.dtps-live-submit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 14px;
    color: #888;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.dtps-live-submit:hover { color: #111; }

/* Dropdown */
.dtps-live-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    z-index: 99999;
    overflow: hidden;
}

.dtps-live-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #111;
    transition: background .15s;
    border-bottom: 1px solid #f5f5f5;
}
.dtps-live-item:last-child { border-bottom: none; }
.dtps-live-item:hover { background: #f8f8f8; }

.dtps-live-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.dtps-live-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dtps-live-info { flex: 1; min-width: 0; }
.dtps-live-title {
    font-size: 13px;
    font-weight: 500;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.dtps-live-meta {
    font-size: 11px;
    color: #888;
    display: flex;
    gap: 6px;
    align-items: center;
}
.dtps-live-cat {
    background: #f0f0f0;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #555;
}

.dtps-live-footer {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #111;
    font-weight: 500;
    background: #f8f8f8;
    text-decoration: none;
    transition: background .15s;
}
.dtps-live-footer:hover { background: #efefef; }

.dtps-live-message {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

/* ---------- PAGE DE RECHERCHE ---------- */
.dtps-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Hero */
.dtps-hero {
    margin-bottom: 32px;
}

.dtps-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.dtps-input-main {
    width: 100%;
    font-size: 18px;
    padding: 16px 52px 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    color: #111;
    background: #fff;
    transition: border-color .2s;
    box-sizing: border-box;
}
.dtps-input-main:focus { border-color: #111; }
.dtps-input-main::placeholder { color: #aaa; }

.dtps-search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
}

.dtps-results-count {
    font-size: 13px;
    color: #888;
    min-height: 20px;
}

/* Filtres */
.dtps-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 32px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 10px;
}

.dtps-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.dtps-filter-label {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.dtps-select {
    padding: 9px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #111;
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.dtps-select:focus { border-color: #111; }

.dtps-btn-reset {
    padding: 9px 16px;
    background: none;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    height: fit-content;
}
.dtps-btn-reset:hover {
    border-color: #111;
    color: #111;
}

/* Grille résultats */
.dtps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.dtps-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #111;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.dtps-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    transform: translateY(-2px);
}

.dtps-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
}
.dtps-card-img-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.dtps-card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dtps-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dtps-card-cat {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #111;
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
}

.dtps-card-year {
    font-size: 11px;
    color: #aaa;
}

.dtps-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dtps-card-excerpt {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dtps-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.dtps-card-tag {
    font-size: 10px;
    background: #f5f5f5;
    color: #666;
    padding: 2px 7px;
    border-radius: 4px;
}

/* Loading */
.dtps-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px;
    color: #888;
    font-size: 14px;
}

.dtps-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #111;
    border-radius: 50%;
    animation: dtps-spin .7s linear infinite;
    display: inline-block;
}
@keyframes dtps-spin { to { transform: rotate(360deg); } }

.dtps-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 15px;
}
.dtps-no-results span {
    display: block;
    font-size: 40px;
    margin-bottom: 12px;
}

/* Pagination */
.dtps-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.dtps-page-btn {
    padding: 8px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    color: #111;
    transition: all .15s;
}
.dtps-page-btn:hover { border-color: #111; }
.dtps-page-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
}
.dtps-page-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .dtps-filter-group { min-width: 100%; }
    .dtps-grid { grid-template-columns: 1fr; }
    .dtps-input-main { font-size: 15px; }
}
