* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* PŁYNNE PRZEWIJANIE DLA CAŁEJ STRONY */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 50px;
}

:root {
    --gold: #C6A15B;
    --gold-light: #e0c28d;
    --bg-dark: #0b0b0b;
    --text-light: #ece7e0;
    --text-muted: #a9a18f;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(198, 161, 91, 0.3);
    --font: 'Inter', sans-serif;
}

body {
    font-family: var(--font);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.5;
    font-weight: 300;
    overflow-x: hidden;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3 {
    font-weight: 400;
    letter-spacing: 0.02em;
}

h2 {
    font-size: 2.4rem;
    border-left: 4px solid var(--gold);
    padding-left: 1.2rem;
    margin-bottom: 2rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* STYL LINKÓW W MENU (DRAWER) - BEZ PODKREŚLEŃ, TAK JAK WCZEŚNIEJ */
.drawer nav a {
    text-decoration: none !important;
    border-bottom: 1px solid rgba(198, 161, 91, 0.2);
}

.drawer nav a:hover {
    text-decoration: none !important;
    color: var(--gold);
    border-bottom-color: var(--gold);
    padding-left: 0.8rem;
}

/* STYL LINKÓW - WIDOCZNE, ŻE TO LINKI */
a:not(.btn-gold):not(.cta-solo-button):not(.footer-links a) {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: 0.2s;
}

a:not(.btn-gold):not(.cta-solo-button):not(.footer-links a):hover {
    color: var(--gold-light);
    text-decoration-thickness: 2px;
}

.footer-links a {
    color: var(--gold);
    text-decoration: none;
    transition: 0.2s;
}

.footer-links a:hover {
    text-decoration: underline;
    color: var(--gold-light);
}

.gold-text {
    color: var(--gold);
}

.btn-gold {
    background: transparent;
    border: 1.5px solid var(--gold);
    color: var(--gold);
    padding: 0.9rem 2.2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    transition: 0.3s;
    display: inline-block;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.btn-gold:hover {
    background: var(--gold);
    color: #0b0b0b;
}

/* HERO PEŁNA SZEROKOŚĆ */
.hero {
    position: relative;
    width: 100%;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('https://rajdzklasa.pl/img/hero.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    isolation: isolate;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(3rem, 12vw, 5.5rem);
    font-weight: 400;
    letter-spacing: 0.3rem;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
}

.hero h1 span {
    color: var(--text-light);
    font-weight: 200;
    display: block;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: 0.6rem;
}

.hero-description {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 2rem;
    border: 1px solid rgba(198, 161, 91, 0.4);
    max-width: 800px;
    margin: 2rem auto 0;
    font-size: 1.1rem;
}

/* HEADER */
.page-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    backdrop-filter: blur(8px);
}

.logo {
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.3rem;
    text-transform: uppercase;
    color: var(--gold);
}

.logo span {
    font-weight: 200;
    color: var(--text-light);
}

/* HAMBURGER */
.hamburger {
    background: transparent;
    border: none;
    color: var(--gold);
    width: 56px;
    height: 56px;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    z-index: 210;
}

.hamburger:hover {
    color: white;
    transform: scale(1.05);
}

/* SZUFLADA */
.drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 35%;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    z-index: 200;
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 120px 1.8rem 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.drawer.open {
    right: 0;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    backdrop-filter: blur(3px);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.drawer nav a {
    font-size: 1.8rem;
    font-weight: 300;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(198, 161, 91, 0.2);
    transition: 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    text-decoration: none;
}

.drawer nav a:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
    padding-left: 0.8rem;
}

@media (max-width: 768px) {
    .drawer {
        width: 100% !important;
        padding: 120px 2rem 2rem;
    }

    .drawer nav a {
        font-size: 2rem;
    }
}

/* SEKCJE */
section {
    padding: 5rem 0;
    border-bottom: 1px solid rgba(198, 161, 91, 0.1);
}

/* TRASA */
.trasa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.trasa-mapa-placeholder {
    background: #1e1b17;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--gold);
    color: var(--gold);
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .trasa-grid {
        grid-template-columns: 1fr;
    }
}

/* CTA */
.cta-float-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0 4rem;
}

.cta-solo-button {
    display: inline-block;
    background: var(--gold);
    color: #0b0b0b;
    font-size: 1.8rem;
    font-weight: 600;
    padding: 1.2rem 3.5rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    border: none;
    transition: 0.2s;
    box-shadow: 0 10px 30px rgba(198, 161, 91, 0.3);
    text-align: center;
    text-decoration: none;
}

.cta-solo-button:hover {
    background: #b58d4a;
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(198, 161, 91, 0.5);
}

.cta-solo-button i {
    margin-right: 1rem;
    font-size: 1.8rem;
}

/* WSPÓŁPRACA */
.wspolpraca-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    background: #0f0f0f;
    padding: 2.5rem;
    border: 1px solid #332e26;
}

.wspolpraca-lista {
    list-style: none;
    margin: 2rem 0;
}

.wspolpraca-lista li {
    margin: 0.8rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.wspolpraca-lista i {
    color: var(--gold);
    width: 28px;
}

.kontakt-wspolpracy {
    background: #1c1c1c;
    padding: 2rem;
    border-left: 4px solid var(--gold);
}

@media (max-width: 768px) {
    .wspolpraca-grid {
        grid-template-columns: 1fr;
    }
}

/* GALERIA GŁÓWNA */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.galeria-item {
    aspect-ratio: 1/1;
    background-size: cover;
    background-position: center;
    border: 1px solid #3f392f;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.galeria-item span {
    background: rgba(0, 0, 0, 0.6);
    width: 100%;
    text-align: center;
    padding: 0.6rem;
    font-size: 0.9rem;
    letter-spacing: 0.1rem;
}

.galeria-item:hover {
    transform: scale(1.03);
    border-color: var(--gold);
}

@media (max-width: 768px) {
    .galeria-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* EKIPA */
.ekipa-opis {
    max-width: 800px;
    margin-bottom: 3rem;
}

.ekipa-zdjecia {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.zdjecie-placeholder {
    aspect-ratio: 4/3;
    background: linear-gradient(145deg, #2d271f, #16130f);
    border: 1px dashed var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .ekipa-zdjecia {
        grid-template-columns: 1fr;
    }
}

/* POPRZEDNIE EDYCJE - FILTRY */
.filtry-lat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(198, 161, 91, 0.2);
}

.filter-btn {
    background: transparent;
    border: 1.5px solid var(--gold);
    color: var(--gold);
    padding: 0.6rem 1.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 0;
    text-transform: uppercase;
}

.filter-btn:hover {
    background: rgba(198, 161, 91, 0.2);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gold);
    color: #0b0b0b;
}

/* EDYCJA ROKU */
.edycja-roku {
    transition: all 0.4s ease;
    margin-bottom: 4rem;
}

.edycja-roku.hidden {
    display: none;
}

.edycja-roku.visible {
    display: block;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.edycja-tytul {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(198, 161, 91, 0.3);
}

.edycja-rok {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.05em;
}

.edycja-stat {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* GALERIE ZDJĘĆ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-item {
    aspect-ratio: 1/1;
    background-color: #2a251f;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 1px solid #3f392f;
    transition: 0.3s;
    position: relative;
}

.gallery-item.lazy-bg {
    background-image: none;
    position: relative;
}

.gallery-item.lazy-bg::before {
    content: "\f03e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gold);
    font-size: 2rem;
    opacity: 0.5;
}

.gallery-item.loaded::before {
    display: none;
}

.gallery-item:hover {
    transform: scale(1.03);
    border-color: var(--gold);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .edycja-tytul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .edycja-rok {
        font-size: 1.6rem;
    }
}

/* KONTAKT */
.kontakt-block {
    background: #0c0c0c;
    padding: 3rem;
    margin-bottom: 2rem;
}

.stopka {
    padding: 3rem 0 2rem;
    color: var(--text-muted);
    border-top: 1px solid #2d2d2d;
    font-size: 0.9rem;
}

.stopka .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    margin-right: 2rem;
    color: var(--gold);
}

@media (max-width: 480px) {
    .page-header {
        padding: 1rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* OVERLAY */
.overlay-page {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 999;
    display: none;
    overflow-y: auto;
}

.overlay-page.active {
    display: block;
}

.overlay-content {
    max-width: 900px;
    margin: 6rem auto;
    padding: 2rem;
}

.overlay-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.overlay-section.active {
    display: block;
}

.close-overlay {
    position: fixed;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    background: none;
    border: none;
    color: var(--gold);
    cursor: pointer;
}

.overlay-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.overlay-images div {
    background: linear-gradient(145deg, #2d271f, #16130f);
    border: 1px dashed var(--gold);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border: 2px solid var(--gold);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: var(--gold);
    cursor: pointer;
}

.content-block {
    max-width: 900px;
    margin-bottom: 3rem;
}

.style-list {
    columns: 2;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.cta-wrapper {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-subtitle {
    margin-top: 0.8rem;
    font-size: 0.8rem;
    letter-spacing: 0.25rem;
    text-transform: uppercase;
    color: var(--text-muted);
    position: relative;
}

.cta-subtitle::before {
    content: "";
    display: block;
    width: 60px;
    height: 1px;
    background: var(--gold);
    margin: 0 auto 0.6rem;
    opacity: 0.6;
}

.cta-wrapper:hover .cta-subtitle {
    color: var(--gold-light);
}

/* PRZYCISK POKAŻ WIĘCEJ */
.load-more-btn {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.3rem 1rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.3s;
    margin-left: auto;
}

.load-more-btn:hover {
    background: var(--gold);
    color: #0b0b0b;
}

/* ŁADOWANIE WIĘCEJ ZDJĘĆ */
.loading-more {
    text-align: center;
    padding: 1rem;
}

.loading-more i {
    color: var(--gold);
    font-size: 1.5rem;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
    .edycja-tytul {
        flex-wrap: wrap;
    }
    
    .load-more-btn {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* Klasy do ukrywania/pokazywania */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.all-edycje-wrapper {
    margin-bottom: 2rem;
}

#all-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Overlay sekcje - domyślnie ukryte */
.overlay-section {
    display: none;
}

/* Pokazanie aktywnej sekcji */
.overlay-section.active-section {
    display: block !important;
}

/* Lub jeśli używasz klasy .active */
.overlay-section.active {
    display: block !important;
}

/* PASEK PARTNERÓW - ANIMACJA */
.partners-scroller {
    width: 100%;
    overflow: hidden;
    /*background: rgba(220, 220, 220, 0.5);*/
    background-color: white;
    padding: 2rem 0;
    white-space: nowrap;
}

.partners-track {
    display: inline-flex; /* Ważne: inline-flex pozwoli na poprawne obliczenie szerokości */
    animation: scrollInfinite 40s linear infinite;
}

.partners-track img {
    height: 60px; /* Stała wysokość, szerokość auto dla zachowania proporcji */
    width: auto;
    margin: 0 40px; /* Odstęp między logotypami */
    flex-shrink: 0;
}

@keyframes scrollInfinite {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Przesuwamy o dokładnie połowę szerokości całego kontenera track */
        transform: translateX(-50%); 
    }
}

/* Zatrzymanie po najechaniu dla wygody użytkownika */
.partners-scroller:hover .partners-track {
    animation-play-state: paused;
}

/* Poprawka dla wersji mobilnej, aby pętla nadal działała */
@media (max-width: 768px) {
    .partners-track img {
        height: 40px;
        margin: 0 20px;
    }
    .partners-track {
        animation-duration: 20s; /* Szybszy ruch na małych ekranach */
    }
}




/* SPÓJNA SEKCJA OPISOWA */
.description-section {
    padding: 80px 0;
    background-color: var(--bg-dark);
    position: relative;
}

/* Opcjonalny subtelny akcent oddzielający sekcję */
.description-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: var(--gold);
    opacity: 0.5;
}

.description-content {
    /*max-width: 900px;*/
    margin: 0 auto;
    text-align: center;
}

.description-content .lead {
    font-size: 1.6rem;
    color: var(--gold-light);
    line-height: 1.5;
    margin-bottom: 30px;
    font-weight: 400;
}

.description-content p:not(.lead) {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Responsywność dla urządzeń mobilnych */
@media (max-width: 768px) {
    .description-section {
        padding: 50px 0;
    }
    .description-content .lead {
        font-size: 1.3rem;
    }
}

/* NOWE ZMIENNE DLA JASNYCH SEKCJI */
:root {
    --light-bg: #f9f7f2; /* Elegancki odcień złamanej bieli */
    --light-text: #1a1a1a; /* Bardzo ciemny szary dla czytelności */
}

/* STYL JASNEJ SEKCJI */
.light-section {
    background-color: var(--light-bg) !important;
    color: var(--light-text) !important;
    padding: 100px 0;
}

/* Dostosowanie treści w jasnej sekcji */
.light-section .description-content .lead {
    color: #8b6b2e; /* Ciemniejszy odcień złota dla lepszego kontrastu na bieli */
    font-weight: 500;
}

.light-section .description-content p:not(.lead) {
    color: #444; /* Ciemniejszy tekst pomocniczy */
}

/* Opcjonalny subtelny cień/gradient na przejściu, żeby nie było "cięcia" nożem */
.partners-scroller + .light-section {
    border-top: 1px solid var(--gold);
}

/* UNIWERSALNA JASNA SEKCJA */
.section-light {
    background-color: #f4f1ea !important; /* Szlachetna biel wpadająca w beż */
    color: #1a1a1a !important;
    padding-top: 80px;
    padding-bottom: 80px;
}

/* Dostosowanie nagłówków w jasnej sekcji */
.section-light h2 {
    color: #1a1a1a !important;
    border-left: 4px solid var(--gold); /* Zachowanie Twojego stylu linii */
}

.section-light p, 
.section-light li,
.section-light .contact-item {
    color: #333 !important;
}

.section-light .wspolpraca-lista li,
.section-light .kontakt-wspolpracy p,
.section-light .wspolpraca-grid p{
    color: #a9a18f !important;
}

/* Jeśli masz linki w tych sekcjach */
.section-light a {
    color: #8b6b2e !important;
}

/* Specjalne dopasowanie dla "paska partnerów", jeśli styka się z jasną sekcją */
.partners-scroller {
    border-bottom: none; /* Usuwamy dolną linię, jeśli pod spodem jest biel */
}

.partners-scroller {
    width: 100%;
    background: #ffffff;
    overflow: hidden;
    padding: 30px 0;
    /* Fade edges */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 10%,
        black 90%,
        transparent 100%
    );
}

.partners-track {
    display: flex;
    align-items: center;
    gap: 60px;
    width: max-content;
    animation: scroll-logos 60s linear infinite;
}

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

.partners-track img {
    height: 60px;
    width: auto;
    object-fit: contain;
   
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.partners-track img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scroll-logos {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}