/* Páginas arquivo/c/*/e/*/index.html — layout alinhado ao painel de resultados da Central (motor_cronoelo) */
:root {
  --ce-page: #0a0a0a;
  --ce-header-top: #1a1a1a;
  --ce-gold: #b8860b;
  --ce-title: #e8b020;
  --ce-card: #181818;
  --ce-card-border: #333;
  --ce-row-a: #161616;
  --ce-row-b: #1f1f1f;
  --ce-row-line: #2a2a2a;
  --ce-red-a: #990000;
  --ce-red-b: #cc0000;
  --ce-btn-cons: #6f42c1;
  --ce-muted: #9a9aa8;
  --arc-radius: 8px;
}

html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--ce-page);
  color: #eee;
  line-height: 1.5;
  font-size: 16px;
}

.arc-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

/* Faixa superior: barra escura; linha dourada fica na .arc-header-bar (igual publicações da Central) */
.arc-header {
  background: transparent;
  border-bottom: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0 1.25rem 0.85rem;
  margin: 0 -1.25rem 0.85rem;
}

/* Logo Cronoelo | título do evento | área promotor (opcional) */
.arc-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 16px;
  margin: 0 -1.25rem 12px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  border-bottom: 2px solid #d4af37;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.arc-header-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.arc-header-logo--left img {
  height: 52px;
  width: auto;
  max-width: min(200px, 34vw);
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Título centrado na barra (evento ou campeonato) */
.arc-title--header {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: 4px 10px !important;
  text-align: center;
  font-size: clamp(0.72rem, 2.1vw, 1.05rem);
  font-weight: 700;
  color: #e8b020 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.22;
  text-shadow: 0 0 20px rgba(232, 176, 32, 0.2);
}

/* Área opcional para logomarcas (ex.: federação) — fundo branco como nas publicações */
.arc-header-promo {
  flex: 0 1 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 72px;
  padding: 6px 12px;
  box-sizing: border-box;
}

.arc-header-promo:not(:empty) {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.arc-header-promo img {
  max-height: 50px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.arc-brand {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Pedido: não exibir "Cronoelo — Arquivo de resultados" */
.arc-brand {
  display: none !important;
}

.arc-crumb {
  font-size: 0.875rem;
  line-height: 1.45;
  color: #94a3b8;
}

.arc-crumb a {
  color: #7dd3fc;
  text-decoration: none;
  border-bottom: 1px solid rgba(125, 211, 252, 0.35);
  transition: color 0.15s, border-color 0.15s;
}

.arc-crumb a:hover {
  color: #bae6fd;
  border-bottom-color: rgba(186, 230, 253, 0.55);
}

.arc-main {
  min-height: 40vh;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 0 1.5rem;
}

/* Título dentro do <main> só em páginas antigas sem .arc-header-bar */
.arc-main > .arc-title:not(.arc-title--header) {
  font-size: clamp(0.78rem, 2.4vw, 1.12rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 0.65rem;
  padding: 0.2rem 0.5rem 0.55rem;
  color: var(--ce-title);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-shadow: 0 0 24px rgba(232, 176, 32, 0.22);
  border: none;
}

.arc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 8px;
  padding: 0;
}

.arc-table-wrap:last-child {
  margin-bottom: 0;
}

.arc-table-wrap::-webkit-scrollbar {
  height: 8px;
}

.arc-table-wrap::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

/* Tabela = “card” único como bloco da Central
   Nunca usar display:flex em td/th: deixa de ser table-cell e a grelha colapsa. */
.arc-grid {
  width: 100%;
  min-width: 520px;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  background: var(--ce-card);
  border: 1px solid var(--ce-card-border);
  border-radius: var(--arc-radius);
  overflow: hidden;
}

.arc-grid th,
.arc-grid td {
  border: 1px solid var(--ce-row-line);
  padding: 0.28rem 0.38rem;
  vertical-align: middle;
}

/* Linha da data = barra vermelha tipo .card-header */
.arc-grid thead tr:first-child th.arc-date {
  background: linear-gradient(90deg, var(--ce-red-a), var(--ce-red-b)) !important;
  color: #fff !important;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-color: var(--ce-row-line);
  padding: 0.34rem 0.4rem !important;
}

.arc-grid thead tr:nth-child(2) th {
  background: var(--ce-row-a) !important;
  color: #eee !important;
  font-weight: 700;
  font-size: 0.68rem;
  line-height: 1.15;
  border-color: var(--ce-row-line);
}

.arc-corner {
  background: #121212 !important;
  width: 1%;
  min-width: 2.75rem;
}

.arc-ev {
  text-align: center;
  min-width: 6rem;
}

/* Corpo: zebras como .result-row da Central */
.arc-grid tbody tr:nth-child(even) .arc-cell {
  background: var(--ce-row-b);
}

.arc-grid tbody tr:nth-child(odd) .arc-cell {
  background: var(--ce-row-a);
}

/* Categoria: fundo vermelho + texto claro (pedido: alinhar à identidade das barras) */
.arc-grid tbody th.arc-cat {
  background: linear-gradient(90deg, var(--ce-red-a), var(--ce-red-b)) !important;
  color: #fff !important;
  -webkit-font-smoothing: antialiased;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.045em;
  border-color: var(--ce-row-line);
  white-space: normal;
  min-width: 6.75rem;
  width: 1%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.arc-cat {
  border-right: 2px solid rgba(0, 0, 0, 0.3);
}

/* Texto solto na célula (ex.: “TXT”) colapsa; links .arc-pdf repõem tamanho — funciona sem :has() */
.arc-cell {
  padding: 0.3rem 0.32rem !important;
  text-align: center;
  vertical-align: middle;
  font-size: 0;
  line-height: 0;
}

.arc-cell a.arc-pdf {
  font-size: 0.68rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.arc-cell br {
  display: block;
  content: "";
  margin-top: 0.12rem;
}

/* HTML antigo: esconder links .txt */
.arc-cell a[href$=".txt"],
.arc-cell a[href$=".TXT"] {
  display: none !important;
}

/* Links tipo “botão”: sem preenchimento — só destaque pela cor do texto */
.arc-pdf {
  display: inline-block;
  text-decoration: none;
  font-weight: 800;
  padding: 2px 4px;
  margin: 1px;
  border-radius: 4px;
  border: 1px solid transparent;
  line-height: 1.25;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

.arc-pdf:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.arc-pdf:focus-visible {
  outline: 2px solid #ffcc00;
  outline-offset: 2px;
}

/* Cores por tipo (r_/p_/m_) ficam no <style id="arc-critical-fallback"> de cada
   index.html — aqui não repetimos, para o inline não ser “vencido” por esta folha. */

/* Footer: trocar "Site atual · © 1998–2026" por "Cronoelo · © 1997–2025" mantendo link */
.arc-footer p {
  font-size: 0 !important;
}

.arc-footer p a {
  font-size: 0 !important;
}

.arc-footer p a::after {
  content: "Cronoelo";
  font-size: 0.85rem;
  color: #7dd3fc;
}

.arc-footer p::after {
  content: " · © 1997–2025";
  font-size: 0.85rem;
  color: var(--ce-muted);
}

/* Ícone SVG: oculto (evita ícone partido se asset faltar) */
.arc-cell img {
  display: none !important;
}

.arc-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ce-row-line);
  font-size: 0.8rem;
  color: var(--ce-muted);
  text-align: center;
}

.arc-footer a {
  color: #7dd3fc;
  text-decoration: none;
}

.arc-footer a:hover {
  text-decoration: underline;
}

/* Campeonato no shell: lista de etapas alinhada ao índice do arquivo */
.arc-wrap--in-shell {
  margin: 0 auto;
}

.arc-wrap--in-shell .arc-footer {
  display: none !important;
}

.arc-sub {
  margin: 0 0 14px;
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}

ul.arc-list.arc-stages {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ce-card-border);
  border-radius: var(--arc-radius);
  overflow: hidden;
  background: var(--ce-card);
}

ul.arc-list.arc-stages li {
  border-bottom: 1px solid var(--ce-row-line);
}

ul.arc-list.arc-stages li:last-child {
  border-bottom: none;
}

ul.arc-list.arc-stages a {
  display: block;
  padding: 12px 14px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  -webkit-font-smoothing: antialiased;
}

ul.arc-list.arc-stages a:hover {
  color: #fff;
  background: var(--ce-row-a);
  text-decoration: underline;
}

@media (max-width: 720px) {
  .arc-wrap {
    padding: 0 0.75rem 1.5rem;
  }

  .arc-header {
    margin: 0 -0.75rem 0.75rem;
    padding: 0 0.75rem 0.65rem;
  }

  .arc-header-bar {
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 -0.75rem 10px;
    padding: 10px 10px 12px;
    border-radius: 0 0 16px 16px;
  }

  .arc-header-logo--left {
    order: 1;
  }

  .arc-header-promo {
    order: 2;
    flex: 0 1 auto;
  }

  .arc-title--header {
    order: 3;
    flex-basis: 100%;
    font-size: clamp(0.65rem, 3.2vw, 0.88rem) !important;
  }

  .arc-grid {
    font-size: 0.75rem;
    min-width: 100%;
  }

  .arc-ev {
    min-width: 5rem;
    white-space: normal;
  }

  .arc-grid tbody th.arc-cat {
    white-space: normal;
    font-size: 0.68rem;
  }

  .arc-cell {
    white-space: normal;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .arc-header {
    background: #f5f5f5;
    border-bottom-color: #999;
    box-shadow: none;
  }

  .arc-header-bar {
    background: #e8e8e8;
    box-shadow: none;
    border-bottom-color: #999;
  }

  .arc-title--header,
  .arc-main > .arc-title {
    color: #000 !important;
    text-shadow: none;
  }

  .arc-grid {
    border: 1px solid #ccc;
  }

  .arc-cell {
    font-size: 0.75rem;
    line-height: 1.4;
    color: #333;
  }

  .arc-pdf {
    background: transparent !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }

  .arc-wrap a.arc-pdf[href*="/r_"],
  .arc-wrap a.arc-pdf[href*="r_"] {
    color: #b91c1c !important;
    -webkit-text-fill-color: #b91c1c !important;
  }

  .arc-wrap a.arc-pdf[href*="/p_"],
  .arc-wrap a.arc-pdf[href*="p_"] {
    color: #c2410c !important;
    -webkit-text-fill-color: #c2410c !important;
  }

  .arc-wrap a.arc-pdf[href*="/m_"],
  .arc-wrap a.arc-pdf[href*="m_"] {
    color: #0369a1 !important;
    -webkit-text-fill-color: #0369a1 !important;
  }
}
