/* ============================================================
   Circuito Sesc de Corridas — home pública /circuito-sesc-corridas
   Visual baseado no modelo original (Ruberoid + roxo/laranja).
   Namespace: .csc-*  (Circuito Sesc Corridas)
   ============================================================ */

html, body {
    margin: 0;
    padding: 0;
    background: #000;
    overflow-x: hidden;
}

/* Reserva o espaço da scrollbar mesmo quando o modal trava o body.
   Sem isso a página "pula" pra direita ao abrir, descentralizando o modal. */
html { scrollbar-gutter: stable; }

@font-face {
    font-family: 'Ruberoid-italic';
    src: url("/css/Public/circuito-fonts/Ruberoid-BoldOblique.otf") format("opentype");
    font-display: swap;
}
@font-face {
    font-family: 'Ruberoid';
    src: url("/css/Public/circuito-fonts/Ruberoid-Bold.otf") format("opentype");
    font-display: swap;
}
@font-face {
    font-family: 'RuberoidNormal';
    src: url("/css/Public/circuito-fonts/Ruberoid-Medium.otf") format("opentype");
    font-display: swap;
}

/* Variáveis de paleta em :root pra serem herdadas tanto pela .csc-page
   quanto pelo modal (que vive fora dela). A view pode sobrescrever inline. */
:root {
    --csc-roxo: #781bcf;
    --csc-laranja: #ef5d29;
    --csc-laranja-2: #f7931e;
    --csc-destaque: #ffa500;
    --csc-texto: #ffffff;
}

.csc-page {
    font-family: "Roboto", sans-serif;
    font-weight: 300;
    color: var(--csc-texto);
    font-size: 1.1rem;
    background: url('/images/static/circuito/back4.jpg') center center / cover no-repeat;
    background-attachment: fixed;
    backdrop-filter: blur(7px);
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* iOS/Android: background-attachment: fixed quebra com cover.
   Em telas pequenas, vira scroll normal (a imagem rola junto). */
@media (max-width: 900px), (hover: none) {
    .csc-page {
        background-attachment: scroll;
    }
}

.csc-page *,
.csc-page *::before,
.csc-page *::after {
    box-sizing: border-box;
}

/* Quebra palavras longas (URLs, "testetetetete...") pra não estourar o layout */
.csc-page p,
.csc-page li,
.csc-page h1,
.csc-page h2,
.csc-page h3,
.csc-page h4,
.csc-conteudo,
.csc-conteudo * {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.csc-page img { max-width: 100%; height: auto; }

.csc-page p,
.csc-page li,
.csc-page span,
.csc-page strong,
.csc-page b,
.csc-page i,
.csc-page em,
.csc-page small {
    color: var(--csc-texto);
}

.csc-page b,
.csc-page strong { font-weight: 600; }

.csc-page h1 {
    font-family: 'Ruberoid-italic', sans-serif;
    font-size: 32px;
    margin: 2rem 0;
    text-align: center;
    color: var(--csc-destaque);
    font-weight: 600;
}

.csc-page h2 {
    font-family: 'Ruberoid-italic', sans-serif;
    font-size: 24px;
    padding: 2rem 0 1rem;
    color: var(--csc-destaque);
    font-weight: 500;
}

.csc-page h3 {
    font-family: 'Ruberoid-italic', sans-serif;
    font-size: 20px;
    margin: 1rem 0;
    text-decoration: underline;
    font-weight: 400;
    color: var(--csc-texto);
}

/* ─── Testeira fixa (topo roxo com botão "Anos anteriores") ─── */
.csc-testeira {
    background: var(--csc-roxo);
    width: 100%;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 50;
    overflow: hidden;
}

.csc-testeira-central {
    max-width: 1280px;
    height: 60px;
    margin: 0 auto;
    font-family: 'Ruberoid-italic', sans-serif;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

.csc-testeira .csc-logomini,
.csc-testeira img {
    height: 42px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 42px !important;
    grid-column: 2;
    justify-self: center;
}

.csc-testeira-info {
    display: none; /* sem texto descritivo na testeira; ele fica no hero */
}

.csc-testeira-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    gap: .5rem;
}

.csc-btn-historico {
    font-weight: 500;
    height: 36px;
    display: inline-flex;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-family: 'Ruberoid', sans-serif;
    color: #fff;
    text-decoration: none;
    padding: 0 .9rem;
    font-size: .85rem;
    border-radius: 999px;
    background-image: linear-gradient(90deg, var(--csc-laranja) 0%, var(--csc-laranja-2) 33%, var(--csc-laranja) 66%, var(--csc-laranja-2) 100%);
    background-size: 150% 100%;
    transition: all .25s ease;
    border: 0;
}

@keyframes csc-btn-anim {
    0%   { background-position: 0% 0%; }
    100% { background-position: 100% 0%; }
}

.csc-btn-historico:hover {
    color: #fff;
    text-decoration: none;
    font-family: 'Ruberoid-italic', sans-serif;
    background-position: 100% 0%;
    animation: csc-btn-anim 1s ease 1;
}

/* ─── Botão flutuante "voltar ao topo" (fixed, fora da .csc-page) ─── */
.csc-fixotop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 110px;
    height: 50px;
    background-image: linear-gradient(-180deg, #FF7E31, #E62C03);
    box-shadow: rgba(0, 0, 0, .5) 0 4px 12px;
    cursor: pointer;
    z-index: 9000;
    border: 0;
    border-radius: 6px;
    padding: 0;
    color: #fff;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.csc-fixotop.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
.csc-fixotop a {
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    height: 100%;
    width: 100%;
    font-size: 14px;
    font-family: 'Ruberoid-italic', sans-serif;
    line-height: 1.1;
    padding: 0 .5rem;
}
.csc-fixotop a i { font-size: 1.1rem; }

@media (max-width: 600px) {
    .csc-fixotop { width: 44px; height: 44px; bottom: 16px; right: 16px; border-radius: 50%; }
    .csc-fixotop a span { display: none; }
    .csc-fixotop a { justify-content: center; padding: 0; }
}

/* ─── Hero full-screen: logo grande + slogan + botões de cidade
   (mesma hierarquia do modelo PHP original) ─── */
.csc-header {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 60px);
}

/* Layout horizontal: à direita o logo+slogan, à esquerda os botões */
.csc-destaque {
    display: flex;
    flex-direction: row-reverse;
    padding: 2rem 0;
    align-items: center;
    gap: 1rem;
}

.csc-logoslogan {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
}

/* Logo grande do hero — controla QUALQUER <img> dentro, independente da classe
   (csc-banner-img, csc-logomini, etc). Evita que .csc-page img estique. */
.csc-logoslogan img,
.csc-banner-img {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    margin: 1rem 0;
    display: block;
}

.csc-slogan {
    margin: 1rem 2rem 0 0;
    font-size: 26px;
    text-align: right;
    font-family: 'Ruberoid-italic', sans-serif;
    color: var(--csc-texto);
    width: 100%;
}

.csc-containerunidades {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    max-width: 900px;
    margin: auto;
}

.csc-textselectunity {
    color: var(--csc-texto);
    font-size: 24px;
    text-align: left;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-family: 'Ruberoid-italic', sans-serif;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.csc-unidade {
    margin: 0.5rem 1rem;
    height: 100px;
    padding: 1rem;
    width: 100%;
    max-width: 550px;
    cursor: pointer;
    border: 0;
    transition: all .25s ease;
    background: linear-gradient(117deg, var(--csc-roxo) 50%, var(--csc-laranja) 50.5%);
    background-size: 220% 100%;
    color: #fff;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    text-align: left;
    font-family: 'Ruberoid', sans-serif;
}

@keyframes csc-gradient {
    0%   { background-position: 0% 0%; }
    100% { background-position: 100% 0%; }
}

.csc-unidade:hover {
    color: #fff;
    background-position: 100% 0%;
    animation: csc-gradient 0.6s ease 1;
    font-family: 'Ruberoid-italic', sans-serif;
}

.csc-unidade.csc-unidade-ativa {
    background-position: 100% 0%;
}

.csc-unidade span {
    position: relative;
    font-family: 'Ruberoid', sans-serif;
    font-size: 1.3rem;
    color: #fff;
}
.csc-unidade-ativa span,
.csc-unidade:hover span { font-family: 'Ruberoid-italic', sans-serif; }

.csc-unidade-ano {
    display: block;
    font-size: .85rem;
    font-family: 'RuberoidNormal', sans-serif;
    opacity: .9;
    margin-top: 4px;
}

.csc-setas {
    position: absolute;
    right: -120px;
    top: -50%;
    transition: all .25s ease;
}
.csc-unidade:hover .csc-setas,
.csc-unidade-ativa .csc-setas { right: -55px; }

.csc-unidade:active { box-shadow: rgba(255, 255, 255, 0.5) 0 0 15px; }

/* ─── Menu de seções (Kits / Prova / Regras / Inscrições) ─── */
.csc-menu-wrap {
    margin-top: 1rem;
    display: none;
}
.csc-menu-wrap.csc-menu-ativa { display: block; }

.csc-menu {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    flex-wrap: wrap;
    text-align: center;
    gap: .5rem;
    position: relative;
}

.csc-menu-botao {
    max-width: 195px;
    width: 100%;
    height: 60px;
    margin: 1rem 1%;
    background: linear-gradient(117deg, var(--csc-laranja) 50%, var(--csc-laranja-2) 50.5%);
    background-size: 220% 100%;
    overflow: hidden;
    position: relative;
    font-style: italic;
}
.csc-menu-botao:hover {
    background-position: 100% 0%;
    animation: csc-gradient 0.6s ease 1;
}
.csc-menu-botao a {
    text-decoration: none;
    color: #fff;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Ruberoid-italic', sans-serif;
    font-weight: 400;
    padding: 0 .5rem;
    font-size: 1rem;
}

/* ─── Conteúdo de cada cidade ─── */
/* Wrap transparente — o fundo roxo só aparece quando uma cidade está ativa */
.csc-content-wrap {
    position: relative;
    margin-top: 0.5rem;
}

/* Section full-width — fundo roxo ocupa 100% da viewport quando ativa.
   Usa grid de 3 colunas pra travar o conteúdo no centro (1100px) sem
   depender de `margin: 0 auto` (que pode falhar com filhos flex/grid). */
.csc-conteudo {
    display: none;
    width: 100%;
    margin: 0;
    padding: 2rem 0 3rem;
    background: rgba(120, 27, 207, 0.75);
    grid-template-columns: minmax(1.5rem, 1fr) minmax(0, 1100px) minmax(1.5rem, 1fr);
    column-gap: 0;
    row-gap: 0;
}
.csc-conteudo.csc-conteudo-ativa { display: grid; }
.csc-conteudo > * { grid-column: 2; min-width: 0; }

.csc-conteudo p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 1rem 0;
    color: var(--csc-texto);
}

/* Hero do conteúdo da edição (Cidade — Edição YYYY) */
.csc-edicao-hero {
    text-align: center;
    margin: 1rem 0 2rem;
    padding: 1.5rem 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}
.csc-edicao-cidade {
    display: inline-block;
    background: var(--csc-laranja);
    color: #fff;
    padding: .3rem 1rem;
    border-radius: 6px;
    font-family: 'Ruberoid-italic', sans-serif;
    font-size: .9rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: .8rem;
}
.csc-conteudo .csc-edicao-hero h1 {
    margin: 0 0 .25rem;
    font-size: clamp(2rem, 5vw, 3rem);
    text-decoration: none;
}
.csc-edicao-ano {
    color: rgba(255, 255, 255, 0.8);
    font-family: 'RuberoidNormal', sans-serif;
    font-size: 1rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* Descrição da edição com largura confortável de leitura */
.csc-edicao-descricao {
    max-width: 800px;
    margin: 0 auto 2.5rem;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Título de seção (Inscrições, Galeria, etc.) */
.csc-secao-titulo {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--csc-destaque) !important;
    font-size: 1.5rem !important;
    text-decoration: none !important;
    margin-top: 3rem !important;
    padding-bottom: .5rem !important;
    border-bottom: 2px solid rgba(255, 165, 0, 0.4);
}
.csc-secao-titulo i {
    color: var(--csc-laranja);
    font-size: 1.3rem;
}

/* Accordion vertical (Kits / Prova / Regras) — exclusive via `name=info-X` no <details> */
.csc-info-accordion {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 2rem 0;
}

.csc-info-item {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--csc-laranja);
    border-radius: .75rem;
    overflow: hidden;
    transition: border-color .25s ease;
}
.csc-info-item[open] {
    border-left-color: var(--csc-destaque);
    background: rgba(0, 0, 0, 0.35);
}

/* Tira o triângulo padrão do summary */
.csc-info-item summary::-webkit-details-marker { display: none; }
.csc-info-item summary { list-style: none; }

.csc-info-item__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background .2s ease;
}
.csc-info-item__header:hover { background: rgba(255, 255, 255, 0.05); }

.csc-info-item__ico {
    font-size: 1.05rem;
    color: var(--csc-laranja);
    background: rgba(255, 255, 255, 0.08);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.csc-info-item__title {
    flex: 1;
    color: var(--csc-destaque);
    font-family: 'Ruberoid-italic', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
}

.csc-info-item__chevron {
    color: var(--csc-laranja);
    font-size: .9rem;
    transition: transform .25s ease;
    flex-shrink: 0;
}
.csc-info-item[open] .csc-info-item__chevron { transform: rotate(180deg); }

.csc-info-item__body {
    padding: 0 1.25rem 1.25rem 4rem;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--csc-texto);
}
.csc-info-item__body p { margin: .5rem 0; }
.csc-info-item__body p:first-child { margin-top: 0; }
.csc-info-item__body p:last-child { margin-bottom: 0; }
.csc-info-item__body strong { color: var(--csc-destaque); }
.csc-info-item__body ul, .csc-info-item__body ol { padding-left: 1.5rem; margin: .5rem 0; }

@media (max-width: 600px) {
    .csc-info-item__body { padding-left: 1.25rem; }
}

/* ─── Blindagem do conteúdo vindo do editor ──────────────────────────────
   Descrição e os três blocos de informação saem com Html.Raw. Texto colado
   do Word chega com a formatação da PÁGINA de origem junto, em duas
   famílias: Word desktop (classes Mso*, <o:p>, fundo branco, recuo
   pendurado) e Word Online (classes SCXW*/TextRun, white-space: pre-wrap,
   margin: 0 em todo parágrafo e os grifos do corretor gravados como
   background-image: url(data:image/svg+xml…) — os sublinhados vermelhos
   NÃO são do navegador, estão salvos no banco).

   HtmlWord.cs limpa o que for gravado daqui em diante; estas regras cobrem
   o que JÁ está no banco, sem precisar reeditar edição nenhuma. A premissa:
   dentro destes blocos, cor e fundo são do site, não do conteúdo. */
.csc-info-item__body [style*="background"],
.csc-edicao-descricao [style*="background"] {
    background: transparent !important;
}

.csc-info-item__body [style*="color"],
.csc-edicao-descricao [style*="color"] {
    color: inherit !important;
}

/* strong mantém a cor de destaque mesmo quando o Word pintou por cima */
.csc-info-item__body strong[style*="color"] { color: var(--csc-destaque) !important; }

/* Recuo pendurado do Word: text-indent negativo + margem em pt */
.csc-info-item__body [style*="text-indent"],
.csc-edicao-descricao [style*="text-indent"],
.csc-info-item__body [class^="Mso"],
.csc-info-item__body [class*=" Mso"],
.csc-edicao-descricao [class^="Mso"],
.csc-edicao-descricao [class*=" Mso"] {
    margin-left: 0 !important;
    text-indent: 0 !important;
}

/* <o:p> não desenha nada — só carrega espaçamento fantasma */
.csc-info-item__body o\:p,
.csc-edicao-descricao o\:p { display: none; }

/* white-space: pre-wrap do Word Online transforma a indentação do HTML de
   origem em quebras de linha de verdade — parágrafo picado no meio. */
.csc-info-item__body [style*="white-space"],
.csc-edicao-descricao [style*="white-space"] { white-space: normal !important; }

/* O Word Online carimba margin: 0px em TODO parágrafo, colando um no outro;
   o Word desktop carimba margem em pt. O ritmo vertical é do painel. */
.csc-info-item__body p[style*="margin"],
.csc-edicao-descricao p[style*="margin"] { margin: .5rem 0 !important; }

.csc-conteudo ul { margin-bottom: 2rem; padding-left: 1.5rem; }
.csc-conteudo li { margin: 0 0 0.5rem; color: #fff; }

.csc-conteudo a {
    color: var(--csc-laranja-2);
    font-weight: 600;
    text-decoration: underline rgba(247, 147, 30, 0);
    transition: all .15s ease;
}
.csc-conteudo a:hover {
    color: var(--csc-laranja-2);
    font-style: italic;
    text-decoration: underline var(--csc-laranja-2);
}

.csc-edicao-banner {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: .75rem;
    margin: 1rem 0;
}

/* ─── Cards de etapa ─── */
.csc-etapas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem;
}
/* .csc-conteudo a.csc-etapa-card: o ancestral .csc-conteudo aplica
   underline + itálico nos links; precisamos vencer aquela regra. */
.csc-conteudo a.csc-etapa-card,
.csc-etapa-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: .75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .25s ease;
    text-decoration: none;
    font-style: normal;
    color: inherit;
}
.csc-conteudo a.csc-etapa-card:hover,
.csc-etapa-card:hover {
    transform: translateY(-3px);
    border-color: var(--csc-laranja-2);
    box-shadow: 0 8px 22px rgba(0,0,0,.4);
    text-decoration: none;
    font-style: normal;
    color: inherit;
}
.csc-etapa-card.is-fechado { opacity: .82; }

/* Capa: imagem real OU placeholder com gradiente + ícone (quando sem capa). */
.csc-etapa-capa { position: relative; }
.csc-etapa-capa img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
.csc-etapa-capa--placeholder {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 120% at 80% -10%, rgba(255,255,255,.18), transparent 60%),
        linear-gradient(135deg, var(--csc-roxo), var(--csc-laranja));
}
.csc-etapa-capa--placeholder i { font-size: 2.5rem; color: rgba(255,255,255,.92); }

/* Badge de status, sobreposto no canto da capa. */
.csc-etapa-badge {
    position: absolute;
    top: .6rem;
    right: .6rem;
    font-family: 'Ruberoid', sans-serif;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1;
    padding: .32rem .6rem;
    border-radius: 6px;
    color: #fff;
}
.csc-etapa-badge.is-aberta    { background: #1f9d57; }
.csc-etapa-badge.is-ultimas   { background: #e8821e; }
.csc-etapa-badge.is-esgotado  { background: #c0392b; }
.csc-etapa-badge.is-breve     { background: #2d6cdf; }
.csc-etapa-badge.is-encerrada { background: rgba(0,0,0,.6); }

.csc-etapa-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.csc-etapa-body h4 {
    font-family: 'Ruberoid-italic', sans-serif;
    font-size: 1.12rem;
    line-height: 1.25;
    color: var(--csc-destaque);
    margin: 0 0 .6rem;
}
.csc-etapa-meta {
    font-size: .92rem;
    color: #fff;
    opacity: .92;
    margin-bottom: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.csc-etapa-meta i { margin-right: .35rem; color: var(--csc-laranja-2); width: 1rem; text-align: center; }
.csc-etapa-card .csc-cta {
    display: block;
    text-align: center;
    background: linear-gradient(117deg, var(--csc-laranja) 50%, var(--csc-laranja-2) 50.5%);
    background-size: 220% 100%;
    padding: .6rem .8rem;
    text-decoration: none;
    color: #fff;
    font-family: 'Ruberoid-italic', sans-serif;
    transition: all .25s ease;
}
.csc-etapa-card .csc-cta:hover {
    background-position: 100% 0%;
    color: #fff;
    text-decoration: none;
}

/* ─── Galeria de fotos ─── */
.csc-galeria-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin: .5rem 0 2rem;
}
.csc-galeria-link {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255,255,255,.25);
    padding: .6rem 1rem;
    border-radius: 999px;
    text-decoration: none !important;
    color: #fff !important;
    font-family: 'RuberoidNormal', sans-serif;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.csc-galeria-link:hover {
    background: rgba(247, 147, 30, 0.2);
    border-color: var(--csc-laranja-2);
    color: var(--csc-laranja-2) !important;
}

/* ─── Estado vazio (sem edições no ano corrente) ─── */
.csc-vazio {
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 1rem;
    padding: 3rem 1.5rem;
    max-width: 700px;
    margin: 2rem auto;
}
.csc-vazio i { font-size: 3rem; color: var(--csc-laranja-2); margin-bottom: 1rem; }

/* Botão "Regulamento" na testeira — herda o gradient laranja de .csc-btn-historico
   (visual idêntico ao "Anos anteriores"; o ícone fa-file-pdf é o diferenciador). */

/* ─── Modal "Sobre o Circuito" ─── */
.csc-modal {
    position: fixed;
    inset: 0 0 auto 0;       /* topo/laterais colados; a altura vem do dvh abaixo */
    height: 100dvh;          /* altura REAL visível (desconta a barra do navegador) */
    z-index: 9999;
    overflow: auto;          /* scroll fica no modal, não dentro do dialog */
    padding: 2rem 1rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    animation: csc-modal-in .2s ease;
    /* `margin: auto` no dialog (flex item) centra em ambos eixos quando cabe;
       quando passa do viewport, vira scroll normal */
    display: flex;
}
.csc-modal[hidden] { display: none; }

@keyframes csc-modal-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes csc-modal-dialog-in {
    from { transform: translateY(20px) scale(.97); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.csc-modal__backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(4px);
    cursor: pointer;
    z-index: 0;
}

.csc-modal__dialog {
    position: relative;
    z-index: 1;
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--csc-roxo) 85%, #000) 0%,
        color-mix(in srgb, var(--csc-roxo) 40%, #0a0a14) 100%);
    color: var(--csc-texto);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    max-width: 860px;
    width: 100%;
    margin: auto;            /* centra vertical quando cabe; alinha topo quando passa */
    animation: csc-modal-dialog-in .25s ease;
    overflow: hidden;        /* só pra clipar border-radius */
}

.csc-modal__close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.csc-modal__close:hover {
    background: var(--csc-laranja);
    transform: rotate(90deg);
}

.csc-modal__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 3.5rem 1rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.csc-modal__header i {
    font-size: 1.5rem;
    color: var(--csc-laranja);
    background: rgba(255, 255, 255, .08);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.csc-modal__header h2 {
    margin: 0 !important;
    padding: 0 !important;
    color: var(--csc-destaque) !important;
    font-size: 1.4rem !important;
    text-decoration: none !important;
}

.csc-modal__body {
    padding: 1.5rem 2rem;
    font-size: 1rem;
    line-height: 1.7;
    /* Quebra forçada pra HTML colado do admin não estourar largura */
    word-break: break-word;
    overflow-wrap: anywhere;
}
.csc-modal__body * {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.csc-modal__body p { margin: .75rem 0; color: var(--csc-texto); }
.csc-modal__body p:first-child { margin-top: 0; }
.csc-modal__body p:last-child { margin-bottom: 0; }
.csc-modal__body a { color: var(--csc-laranja); text-decoration: underline; }
.csc-modal__body strong { color: var(--csc-destaque); }
.csc-modal__body img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
    margin: .5rem 0;
}
.csc-modal__body ul, .csc-modal__body ol { padding-left: 1.5rem; margin: .75rem 0; }
.csc-modal__body li { margin: .25rem 0; }
.csc-modal__body table { max-width: 100%; display: block; overflow-x: auto; }
.csc-modal__body pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; }

.csc-modal__footer {
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}
.csc-modal__footer .csc-cta {
    background: linear-gradient(117deg, var(--csc-laranja) 0%, var(--csc-laranja-2) 100%);
    color: #fff;
    padding: .75rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    font-family: 'Ruberoid', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: all .2s ease;
}
.csc-modal__footer .csc-cta:hover {
    transform: translateY(-2px);
}

/* Botão "Sobre o Circuito" na testeira — sem gradient laranja, mais discreto */
.csc-btn-info {
    background: transparent !important;
    background-image: none !important;
    border: 2px solid rgba(255, 255, 255, .35);
    color: #fff !important;
}
.csc-btn-info:hover {
    background: rgba(255, 255, 255, .12) !important;
    border-color: #fff;
    color: #fff !important;
    animation: none !important;
}

@media (max-width: 600px) {
    .csc-modal__dialog { border-radius: .75rem; }
    .csc-modal__header { padding: 1.2rem 3rem 1rem 1rem; }
    .csc-modal__body, .csc-modal__footer { padding-left: 1rem; padding-right: 1rem; }
    .csc-modal__header h2 { font-size: 1.2rem !important; }
    .csc-modal__footer { justify-content: stretch; }
    .csc-modal__footer .csc-cta { flex: 1; justify-content: center; }
}

/* ─── Rodapé (separado do body com fundo escuro) ─── */
.csc-footer {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--csc-roxo) 40%, #0a0a14) 0%,
        #0a0a14 100%);
    padding: 2.5rem 0 1rem;
    margin-top: 0;
    border-top: 4px solid var(--csc-laranja);
}

.csc-rodape {
    max-width: 1280px;
    margin: auto;
    padding: 1rem;
}
.csc-rodape *:not(i):not(svg):not(svg *) { font-family: 'RuberoidNormal', sans-serif; color: #fff; }
.csc-rodapeinfo {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.csc-info-sesc {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    line-height: 1.4rem;
}
.csc-info-sesc p,
.csc-info-sesc a,
.csc-info-sesc strong { font-size: 15px; color: #fff; }
.csc-info-sesc a { text-decoration: none; }
.csc-info-sesc a:hover { text-decoration: underline; }
.csc-info-sesc-marca {
    color: #F6BE00 !important;
    font-weight: 500;
}

.csc-reverse {
    width: 66.6%;
    display: flex;
    flex-direction: row;
}
.csc-logo-rodape {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.csc-logo-rodape img { width: 80%; max-width: 220px; }
.csc-logosistema {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.csc-redes {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.csc-redes p {
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
    color: #fff;
}
/* Círculos brancos com ícone azul Sesc — mesmo padrão do footer principal do site */
ul.csc-redes-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: .65rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
ul.csc-redes-links li {
    margin: 0 !important;
    padding: 0;
    list-style: none;
    line-height: 0;
    display: flex;
    align-items: center;
}
ul.csc-redes-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    box-sizing: border-box;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e0e7f0;
    text-decoration: none !important;
    font-size: 1rem;
    line-height: 1;
    transition: all .25s ease;
    flex-shrink: 0;
}
ul.csc-redes-links a i {
    width: 1em;
    height: 1em;
    line-height: 1;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
/* Cor do ícone — força azul Sesc; a regra global `.csc-page i { color: #fff }` estava
   herdando branco em cima do círculo branco. */
ul.csc-redes-links a,
ul.csc-redes-links a i,
ul.csc-redes-links a i::before {
    color: #004c99 !important;
}
ul.csc-redes-links a:hover {
    background: #004c99;
    border-color: #004c99;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 76, 153, .35);
}
ul.csc-redes-links a:hover,
ul.csc-redes-links a:hover i,
ul.csc-redes-links a:hover i::before {
    color: #fff !important;
}
ul.csc-redes-links a i { line-height: 1; }

.csc-textorodape {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 1rem;
    text-align: center;
    margin-top: 1rem;
    font-size: 14px;
    color: #fff;
}
.csc-textorodape a { color: #fff; }
.csc-textorodape a:hover { color: var(--csc-laranja-2); }

/* ─── Responsivo ─── */
/* ─── Botões da testeira no mobile: viram só ícone, círculos compactos ─── */
@media screen and (max-width: 768px) {
    .csc-btn-historico {
        width: 34px !important;
        min-width: 0 !important;
        height: 34px;
        padding: 0;
        gap: 0;
        font-size: .9rem;
        border-radius: 50%;
        flex-shrink: 0;
    }
    .csc-btn-label { display: none; }
    .csc-testeira-actions { gap: .4rem; }

    /* "Sobre o Circuito" — círculo transparente com borda branca */
    .csc-btn-info {
        background: transparent !important;
        border: 1.5px solid rgba(255, 255, 255, .5);
    }
    .csc-btn-info:hover {
        background: rgba(255, 255, 255, .15) !important;
        border-color: #fff;
    }
}

@media screen and (max-width: 900px) {
    .csc-page { font-size: 1rem; }
    .csc-destaque { flex-direction: column; padding-bottom: 0; }
    .csc-slogan { text-align: center; margin: 0 1rem; }
    .csc-containerunidades { flex-direction: column; width: 100%; }
    .csc-unidade { width: 95%; max-width: 95%; margin: 0.3rem auto; }
    .csc-menu { flex-direction: column; }
    .csc-menu-botao { max-width: 80%; margin: 0.2rem auto; }
    .csc-testeira-info { display: none; }

    /* Mobile: empilha logo em cima dos botões */
    .csc-header { min-height: auto; padding: 1rem; }
    .csc-banner-img { max-width: 80vw; }
    .csc-slogan { text-align: center; margin: 0 1rem; font-size: 20px; }

    .csc-btn-regulamento { min-width: 0; }
    .csc-rodapeinfo { flex-direction: column-reverse; }
    .csc-reverse { width: 100%; flex-direction: column; }
    .csc-logo-rodape { width: 100%; margin: 1rem 0; }
    .csc-logosistema { width: 100%; margin: 2rem auto; }
    .csc-info-sesc { padding: 1rem 0; }
}

@media screen and (max-width: 600px) {
    .csc-btn-historico { min-width: 120px; padding: 0 .6rem; font-size: .9rem; }
    .csc-banner-img { max-width: calc(100% - 2rem); margin: 1rem; }
    .csc-slogan { width: calc(100% - 2rem); font-size: 20px; }
    .csc-conteudo { padding: 1rem; }
}
