:root {
    --title-font: "Chakra Petch", system-ui, sans-serif;
    --text-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --subtitle-font: "Rajdhani", system-ui, sans-serif;
    --red-color: #cc0000;
    --text-color: #94a3b8;
    --white-color: #fff;
    --grey-color: #96999d;
    --border-radius: 8px;
    --padding-top: 60px;
    --padding-bottom: 60px;
    --border-grey: 1px solid #FFFFFF1A;
    --redbg-hover: #bf0000;
    --red-gradient: linear-gradient(to right, var(--red-color) 0%, rgba(255, 0, 59, 0.6) 100%);
    --dark-bg: #0a0d12;
}

*,*::before, *::after{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal overflow on small devices */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.bg{
    background-image: linear-gradient(rgba(0,0,0,0.80), rgba(0,0,0,0.40)), url(../img/index/hero_bg.webp);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* MAIN */

main{
    padding-top: var(--padding-top);
    padding-bottom: var(--padding-bottom);
    border-bottom: 1px solid #FFFFFF1A;
}

.main_container{
    max-width: 1400px;
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    padding-top: var(--padding-top);
    padding-left: 10px;
    padding-right: 10px;
}

.main_text{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.main_text h1{
    font-size: 96px;
    font-family: var(--title-font);
    margin-bottom: 24px;
    text-transform: uppercase;
    width: 70%;
    font-style: italic;
    font-weight: 700;
    line-height: 100px;
    letter-spacing: -0.02em;
    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        #f2f2f2 40%,
        #96999d 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main_text h2{
    font-size: 20px;
    color: var(--text-color);
    font-family: var(--text-font);
    font-weight: 400;
    width: 40%;
    line-height: 1.6;
    margin-bottom: 40px;
}

/* MAIN BUTTONS */

.main_buttons{
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Contenedor opcional */
.main_button{
  display: flex;
}

/* BOTÓN BASE */
.main_button a{
    --skew: -14deg;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    width: auto;
    padding: 0 28px;
    background: var(--red-color);
    color: var(--white-color);
    text-decoration: none;
    letter-spacing: .06em;
    text-transform: uppercase;
    transform: skewX(var(--skew));
    border-radius: 2px;
    box-shadow: 0 12px 24px rgba(0,0,0,.35);
    transition: all .25s ease;
    font-family: var(--title-font);
    font-size: 20px;
    font-weight: 700;
}

/* Enderezamos texto e íconos */
.main_button a p,
.main_button a svg{
    transform: skewX(14deg);
}

/* TEXTO */
.main_button a p{
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
}

/* ICONOS */
.main_button a svg{
    width: 20px;
    height: 20px;
}

/* HOVER */
.main_button a:hover{
    filter: brightness(1.08);
    transform: skewX(var(--skew)) translateY(-1px);
}

/* SEGUNDO BOTÓN (negro / ghost) */
.main_button:nth-child(2) a{
    background: rgba(10,12,16,.65);
    border: 1px solid var(--grey-color);
    box-shadow: none;
}

.main_button:nth-child(2) a:hover{
    border-color: var(--grey-color);
}

/* TERCER BOTÓN (gris / ghost) */
.main_button:nth-child(3) a{
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}

.main_button:nth-child(3) a:hover{
    border-color: var(--grey-color);
}

/* LIVE YOUTUBE BUTTON */

.live_button{
    display: flex;
}

.live_button a{
    --skew: -14deg;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    width: auto;
    padding: 0 28px;
    background: var(--red-color);
    color: var(--white-color);
    text-decoration: none;
    letter-spacing: .06em;
    text-transform: uppercase;
    transform: skewX(var(--skew));
    border-radius: 2px;
    box-shadow: 0 12px 24px rgba(0,0,0,.35);
    transition: all .25s ease;
    font-family: var(--title-font);
    font-size: 20px;
    font-weight: 700;
    border: var(--border-grey);
}

.live_button a p, .live-dot{
    transform: skewX(14deg);
}

.live_button a p{
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
}

.live_button a:hover{
    filter: brightness(1.08);
    transform: skewX(var(--skew)) translateY(-1px);
}

.live-dot{
    background: var(--white-color);
    position: relative;
    box-shadow:
        0 0 0 0 rgba(255,26,26,.0),
        0 0 10px rgba(255, 255, 255, 0.75),
        0 0 22px rgba(255, 255, 255, 0.55);
    animation: livePulse 1.1s infinite ease-in-out;
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0; 
}

.live-dot::after{
    content:"";
    position:absolute;
    inset:-10px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255,26,26,0) 70%);
    filter: blur(2px);
    opacity: .0;
    transform: scale(.85);
    animation: liveTrail 1.1s infinite ease-in-out;
}

.live_button a p, .live-dot{
    transform: skewX(14deg) !important;
}

@keyframes livePulse{
    0%, 100%{
        opacity: .35;
        transform: scale(.92);
        box-shadow:
        0 0 0 0 rgba(255,26,26,.0),
        0 0 6px rgba(255,26,26,.35),
        0 0 14px rgba(255,26,26,.20);
    }
    45%{
        opacity: 1;
        transform: scale(1);
        box-shadow:
        0 0 0 6px rgba(255,26,26,.10),
        0 0 14px rgba(255,26,26,.95),
        0 0 34px rgba(255,26,26,.65);
    }
}

@keyframes liveTrail{
    0%, 100%{
        opacity: 0;
        transform: scale(.85);
    }
    45%{
        opacity: 1;
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce){
    .live-dot, .live-dot::after{ animation: none; }
}

/* END OF YOUTUBE LIVE LINK */

.sistem_container{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 10px;
}

.sistem_container .dot{
    width: 10px;
    height: 10px;
    border-radius: 100%;
    background-color: #00c951;
    animation: pulse 1.4s ease-in-out infinite;
}

.sistem_container p{
    font-family: var(--subtitle-font);
    font-size: 16px;
    line-height: 1.4;
    color: var(--white-color);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 201, 81, 0.7);
    }
    50% {
        transform: scale(1.25);
        opacity: 0.6;
        box-shadow: 0 0 0 6px rgba(0, 201, 81, 0);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 201, 81, 0);
    }
}

/* FIRST SECTION - NEXT RACE COUNTER */

.first_wrapper{
    background-image: linear-gradient(rgba(5, 5, 5, 0.8), rgba(5, 5, 5, 0.80)), url(../img/escuderia-bg-vertical/mclaren_bg.webp);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding-top: var(--padding-top);
    padding-bottom: var(--padding-bottom);
}

.first_container{
    max-width: 1100px;
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: auto;
    gap: 64px;
}

.first_title{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    margin-bottom: 16px;
}

.first_icon{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.first_icon h2{
    font-family: var(--title-font);
    font-size: 18px;
    text-transform: uppercase;
    color: var(--red-color);
    letter-spacing: 1.8px;
    font-weight: 700;
    line-height: 1.5;
}

.race_title{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    text-align: center;
}

.race_title h3{
    font-size: 60px;
    font-family: var(--title-font);
    font-style: italic;
    line-height: 1.25;
    font-weight: 700;
    background: linear-gradient(to right, var(--red-color) 0%, rgba(255, 0, 59, 0.6) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.race_title h4{
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-color);
    font-family: var(--text-font);
    font-weight: 400;
}   

.counter_container{
    max-width: 600px;
    width: 100%;
    margin: auto;
}

.counter{
    display: flex;
    gap: 32px;
    align-items: center;
    justify-content: center;
}

.counter_item{
    max-width: 100px;
    width: 100%;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.number_box{
    border-radius: var(--border-radius);
    border: 1px solid var(--red-color);
    max-width: 92px;
    width: 100%;
    height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--title-font);
    font-size: 36px;
    line-height: 1.1;
    color: var(--red-color);
    font-weight: 700;
    padding: 20px;
    background: linear-gradient(to right, rgba(255, 0, 59, 0.1), rgba(255, 0, 59, 0.1));
}

.dots_counter{
    color: #ff003b4d;
    font-size: 36px;
    font-weight: 700;
    font-family: var(--text-font);
    padding-bottom: 16px;
}

.counter_item span{
    color: var(--text-color);
    font-family: var(--title-font);
    font-size: 14px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-weight: 700;
}

.nextrace_features{
    max-width: 900px;
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    margin: auto;
}

.nextrace_feature{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 250px;
    width: 100%;
    border: 1px solid #FFFFFF1A;
    border-radius: var(--border-radius);
    padding: 24px;
    background-color: #00000066;
    transition: .5s all ease;
}

.nextrace_feature:hover{
    border: 1px solid var(--red-color);
}

.nextrace_feature p{
    text-transform: uppercase;
    font-family: var(--title-font);
    font-size: 14px;
    line-height: 1.3;
    color: var(--text-color);
    font-weight: 700;
}

.nextrace_feature span{
    font-size: 20px;
    font-weight: 700;
    font-family: var(--title-font);
    color: var(--white-color);
}

.nextrace_feature img{
    width: 15px;
    height: 15px;
}

.nextrace_feature div{
    display: flex;
    align-items: center;
    gap: 6px;
}

.red{
    color: var(--red-color) !important;
}

/* SECOND SECTION / LAST POST */

.second_wrapper{
    padding-top: var(--padding-top);
    padding-bottom: var(--padding-bottom);
    background-color: #0a0d12;
}

.second_container{
    border-radius: 16px;
    border: var(--border-grey);
    max-width: 1300px;
    width: 100%;
    margin: auto;
}

.last_post{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    background-color: #000;
    border-radius: 16px;
    height: 500px;
    overflow: hidden;
}

.last_post_img{
    /* FIX: sin max-width fijo, ocupa lo que necesita dentro del flex */
    flex: 1 1 55%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.last_post_img img{
    width: 100%;
    height: 100%;
    border-radius: 16px 0 0 16px;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.last_post_img:hover img {
  transform: scale(1.1);
}

.last_post_info{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* FIX: flex en lugar de max-width fijo */
    flex: 1 1 45%;
    min-width: 0;
    padding: 32px 28px;
    height: 100%;
    justify-content: space-around;
}

.last_post_banners{
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.banner_1{
    display: flex;
    gap: 6px;
    background-color: var(--red-color);
    padding: 4px 12px;
    border-radius: var(--border-radius);   
    align-items: center;
    justify-content: center;
    width: auto;
}

.banner_1 svg{
    width: 12px;
    height: 12px;
}

.banner_1 p{
    font-family: var(--title-font);
    color: var(--white-color);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.banner_2{
    border-left: var(--border-grey);
    padding-left: 16px;
}

.banner_2 p{
    font-family: var(--subtitle-font);
    color: var(--grey-color);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
}

.last_post_textbox{
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
}

.last_post_textbox h2{
    font-size: 38px;
    line-height: 1.1;
    font-family: var(--title-font);
    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        #f2f2f2 40%,
        #96999d 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    margin-bottom: 16px;
}

.last_post_textbox h3{
    color: var(--text-color);
    font-family: var(--text-font);
    font-weight: 300;
    font-size: 18px;
    margin-bottom: 16px;
    line-height: 1.6;
}

.last_post_author{
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.author, .date{
    display: flex;
    gap: 8px;
    align-items: center;
}

.author p, .date p{
    font-family: var(--subtitle-font);
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.4;
    font-weight: 500;
}

.author svg, .date svg{
    width: 16px;
    height: 16px;
}

/* Contenedor opcional */
.post_button{
  display: flex;
}

/* BOTÓN BASE */
.post_button a{
    --skew: -14deg;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    width: auto;
    padding: 0 28px;
    background: var(--white-color);
    color: #000;
    text-decoration: none;
    letter-spacing: .06em;
    text-transform: uppercase;
    transform: skewX(var(--skew));
    border-radius: 2px;
    box-shadow: 0 12px 24px rgba(0,0,0,.35);
    transition: all .25s ease;
    font-family: var(--title-font);
    font-size: 20px;
    font-weight: 700;
}

.post_button a p,
.post_button a svg{
    transform: skewX(14deg);
}

.post_button a p{
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
}

.post_button a svg{
    width: 20px;
    height: 20px;
}

.post_button a:hover{
    filter: brightness(1.08);
    transform: skewX(var(--skew)) translateY(-1px);
}

/* THIRD SECTION - LAST OPINIONS */

.third_wrapper{
    padding-bottom: var(--padding-bottom);
    background-color: #0a0d12;
}

.third_container{
    max-width: 1300px;
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.third_title{
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    gap: 16px;
}

.third_title h2{
    font-family: var(--title-font);
    font-weight: 700;
    font-style: italic;
    color: var(--white-color);
    font-size: 48px;
    line-height: 1;
}

.third_title h2 span{
    background: linear-gradient(to right, var(--red-color) 0%, rgba(255, 0, 59, 0.6) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.third_title button{
    background-color: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.third_title button a{
    text-decoration: none;
    color: var(--white-color);
    font-family: var(--title-font);
    letter-spacing: 0.7px;
    line-height: 1.4;
    font-size: 16px;
    font-weight: 700;
    transition: .5s all ease;
}

.third_title button a:hover{
    color: var(--red-color);
}

.lastopinions_container{
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.last_opinion{
    /* FIX: flex en lugar de max-width fijo, para que escalen bien */
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    overflow: hidden;
    cursor: pointer;
}

.last_opinion img{
    width: 100%;
    height: 200px;
    object-fit: cover;
    border: var(--border-grey);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.last_opinion div{
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}

.last_opinion div h4{
    font-family: var(--title-font);
    color: var(--text-color);
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
}

.last_opinion div svg{
    width: 12px;
    height: 12px;
}

.last_opinion h3{
    font-family: var(--title-font);
    color: var(--white-color);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    transition: color 0.3s ease;
}

.last_opinion:hover h3 {
  color: var(--red-color);
}

/* FOURTH SECTION - CHAMPIONSHIP */

/* FIFTH SECTION - SOCIAL MEDIA */

.fifth_wrapper{
    padding-bottom: var(--padding-bottom);
    padding-top: var(--padding-top);
    background-color: #0a0d12;
}

.fifth_container{
    max-width: 1300px;
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.fifth_title{
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-bottom: 64px;
    text-align: center;
}

.fifth_title h2{
    font-family: var(--title-font);
    font-weight: 700;
    font-style: italic;
    color: var(--white-color);
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
}

.fifth_title h2 span{
    background: linear-gradient(to right, var(--red-color) 0%, rgba(255, 0, 59, 0.6) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.fifth_title h3{
    color: var(--text-color);
    font-family: var(--text-font);
    font-weight: 300;
    font-size: 18px;
    line-height: 1.6;
}

.socialmedia_container{
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
    /* FIX: gap reducido para mobile */
    gap: 48px;
}

.socialmedia_media{
    padding-top: 40px;
    width: 100%;
}

.social_media{
    display: flex;
    flex-direction: column;
    width: 100%;
}

.social_titles{
    border-bottom: var(--border-grey);
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    padding-bottom: 16px;
    gap: 12px;
}

.social_title{
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.social_icon{
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.youtube{
    background-color: #e7000b;
}

.instagram{
    background: radial-gradient(
    circle at 30% 107%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285AEB 90%);
}

.tiktok{
    background-color: #000;
}

.linkedin{
    background-color: #0A66C2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.linkedin svg{
    width: 24px;
    height: 24px;
}

.social_title h4 a{
    font-family: var(--title-font);
    color: var(--white-color);
    font-size: 30px;
    /* FIX: font-weight con px es inválido, corregido */
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: 0.5s all ease;
}

.social_title h4 a:hover{
    color: var(--red-color);    
}

.social_titles button{
    background-color: var(--red-color);
    cursor: pointer;
    border-radius: var(--border-radius);
    border: none;
    padding: 8px 16px;
    transition: .5s all ease;
    flex-shrink: 0;
}

.social_titles button a{
    font-family: var(--subtitle-font);
    font-weight: 700;
    font-size: 16px;
    color: var(--white-color);
    text-decoration: none;
    white-space: nowrap;
}

.social_titles button:hover{
    background-color: var(--redbg-hover);
}

/* PRESENTACIONES */

.presentation_wrapper{
    padding-top: var(--padding-top);
    padding-bottom: var(--padding-bottom);
    background-color: #0a0d12;
}

.presentation_container{
    max-width: 1300px;
    width: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.presentation_title{
    display: flex;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.presentation_title svg{
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.presentation_title h2{
    font-family: var(--title-font);
    font-weight: 700;
    font-style: italic;
    color: var(--white-color);
    font-size: 48px;
    line-height: 1;
}

.presentation_title h2 span{
    background: linear-gradient(to right, var(--red-color) 0%, rgba(255, 0, 59, 0.6) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.presentations{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #000;
    border: var(--border-grey);
}

.presentation_info{
    display: flex;
    align-items: stretch;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    height: 420px;
}

.presentation_data{
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-items: flex-start;
    justify-content: center;
    width: 40%;
    padding: 48px;
    border-right: var(--border-grey);
}

.presentation_data h3{
    font-family: var(--title-font);
    color: var(--white-color);
    font-size: 74px;
    text-transform: uppercase;
    font-weight: 700;
    font-style: italic;
}

.presentation_data h4{
    font-family: var(--title-font);
    color: var(--red-color);
    font-size: 36px;
    text-transform: uppercase;
    font-weight: 700;
    font-style: italic;
}

.presentation_img{
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-items: center;
    justify-content: center;
    width: 60%;
    position: relative;
    overflow: hidden;
}

.presentation_img h3{
    font-family: var(--text-font);
    color: var(--text-color);
    font-size: 18px;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.8px;
}

.presentation_img > div:not(.image-gallery){
    display: flex;
    align-items: flex-end;
    gap: 6px;
    justify-content: center;
}

.presentation_img > div:not(.image-gallery) p{
    font-size: 72px;
    font-family: var(--subtitle-font);
    color: var(--white-color);
    line-height: 0.8;
    font-weight: 700;
}

.presentation_img > div:not(.image-gallery) span{
    color: var(--red-color);
    font-family: var(--title-font);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.teams{
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.team{
    padding: 8px 16px;
    width: fit-content;
    border: var(--border-grey);
    cursor: pointer;
    background-color: #0000007a;
    transition: .5s all ease;
}

.team:hover{
    background-color: var(--dark-bg);
}

.team:hover p{
    color: var(--red-color);
}

.team p{
    font-family: var(--title-font);
    color: var(--white-color);
    font-size: 18px;
    text-transform: uppercase;
    font-weight: 600;
    transition: .5s all ease;
}

.team.active{
  background-color: var(--dark-bg);
}

.team.active p{
  color: var(--red-color);
}

/* GALERÍA DE IMÁGENES */

.image-gallery {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item.active {
  opacity: 1;
  z-index: 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.image-attribution {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.75);
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 14px;
  font-family: var(--text-font);
  font-size: 12px;
  font-weight: 400;
  border-radius: 4px;
  backdrop-filter: blur(8px);
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  user-select: none;
}

.gallery-prev,
.gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: var(--white-color);
  border: none;
  font-size: 2.5rem;
  padding: 12px 20px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  line-height: 1;
}

.gallery-prev:hover,
.gallery-next:hover {
  background: var(--red-color);
  transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
  left: 1rem;
  border-radius: 4px;
}

.gallery-next {
  right: 1rem;
  border-radius: 4px;
}

.gallery-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.2);
}

.dot.active {
  background: var(--red-color);
  border-color: var(--white-color);
  transform: scale(1.3);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* --- TABLET (≤ 1024px) --- */
@media (max-width: 1024px) {
    .main_text h1 {
        font-size: 72px;
        line-height: 1.1;
        width: 85%;
    }
    .main_text h2 {
        width: 65%;
    }
    .main_buttons {
        padding-left: 5px;
    }
    .second_container,
    .third_container,
    .presentation_container,
    .first_container,
    .fifth_container {
        width: 90%;
    }

    /* Last post: apilado */
    .last_post {
        height: auto;
        flex-direction: column;
    }
    .last_post_img {
        flex: none;
        width: 100%;
    }
    .last_post_img img {
        border-radius: 16px 16px 0 0;
        height: 100%;
    }
    .last_post_info {
        flex: none;
        width: 100%;
        max-width: 100%;
        padding: 28px 24px;
    }

    .third_title h2,
    .presentation_title h2 {
        font-size: 36px;
    }
    .third_title {
        margin-bottom: 20px;
    }

    /* Opinions con gap controlado */
    .lastopinions_container {
        gap: 16px;
    }

    .presentation_title svg {
        width: 24px;
        height: 24px;
    }
    .presentation_data h3 {
        font-size: 60px;
    }
    .presentation_data h4 {
        font-size: 28px;
    }
    .nextrace_feature {
        max-width: 205px;
    }
    .nextrace_feature span {
        text-align: center;
        font-size: 18px;
    }
}

/* --- MOBILE (≤ 768px) --- */
@media (max-width: 768px) {
    :root {
        --padding-top: 40px;
        --padding-bottom: 40px;
    }

    /* Hero */
    .main_text h1 {
        font-size: 48px;
        line-height: 1.15;
        /* FIX: width al 100% en mobile */
        width: 100%;
    }
    .main_text h2 {
        /* FIX: width al 100% en mobile */
        width: 100%;
        font-size: 17px;
    }
    .main_buttons {
        align-items: flex-start;
        flex-direction: column;
        /* FIX: gap coherente en columna */
        gap: 12px;
    }

    .last_post_textbox h2 {
        font-size: 28px;
    }
    .last_post_textbox h3 {
        font-size: 16px;
    }

    /* Opinions */
    .lastopinions_container {
        flex-direction: column;
        gap: 32px;
    }
    .last_opinion {
        /* FIX: ancho completo en mobile */
        flex: none;
        width: 100%;
        max-width: 100%;
    }
    .last_opinion img {
        height: 180px;
    }

    .third_title {
        align-items: flex-start;
        gap: 12px;
    }
    .third_title button {
        text-align: right;
        align-self: center;
    }
    .third_title button a {
        font-size: 14px;
    }
    .third_title h2,
    .presentation_title h2 {
        font-size: 28px;
    }
    .presentation_title h2 {
        width: 100%;
    }

    /* Teams tabs */
    .teams {
        justify-content: center;
        gap: 0;
    }
    .team {
        flex: 1 1 calc(33.333% - 2px);
        min-width: 0;
        text-align: center;
        padding: 12px 8px;
    }
    .team p {
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Presentation */
    .presentation_info {
        flex-direction: column;
        height: auto;
        min-height: 400px;
    }
    .presentation_data {
        width: 100%;
        border: none;
        border-bottom: var(--border-grey);
        align-items: center;
        text-align: center;
        padding: 28px 24px;
        gap: 14px;
    }
    .presentation_data h3 {
        font-size: 44px;
    }
    .presentation_data h4 {
        font-size: 22px;
    }
    .presentation_img {
        width: 100%;
        min-height: 300px;
        padding: 0;
    }
    .presentation_img h3 {
        font-size: 15px;
        margin-top: 16px;
    }
    .presentation_img > div:not(.image-gallery) p {
        font-size: 52px;
    }
    .presentation_img > div:not(.image-gallery) span {
        font-size: 19px;
    }

    /* Gallery */
    .gallery-prev,
    .gallery-next {
        font-size: 1.8rem;
        padding: 8px 12px;
    }
    .gallery-prev { left: 0.5rem; }
    .gallery-next { right: 0.5rem; }
    .gallery-dots {
        bottom: 1rem;
        padding: 6px 12px;
        gap: 8px;
    }
    .dot {
        width: 8px;
        height: 8px;
    }
    .image-attribution {
        font-size: 11px;
        padding: 4px 10px;
        bottom: 0;
        left: 0;
        border-radius: 0 4px 0 0;
    }

    /* Next race counter */
    .race_title h3 {
        font-size: 42px;
    }
    .race_title h4 {
        font-size: 15px;
    }
    .counter {
        gap: 12px;
    }
    .counter_item {
        max-width: 72px;
        height: auto;
        gap: 8px;
    }
    .number_box {
        font-size: 22px;
        height: 72px;
        padding: 12px;
    }
    .counter_item span {
        font-size: 11px;
        letter-spacing: 0.8px;
    }
    .dots_counter {
        font-size: 28px;
        padding-bottom: 12px;
    }
    .first_container {
        gap: 28px;
    }
    .nextrace_features {
        align-items: center;
        flex-direction: column;
        gap: 12px;
    }
    /* FIX: ancho completo para las cards en columna */
    .nextrace_feature {
        max-width: 100%;
        width: 100%;
        padding: 16px 20px;
    }

    /* Social media */
    .socialmedia_container {
        /* FIX: gap reducido en mobile */
        gap: 32px;
    }
    .socialmedia_media {
        padding-top: 20px;
    }
    .social_title {
        gap: 10px;
    }
    .social_icon {
        width: 32px;
        height: 32px;
    }
    .social_icon svg {
        width: 16px;
        height: 16px;
    }
    .social_title h4 a {
        font-size: 22px;
    }
    .social_titles button a {
        font-size: 13px;
    }

    /* Fifth title */
    .fifth_title {
        margin-bottom: 40px;
    }
    .fifth_title h2 {
        font-size: 36px;
    }
    .fifth_title h3 {
        font-size: 16px;
        text-align: center;
    }
}

/* --- MÓVILES PEQUEÑOS (≤ 480px) --- */
@media (max-width: 480px) {

    .presentation_title h2 {
        font-size: 22px;
        width: 100%;
    }
    .post_button a{
        padding: 0 10px;
    }

    .third_title button{
        width: 40%;
    }

    /* Teams: 2 columnas en pantallas muy pequeñas */
    .team {
        flex: 1 1 calc(50% - 2px);
        padding: 10px 6px;
    }
    .team p {
        font-size: 11px;
    }

    .presentation_data h3 {
        font-size: 34px;
    }
    .presentation_data h4 {
        font-size: 18px;
    }
    .presentation_img {
        min-height: 260px;
    }
    .presentation_img > div:not(.image-gallery) p {
        font-size: 44px;
    }
    .presentation_img > div:not(.image-gallery) span {
        font-size: 17px;
    }

    .gallery-prev,
    .gallery-next {
        font-size: 1.4rem;
        padding: 6px 10px;
    }
    .gallery-prev { left: 0.25rem; }
    .gallery-next { right: 0.25rem; }

    /* Counter ajustado para 320px */
    .counter {
        gap: 8px;
    }
    .counter_item {
        max-width: 64px;
    }
    .number_box {
        font-size: 20px;
        height: 64px;
        max-width: 64px;
    }

    .last_post_textbox h2 {
        font-size: 30px;
    }
    .last_post_textbox h3 {
        font-size: 15px;
    }
    .last_post_author {
        gap: 12px;
    }

    .social_title h4 a {
        font-size: 18px;
    }
    .social_titles button {
        padding: 8px 12px;
    }
    .social_titles button a {
        font-size: 12px;
    }
}