/* ============================================================
 * Homepage Premium — GovBR Prefeitura
 * Versão 2.0 — Design System Modernizado
 * ============================================================ */

/* ── Reset de links globais (elimina sublinhados do browser) ── */
.entry-content a:not(.wp-block-button__link):not(.btn):not(.govbr-stat-card),
.site-main a:not(.wp-block-button__link):not(.btn):not(.govbr-stat-card):not(.premium-access-card):not(.hp-news-hero):not(.hp-news-list-item) {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* ── Cards de Acesso Rápido (Serviços / Governança) ── */
.premium-access-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 1.5rem 1rem;
    min-height: 150px;
    border: 1px solid #cbd5e1; /* Borda clareada conforme pedido (Slate 300) */
    border-radius: 16px; /* Mais arredondado */
    text-align: center;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05); /* Sombra estilo Tailwind shadow-md */
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Faixa de cor sutil no topo */
.premium-access-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--portal-primary-hex, #1351B4), var(--portal-accent-hex, #0ea5e9));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    border-radius: 16px 16px 0 0;
}

.premium-access-card:hover::before {
    transform: scaleX(1);
}

.premium-access-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(var(--portal-primary-rgb, 19, 81, 180), 0.14);
    border-color: rgba(var(--portal-primary-rgb, 19, 81, 180), 0.25);
}

.icon-badge-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #e8f0fe 0%, #d1e3ff 100%);
    border-radius: 50%;
    margin: 0 auto 0.9rem auto;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(var(--portal-primary-rgb, 19, 81, 180), 0.12);
}

.premium-access-card:hover .icon-badge-premium {
    background: linear-gradient(135deg, var(--portal-primary-hex, #1351B4) 0%, var(--portal-accent-hex, #0ea5e9) 100%);
    box-shadow: 0 8px 20px rgba(var(--portal-primary-rgb, 19, 81, 180), 0.35);
    transform: scale(1.08) rotate(-3deg);
}

.icon-badge-premium i {
    font-size: 1.5rem;
    color: var(--portal-primary-hex, #1351B4);
    transition: color 0.3s ease;
}

.premium-access-card:hover .icon-badge-premium i {
    color: #ffffff;
}

.premium-access-card h4 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    text-decoration: none;
    transition: color 0.3s ease;
    letter-spacing: -0.01em;
}

.premium-access-card:hover h4 {
    color: var(--portal-primary-hex, #1351B4);
}

/* ── Seção "Diário Oficial" — título  ── */
.wp-block-separator+section h2,
section.container h2 {
    font-weight: 800;
    font-size: 1.4rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

section.container h2 i {
    color: var(--portal-primary-hex, #1351B4);
}

/* ── Cards Diário Oficial (Stat Cards) ── */
.govbr-stat-cards {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.govbr-stat-card {
    flex: 1 1 220px;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #cbd5e1; /* Borda clareada conforme pedido (Slate 300) */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    padding: 1.4rem 1.6rem;
    text-decoration: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    border-left: 4px solid var(--portal-primary-hex, #1351B4);
    position: relative;
    overflow: hidden;
}

.govbr-stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(19, 81, 180, 0.03) 0%, transparent 60%);
    pointer-events: none;
}

.govbr-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(var(--portal-primary-rgb, 19, 81, 180), 0.15);
    text-decoration: none;
}

.govbr-stat-card--accent-blue {
    border-left-color: var(--portal-accent-hex, #0ea5e9);
}

.govbr-stat-card--accent-green {
    border-left-color: var(--portal-success-hex, #10b981);
}

.govbr-stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--portal-primary-rgb, 19, 81, 180), 0.1);
    color: var(--portal-primary-hex, #1351B4);
    flex-shrink: 0;
    font-size: 1.3rem;
    transition: all 0.2s ease;
}

.govbr-stat-card:hover .govbr-stat-card__icon {
    background: var(--portal-primary-hex, #1351B4);
    color: #fff;
}

.govbr-stat-card--accent-blue .govbr-stat-card__icon {
    background: rgba(14, 165, 233, 0.12);
    color: var(--portal-accent-hex, #0ea5e9);
}

.govbr-stat-card--accent-green .govbr-stat-card__icon {
    background: rgba(16, 185, 129, 0.12);
    color: var(--portal-success-hex, #10b981);
}

.govbr-stat-card--accent-blue:hover .govbr-stat-card__icon {
    background: var(--portal-accent-hex, #0ea5e9);
    color: #fff;
}

.govbr-stat-card--accent-green:hover .govbr-stat-card__icon {
    background: var(--portal-success-hex, #10b981);
    color: #fff;
}

.govbr-stat-card__number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--portal-primary-hex, #1351B4);
    letter-spacing: -0.02em;
}

.govbr-stat-card--accent-blue .govbr-stat-card__number {
    color: var(--portal-accent-hex, #0ea5e9);
}

.govbr-stat-card--accent-green .govbr-stat-card__number {
    color: var(--portal-success-hex, #10b981);
}

.govbr-stat-card__label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    margin-bottom: 0.2rem;
}

.govbr-stat-card__sublabel {
    font-size: 0.8rem;
    color: #64748b;
    text-decoration: none;
}

/* ── Botões "Ver todos" (Diário Oficial, Licitações, LRF) ── */
.govbr-stat-cards~p a,
.govbr-stat-cards~div a,
section.container a.fw-bold,
.d-flex a.fw-bold,
.wp-block-column>p>strong>a,
.wp-block-column>p>a,
.wp-block-column>p.has-text-align-center>a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #f1f5f9;
    color: var(--portal-primary-hex, #1351B4) !important;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    margin-top: 1rem;
}

.govbr-stat-cards~p a:hover,
.govbr-stat-cards~div a:hover,
section.container a.fw-bold:hover,
.d-flex a.fw-bold:hover,
.wp-block-column>p>strong>a:hover,
.wp-block-column>p>a:hover,
.wp-block-column>p.has-text-align-center>a:hover {
    background: var(--portal-primary-hex, #1351B4);
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(var(--portal-primary-rgb, 19, 81, 180), 0.25);
    transform: translateY(-2px);
    gap: 12px;
}

.govbr-stat-cards~p a::after,
.govbr-stat-cards~div a::after,
section.container a.fw-bold::after,
.d-flex a.fw-bold::after,
.wp-block-column>p>strong>a::after,
.wp-block-column>p>a::after,
.wp-block-column>p.has-text-align-center>a::after {
    content: '→';
    font-family: Arial, sans-serif;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.govbr-stat-cards~p a:hover::after,
.govbr-stat-cards~div a:hover::after,
section.container a.fw-bold:hover::after,
.d-flex a.fw-bold:hover::after,
.wp-block-column>p>strong>a:hover::after,
.wp-block-column>p>a:hover::after,
.wp-block-column>p.has-text-align-center>a:hover::after {
    transform: translateX(4px);
}

/* Evitar que afete botões que já tenham classes como .btn ou .wp-block-button */
.wp-block-button__link {
    background: var(--portal-primary-hex, #1351B4) !important;
    color: white !important;
}

/* ── Notícias ── */
.news-badge-wrapper a {
    display: inline-block;
    background-color: #e0f2fe;
    color: #0369a1;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.news-card-premium {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
}

.news-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--portal-success-hex, #10b981), var(--portal-accent-hex, #0ea5e9));
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.news-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.news-card-premium:hover::before {
    opacity: 1;
}

/* ── Licitações e LRF ── */
.dynamic-list-row {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.3s ease, transform 0.3s ease, padding-left 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    border-radius: 8px;
    margin: 2px 6px;
}

.dynamic-list-row:last-child {
    border-bottom: none;
}

.dynamic-list-row:hover {
    background-color: #f8fafc;
    padding-left: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.dynamic-list-row .wp-block-post-title a {
    text-decoration: none !important;
    color: #1e293b;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.4;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-list-row .wp-block-post-title a::before {
    content: '📄';
    font-size: 1.1rem;
    filter: grayscale(100%) opacity(0.8);
    transition: filter 0.2s ease;
}

.dynamic-list-row .wp-block-post-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.dynamic-list-row:hover .wp-block-post-title a {
    color: var(--portal-primary-hex, #1351B4) !important;
}

.dynamic-list-row:hover .wp-block-post-title a::before {
    filter: none;
}

/* Agrupa título + data em coluna, eliminando o salto visual */
.dynamic-list-row .wp-block-post-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dynamic-list-row .wp-block-post-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* Badges modernizados */
.badge-status-aberto {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    min-width: 90px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    letter-spacing: 0.03em;
    border: 1px solid rgba(22, 101, 52, 0.2);
}

.badge-status-encerrado {
    background-color: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    min-width: 90px;
    text-align: center;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    border: 1px solid #cbd5e1;
}

/* ── Títulos de seção com acento ── */
.acesso-rapido-section h2.wp-block-heading,
.wp-block-group h2.wp-block-heading {
    position: relative;
}

/* ── Arredondar fundos de grupos (a div que engloba tudo) ── */
.wp-block-group.has-background {
    border-radius: 24px;
}

/* ── Links gerais dentro dos cards de lista (Licitações / LRF) ── */
.wp-block-query-loop a,
.wp-block-post-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.wp-block-query-loop a:hover,
.wp-block-post-title a:hover {
    color: var(--portal-primary-hex, #1351B4);
}

.unidades-atendimento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

/* ── Responsividade do Grid de Unidades de Atendimento ── */
@media (max-width: 992px) {
    .govbr-unidades-shortcode > div {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 576px) {
    .govbr-unidades-shortcode > div {
        grid-template-columns: 1fr !important;
    }
}