/* ── RESET & BASE ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Saira Condensed', sans-serif;
    overflow-x: hidden;
}

:root {
    --yellow: #F4C300;
    --teal: #F4C300;
    --blue: #006ab4;
    --navy: #051B3E;
    --ink: #051B3E;
    --line: #DDE4EF;
    --muted: #6B7F99;
    --bg: #FFFFFF;
    --bg-soft: #F4F7FC;
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
    background: var(--teal);
}

/* Typography Helpers */
.s-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.6rem, 7vw, 6rem);
    line-height: 0.93;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.accent {
    color: var(--blue);
}

.teal-rule {
    display: block;
    width: 44px;
    height: 3px;
    background: var(--yellow);
    margin-bottom: 1.2rem;
}

/* ── NAVBAR ── */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: var(--yellow);
}

.nav-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--navy);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-logo em {
    color: var(--teal);
    font-style: normal;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--navy);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
}

#navbar.scrolled .nav-links a:hover {
    color: var(--navy);
}

#navbar.scrolled .nav-logo {
    color: var(--navy);
}

#navbar.scrolled .nav-socials a {
    color: var(--navy);
}

#navbar.scrolled .nav-socials a:hover {
    color: var(--muted);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--navy);
    transform: scaleX(0);
    transition: transform 0.25s;
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

/* Nav Socials */
.nav-socials {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-socials a {
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: color 0.25s;
}

.nav-socials a:hover {
    color: var(--blue);
}

/* Mobile Menu */
#hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 110;
}

#hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy);
    transition: 0.3s;
}

#mob-menu {
    display: none;
    flex-direction: column;
    gap: 2rem;
    position: fixed;
    inset: 0;
    z-index: 105;
    background: var(--yellow);
    align-items: center;
    justify-content: center;
}

#mob-menu.open {
    display: flex;
}

#mob-menu a {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--navy);
    text-decoration: none;
    text-transform: uppercase;
}

.mob-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--navy);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.mob-close:hover {
    color: var(--blue);
}

.mob-socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.mob-socials a {
    color: var(--navy);
    display: flex;
    align-items: center;
    transition: color 0.25s;
    font-size: 0 !important;
    /* reset do font-size herdado do #mob-menu a */
}

.mob-socials a:hover {
    color: var(--blue);
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    line-height: 1;
    margin-bottom: 3rem;
    text-transform: uppercase;
    color: var(--navy);
    letter-spacing: -1px;
}

.section-title span {
    color: var(--teal);
}

/* ── HERO ── */
#hero {
    position: relative;
    height: 85vh;
    min-height: 550px;
    overflow: hidden;
    display: flex;
    background: var(--navy);
}

.h-bg-fixed {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.18;
    filter: saturate(0.5);
    z-index: 1;
}

.h-slides,
.h-slide {
    position: absolute;
    inset: 0;
}

.h-slide {
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.4s ease;
    filter: brightness(1) saturate(0.6);
}

.h-slide.active {
    opacity: 0.12;
}

.h-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
}

.h-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    padding: 0 2.5rem;
    align-items: flex-end;
    height: 100%;
}

.h-pilot-side {
    flex: 1;
    display: flex;
    align-items: flex-end;
    align-self: flex-end;
}

.pilot-img {
    height: 100%;
    max-height: 75vh;
    width: auto;
    object-fit: contain;
    object-position: bottom;
    display: block;
}

.h-info-side {
    flex: 1.2;
    display: flex;
    align-items: center;
    padding-bottom: 60px;
    padding-top: 80px;
    align-self: center;
}

.h-name {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 0.9;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.h-desc {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
}

.h-desc strong {
    color: var(--yellow);
}

/* Hero — Timer próxima corrida */
.h-next-race {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.h-next-label {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.h-next-label::before {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--yellow);
}

.h-countdown {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.8rem 1.4rem;
    gap: 4px;
    width: fit-content;
}

.h-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.h-cd-unit span {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: #fff;
    background: none;
    border: none;
    padding: 0 0.5rem;
    min-width: 52px;
    text-align: center;
    line-height: 1;
}

.h-cd-unit small {
    font-size: 0.48rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--yellow);
    text-transform: uppercase;
}

.h-cd-sep {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.3);
    padding-bottom: 0.8rem;
    opacity: 1;
    align-self: flex-start;
    padding-top: 0.1rem;
}

.h-cal-btn {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.85rem 2rem;
    background: var(--yellow);
    color: var(--navy);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
    width: fit-content;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.h-cal-btn:hover {
    background: #fff;
    border-color: #fff;
    color: var(--navy);
    box-shadow: 0 6px 20px rgba(5, 27, 62, 0.25);
    transform: translateY(-2px);
}

/* ── STATS ── */
#stats {
    height: 15vh;
    min-height: 100px;
    background: var(--navy);
    display: flex;
    align-items: center;
    z-index: 20;
}

.stats-row {
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.stat-item {
    flex: 1;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-right: none;
}

.stat-n {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #ffffff;
    line-height: 1;
}

.stat-l {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--yellow);
    letter-spacing: 0.08em;
    margin-top: 3px;
}

/* ── CATEGORIA ── */
#categoria {
    position: relative;
    padding: 8rem 0;
    background: var(--blue);
}

#categoria .section-title,
#categoria .cat-description,
#categoria .cat-description p,
#categoria .cat-description strong {
    color: var(--bg);
}

#categoria .teal-rule {
    background: var(--yellow);
}

.cat-bg-overlay {
    position: absolute;
    inset: 0;
    background: url('background-copatruck.webp') center/cover;
    z-index: 1;
    display: block;
}

#categoria::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    background: #0069b4de;
}

.cat-wrapper {
    position: relative;
    z-index: 3;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

.cat-content {
    max-width: 650px;
}

.cat-copatruck {
    width: 152px;
    margin-bottom: 1.5rem;
}

.cat-dmais {
    width: 96px;
    margin-bottom: 1.5rem;
}

.cat-description {
    margin-top: 2.5rem;
    font-size: 1.15rem;
    line-height: 1.8;
}


/* ── EQUIPE D+ MOTORSPORT ── */
#equipe {
    position: relative;
    padding: 8rem 0;
    background: var(--blue);
}

.equipe-bg-overlay {
    position: absolute;
    inset: 0;
    background: url('background-dmais-motorsport.webp') center/cover;
    z-index: 1;
}

/* Gradiente radial: navy nas bordas → quase transparente no centro */
#equipe::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #0069b4de;
    z-index: 2;
}

#equipe .section-title,
#equipe .cat-description,
#equipe .cat-description p,
#equipe .cat-description strong {
    color: var(--bg);
}

#equipe .teal-rule {
    background: var(--yellow);
}

/* Conteúdo alinhado à direita (espelhado em relação à Copa Truck) */
.cat-content--right {
    max-width: 650px;
    text-align: left;
}

/* ── PATROCINADORES ── */
#patrocinadores {
    padding: 3rem 0;
    overflow: hidden;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.spon-lbl {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 2rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.spon-track {
    display: flex;
}

.spon-inner {
    display: flex;
    align-items: center;
    gap: 4rem;
    animation: scrollSp 40s linear infinite;
    width: max-content;
}

.spon-inner a {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.spon-logo {
    object-fit: contain;
    flex-shrink: 0;
    filter: none;
    pointer-events: none;
}

.spon-logo:hover {
    filter: none;
    transform: none;
}

@keyframes scrollSp {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ── CALENDÁRIO ── */
#calendario {
    background: var(--navy);
    padding: 6rem 0;
}

.cal-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.cal-main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1;
    margin-bottom: 3rem;
    text-transform: uppercase;
    color: #ffffff;
}

.cal-main-title span {
    color: var(--teal);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    background: transparent;
    border: none;
    margin-bottom: 14px;
}

.rc {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    border: 1px solid;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(5, 27, 62, 0.05);
    transition: all 0.3s ease;
}

.rc:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--yellow);
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 106, 180, 0.14);
}

/* Card vazio — sem interação */
.rc.empty {
    pointer-events: none;
    background: transparent;
    border: none !important;
    box-shadow: none !important;
    min-height: 280px;
}

.rc.done {
    opacity: 0.4;
}

.rc.is-next {
    border: 1px solid var(--yellow) !important;
    box-shadow: 0 10px 30px rgba(244, 195, 0, 0.2);
    background: rgba(244, 195, 0, 0.08);
    transform: scale(1.02);
    z-index: 2;
}

.rc-track {
    height: 60px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.rc-track img {
    max-height: 100%;
    filter: brightness(0) invert(1);
    opacity: 0.4;
}

.rc-d {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    line-height: 1;
    color: #ffffff;
}

.rc-m {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.rc-c {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    color: #ffffff;
}

.rc-s {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.badge {
    margin-top: auto;
    width: fit-content;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.5rem 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 6px;
}

.b-done {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
    border: 1px solid;
}

.b-soon {
    border: 1px solid;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
}

/* Estilo Próxima Corrida - destaque */
.b-next {
    background: var(--teal);
    color: #051B3E;
    font-size: 0.75rem;
    padding: 0.55rem 1.2rem;
    box-shadow: 0 0 14px rgba(244, 195, 0, 0.5);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(244, 195, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 22px rgba(244, 195, 0, 0.8);
    }
}

/* Next Race Area */

/* ── RESULTADOS NOS CARDS DO CALENDÁRIO ── */
.rc-results {
    margin-top: auto;
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.8rem;
}

.rc-res-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.rc-res-item:last-child {
    border-right: none;
}

.rc-res-pos {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--yellow);
    line-height: 1;
}

.rc-res-label {
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    white-space: nowrap;
}

/* Vitória (P1) em destaque */
.rc-res-pos[data-pos="1"] {
    color: #FFD700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.next-race-wrapper {
    background: rgba(255, 255, 255, 0.05);
    padding: 4rem 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    border-top: 3px solid var(--yellow);
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Linha divisória entre as duas colunas */
.next-race-wrapper::after {
    display: none;
}

.next-col {
    padding: 0 3rem;
}

.info-col {
    padding-left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Coluna direita: contador em cima, botão embaixo */
.next-right-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 2rem;
    padding-right: 0;
}

.next-tag {
    background: var(--teal);
    color: #051B3E;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 0.3rem 0.6rem;
    display: inline-block;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.next-date-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1rem;
}

.next-main-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.next-day {
    font-family: 'Orbitron', sans-serif;
    font-size: 7rem;
    color: var(--teal);
    line-height: 0.8;
}

.next-mo-yr {
    display: flex;
    flex-direction: column;
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

.next-city {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: #ffffff;
    text-transform: uppercase;
}

.next-detail {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    margin-top: 5px;
}

.next-mo {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 700;
}

.next-dt {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
}

.next-countdown {
    text-align: left;
}

.timer-col {
    text-align: center;
}

.btn-tickets {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--teal);
    color: #051B3E;
    padding: 0.8rem 1.8rem;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.btn-tickets-new {
    border: 1px solid var(--yellow);
    color: var(--navy);
    background: var(--yellow);
    padding: 1.2rem 2.5rem;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.btn-tickets-new:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    box-shadow: 0 0 20px rgba(5, 27, 62, 0.2);
}

.btn-tickets:hover {
    background: #fff;
    color: #000;
    box-shadow: 0 0 20px var(--teal);
}

/* Countdown */
.cd-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.cd-timer {
    display: flex;
    gap: 8px;
}

.cd-timer-digital {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
}

.cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cd-unit small {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--yellow);
    margin-top: 8px;
    text-transform: uppercase;
}

.cd-num {
    background: none;
    color: var(--yellow);
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    padding: 0 0.6rem;
    border: none;
    min-width: 80px;
    box-shadow: none;
}

.cd-box {
    background: var(--teal);
    color: #051B3E;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cd-box span {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    line-height: 1;
}

.cd-box small {
    font-size: 0.5rem;
    font-weight: 800;
    margin-top: 2px;
    opacity: 0.6;
}

.cd-sep {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--line);
    padding-bottom: 1.2rem;
    /* Alinha os dois pontos com o número */
}

/* ── GALERIA ── */
#galeria {
    padding: 6rem 0;
    background: var(--navy);
}

.gal-container {
    text-align: center;
}

#galeria .section-title {
    color: #fff;
}

#galeria .section-title span {
    color: var(--yellow);
}

#galeria .teal-rule {
    background: var(--yellow);
}

.gal-tabs-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 4rem;
}

.gtab {
    font-family: 'Saira Condensed', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.6rem 1.4rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.gtab.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.gal-ticker-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.gal-ticker-track {
    display: flex;
    width: max-content;
    animation: scrollGal 40s linear infinite;
}

.gal-ticker-track:hover {
    animation-play-state: paused;
}

.gal-group {
    display: grid;
    grid-template-rows: repeat(2, 260px);
    grid-auto-flow: column;
    gap: 15px;
    padding-right: 15px;
}

.g-item {
    width: 380px;
    height: 260px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    position: relative;
}

.g-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.75);
    transition: 0.5s;
    border-radius: 6px;
}

.g-item:hover img {
    filter: brightness(1.1);
    transform: scale(1.05);
}

.g-item:hover {
    border-color: var(--blue);
}

.g-panel {
    display: none;
}

.g-panel.active {
    display: block;
}

@keyframes scrollGal {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ── LIGHTBOX ── */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(5, 27, 62, 0.97);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#lightbox.open {
    display: flex;
}

#lb-img {
    max-height: 85vh;
    max-width: 90vw;
    object-fit: contain;
}

#lb-x {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    cursor: pointer;
}

#lb-p,
#lb-n {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    color: var(--teal);
    cursor: pointer;
    padding: 20px;
    user-select: none;
}

#lb-p {
    left: 10px;
}

#lb-n {
    right: 10px;
}

/* ── HISTÓRICO & FORM ── */
#historico {
    padding: 6rem 0;
    text-align: center;
    background: var(--bg);
}

.hist-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hist-tabs-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    display: flex;
    width: 100%;
    padding: 6px 0;
}

.hist-tabs-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.hist-tabs {
    display: flex;
    gap: 15px;
    white-space: nowrap;
    /* Impede que os botões quebrem linha */
}

.htab {
    padding: 0.6rem 2rem;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.htab.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 106, 180, 0.3);
}

.hist-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.hist-content.active {
    display: block;
}

.hist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    min-height: 450px;
}

.hist-text {
    text-align: left;
}

.hist-text h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hist-text p {
    font-size: 1.25rem;
    color: var(--muted);
    line-height: 1.7;
    font-weight: 300;
}

.hist-media {
    position: relative;
}

.hist-media img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 20px 20px 0px rgba(244, 195, 0, 0.1);
    /* Detalhe estético */
}

.hist-header {
    display: none;
}

/* Ticker container — máscara de fade nas bordas */
.hist-photo-grid {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
    padding: 8px 0 16px;
}

/* Faixa que rola — duplicada no HTML para loop perfeito */
.hist-ticker-track {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 15px;
    animation: scrollHist 35s linear infinite;
}

.hist-ticker-track:hover {
    animation-play-state: paused;
}

@keyframes scrollHist {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.h-thumb {
    flex-shrink: 0;
    width: 360px;
    height: 260px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 6px;
    transition: all 0.3s ease;
    background: var(--bg-soft);
}

.hist-navigation {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto 3rem;
    padding: 6px 40px;
    /* Espaço para as setas + espaço vertical para o translateY do botão ativo */
    overflow: visible;
}

.hist-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 106, 180, 0.1);
    border: 1px solid var(--blue);
    color: var(--blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hist-nav-btn:hover {
    background: var(--blue);
    color: #fff;
}

.hist-nav-btn.prev {
    left: 0;
}

.hist-nav-btn.next {
    right: 0;
}

.hist-navigation::before,
.hist-navigation::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    pointer-events: none;
    z-index: 2;
}

.hist-navigation::before {
    left: 40px;
    background: linear-gradient(to right, var(--bg), transparent);
}

.hist-navigation::after {
    right: 40px;
    background: linear-gradient(to left, var(--bg), transparent);
}

.h-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.75) grayscale(0.3);
    transition: all 0.5s ease;
    border-radius: 6px;
}

.h-thumb:hover {
    border-color: var(--blue);
    transform: scale(1.02);
    z-index: 2;
}

.h-thumb:hover img {
    filter: brightness(1) grayscale(0);
}

/* Ajuste Mobile */
@media (max-width: 768px) {
    .h-thumb {
        width: 260px;
        height: 180px;
    }
}

@media (max-width: 900px) {
    .hist-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hist-text {
        text-align: center;
    }

    .hist-text h3 {
        font-size: 2rem;
    }

    .hist-media img {
        height: 300px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.tl-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 2rem 0;
}

.ttab {
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    color: var(--muted);
    transition: 0.3s;
}

.ttab.active {
    color: var(--blue);
    border-bottom: 2px solid var(--blue);
}

#contato {
    padding: 6rem 0;
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
}

.ct-in {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    padding: 0 2rem;
}

.ct-lnk {
    color: var(--teal);
    font-size: 1.5rem;
    text-decoration: none;
    font-weight: 700;
}

.ct-f {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ct-f input,
.ct-f textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    color: var(--navy);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.ct-f input:focus,
.ct-f textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 106, 180, 0.1);
}

.ct-f textarea {
    min-height: 130px;
    resize: vertical;
}

.button-col {
    display: flex;
    justify-content: flex-end;
}

.btn-send {
    background: var(--yellow);
    color: var(--navy);
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.05em;
    transition: background 0.3s, transform 0.2s;
    font-weight: 700;
}

.btn-send:hover:not(:disabled) {
    background: var(--navy);
    color: #fff;
    transform: translateY(-2px);
}

.btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.f-ok {
    display: none;
    color: var(--blue);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.f-err {
    display: none;
    color: #ff5555;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ── REVEAL ── */
.rv {
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s ease-out;
}

.rv.on {
    opacity: 1;
    transform: translateY(0);
}

.d1 {
    transition-delay: 0.1s;
}

.d2 {
    transition-delay: 0.2s;
}

.d3 {
    transition-delay: 0.3s;
}

/* ── FOOTER ── */
footer {
    border-top: 1px solid var(--line);
    background: var(--navy);
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 5rem 2.5rem 3rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 4rem;
}

.footer-brand .f-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
}

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

.f-tagline {
    font-size: 0.9rem;
    color: #7B9CC4;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.f-socials {
    display: flex;
    gap: 14px;
}

.f-socials a {
    color: #7B9CC4;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.f-socials a:hover {
    color: var(--blue);
}

.footer-col-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--teal);
    margin-bottom: 1.4rem;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.footer-links a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.25s;
}

.footer-links a:hover {
    color: var(--yellow);
}

.footer-patrocinio {
    margin-top: 1.8rem;
    padding-top: 1.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-patrocinio p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.8rem;
}

.footer-cta {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: var(--yellow);
    color: var(--navy);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: background 0.3s;
    border-radius: 6px;
    font-weight: 700;
}

.footer-cta:hover {
    background: #fff;
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
}

.footer-bottom strong {
    color: rgba(255, 255, 255, 0.5);
}

/* ── RESPONSIVIDADE ── */
@media (max-width: 1024px) {
    .cal-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .rc.empty {
        display: none;
    }

    .ct-in {
        grid-template-columns: 1fr;
    }


    /* ── RESULTADOS NOS CARDS DO CALENDÁRIO ── */
    .rc-results {
        margin-top: auto;
        display: flex;
        gap: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 0.8rem;
    }

    .rc-res-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 0 4px;
        border-right: 1px solid rgba(255, 255, 255, 0.07);
    }

    .rc-res-item:last-child {
        border-right: none;
    }

    .rc-res-pos {
        font-family: 'Orbitron', sans-serif;
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--yellow);
        line-height: 1;
    }

    .rc-res-label {
        font-size: 0.52rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.4);
        text-align: center;
        white-space: nowrap;
    }

    /* Vitória (P1) em destaque */
    .rc-res-pos[data-pos="1"] {
        color: #FFD700;
        text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    }

    .next-race-wrapper {
        grid-template-columns: 1fr;
        padding: 2.5rem 1.5rem;
        gap: 0;
    }

    .info-col {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 2rem;
        padding-left: 0;
        text-align: center;
        align-items: center;
    }

    .next-right-col {
        padding-top: 2rem;
        padding-left: 0;
        align-items: center;
    }

    .cd-timer-digital {
        justify-content: center;
    }

    .next-date-row {
        justify-content: center;
    }
}

@media (max-width: 768px) {

    /* Navbar */
    #navbar {
        padding: 0 1rem;
    }

    .nav-links,
    .nav-socials {
        display: none;
    }

    #hamburger {
        display: flex;
    }

    /* Hero */
    #hero {
        height: auto;
        min-height: 100svh;
    }

    /* Gradiente na parte inferior da seção hero */
    #hero::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 45%;
        background: linear-gradient(to top, #000 0%, transparent 100%);
        pointer-events: none;
        z-index: 1;
    }

    .h-wrapper {
        flex-direction: column;
        align-items: center;
        padding: 0;
        min-height: 100svh;
    }

    .h-pilot-side {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        flex: 0 0 55svh;
        padding-top: 60px;
        position: relative;
        z-index: 1;
    }

    .pilot-img {
        height: 55svh;
        width: auto;
        object-fit: contain;
        object-position: bottom center;
    }

    .h-info-side {
        order: 2;
        width: 100%;
        flex: 0 0 auto;
        display: flex;
        align-items: flex-start;
        padding: 0 1.5rem 3rem;
        position: relative;
        z-index: 2;
    }

    .h-text-content {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
    }

    .h-name {
        font-size: clamp(2.8rem, 14vw, 5rem);
        text-align: center;
        margin-bottom: 0.8rem;
    }

    .h-desc {
        font-size: 0.95rem;
        text-align: center;
    }

    /* Hero timer */
    .h-next-race {
        align-items: center;
        margin-top: 1.2rem;
        width: 100%;
    }

    .h-next-label {
        justify-content: center;
    }

    .h-next-label::before {
        display: none;
    }

    .h-countdown {
        gap: 4px;
        justify-content: center;
    }

    .h-cd-unit span {
        font-size: 1.4rem;
        min-width: 46px;
        padding: 0.3rem 0.5rem;
    }

    .h-cd-sep {
        font-size: 1rem;
        padding-bottom: 1.2rem;
    }

    .h-cal-btn {
        font-size: 0.75rem;
        padding: 0.6rem 1.2rem;
    }

    /* Stats */
    .stat-item {
        border: none;
    }

    .stat-n {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .stat-l {
        font-size: 0.65rem;
    }

    /* Categoria */
    .cat-wrapper {
        padding: 0 1.5rem;
    }

    .s-title {
        font-size: clamp(1.6rem, 7vw, 2.8rem);
    }

    .cat-description {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    /* Calendário */
    #calendario {
        padding: 4rem 0;
    }

    .cal-container {
        padding: 0 1rem;
    }

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

    /* Oculta card vazio no mobile para não gerar espaço */
    .rc.empty {
        display: none;
    }

    .rc {
        padding: 1.2rem 1rem;
        min-height: 220px;
    }

    .rc-d {
        font-size: 2.2rem;
    }

    .rc-c {
        font-size: 1rem;
    }

    /* Próxima corrida / timer */

    /* ── RESULTADOS NOS CARDS DO CALENDÁRIO ── */
    .rc-results {
        margin-top: auto;
        display: flex;
        gap: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 0.8rem;
    }

    .rc-res-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 0 4px;
        border-right: 1px solid rgba(255, 255, 255, 0.07);
    }

    .rc-res-item:last-child {
        border-right: none;
    }

    .rc-res-pos {
        font-family: 'Orbitron', sans-serif;
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--yellow);
        line-height: 1;
    }

    .rc-res-label {
        font-size: 0.52rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.4);
        text-align: center;
        white-space: nowrap;
    }

    /* Vitória (P1) em destaque */
    .rc-res-pos[data-pos="1"] {
        color: #FFD700;
        text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    }

    .next-race-wrapper {
        padding: 2.5rem 1.5rem;
        gap: 1.5rem;
        text-align: center;
        grid-template-columns: 1fr;
        overflow: hidden;
    }

    .next-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .next-day {
        font-size: 3.5rem;
    }

    .cd-num {
        font-size: 1.8rem;
        min-width: 56px;
        padding: 0.4rem 0.5rem;
    }

    .cd-timer-digital {
        gap: 5px;
    }

    .cd-sep {
        font-size: 1rem;
        padding-bottom: 1rem;
    }

    .btn-tickets-new {
        padding: 0.9rem 1.8rem;
        font-size: 0.8rem;
    }

    /* Galeria */
    #galeria {
        padding: 4rem 0;
    }

    .gal-container {
        overflow: hidden;
    }

    .section-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
        padding: 0 1.5rem;
    }

    .gal-tabs-wrapper {
        padding: 0 1rem;
        gap: 8px;
    }

    .gtab {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .g-item {
        width: 260px;
        height: 180px;
    }

    .gal-group {
        grid-template-rows: repeat(2, 180px);
        gap: 10px;
        padding-right: 10px;
    }

    /* Histórico */
    #historico {
        padding: 4rem 0;
    }

    .hist-container {
        padding: 0 1rem;
    }

    .hist-navigation {
        padding: 6px 36px;
        margin-bottom: 2rem;
    }

    .htab {
        font-size: 0.75rem;
        padding: 0.5rem 1.2rem;
    }

    /* Contato */
    #contato {
        padding: 4rem 0;
    }

    .ct-in {
        padding: 0 1.5rem;
        gap: 2.5rem;
    }

    /* Footer */
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 3rem 1.5rem 2rem;
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .f-socials {
        justify-content: center;
    }

    .footer-patrocinio {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 1.2rem 1.5rem;
    }
}

/* Extra pequeno — 375px */
@media (max-width: 400px) {
    .h-cd-unit span {
        font-size: 1.2rem;
        min-width: 40px;
        padding: 0.25rem 0.4rem;
    }

    .cal-grid {
        grid-template-columns: 1fr;
    }

    .cd-num {
        font-size: 1.5rem;
        min-width: 48px;
    }

    /* Próxima corrida — evita overflow em telas estreitas */
    .next-race-wrapper {
        padding: 2rem 1rem;
    }

    .next-city {
        font-size: clamp(1.4rem, 8vw, 2.2rem);
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .next-day {
        font-size: 2.8rem;
    }

    .next-mo-yr {
        font-size: 1rem;
    }

    .next-detail {
        font-size: 0.85rem;
    }

    .cd-timer-digital {
        gap: 3px;
    }

    .cd-sep {
        font-size: 0.85rem;
    }

    .btn-tickets-new {
        font-size: 0.8rem;
        padding: 0.9rem 1rem;
    }


    /* ── RESULTADOS NOS CARDS DO CALENDÁRIO ── */
    .rc-results {
        margin-top: auto;
        display: flex;
        gap: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 0.8rem;
    }

    .rc-res-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 0 4px;
        border-right: 1px solid rgba(255, 255, 255, 0.07);
    }

    .rc-res-item:last-child {
        border-right: none;
    }

    .rc-res-pos {
        font-family: 'Orbitron', sans-serif;
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--yellow);
        line-height: 1;
    }

    .rc-res-label {
        font-size: 0.52rem;
        font-weight: 800;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.4);
        text-align: center;
        white-space: nowrap;
    }

    /* Vitória (P1) em destaque */
    .rc-res-pos[data-pos="1"] {
        color: #FFD700;
        text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
    }

    .next-race-wrapper {
        padding: 2rem 1rem;
    }
}