/* ============================================================
 * GOVBR PREMIUM ENHANCEMENTS — Prefeitura de Brasília
 * Fixes: dark/light mode, cards, responsiveness, animations
 * ============================================================ */
/* GovBR Premium Global Stylesheet (Master Bundle)
 * 
 * Imports modular component styles following SOLID principles.
 */


/* ── Root Tokens (Light Mode) ─────────────────────────────── */
:root {
  --gov-primary: var(--portal-primary-hex, #1351B4);
  --gov-primary-dark: #0c326f;
  --gov-secondary: #155BCB;
  --gov-accent: var(--portal-accent-hex, #0ea5e9);
  --gov-success: var(--portal-success-hex, #10b981);
  --gov-green: #168821;
  --gov-yellow: #FFCD07;
  --gov-red: #E52207;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --bg-color: #ffffff;
  --section-bg: #f8fafc;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --card-border: #e4e8ed;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.07);
  --card-shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: #e2e8f0;
}



body, body.wp-theme-govbr, body.wp-theme-govbr-premium {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #ffffff;
}

/* ── Reset Global de Links (Elimina sublinhados do browser) ── */
a {
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: none;
}

/* ── Hero Banner ──────────────────────────────────────────── */
.hero-banner-home.wp-block-cover {
  min-height: 550px;
  position: relative;
}
.hero-banner-home .wp-block-cover__image-background {
  object-fit: cover;
  object-position: center 35%;
}
.hero-banner-home .wp-block-cover__inner-container {
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.hero-banner-home h1.wp-block-heading {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
  color: #ffffff;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  opacity: 0.95;
  margin-bottom: 2rem;
  color: #f0f0f0;
}
.wp-block-cover .wp-block-button .wp-block-button__link {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wp-block-cover .wp-block-button .wp-block-button__link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* ── Quick Access Cards ───────────────────────────────────── */
.acesso-rapido-section {
  background: var(--section-bg);
  padding: 4rem 0;
}
.acesso-rapido-section > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
body .servico-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.25,0.8,0.25,1), box-shadow 0.3s ease;
  text-align: center;
  height: 100%;
}
body .servico-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--gov-primary);
}
body .servico-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gov-primary);
  margin-bottom: 0.5rem;
}
body .servico-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
body .servico-card .wp-block-button__link {
  border-radius: 30px;
  background: var(--gov-primary);
  color: #fff;
  font-size: 0.9rem;
  padding: 10px 24px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
body .servico-card .wp-block-button__link:hover {
  background: var(--gov-primary-dark);
  transform: translateY(-1px);
}

/* ── News Grid ────────────────────────────────────────────── */
.news-grid {
  max-width: 1200px;
  margin: 0 auto;
}
.news-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}
.news-card .wp-block-post-featured-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}
.news-card .wp-block-post-featured-image {
  margin-bottom: 0;
}
.news-card .wp-block-post-date {
  color: var(--gov-primary);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}
.news-card .wp-block-post-title a {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.4;
  text-decoration: none;
}
.news-card .wp-block-post-title a:hover {
  color: var(--gov-primary);
}
.news-card .wp-block-post-excerpt p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}
.news-card .wp-block-post-excerpt .wp-block-post-excerpt__more-link {
  color: var(--gov-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ── Single Posts ─────────────────────────────────────────── */
.entry-content {
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 1rem;
}
.entry-title {
  color: var(--text-primary);
}
.entry-meta, .entry-footer {
  color: var(--text-muted);
}

/* ── ACF Transparent Tables / Dark Mode Fix ───────────────── */
.br-table {
  background: transparent;
  color: var(--text-primary);
  border-collapse: collapse;
}
.br-table td, .br-table th {
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
}
.br-table tbody tr:nth-child(even) {
  background: var(--section-bg);
}

/* ── Cards ACF ─────────────────────────────────────────────── */
.br-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}
.br-card h3 {
  color: var(--gov-primary);
}

/* ── Ouvidoria Hero Text Fix (contrast) ────────────────────── */
.ouvidoria-hero {
  background: linear-gradient(135deg, #0c326f 0%, var(--portal-primary-hex, #1351B4) 60%, #2067d1 100%);
  color: #ffffff;
}
.ouvidoria-hero h1,
.ouvidoria-hero p,
.ouvidoria-hero * {
  color: #ffffff;
}

/* ── Ouvidoria Cards Dark Mode ─────────────────────────────── */
[data-color-mode="dark"] .ouv-card {
  background: rgba(30,43,60,0.9);
  border-color: rgba(255,255,255,0.1);
}
[data-color-mode="dark"] .ouv-card h3 {
  color: #e8edf5;
}
[data-color-mode="dark"] .ouv-card p {
  color: #94a3b8;
}
[data-color-mode="dark"] .ouvidoria-form-section {
  background: var(--card-bg);
}
[data-color-mode="dark"] .ouvidoria-form-section h2 {
  color: #93c5fd;
}


/* ── Section Utility ───────────────────────────────────────── */
.wp-block-group + .wp-block-group {
  margin-top: 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-banner-home.wp-block-cover {
    min-height: 400px;
  }
  .acesso-rapido-section .wp-block-columns {
    grid-template-columns: 1fr 1fr;
  }
  .news-grid .wp-block-post-template {
    grid-template-columns: 1fr;
  }
  .servico-card {
    margin-bottom: 1rem;
  }
}
@media (max-width: 480px) {
  .hero-banner-home h1.wp-block-heading {
    font-size: 1.8rem;
  }
  .acesso-rapido-section .wp-block-columns {
    grid-template-columns: 1fr;
  }
  .ouvidoria-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Scroll Animation Utility ─────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.servico-card, .news-card {
  animation: fadeInUp 0.5s ease both;
}
.wp-block-columns .wp-block-column:nth-child(1) .servico-card { animation-delay: 0.1s; }
.wp-block-columns .wp-block-column:nth-child(2) .servico-card { animation-delay: 0.2s; }
.wp-block-columns .wp-block-column:nth-child(3) .servico-card { animation-delay: 0.3s; }
.wp-block-columns .wp-block-column:nth-child(4) .servico-card { animation-delay: 0.4s; }

/* ── Tags / Badges ─────────────────────────────────────────── */
.br-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--gov-primary);
  color: #fff;
}
.br-tag.bg-success { background: var(--gov-green); }
.br-tag.bg-warning { background: var(--gov-yellow); color: #333; }
.br-tag.bg-danger  { background: var(--gov-red); }

/* ── Buttons Global ────────────────────────────────────────── */
.br-button.primary {
  background: var(--gov-primary);
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.br-button.primary:hover {
  background: var(--gov-primary-dark);
  transform: translateY(-2px);
}
.br-button.secondary {
  background: transparent;
  color: var(--gov-primary);
  border: 2px solid var(--gov-primary);
  padding: 8px 22px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.br-button.secondary:hover {
  background: var(--gov-primary);
  color: #fff;
  transform: translateY(-2px);
}
.br-button.small {
  padding: 6px 16px;
  font-size: 0.85rem;
}

/* ── Transparency Page ─────────────────────────────────────── */
.transparencia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.transparencia-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.transparencia-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .ouvidoria-hero, .acesso-rapido-section { display: none; }
  .entry-content { color: #000; }
}



/* ── Bug Fixes (Session 2) ─────────────────────────────────── */

/* Logo fix - Target wrappers as well as the image */
body .header-logo {
  display: flex;
  align-items: center;
}
body .header-logo [class*="custom-logo-link"],
body .wp-block-site-logo {
  display: flex;
  align-items: center;
  height: 100%;
}
body .header-logo [class*="custom-logo-link"] img,
body .wp-block-site-logo img,
body img[class*="custom-logo"] {
  height: 140px;
  width: auto;
  max-width: 350px;
  object-fit: contain;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  body .header-logo [class*="custom-logo-link"] img,
  body .wp-block-site-logo img,
  body img[class*="custom-logo"] {
    max-height: 50px;
    max-width: 200px;
  }
}

/* Servico Card styles */
.servico-card {
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1.5rem;
}
.servico-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.1);
}

/* Hide broken menu placeholders from parent theme and login button */
.menu-logos,
.menu-links,
.menu-info,
.header-login {
  display: none;
}

/* Search results and post images fix */
.search-results .wp-block-post-image img,
.wp-block-query .wp-block-post-image img {
  height: 200px;
  object-fit: cover;
}

/* Equal height for news cards */
body .news-grid ul.wp-block-post-template {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
body .news-grid .wp-block-post {
  display: flex;
  flex: 1 1 30%;
}
body .news-grid .news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
body .news-grid .news-card > .wp-block-group {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Swiper Carousel */
.swiper-hero { width: 100%; height: 550px; position: relative; }
.swiper-slide { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.swiper-slide img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.swiper-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.55); z-index: 2; }
.swiper-content { position: relative; z-index: 3; text-align: center; color: #ffffff; max-width: 800px; padding: 2rem; margin: 0 auto; }
.swiper-content h2 { font-size: 2.8rem; font-weight: 800; margin-bottom: 1rem; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.9); }
.swiper-content p { font-size: 1.35rem; margin-bottom: 2rem; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.9); font-weight: 500; }
.swiper-content .btn { display: inline-block; padding: 12px 30px; border-radius: 30px; background: var(--portal-primary-hex, #1351B4); color: #ffffff; text-decoration: none; font-weight: 700; margin: 0 10px; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.swiper-content .btn:hover { background: #0b3475; transform: translateY(-2px); }
.swiper-content .btn-outline { background: rgba(255,255,255,0.15); border: 2px solid #ffffff; color: #ffffff; }
.swiper-content .btn-outline:hover { background: rgba(255,255,255,0.35); }


/* Quick Access gap fix */
.acesso-rapido-section .wp-block-columns {
  gap: 2rem;
}
.br-card {
  padding: 2rem;
}

/* News excerpt visibility and layout fix */
.wp-block-post-excerpt {
  display: block;
  visibility: visible;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.wp-block-post-excerpt__more-text {
  color: var(--gov-primary);
  font-weight: 600;
}

/* News inner container padding */
.wp-block-post .wp-block-group {
  padding: 1.5rem;
}




/* WCAG 1.4.3 / 1.4.1: meta de categorias e tags em listagens e busca.
   Texto #4a5568 (7,5:1 sobre branco) e links sublinhados, para não depender só da cor. */
.entry-footer .cat-links,
.entry-footer .tags-links {
  color: #4a5568;
}
.entry-footer .cat-links a,
.entry-footer .tags-links a {
  text-decoration: underline !important;
}

/* B26: o widget VLibras (terceiro) é focável pelo teclado; garante indicador de foco visível. */
#vlibras-access-wrapper:focus,
#vlibras-access-wrapper:focus-visible,
[vw] [vw-access-button]:focus-visible,
[vw] [vp-widget]:focus-visible,
[vw] button:focus-visible {
    outline: 3px solid #1351b4 !important;
    outline-offset: 2px !important;
}
