/* ==========================================================
   Periferias Search — CSS
   Design tokens do tema: --c-primary: #035299 | --red: #EF4B32
   Fontes: Roboto (body) | Nunito (menus/footer)
========================================================== */

/* ----------------------------------------------------------
   WRAPPER GERAL
---------------------------------------------------------- */
.periferias-search-wrapper {
    width: 100%;
    margin-bottom: 3rem;
}

/* ----------------------------------------------------------
   BLOCO DE FILTROS
---------------------------------------------------------- */
.periferias-filters {
    background: #f7f9fc;
    border: 1px solid #dde6ef;
    border-radius: 8px;
    padding: 28px 32px 20px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .periferias-filters {
        padding: 20px 16px 16px;
        margin-bottom: 24px;
    }
}

/* Campo de busca textual */
.periferias-filters__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.periferias-filters__field label {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #035299;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.periferias-filters__field--search {
    margin-bottom: 20px;
}

.ps-input-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.periferias-filters__field input[type="text"],
.periferias-filters__field select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid #c5d5e8;
    border-radius: 6px;
    font-family: Roboto, sans-serif;
    font-size: 15px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.periferias-filters__field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23035299' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
    cursor: pointer;
}

.periferias-filters__field select:disabled {
    background-color: #f0f4f8;
    color: #999;
    cursor: not-allowed;
}

.periferias-filters__field input[type="text"]:focus,
.periferias-filters__field select:focus {
    border-color: #035299;
    box-shadow: 0 0 0 3px rgba(3, 82, 153, 0.1);
}

/* Linha de filtros (dropdowns) */
.periferias-filters__row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1100px) {
    .periferias-filters__row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .periferias-filters__row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .periferias-filters__row {
        grid-template-columns: 1fr;
    }
}

/* Ações */
.periferias-filters__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ps-result-count {
    font-family: Roboto, sans-serif;
    font-size: 14px;
    color: #666;
    margin-left: auto;
}

/* ----------------------------------------------------------
   BOTÕES
---------------------------------------------------------- */
.ps-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 44px;
    padding: 0 20px;
    border-radius: 6px;
    border: none;
    font-family: Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.ps-btn--primary {
    background: #035299;
    color: #fff;
    flex-shrink: 0;
}

.ps-btn--primary:hover {
    background: #024280;
    color: #fff;
}

.ps-btn--ghost {
    background: transparent;
    color: #666;
    border: 1.5px solid #c5d5e8;
}

.ps-btn--ghost:hover {
    border-color: #EF4B32;
    color: #EF4B32;
}

/* ----------------------------------------------------------
   LOADING
---------------------------------------------------------- */
.ps-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 60px 20px;
    color: #666;
    font-family: Roboto, sans-serif;
    font-size: 16px;
}

.ps-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #dde6ef;
    border-top-color: #035299;
    border-radius: 50%;
    animation: ps-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes ps-spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------
   SEM RESULTADOS
---------------------------------------------------------- */
.ps-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
}

.ps-no-results p {
    font-family: Roboto, sans-serif;
    font-size: 17px;
    color: #666;
    margin: 0;
}

/* ----------------------------------------------------------
   GRID DE CARDS
---------------------------------------------------------- */
.ps-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1100px) {
    .ps-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ps-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .ps-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------------
   CARD
---------------------------------------------------------- */
.ps-card {
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.ps-card:hover {
    box-shadow: 0 6px 24px rgba(3, 82, 153, 0.12);
    transform: translateY(-2px);
}

.ps-card__thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #dde6ef;
    flex-shrink: 0;
}

.ps-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ps-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

.ps-card__name {
    font-family: Roboto, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.ps-card__name a {
    color: #035299;
    text-decoration: none;
}

.ps-card__name a:hover {
    color: #EF4B32;
    text-decoration: none;
}

.ps-card__locate {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ps-card__locate span {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    color: #555;
}

.ps-label {
    font-weight: 600;
    color: #035299;
}

.ps-card__excerpt {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ps-card__date {
    font-family: Roboto, sans-serif;
    font-size: 12px;
    color: #999;
    margin-top: auto;
}

.ps-card__link {
    display: inline-block;
    margin-top: 4px;
    padding: 7px 16px;
    background: #035299;
    color: #fff !important;
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    text-decoration: none !important;
    text-align: center;
    transition: background 0.2s;
    align-self: flex-start;
}

.ps-card__link:hover {
    background: #EF4B32;
    color: #fff !important;
}

/* ----------------------------------------------------------
   PAGINAÇÃO
---------------------------------------------------------- */
.periferias-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e8eef5;
}

.ps-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border: 1.5px solid #035299;
    border-radius: 6px;
    background: transparent;
    color: #035299;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ps-page-btn:hover:not(:disabled) {
    background: #035299;
    color: #fff;
}

.ps-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #c5d5e8;
    color: #999;
}

.ps-page-info {
    font-family: Roboto, sans-serif;
    font-size: 14px;
    color: #555;
    min-width: 100px;
    text-align: center;
}
