/* ============================================================
   Shared styles: Edital / Licitação / Processo Seletivo
   ============================================================ */

/* Hero banner — full-width, fora do container */
.ps-hero {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 0;
}

/* Imagem de fundo embaçada */
.ps-hero::before {
    content: '';
    position: absolute;
    inset: -20px;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px) brightness(0.45);
    z-index: 0;
}

/* Sobreposição em gradiente */
.ps-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,30,80,0.92) 0%, rgba(0,76,153,0.45) 55%, transparent 100%);
    z-index: 1;
}

.ps-hero > .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.ps-hero h1 {
    color: #fff;
    font-size: clamp(28px, 2.5vw + 16px, 46px);
    font-weight: 800;
    margin: 0;
    padding: 32px 0;
    text-shadow: none;
    line-height: 1.15;
}

/* Status filter pills (Index page) */
.ps-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.25rem;
    align-items: center;
}

.ps-pill {
    display: inline-block;
    padding: .35rem 1rem;
    border-radius: 2rem;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    border: 1.5px solid #d0d7df;
    background: #fff;
    color: #555;
    transition: background .15s, color .15s, border-color .15s;
    white-space: nowrap;
}

.ps-pill:hover {
    background: #e8f0fb;
    color: #004c99;
    border-color: #004c99;
    text-decoration: none;
}

.ps-pill.active {
    background: #004c99;
    color: #fff;
    border-color: #004c99;
    text-decoration: none;
}

/* Filter bar (Buscar page) */
.ps-filter-bar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    padding: 1.25rem 1.25rem .75rem;
    margin-bottom: 1.5rem;
}

.ps-filter-bar label {
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .25rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.ps-filter-bar .form-control,
.ps-filter-bar .form-select {
    font-size: .925rem;
    border-radius: .4rem;
}

.ps-filter-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    padding-top: .75rem;
}

/* Card grid */
.ps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1199px) {
    .ps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .ps-grid { grid-template-columns: 1fr; }
}

/* Card */
.ps-card {
    border: 2px solid #e0e7f0;
    border-radius: .75rem;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}

.ps-card:hover {
    border-color: dodgerblue;
    box-shadow: 0 4px 18px rgba(30, 90, 200, .1);
}

.ps-card > a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ps-card-header {
    background: #004c99;
    padding: .75rem 1rem;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.ps-card-header h4 {
    color: #fff;
    font-size: .95rem;
    text-align: center;
    margin: 0;
    line-height: 1.3;
}

.ps-card:hover .ps-card-header {
    background: dodgerblue;
}

.ps-card-body {
    padding: .85rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: .875rem;
}

.ps-card-objeto {
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #222;
    margin: 0 0 .25rem;
}

.ps-card-meta {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    color: #555;
    margin: 0;
    line-height: 1.4;
}

.ps-card-meta svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #004c99;
}

/* Status badge */
.ps-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 600;
    font-size: .825rem;
    margin-top: auto;
    padding-top: .35rem;
}

.ps-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ps-status--aberto   { color: #198754; }
.ps-status--aberto::before   { background: #198754; }
.ps-status--andamento { color: #915e00; }
.ps-status--andamento::before { background: #e6a800; }
.ps-status--finalizado { color: #dc3545; }
.ps-status--finalizado::before { background: #dc3545; }

/* "Ver todos" / "Busca avançada" row */
.ps-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: .25rem 0 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.ps-list-footer small {
    color: #888;
    font-size: .85rem;
}

.ps-busca-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    color: #004c99;
    text-decoration: none;
    font-size: .925rem;
    white-space: nowrap;
    transition: color .15s;
}

.ps-busca-link:hover {
    color: dodgerblue;
    text-decoration: none;
}

/* Empty state */
.ps-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 1rem;
}

/* Pagination */
.ps-pagination .pagination {
    justify-content: center;
}

/* ============================================================
   Detail page styles
   ============================================================ */

.ps-detail-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color .15s;
}
.ps-detail-back:hover { color: #004c99; text-decoration: none; }

/* Status badge (inline) */
.ps-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border-radius: 2rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}
.ps-badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.ps-badge--aberto   { background: #d1f0e0; color: #0d5e30; }
.ps-badge--aberto::before   { background: #198754; }
.ps-badge--andamento { background: #fff3cd; color: #6c4400; }
.ps-badge--andamento::before { background: #e6a800; }
.ps-badge--finalizado { background: #fde8ea; color: #8b1b24; }
.ps-badge--finalizado::before { background: #dc3545; }

/* Detail header */
.ps-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.ps-detail-header-left { flex: 1; min-width: 0; }
.ps-detail-header-left h1 {
    font-size: clamp(1.2rem, 2vw + .8rem, 1.75rem);
    margin: 0 0 .4rem;
    color: #1a2a40;
}
.ps-detail-header-left .ps-detail-objeto {
    font-size: 1rem;
    color: #444;
    margin: .5rem 0 0;
}
.ps-detail-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .6rem;
    flex-shrink: 0;
}

/* Meta grid */
.ps-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
    margin-bottom: 1.75rem;
}
.ps-meta-item {
    background: #f5f7fa;
    border: 1px solid #e4e8ef;
    border-radius: .5rem;
    padding: .75rem 1rem;
}
.ps-meta-item label {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #888;
    margin: 0 0 .25rem;
}
.ps-meta-item label svg { color: #004c99; }
.ps-meta-item span {
    font-size: .95rem;
    font-weight: 600;
    color: #222;
    display: block;
}

/* Section wrapper */
.ps-detail-section {
    margin-bottom: 2rem;
}
.ps-detail-section-title {
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #004c99;
    border-bottom: 2px solid #e0e7f0;
    padding-bottom: .4rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* Description */
.ps-detail-descricao {
    font-size: .975rem;
    color: #333;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* File list */
.ps-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.ps-file-item a {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .875rem;
    border: 1.5px solid #d0ddf0;
    border-radius: .4rem;
    font-size: .9rem;
    font-weight: 500;
    color: #004c99;
    text-decoration: none;
    background: #f5f8ff;
    transition: background .15s, border-color .15s;
    word-break: break-word;
}
.ps-file-item a:hover {
    background: #e6eeff;
    border-color: #004c99;
    text-decoration: none;
}

/* Cargo table */
.ps-cargo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.ps-cargo-table thead tr {
    background: #004c99;
    color: #fff;
}
.ps-cargo-table th {
    padding: .6rem .875rem;
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .03em;
    text-align: left;
}
.ps-cargo-table td {
    padding: .6rem .875rem;
    border-bottom: 1px solid #e8eef5;
    vertical-align: top;
}
.ps-cargo-table tbody tr:last-child td { border-bottom: none; }
.ps-cargo-table tbody tr:hover { background: #f5f8ff; }
.ps-cargo-table-wrap {
    border: 1px solid #d0ddf0;
    border-radius: .5rem;
    overflow: hidden;
}

/* Cargos pill list (for meta display) */
.ps-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ps-pill-list li {
    background: #e8f0fb;
    color: #004c99;
    border-radius: 2rem;
    padding: .2rem .7rem;
    font-size: .8rem;
    font-weight: 600;
}

@media (max-width: 575px) {
    .ps-detail-header { flex-direction: column; }
    .ps-detail-header-right { align-items: flex-start; }
    .ps-meta-grid { grid-template-columns: repeat(2, 1fr); }
}
