/* =========================================================
   VI Feirinha da Nossa Gente — Pau dos Ferros/RN
   Estilo institucional limpo. Paleta derivada da logo oficial
   da Prefeitura (azul #0062B6 / ciano #00A8FF sobre branco).
   ========================================================= */

:root {
  /* paleta base: logo da Feirinha da Nossa Gente */
  --azul-brand: #1B8CF8;  /* azul da logo (acentos) */
  --azul: #0C63C4;        /* primário interativo (contraste seguro no branco) */
  --azul-escuro: #0A4F9E;
  --teal: #2FC4B4;        /* teal da logo (levemente ajustado p/ branco) */
  --teal-brand: #40DBCD;
  --amarelo: #FBD001;     /* amarelo da logo */
  --escuro: #0B2948;      /* fundo do hero e rodapé — azul profundo da logo */
  --escuro-2: #0E3456;
  --tinta: #16202B;
  --cinza: #566573;
  --cinza-claro: #8493A0;
  --linha: #E4E8EE;
  --fundo: #ffffff;
  --fundo-2: #F5F7FA;

  --radius: 10px;
  --wrap: 1140px;

  --sans: "Public Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--tinta);
  background: var(--fundo);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--azul); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--azul);
  color: #fff;
  padding: 10px 16px;
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--azul-brand);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: .98rem;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary {
  background: var(--azul);
  color: #fff;
}
.btn--primary:hover { background: var(--azul-escuro); }
.btn--outline {
  background: #fff;
  color: var(--azul);
  border-color: var(--linha);
}
.btn--outline:hover { border-color: var(--azul); background: var(--fundo-2); }
.btn--on-dark {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .38);
}
.btn--on-dark:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn--sm { padding: 8px 16px; font-size: .88rem; }

/* ---------- Rótulos ---------- */
.eyebrow,
.section-eyebrow,
.panel__eyebrow {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--azul);
  margin: 0 0 12px;
}
.section-eyebrow.center { text-align: center; }

.section-title {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.15;
  margin: 0 0 20px;
  color: var(--tinta);
}

/* =========================================================
   CABEÇALHO
   ========================================================= */
.site-header { position: sticky; top: 0; z-index: 40; background: #fff; }
.site-header__accent {
  height: 4px;
  background: linear-gradient(90deg,
    var(--teal-brand) 0 33.33%,
    var(--amarelo) 33.33% 66.66%,
    var(--azul-brand) 66.66% 100%);
}
.site-header__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--linha);
}
.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 46px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  text-decoration: none;
  color: var(--cinza);
  font-weight: 600;
  font-size: .96rem;
}
.site-nav a:hover { color: var(--azul); }
.site-nav__cta {
  color: #fff !important;
  background: var(--azul);
  padding: 9px 18px;
  border-radius: 8px;
}
.site-nav__cta:hover { background: var(--azul-escuro); }

/* =========================================================
   ABERTURA (hero escuro — a logo tem letras brancas)
   ========================================================= */
.hero {
  background: linear-gradient(135deg, rgba(11, 41, 72, 0.85) 0%, rgba(10, 61, 107, 0.85) 40%, rgba(16, 70, 90, 0.85) 70%, rgba(17, 78, 74, 0.85) 100%), url('../img/hero-bg.png') center/cover no-repeat;
  color: #fff;
  position: relative;
  overflow: hidden;
  text-align: center;
}
/* sutil textura de luz no canto — dá profundidade */
.hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(64, 219, 205, .10) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(27, 140, 248, .08) 0%, transparent 70%);
  pointer-events: none;
}
.hero__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 24px 52px;
  position: relative;
  z-index: 1;
}
.eyebrow--light { color: var(--teal-brand); }

.hero__logo-wrap { margin: 0 auto 14px; display: flex; justify-content: center; }
.hero__logo { width: auto; height: auto; max-width: 420px; max-height: 260px; }

.hero__edition {
  font-weight: 700;
  color: var(--amarelo);
  margin: 0 0 22px;
  font-size: 1rem;
  letter-spacing: .01em;
}
.hero__lead {
  max-width: 620px;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, .74);
  margin: 0 auto 30px;
}

.info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 30px;
  border: 1px solid var(--linha);
  border-radius: var(--radius);
  overflow: hidden;
}
.info__item { padding: 18px 20px; }
.info__item + .info__item { border-left: 1px solid var(--linha); }
.info dt {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cinza-claro);
  margin-bottom: 5px;
}
.info dd { margin: 0; font-weight: 600; color: var(--tinta); }

/* variante escura do bloco de informações (no hero) */
.info--dark { border-color: rgba(255, 255, 255, .16); }
.info--dark .info__item + .info__item { border-left-color: rgba(255, 255, 255, .16); }
.info--dark dt { color: var(--teal-brand); }
.info--dark dd { color: #fff; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 20px; }
.hero__note { margin: 0; color: rgba(255, 255, 255, .7); font-size: .98rem; }
.hero__note strong { color: #fff; }

/* =========================================================
   NÚCLEO — Edital + Vídeo
   ========================================================= */
.core { background: var(--fundo-2); border-bottom: 1px solid var(--linha); }
.core__grid {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--linha);
}
.panel__eyebrow { margin: 0 0 3px; }
.panel__title { font-size: 1.2rem; font-weight: 700; margin: 0; }

/* Leitor de PDF */
.viewer__frame {
  position: relative;
  background: var(--fundo-2);
  height: 560px;
  max-height: 76vh;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px;
}
.viewer__canvas {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--linha);
  background: #fff;
  box-shadow: 0 6px 18px -12px rgba(21, 33, 46, .4);
}
.viewer__loading,
.viewer__error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--cinza);
  font-weight: 500;
  text-align: center;
  padding: 24px;
}
.viewer__error a { color: var(--azul); font-weight: 700; }
/* garante que o atributo hidden esconda os overlays (display:flex acima o sobrescreveria) */
.viewer__loading[hidden],
.viewer__error[hidden] { display: none; }
.spinner {
  width: 18px; height: 18px;
  border: 3px solid var(--linha);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.viewer__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--linha);
  background: #fff;
  flex-wrap: wrap;
}
.ctrl {
  font-size: 1.1rem;
  font-weight: 700;
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--linha);
  background: #fff;
  color: var(--tinta);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ctrl:hover:not(:disabled) { border-color: var(--azul); background: var(--fundo-2); }
.ctrl:disabled { opacity: .4; cursor: not-allowed; }
.viewer__count { font-weight: 600; font-size: .92rem; min-width: 128px; text-align: center; color: var(--cinza); }
.viewer__sep { width: 1px; height: 24px; background: var(--linha); }

/* Vídeo (chamamento é vertical 9:16) */
.video__frame {
  background: #0b1620;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 560px;
}
.video__player { width: 100%; height: 100%; object-fit: contain; background: #0b1620; }
.video__foot { padding: 6px 8px 10px; }
.linkrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 12px;
  text-decoration: none;
  color: var(--tinta);
  font-weight: 600;
  font-size: .95rem;
  border-radius: 8px;
}
.linkrow:hover { background: var(--fundo-2); color: var(--azul); }
.linkrow + .linkrow { border-top: 1px solid var(--linha); }

/* =========================================================
   QUEM PODE PARTICIPAR
   ========================================================= */
.who__inner { max-width: var(--wrap); margin: 0 auto; padding: 56px 24px; }
.who__lead { max-width: 640px; font-size: 1.08rem; color: var(--cinza); margin: 0 0 22px; }
.who__sub { font-weight: 600; margin: 26px 0 12px; color: var(--tinta); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.tags li {
  font-weight: 600;
  font-size: .95rem;
  background: #fff;
  border: 1px solid var(--linha);
  color: var(--tinta);
  padding: 8px 16px;
  border-radius: 999px;
}
.tags--muted li { color: var(--cinza); background: var(--fundo-2); }

/* =========================================================
   CRONOGRAMA
   ========================================================= */
.schedule { background: var(--fundo-2); border-top: 1px solid var(--linha); border-bottom: 1px solid var(--linha); }
.schedule__inner { max-width: var(--wrap); margin: 0 auto; padding: 56px 24px; }
.sched-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: var(--radius);
  overflow: hidden;
}
.sched-table th,
.sched-table td { text-align: left; padding: 15px 20px; }
.sched-table thead th {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--cinza-claro);
  background: var(--fundo-2);
  border-bottom: 1px solid var(--linha);
}
.sched-table tbody tr + tr td { border-top: 1px solid var(--linha); }
.sched-table td:first-child { font-weight: 700; color: var(--azul-escuro); white-space: nowrap; width: 200px; }
.sched-table tr.is-open td { background: rgba(0, 98, 182, .05); }
.sched-table tr.is-open td:first-child { color: var(--azul); }

/* =========================================================
   CTA
   ========================================================= */
.cta__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}
.cta__title { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 800; margin: 0 0 14px; }
.cta__lead { font-size: 1.1rem; color: var(--cinza); margin: 0 0 26px; }
.cta__lead strong { color: var(--tinta); }
.cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 24px; }
.cta__help {
  font-size: .92rem;
  color: var(--cinza);
  max-width: 600px;
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--linha);
}
.cta__help strong { color: var(--tinta); }

/* =========================================================
   RODAPÉ
   ========================================================= */
.site-footer { background: linear-gradient(135deg, #0B2948 0%, #0A3D6B 50%, #114E4A 100%); color: rgba(255, 255, 255, .82); padding: 48px 24px 28px; }
.site-footer__logo { height: 96px; width: auto; margin-bottom: 14px; }
.site-footer__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}
.site-footer__title { font-size: 1.25rem; font-weight: 800; color: #fff; margin: 0 0 6px; }
.site-footer__sub { margin: 0; max-width: 320px; }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 40px; }
.site-footer__k {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--teal-brand);
  margin: 0 0 8px;
}
.site-footer__cols a { color: #fff; text-decoration: none; }
.site-footer__cols a:hover { text-decoration: underline; }
.site-footer__cols p { margin: 0; }
.site-footer__legal {
  max-width: var(--wrap);
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: .82rem;
  color: rgba(255, 255, 255, .55);
}

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 900px) {
  .core__grid { grid-template-columns: 1fr; }
  .info { grid-template-columns: repeat(2, 1fr); }
  .info__item:nth-child(3), .info__item:nth-child(4) { border-top: 1px solid var(--linha); }
  .info__item:nth-child(odd) { border-left: none; }
}
@media (max-width: 620px) {
  .site-nav { gap: 14px; }
  .site-nav a:not(.site-nav__cta) { display: none; }
  .info { grid-template-columns: 1fr; }
  .info__item + .info__item { border-left: none; border-top: 1px solid var(--linha); }
  .sched-table td:first-child { width: auto; white-space: normal; }
  .btn { width: 100%; }
  .intro__actions, .cta__actions { flex-direction: column; }
}

/* Acessibilidade: movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}
