/* ==========================================================================
   components.css — componentes de página do portal informativo
   ========================================================================== */

/* ---- Breadcrumb --------------------------------------------------------- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: var(--fs-sm); color: var(--text-invert-muted); padding-block: .25rem 1rem; }
.breadcrumb a { text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb a:hover { color: var(--text-invert); }
.breadcrumb .sep { opacity: .5; }

/* ---- Herói (página inicial) --------------------------------------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 120% at 80% 0%, var(--emerald-700) 0%, var(--emerald-800) 42%, var(--emerald-900) 100%);
  color: var(--text-invert);
}
.hero__art { position: absolute; inset: 0; z-index: -3; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 32%; }
.hero__scrim { position: absolute; inset: 0; z-index: -2; }
.hero__scrim::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(95deg, var(--emerald-900) 4%, rgba(6, 61, 46, .86) 40%, rgba(5, 46, 34, .58) 72%, rgba(5, 46, 34, .68) 100%),
    radial-gradient(75% 90% at 88% 8%, rgba(212, 175, 55, .14), transparent 60%);
}
.hero__inner { position: relative; padding-block: clamp(3rem, 8vw, 6rem); display: grid; gap: 2.5rem; align-items: center; }
.hero__content { min-width: 0; }
.hero h1 { max-width: 14ch; color: var(--text-invert); margin-top: .75rem; }
.hero__lead { font-size: var(--fs-md); max-width: 52ch; color: var(--text-invert-muted); margin-top: 1rem; }
.hero__cta { margin-top: 1.5rem; }
.hero__note { margin-top: 1rem; font-size: var(--fs-sm); color: var(--text-invert-muted); max-width: 52ch; }
.hero__panel {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--hairline-invert);
  border-radius: var(--r-lg); padding: 1.5rem; backdrop-filter: blur(4px);
}
.hero__panel h2 { font-size: var(--fs-md); color: var(--text-invert); margin-bottom: .75rem; }
.hero__panel a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem .25rem; min-height: 48px; border-top: 1px solid var(--hairline-invert);
  color: var(--text-invert); font-weight: 500;
}
.hero__panel a:first-of-type { border-top: 0; }
.hero__panel a .ic { color: var(--gold); width: 18px; height: 18px; }
.hero__panel a:hover { color: var(--gold); }
.hero__panel small { display: block; margin-top: .75rem; color: var(--text-invert-muted); }
@media (min-width: 900px) { .hero__inner { grid-template-columns: 1.15fr .85fr; } }

/* ---- Cabeçalho de página interna ---------------------------------------- */
.page-hero { background: var(--surface-dark); color: var(--text-invert); position: relative; overflow: hidden; isolation: isolate; }
.page-hero::after { content: ""; position: absolute; right: -4%; top: -30%; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(212, 175, 55, .16), transparent 68%); pointer-events: none; }
.page-hero__inner { position: relative; z-index: 2; padding-block: clamp(2rem, 5vw, 3.25rem) clamp(2.25rem, 5vw, 3.5rem); }
.page-hero h1 { font-size: var(--fs-2xl); max-width: 22ch; color: var(--text-invert); margin-top: .5rem; }
.page-hero__lead { color: var(--text-invert-muted); max-width: 62ch; margin-top: .85rem; font-size: var(--fs-md); }
.page-hero__lead a { color: var(--gold); text-decoration: underline; }
.page-hero__art { position: absolute; inset: 0; z-index: 0; }
.page-hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 34%; }
.page-hero__scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(95deg, var(--emerald-900) 8%, rgba(6, 61, 46, .88) 46%, rgba(5, 46, 34, .66) 100%); }

/* ---- Avisos ------------------------------------------------------------- */
.aviso-idade {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: 1rem 1.2rem; border-radius: var(--r); border: 1px solid var(--hairline-gold);
  background: var(--gold-050); font-size: var(--fs-sm);
}
.aviso-idade .badge { margin-top: .1rem; }
.aviso-idade p { color: var(--text); }
.section--dark .aviso-idade { background: rgba(255, 255, 255, .06); border-color: var(--hairline-invert); }
.section--dark .aviso-idade p { color: var(--text-invert); }
.aviso-externo { font-size: var(--fs-sm); color: var(--text-soft); margin-bottom: .5rem; }
.section--dark .aviso-externo, .card--dark .aviso-externo { color: var(--text-invert-muted); }

.callout { display: flex; gap: .85rem; padding: 1.1rem 1.25rem; border-radius: var(--r); border: 1px solid var(--hairline); background: var(--surface-2); font-size: var(--fs-sm); }
.callout .ic { width: 22px; height: 22px; flex: none; margin-top: .1rem; }
.callout p { color: var(--text-muted); }
.callout--gold { background: var(--gold-050); border-color: var(--hairline-gold); }
.callout--gold .ic { color: var(--gold-700); }
.callout--info .ic { color: var(--emerald-700); }
.callout--warn { background: rgba(201, 138, 18, .08); border-color: rgba(201, 138, 18, .35); }
.callout--warn .ic { color: var(--gold-700); }

/* ---- Estado vazio ------------------------------------------------------- */
.estado-vazio {
  display: grid; gap: .75rem; justify-items: start;
  padding: clamp(1.5rem, 3vw, 2.25rem); border-radius: var(--r-lg);
  border: 1px solid var(--hairline); background: var(--surface); box-shadow: var(--sh-sm);
}
.estado-vazio .ic { width: 32px; height: 32px; color: var(--emerald-700); }
.estado-vazio h3, .estado-vazio h2 { font-size: var(--fs-lg); }
.estado-vazio p { max-width: 60ch; }
.estado-vazio .btn { margin-top: .25rem; }

/* ---- Seções úteis (tiles) ----------------------------------------------- */
.tiles { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: .6rem; padding: 1.4rem; min-width: 0;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); overflow: hidden;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--gold); opacity: 0; transition: opacity var(--dur) var(--ease); }
.tile:hover { box-shadow: var(--sh-lg); border-color: var(--hairline-gold); }
.tile:hover::before { opacity: 1; }
.tile__ic { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: rgba(20, 110, 80, .1); color: var(--emerald-700); }
.tile__ic .ic { width: 22px; height: 22px; }
.tile h3 { font-size: var(--fs-md); }
.tile p { font-size: var(--fs-sm); }
.tile__link { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; font-size: var(--fs-sm); font-weight: 600; color: var(--emerald-700); }
.tile__link .ic { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.tile:hover .tile__link .ic { transform: translateX(4px); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Programas publicados (details) ------------------------------------- */
.programas { display: grid; gap: 1rem; }
.programa { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 1rem); }
.programa[open] { border-color: var(--hairline-gold); }
.programa__head {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.25rem; align-items: center;
  padding: 1.1rem 1.25rem;
}
.programa__head::-webkit-details-marker { display: none; }
.programa__head:hover { background: var(--surface-2); }
.programa__data {
  display: grid; place-items: center; min-width: 4.4rem; padding: .5rem .6rem;
  border-radius: var(--r-sm); background: var(--emerald-800); color: var(--gold); text-align: center; line-height: 1.1;
}
.programa__data b { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--text-invert); }
.programa__data span { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; }
.programa__info { min-width: 0; }
.programa__titulo { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.programa__meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .3rem; font-size: var(--fs-sm); color: var(--text-muted); }
.programa__meta span { display: inline-flex; align-items: center; gap: .35rem; }
.programa__meta .ic { width: 15px; height: 15px; color: var(--gold-650); }
.programa__acao { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--emerald-700); font-size: var(--fs-sm); min-height: 32px; }
.programa__acao .ic { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.programa[open] .programa__acao .ic { transform: rotate(180deg); }
.programa__acao .quando-aberto { display: none; }
.programa[open] .programa__acao .quando-aberto { display: inline; }
.programa[open] .programa__acao .quando-fechado { display: none; }
.programa__body { border-top: 1px solid var(--hairline); padding: 1rem 1.25rem 1.25rem; }
.programa__fonte { font-size: var(--fs-sm); color: var(--text-soft); margin-top: .75rem; overflow-wrap: anywhere; }
.programa__fonte a { color: var(--emerald-700); text-decoration: underline; }
@media (min-width: 720px) {
  .programa__head { grid-template-columns: auto 1fr auto; }
  .programa__acao { grid-column: auto; }
}

/* ---- Filtros (só quando há base local) ---------------------------------- */
.filtros { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-bottom: 1.5rem; padding: 1rem 1.2rem; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); }
.filtros .campo { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.filtros label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.filtros select {
  min-height: 44px; padding: .5rem 2.2rem .5rem .8rem; border: 1px solid var(--border-ui); border-radius: var(--r-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230E5C42' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center;
  appearance: none; -webkit-appearance: none; color: var(--text); font-size: var(--fs-base);
}
.filtros select:focus { outline: none; border-color: var(--emerald-600); box-shadow: 0 0 0 3px rgba(20, 110, 80, .14); }
.filtros__acoes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filtros__limpar { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; font-size: var(--fs-sm); font-weight: 600; color: var(--emerald-700); text-decoration: underline; }
@media (max-width: 480px) { .filtros .campo, .filtros select, .filtros__acoes, .filtros__acoes .btn { width: 100%; } }

/* ---- Tabelas (rolagem só dentro do contêiner) --------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); max-width: 100%; }
.table-wrap:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
table.data { min-width: 560px; font-size: var(--fs-sm); }
table.data caption { text-align: left; padding: .9rem 1rem .4rem; font-weight: 600; color: var(--text); font-size: var(--fs-sm); }
table.data thead th { background: var(--surface-3); text-align: left; padding: .8rem 1rem; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
table.data tbody td, table.data tbody th { padding: .8rem 1rem; border-top: 1px solid var(--hairline); vertical-align: top; text-align: left; }
table.data tbody th { font-weight: 600; color: var(--text); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num-cell { text-align: center; width: 56px; }
.tabnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-nota { font-size: var(--fs-sm); color: var(--text-soft); margin-top: .6rem; }

/* ---- Resultados: bloco por reunião -------------------------------------- */
.reuniao { border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-sm); overflow: hidden; margin-bottom: 1.25rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.reuniao__head { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: 1rem 1.25rem; background: var(--surface-3); }
.reuniao__head::-webkit-details-marker { display: none; }
.reuniao__head h3 { font-size: var(--fs-md); margin-right: auto; }
.reuniao__head .meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: var(--fs-sm); color: var(--text-muted); }
.reuniao__head .meta span { display: inline-flex; align-items: center; gap: .3rem; }
.reuniao__head .meta .ic { width: 14px; height: 14px; color: var(--gold-650); }
.reuniao__body { padding: 1rem 1.25rem 1.25rem; display: grid; gap: 1rem; }
.reuniao__body .table-wrap { border-radius: var(--r); }

/* ---- Documentos --------------------------------------------------------- */
.doc-list { display: grid; gap: .75rem; }
.doc { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; align-items: start; padding: 1.1rem 1.25rem; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--surface); }
.doc .ic { width: 26px; height: 26px; color: var(--emerald-700); grid-row: span 3; margin-top: .15rem; }
.doc h3 { font-size: var(--fs-md); }
.doc dl { display: flex; flex-wrap: wrap; gap: .2rem 1.25rem; font-size: var(--fs-sm); color: var(--text-muted); margin-top: .25rem; }
.doc dl div { display: inline-flex; gap: .35rem; }
.doc dt { font-weight: 600; color: var(--text); }
.doc dt::after { content: ":"; }
.doc dd { margin: 0; }
.doc__acao { margin-top: .5rem; }

/* ---- FAQ (details nativo) ----------------------------------------------- */
.faq { display: grid; gap: .7rem; max-width: 80ch; }
.faq details { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--sh-sm); }
.faq details[open] { border-color: var(--hairline-gold); }
.faq summary { cursor: pointer; list-style: none; padding: 1rem 1.2rem; min-height: 48px; font-weight: 600; color: var(--emerald-800); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--gold-650); border-bottom: 2px solid var(--gold-650); transform: rotate(45deg); transition: transform var(--dur) var(--ease); flex: none; margin-right: .2rem; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details > div { padding: 0 1.2rem 1.1rem; }
.faq details > div p { font-size: var(--fs-base); }
.faq details > div p + p { margin-top: .6rem; }

/* ---- Passos ------------------------------------------------------------- */
.steps { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); counter-reset: passo; }
.steps li { position: relative; padding: 1.4rem 1.4rem 1.4rem 4.2rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--sh-sm); min-width: 0; }
.steps li::before { counter-increment: passo; content: counter(passo); position: absolute; left: 1.4rem; top: 1.35rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--emerald-800); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); }
.steps h3 { font-size: var(--fs-md); }
.steps p { font-size: var(--fs-sm); margin-top: .35rem; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Termos (definições) ------------------------------------------------ */
.termos { display: grid; gap: .5rem 2rem; }
.termos div { padding: .9rem 0; border-top: 1px solid var(--hairline); }
.termos dt { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md); color: var(--text); }
.termos dd { margin: .25rem 0 0; color: var(--text-muted); }
@media (min-width: 720px) { .termos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Páginas de texto (legal, guia) ------------------------------------- */
.legal { display: grid; gap: 2.5rem; }
@media (min-width: 980px) { .legal { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.legal-toc { position: sticky; top: calc(var(--header-h) + 1rem); font-size: var(--fs-sm); }
.legal-toc h2 { font-family: var(--font-body); text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-xs); color: var(--text-soft); margin-bottom: .75rem; }
.legal-toc a { display: block; padding: .45rem 0 .45rem .9rem; min-height: 36px; color: var(--text-muted); border-left: 2px solid var(--hairline); }
.legal-toc a:hover { color: var(--emerald-700); border-color: var(--gold); }
.legal-body { max-width: 72ch; min-width: 0; }
.legal-body h2 { font-size: var(--fs-xl); margin-top: 2.5rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.legal-body h2:first-of-type { margin-top: 0; }
.legal-body h3 { font-size: var(--fs-md); margin-top: 1.5rem; }
.legal-body p, .legal-body li { color: var(--text-muted); font-size: var(--fs-base); }
.legal-body p { margin-top: .9rem; }
.legal-body ul, .legal-body ol { margin-top: .9rem; display: grid; gap: .5rem; }
.legal-body ul li { position: relative; padding-left: 1.4rem; }
.legal-body ul li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }
.legal-body ol { list-style: decimal; padding-left: 1.4rem; }
.legal-updated { font-size: var(--fs-sm); color: var(--text-soft); }
.legal-body .aviso-idade, .legal-body .callout { margin-top: 1.5rem; }

/* ---- Apoio -------------------------------------------------------------- */
.support-card { padding: 1.4rem; border-radius: var(--r-lg); border: 1px solid var(--hairline); background: var(--surface); box-shadow: var(--sh-sm); }
.support-card h3 { font-size: var(--fs-md); }
.support-card p { font-size: var(--fs-sm); margin-top: .5rem; }
.support-card .btn { margin-top: 1rem; }

/* ---- Foto + texto ------------------------------------------------------- */
.media-split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.media-split .foto { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-lg); aspect-ratio: 16 / 10; min-width: 0; }
.media-split .foto img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .media-split { grid-template-columns: 1fr 1fr; } .media-split--inv .foto { order: -1; } }

/* ---- Grandes prêmios ---------------------------------------------------- */
.gp-card { display: flex; flex-direction: column; gap: .75rem; }
.gp-card h3 { font-size: var(--fs-lg); }
.gp-card .badge { align-self: flex-start; }

/* ---- Páginas de erro / removida ----------------------------------------- */
.erro { min-height: 52vh; display: grid; place-items: center; text-align: center; }
.erro .container { display: grid; gap: 1.25rem; place-items: center; }
.erro h1 { font-size: var(--fs-2xl); max-width: 22ch; }
.erro p { max-width: 52ch; }
.erro .btn-row { justify-content: center; }

/* ---- Contato ------------------------------------------------------------ */
.contato-bloco h2 { font-size: var(--fs-xl); }
.contato-bloco p { margin-top: .75rem; }
.contato-bloco .btn { margin-top: 1rem; }
