/* ============================================================
   Transparência Portal Widget — style.css
   Prefeitura de Porecatu · Cidade360 / GovBR
   ============================================================ */

/* ── Fontes ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Barlow+Semi+Condensed:wght@500;600&display=swap');

/* ── Variáveis padrão ─────────────────────────────────────── */
.tpor-widget {
    --tpor-gap:   16px;
    --tpor-col-d: 3;
    --tpor-col-t: 2;
    --tpor-col-m: 1;
    --tpor-font-body:    'Source Sans 3', sans-serif;
    --tpor-font-title:   'Barlow Semi Condensed', sans-serif;
    --tpor-radius:       8px;
    --tpor-card-bg:      #ffffff;
    --tpor-card-shadow:  0 2px 8px rgba(0,0,0,.08);
    --tpor-card-shadow-hover: 0 6px 20px rgba(0,0,0,.14);
    --tpor-link-color:   #1a1a2e;
    --tpor-link-hover:   #1565C0;
    --tpor-border:       #e8eaf0;
    --tpor-bg-widget:    transparent;
    font-family: var(--tpor-font-body);
    background: var(--tpor-bg-widget);
}

/* ── Cabeçalho ─────────────────────────────────────────────── */
.tpor-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 3px solid #1565C0;
}
.tpor-title {
    font-family: var(--tpor-font-title);
    font-size: 1.7rem;
    font-weight: 700;
    color: #0d1b2a;
    margin: 0 0 4px;
    line-height: 1.2;
    letter-spacing: -.3px;
}
.tpor-subtitle {
    font-size: .95rem;
    color: #546e7a;
    margin: 0;
}

/* ── Campo de busca ─────────────────────────────────────────── */
.tpor-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f7fa;
    border: 1.5px solid #cfd8e3;
    border-radius: 40px;
    padding: 8px 16px;
    margin-bottom: 20px;
    transition: border-color .2s, box-shadow .2s;
}
.tpor-search-wrap:focus-within {
    background: #fff;
    border-color: #1565C0;
    box-shadow: 0 0 0 3px #1565C022;
}
.tpor-search-icon { font-size: 1rem; flex-shrink: 0; }
.tpor-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--tpor-font-body);
    font-size: .95rem;
    color: #1a1a2e;
    outline: none;
}
.tpor-search-input::placeholder { color: #90a4ae; }
.tpor-search-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #90a4ae;
    font-size: .85rem;
    padding: 0 4px;
    line-height: 1;
    transition: color .2s;
}
.tpor-search-clear:hover { color: #e53935; }

.tpor-no-results {
    text-align: center;
    color: #78909c;
    font-size: .95rem;
    padding: 24px 0;
}

/* ── Grade de categorias ───────────────────────────────────── */
.tpor-grid {
    display: grid;
    grid-template-columns: repeat(var(--tpor-col-d), 1fr);
    gap: var(--tpor-gap);
}

@media (max-width: 1024px) {
    .tpor-grid { grid-template-columns: repeat(var(--tpor-col-t), 1fr); }
}
@media (max-width: 600px) {
    .tpor-grid { grid-template-columns: repeat(var(--tpor-col-m), 1fr); }
}

/* ── Card de categoria ─────────────────────────────────────── */
.tpor-category-card {
    background: var(--tpor-card-bg);
    border: 1px solid var(--tpor-border);
    border-radius: var(--tpor-radius);
    box-shadow: var(--tpor-card-shadow);
    overflow: hidden;
    transition: box-shadow .25s, transform .2s;
    display: flex;
    flex-direction: column;
}
.tpor-category-card:hover {
    box-shadow: var(--tpor-card-shadow-hover);
    transform: translateY(-2px);
}

/* Cabeçalho do card */
.tpor-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--tpor-border);
}
.tpor-cat-icon { font-size: 1.1rem; flex-shrink: 0; }
.tpor-cat-label {
    font-family: var(--tpor-font-title);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .2px;
    line-height: 1.3;
}

/* Lista de links */
.tpor-link-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
}
.tpor-link-item {
    border-bottom: 1px solid #f0f2f5;
}
.tpor-link-item:last-child { border-bottom: none; }
.tpor-link-item a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: .875rem;
    color: var(--tpor-link-color);
    text-decoration: none;
    transition: background .15s, color .15s, padding-left .15s;
    line-height: 1.4;
}
.tpor-link-item a::before {
    content: '›';
    font-size: 1rem;
    color: #b0bec5;
    flex-shrink: 0;
    transition: color .15s, transform .15s;
}
.tpor-link-item a:hover {
    background: #f0f7ff;
    color: var(--tpor-link-hover);
    padding-left: 20px;
}
.tpor-link-item a:hover::before {
    color: var(--tpor-link-hover);
    transform: translateX(2px);
}

/* ── Estado hidden (busca) ─────────────────────────────────── */
.tpor-link-item.tpor-hidden { display: none; }
.tpor-category-card.tpor-card-empty { display: none; }

/* highlight do termo buscado */
.tpor-highlight {
    background: #fff176;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Lista unificada ───────────────────────────────────────── */
.tpor-unified-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--tpor-border);
    border-radius: var(--tpor-radius);
    overflow: hidden;
}
.tpor-unified-list .tpor-link-item { border-bottom: 1px solid #f0f2f5; }
.tpor-unified-list .tpor-link-item:last-child { border-bottom: none; }
.tpor-unified-list .tpor-link-item a {
    padding: 9px 16px;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tpor-unified-list .tpor-link-item a:hover { background: #f0f7ff; color: var(--tpor-link-hover); }
.tpor-li-cat {
    font-size: .72rem;
    font-weight: 600;
    background: #e3f2fd;
    color: #1565C0;
    border-radius: 20px;
    padding: 1px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
