/* Economio Market - componentes das páginas internas (usa os tokens de portal.css) */

/* ---------- Rodapé (layout.js) ---------- */
.footer-brand {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}

.footer-brand em {
  font-style: normal;
  color: var(--accent);
}

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-cols .footer-links {
  flex-direction: column;
  gap: 6px;
}

.footer-cols strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 2px;
}

/* ---------- Topo de página ---------- */
.page-intro {
  max-width: 70ch;
  margin-top: 4px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* ---------- Cards de notícia ---------- */
.news-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.news-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  transition: border-color .15s;
}

.news-card:hover {
  border-color: var(--brand);
}

.news-card:hover h3 {
  text-decoration: underline;
}

.news-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.3;
}

.news-card p {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.news-card .meta-row {
  margin-top: auto;
}

.cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--brand);
}

.cat-tag.cat-commodities {
  color: #a16207;
}

.cat-tag.cat-crypto {
  color: #7c3aed;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cat-tag.cat-commodities {
    color: #f6c453;
  }

  :root:not([data-theme="light"]) .cat-tag.cat-crypto {
    color: #b794f6;
  }
}

.news-card.featured {
  grid-column: 1 / -1;
  padding: 26px 28px;
  border-top: 4px solid var(--brand);
}

.news-card.featured h3 {
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 700;
}

.news-card.featured p {
  font-size: 1rem;
  -webkit-line-clamp: 4;
}

.load-more {
  display: block;
  margin: 20px auto 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 14px var(--font-sans);
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
}

.load-more:hover {
  border-color: var(--brand);
}

.load-more[hidden] {
  display: none;
}

/* ---------- Artigo ---------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 44px;
}

.article-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  font-weight: 700;
  margin: 12px 0 14px;
  text-wrap: balance;
}

.article-head .deck {
  font-size: 1.15rem;
  color: var(--muted);
  line-height: 1.5;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  margin: 20px 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.byline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.byline img {
  border-radius: 8px;
}

.byline strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.share {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.share a,
.share button {
  display: inline-grid;
  place-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 600 12px var(--font-sans);
  text-decoration: none;
  cursor: pointer;
}

.share a:hover,
.share button:hover {
  border-color: var(--brand);
}

.prose {
  font-size: 1.08rem;
  line-height: 1.75;
  max-width: 70ch;
}

.prose>*+* {
  margin-top: 1em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-serif);
  line-height: 1.25;
  margin-top: 1.6em;
}

.prose>h2:first-child,
.prose>h3:first-child {
  margin-top: 0;
}

.prose h2 {
  font-size: 1.55rem;
}

.prose h3 {
  font-size: 1.3rem;
}

.prose h4 {
  font-size: 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li+li {
  margin-top: .35em;
}

.prose a {
  color: var(--brand);
}

.prose .ticker {
  font-family: var(--font-mono);
  font-size: .88em;
  font-weight: 600;
  background: var(--surface-2);
  padding: 0 4px;
  border-radius: 4px;
}

.article-foot {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mini-list {
  list-style: none;
}

.mini-list li+li {
  border-top: 1px solid var(--line);
}

.mini-list a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
}

.mini-list a:hover strong {
  text-decoration: underline;
}

.mini-list strong {
  display: block;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.3;
  margin-top: 2px;
}

.quote-rows {
  list-style: none;
}

.quote-rows li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  font-size: 14px;
}

.quote-rows li+li {
  border-top: 1px solid var(--line);
}

/* ---------- Páginas de setor ---------- */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.quote-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.quote-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quote-card .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quote-card .sub {
  font-size: 12px;
  color: var(--muted);
}

.quote-card .price {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 6px;
}

.quote-card.big {
  grid-column: span 2;
}

.quote-card.big .price {
  font-size: 1.9rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table .num {
  text-align: right;
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

.section-gap {
  margin-top: 28px;
}

.insight {
  border-left: 4px solid var(--accent);
}

.insight .prose {
  font-size: 1rem;
}

/* ---------- Publicidade ---------- */
.ad-slot:empty {
  display: none;
}

.ad-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 12px;
}

.ad-label span:first-child {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border: 1px solid var(--line);
  padding: 0 6px;
  border-radius: 3px;
}

.ad-rail,
.ad-box,
.ad-inline {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.deal-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.deal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  min-width: 0;
}

.deal-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.deal-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.deal-off {
  position: absolute;
  top: 6px;
  left: 6px;
  background: #0a7d3b;
  color: #fff;
  font: 700 11px var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
}

.deal-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.deal-store {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.deal-title {
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal:hover .deal-title {
  text-decoration: underline;
}

.deal-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.deal-price b {
  font-family: var(--font-mono);
  font-size: 15px;
}

.deal-price s {
  font-size: 12px;
  color: var(--muted);
}

.deal-coupon {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  border: 1px dashed var(--brand);
  border-radius: 4px;
  padding: 0 6px;
}

.deal-compact {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.deal-compact .deal-img {
  width: 72px;
  flex-shrink: 0;
}

.deal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.ad-more:hover {
  text-decoration: underline;
}

.ad-house::before {
  content: "Publicidade";
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.house-ad {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(135deg, #142a6b, #0b0d10);
  color: #f2f2f2;
  border-radius: var(--radius);
  padding: 20px 22px;
  text-decoration: none;
}

.house-ad strong {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  line-height: 1.25;
}

.house-ad span {
  font-size: 14px;
  color: #c3c8d0;
}

.house-ad .house-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #ffc107;
}

.house-ad .house-cta {
  align-self: flex-start;
  margin-top: 6px;
  background: #ffc107;
  color: #111;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
}

li.ad-slot {
  list-style: none;
}

.news-list li.ad-inline {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 20px;
}

.news-cards .ad-inline {
  border-style: dashed;
}

/* ---------- Formulários ---------- */
.form-card {
  max-width: 460px;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
}

.field input {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: 500 15px var(--font-sans);
  padding: 11px 12px;
  border-radius: 8px;
}

.field input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  border: 0;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  background: var(--down);
  color: #fff;
}

.form-msg {
  font-size: 13px;
  margin-top: 10px;
  min-height: 1.2em;
}

.form-msg.error {
  color: var(--down);
}

/* ---------- Páginas de texto ---------- */
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1060px) {
  .deal-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .deal-rail .deal:nth-child(n+5) {
    display: none;
  }
}

@media (max-width: 960px) {

  .article-layout,
  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .article {
    padding: 22px 18px;
  }

  .prose {
    font-size: 1.02rem;
  }

  .deal-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-card.big {
    grid-column: 1 / -1;
  }

  .sector-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-card .price {
    font-size: 1.1rem;
  }

  .quote-card.big .price {
    font-size: 1.5rem;
  }

  .news-card.featured {
    padding: 20px;
  }

  .footer-cols {
    gap: 20px 32px;
  }
}

.article.prose {
  max-width: none;
}

.see-all-group {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .header-inner {
    position: relative;
  }

  /* No celular o "Entrar" fica na linha da marca e o menu rola de lado. */
  .main-nav .btn-login {
    position: absolute;
    top: 12px;
    right: 16px;
    margin: 0;
  }

  .quote-card .top {
    flex-wrap: wrap;
  }

  .quote-card .name {
    white-space: normal;
  }
}
