/* ============================================================
   ABRAG Portal — Folha de Estilos Principal
   Paleta: azul marinho #1A2A4A | verde #2A7A3B | cinza claro #F4F6F8
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #1A2A4A;
  --navy-dark:  #111E35;
  --navy-mid:   #243660;
  --green:      #2A7A3B;
  --green-light:#34A34F;
  --green-pale: #E8F5EC;
  --accent:     #2ECC71;
  --gray-bg:    #F4F6F8;
  --gray-line:  #DDE3EC;
  --gray-text:  #6B7A99;
  --white:      #FFFFFF;
  --text:       #1C2B3A;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --shadow-sm: 0 1px 4px rgba(26,42,74,.08);
  --shadow-md: 0 4px 16px rgba(26,42,74,.12);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--gray-bg);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }

img { display: block; max-width: 100%; height: auto; }

ul { list-style: none; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Botões ---- */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}
.btn--primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.btn--primary:hover { background: var(--green-light); border-color: var(--green-light); color: var(--white); }
.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
  font-size: .8rem;
}
.btn--outline:hover { background: var(--navy); color: var(--white); }
.btn--full { width: 100%; text-align: center; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge--jurisprudencia { background: #1A2A4A; color: #fff; }
.badge--regulacao      { background: #2A7A3B; color: #fff; }
.badge--mercado        { background: #B45309; color: #fff; }
.badge--guias          { background: #0E7490; color: #fff; }

/* ---- Topbar ---- */
.topbar {
  background: var(--navy-dark);
  color: rgba(255,255,255,.7);
  font-size: .75rem;
  padding: 6px 0;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.social-icon-img { object-fit: contain; flex-shrink: 0; display: block; }
.topbar__links { display: flex; gap: 14px; align-items: center; }
.topbar__links a { color: rgba(255,255,255,.6); transition: color .2s; display: inline-flex; align-items: center; }
.topbar__links a:hover { color: var(--accent); }
.topbar__links svg, .topbar__links .social-icon-img { width: 16px; height: 16px; }

/* ---- Header ---- */
.header {
  background: var(--white);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--navy);
  box-shadow: 0 2px 8px rgba(26,42,74,.1);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header__logo img {
  height: 140px;
  width: auto;
  max-width: 460px;
  object-fit: contain;
}
.header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header__search {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--gray-bg);
  border: 1px solid var(--gray-line);
  border-radius: 6px;
}

/* Dropdown de sugestões */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
}
.search-dropdown__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-line);
  transition: background .15s;
  text-decoration: none;
  color: inherit;
}
.search-dropdown__item:last-child { border-bottom: none; }
.search-dropdown__item:hover { background: var(--gray-bg); }
.search-dropdown__badge {
  flex-shrink: 0;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}
.search-dropdown__title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}
.search-dropdown__date {
  font-size: .72rem;
  color: var(--gray-text);
  margin-top: 2px;
}
.search-dropdown__empty {
  padding: 16px 14px;
  font-size: .85rem;
  color: var(--gray-text);
  text-align: center;
}
.header__search input {
  background: none;
  border: none;
  outline: none;
  padding: 8px 14px;
  color: var(--text);
  font-size: .875rem;
  width: 220px;
}
.header__search input::placeholder { color: var(--gray-text); }
.header__search button {
  background: none;
  border: none;
  padding: 8px 12px;
  color: var(--gray-text);
  cursor: pointer;
  transition: color .2s;
}
.header__search button:hover { color: var(--green); }

/* ---- Nav Categorias ---- */
.nav-cat {
  background: var(--navy-mid);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-cat__list {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-cat__list::-webkit-scrollbar { display: none; }
.nav-cat__list a {
  display: block;
  padding: 12px 18px;
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all .2s;
}
.nav-cat__list a:hover,
.nav-cat__list a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Hero ---- */
.hero {
  background: var(--white);
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--gray-line);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}
.hero__main a { display: block; color: inherit; }
.hero__main a:hover h1 { color: var(--green); }
.hero__img-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/8;
  margin-bottom: 20px;
}
.hero__img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.hero__img-wrap .badge {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: .65rem;
}
.hero__content time {
  font-size: .8rem;
  color: var(--gray-text);
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
}
.hero__content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--navy);
  margin-bottom: 12px;
  transition: color .2s;
}
.hero__lead {
  font-size: 1rem;
  color: #4A5568;
  line-height: 1.65;
  margin-bottom: 16px;
}
.read-more {
  font-size: .85rem;
  font-weight: 600;
  color: var(--green);
}

.hero__side { border-left: 1px solid var(--gray-line); padding-left: 28px; }
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gray-text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--navy);
}

/* ---- Card Side ---- */
.card--side {
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-line);
}
.card--side:last-child { border-bottom: none; }
.card--side a { display: flex; flex-direction: column; gap: 6px; }
.card--side a:hover h3 { color: var(--green); }
.card--side h3 {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--navy);
  transition: color .2s;
}
.card--side time {
  font-size: .72rem;
  color: var(--gray-text);
  display: block;
  font-weight: 500;
}

/* ---- Main Layout ---- */
.main-content { padding: 36px 0; }
.main-content__inner {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  align-items: start;
}

/* ---- Section Title ---- */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--navy);
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--green);
}

/* ---- Card News ---- */
.news-grid__items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.search-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-text);
}
.search-empty strong { display: block; font-size: 1rem; color: var(--navy); margin-bottom: 8px; }
.card--news {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.card--news:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card--news a { display: block; color: inherit; height: 100%; }
.card--news a:hover h3 { color: var(--green); }
.card__img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card__img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card--news:hover .card__img-wrap img { transform: scale(1.03); }
.card__img-wrap .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: .62rem;
}
.card__body { padding: 16px; }
.card__body time {
  font-size: .75rem;
  color: var(--gray-text);
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}
.card__body h3 {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--navy);
  margin-bottom: 10px;
  transition: color .2s;
}
.card__body p { font-size: .83rem; color: #4A5568; line-height: 1.6; margin-bottom: 12px; }
.card__body .read-more { font-size: .78rem; }

/* ---- Benefícios ---- */
.beneficios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 8px;
}
.beneficio-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  transition: box-shadow .2s, transform .2s;
}
.beneficio-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.beneficio-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.beneficio-card__logo {
  height: 64px;
  max-width: 220px;
  width: auto;
  object-fit: contain;
  margin-bottom: 16px;
  display: block;
}
.beneficio-card__logo--sm { height: 45px; }
.beneficio-card h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.beneficio-card p { font-size: .85rem; color: #4A5568; line-height: 1.65; margin-bottom: 14px; }
.beneficio-card a.read-more { font-size: .8rem; font-weight: 600; }

/* ---- Paginação ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid var(--gray-line);
  background: var(--white);
  transition: all .2s;
}
.pagination__btn:hover,
.pagination__btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.pagination__dots { color: var(--gray-text); padding: 0 4px; }
.pagination__prev,
.pagination__next {
  width: auto;
  padding: 0 14px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--green);
}
.pagination__prev:hover,
.pagination__next:hover { color: var(--navy); }

/* ---- Sidebar ---- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar__widget {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar__title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-line);
}
.sidebar__title--stj { border-bottom-color: var(--navy); }
.sidebar__title--bacen { border-bottom-color: var(--green); }

.sidebar__list { display: flex; flex-direction: column; gap: 12px; }
.sidebar__list li a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--text);
  transition: color .2s;
}
.sidebar__list li a:hover { color: var(--green); }
.sidebar__date {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 600;
  color: var(--gray-text);
  padding-top: 1px;
  white-space: nowrap;
  min-width: 72px;
}

/* Indicadores */
.sidebar__widget--indicators { background: var(--navy); color: var(--white); }
.sidebar__widget--indicators .sidebar__title { color: rgba(255,255,255,.6); border-bottom-color: rgba(255,255,255,.15); }
.indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.indicator:last-of-type { border-bottom: none; }
.indicator__label { font-size: .78rem; color: rgba(255,255,255,.7); }
.indicator__value { font-size: .9rem; font-weight: 700; color: var(--white); }
.indicator__value--up { color: #F87171; }
.indicator__value--down { color: var(--accent); }
.indicator__source { font-size: .65rem; color: rgba(255,255,255,.35); margin-top: 10px; }

/* Social links */
.social-links { display: flex; gap: 10px; flex-wrap: wrap; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: opacity .2s, transform .2s;
}
.social-link svg { width: 18px; height: 18px; }
.social-link .social-icon-img { width: 36px; height: 36px; }
.social-link:hover { opacity: .85; transform: translateY(-1px); }
.social-link--instagram { color: #fff; }
.social-link--whatsapp  { background: #25D366; color: #fff; }

/* ---- Ad Banner ---- */
.ad-banner {
  background: var(--white);
  border-top: 1px solid var(--gray-line);
  border-bottom: 1px solid var(--gray-line);
  padding: 16px 0;
}
.ad-banner__slot {
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
  background: #EEF2FF;
  border: 1px dashed #A0AEC0;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-text);
  font-size: .8rem;
}

/* ---- Footer ---- */
.footer { background: var(--navy-dark); color: rgba(255,255,255,.75); }
.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding: 48px 20px 36px;
  max-width: 1200px;
  margin: 0 auto;
}
.footer__brand > img {
  height: 46px;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 14px;
}
.footer__brand p { font-size: .85rem; line-height: 1.7; margin-bottom: 16px; }
.footer__col h4 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 14px;
}
.footer__col ul { display: flex; flex-direction: column; gap: 9px; }
.footer__col ul a { font-size: .85rem; color: rgba(255,255,255,.6); transition: color .2s; }
.footer__col ul a:hover { color: var(--accent); }
.footer__col p { font-size: .82rem; margin-bottom: 12px; }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 16px 20px;
}
.footer__bottom .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer__bottom p { font-size: .75rem; color: rgba(255,255,255,.4); }
.footer__bottom a { color: rgba(255,255,255,.5); }
.footer__bottom a:hover { color: var(--accent); }

/* ============================================================
   PÁGINA DE ARTIGO (artigo.html)
   ============================================================ */

.article-hero {
  background: var(--white);
  padding: 36px 0 0;
}
.article-hero .container { max-width: 860px; }
.breadcrumb {
  font-size: .75rem;
  color: var(--gray-text);
  margin-bottom: 18px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--green); }
.breadcrumb span { color: var(--gray-text); }

.article-header { margin-bottom: 24px; }
.article-header .badge { margin-bottom: 12px; }
.article-header h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 14px;
}
.article-header .subtitle {
  font-size: 1.1rem;
  color: #4A5568;
  line-height: 1.65;
  margin-bottom: 18px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--gray-text);
  padding: 14px 0;
  border-top: 1px solid var(--gray-line);
  border-bottom: 1px solid var(--gray-line);
  margin-bottom: 28px;
}
.article-meta strong { color: var(--text); }

.article-img {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}

.article-main { padding: 40px 0 60px; }
.article-body { max-width: 860px; margin: 0 auto; }

.article-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: #2D3748;
  margin-bottom: 20px;
}
.article-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  margin: 32px 0 14px;
  padding-left: 14px;
  border-left: 4px solid var(--green);
}
.article-body blockquote {
  background: var(--gray-bg);
  border-left: 4px solid var(--navy);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: #4A5568;
}
.article-source {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 30px 0;
  font-size: .82rem;
  color: #1E40AF;
}
.article-source strong { display: block; margin-bottom: 3px; }
.article-source a { color: #1E40AF; text-decoration: underline; }

.article-tags { margin-top: 36px; display: flex; gap: 8px; flex-wrap: wrap; }
.article-tag {
  background: var(--gray-bg);
  color: var(--gray-text);
  border: 1px solid var(--gray-line);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 500;
  transition: all .2s;
}
.article-tag:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

.article-share {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.article-share span { font-size: .85rem; font-weight: 600; color: var(--navy); }

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

/* ── Tablet largo (≤ 1024px) ── */
@media (max-width: 1024px) {
  /* Hero: empilha artigo principal + destaques */
  .hero__inner { grid-template-columns: 1fr; }
  .hero__side {
    border-left: none;
    border-top: 1px solid var(--gray-line);
    padding-left: 0;
    padding-top: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
  .hero__side .section-label { grid-column: 1 / -1; }

  /* Conteúdo principal: 1 coluna, sidebar abaixo em 2 colunas */
  .main-content__inner { grid-template-columns: 1fr; }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  /* Widgets largos ficam sozinhos na linha */
  .sidebar__widget--indicators { grid-column: 1 / -1; }

  /* Footer: 2 colunas */
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer__brand { grid-column: 1 / -1; }
}

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
  /* Header: logo menor, esconde busca */
  .header__logo img { height: 64px; }
  .header__search { display: none; }

  /* Hero: destaques em coluna única */
  .hero__content h1 { font-size: 1.3rem; }
  .hero__side { grid-template-columns: 1fr; }

  /* Grid de cards: 1 coluna */
  .news-grid__items { grid-template-columns: 1fr; }

  /* Sidebar: 1 coluna */
  .sidebar { grid-template-columns: 1fr; }
  .sidebar__widget--indicators { grid-column: auto; }

  /* Footer */
  .footer__inner { grid-template-columns: 1fr; }
  .footer__brand { grid-column: auto; }
  .footer__bottom .container { flex-direction: column; gap: 4px; }

  /* Topbar: oculta links, mantém data */
  .topbar__links { display: none; }

  /* Artigo */
  .article-header h1 { font-size: 1.5rem; }
  .article-meta { gap: 10px; flex-direction: column; align-items: flex-start; }
  .article-img { aspect-ratio: 16/9; }
}

/* ── Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .container { padding: 0 16px; }

  /* Header */
  .header__logo img { height: 48px; }
  .btn--outline { display: none; }

  /* Nav: mais compacta */
  .nav-cat__list a { padding: 10px 12px; font-size: .78rem; }

  /* Hero */
  .hero { padding: 16px 0; }
  .hero__content h1 { font-size: 1.15rem; }
  .hero__lead { font-size: .9rem; }

  /* Cards */
  .card__body h3 { font-size: .88rem; }
  .card__body p { display: none; } /* oculta resumo em telas muito pequenas */

  /* Paginação */
  .pagination { gap: 6px; }
  .pagination__btn { width: 32px; height: 32px; font-size: .8rem; }

  /* Artigo */
  .article-header h1 { font-size: 1.25rem; }
  .article-header .subtitle { font-size: .95rem; }
  .article-body h2 { font-size: 1.1rem; }
  .article-body p { font-size: .95rem; }
}
