/* =========================================================
RESET + PODSTAWY
background: var(--bg) url("/assets/img/wbwyciskanie.jpg") bottom center / 100% 50vh no-repeat;
========================================================= */

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

:root {
  --bg: #f6f7f9;
  --white: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #0b3c6d;
  --accent: #d4af37;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Arial, sans-serif;
  color: var(--text);
  line-height: 1.5;
  background: var(--bg);
}

/* =========================================================
GLOBAL BACKGROUND OVERLAY
========================================================= */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/assets/img/wbrwanie.jpg") center no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255,255,255,.15), rgba(0,0,0,.45)),
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,.04),
      rgba(0,0,0,.04) 1px,
      transparent 1px,
      transparent 2px
    );
}

/* =========================================================
HEADER
========================================================= */

header {
  background: transparent;
  position: relative;
  z-index: 20;
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  height: 80px;
  width: auto;
  display: block;
  background: transparent;
  padding: 0;
  border-radius: 4px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
}

/* DUPE BLOK – ZOSTAWIAM BO BYŁ W TWOIM PLIKU */

.logo {
  display: block !important;
  position: relative;
  z-index: 10;
  height: 48px;
}

header nav {
  display: flex;
  gap: 20px;
  align-items: center;
  position: relative;
  z-index: 10;
}

header nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

/* =========================================================
HERO HEADER
========================================================= */

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 50, 0.55);
  display: none !important;
}

.hero-header {
  position: static;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 40px;
  color: #fff;
  background: transparent;
}

.hero-header nav {
  display: flex;
  gap: 22px;
}

.hero-header nav a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  font-size: 20px;
}

/* =========================================================
HERO
========================================================= */

.hero-inner {
  max-width: 1200px;
  width: 100%;
  text-align: center;
  padding: 0 20px;
}

/* UWAGA: WRACAM DO ORYGINALNEJ WERSJI Z IMG */

.hero img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
  filter: brightness(0.55);
}

.hero-text {
  position: absolute;
  left: 32px;
  bottom: 32px;
  color: #fff;
}

.hero-text h2 {
  font-size: 32px;
  margin-bottom: 6px;
}
/* =========================================================
LAYOUT
========================================================= */

main {
  max-width: 1200px;
  width: 100%;
  margin: -80px auto 30px;
  padding: 0 20px;
  position: relative;
  z-index: 5;
  background: transparent;
}

@media (max-width: 768px) {
  main {
    max-width: 100%;
    margin: -20px auto 20px;
    padding: 0 10px;
  }
}

h2 {
  font-size: 20px;
  margin-bottom: 16px;
  font-weight: 700;
}

/* =========================================================
SEKCJE
========================================================= */

.section {
  background: rgba(255, 255, 255, 0.60);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* =========================================================
TABELA – DESKTOP
========================================================= */

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255,255,255,0.7);
}

thead {
  background: rgba(241,245,249,0.7);
}

th {
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: rgba(241,245,249,0.7);
}

td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  background: rgba(241,245,249,0.7);
}

table th,
table td {
  text-align: center;
  vertical-align: middle;
  background: rgba(241,245,249,0.7);
}

/* SINCLAIR – kolumny M / K */

.col-m {
  color: #15803d;
  font-weight: 600;
}

.col-k {
  color: #15803d;
  font-weight: 600;
}

button.toggle {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  cursor: pointer;
}

button.toggle.active {
  background: #15803d;
  color: #fff;
  border-color: #15803d;
}

th.col-m,
th.col-k {
  font-weight: 700;
}

/* =========================================================
LINKI / TEKST
========================================================= */

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================
FOOTER
========================================================= */

footer {
  margin-top: 60px;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  position: relative;
  z-index: 10;
  background: rgba(255,255,255,0.6);
}
/* =========================================================
INDEX – MOBILE – JEDNA LINIA
========================================================= */

@media (max-width: 768px) {

  body:not(.page-zawody) table thead {
    display: none;
  }

  body:not(.page-zawody) table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "date name place";
    gap: 6px 10px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }

  body:not(.page-zawody) td {
    padding: 0;
    border: none;
    white-space: nowrap;
  }

  body:not(.page-zawody) td::before {
    display: none !important;
    content: none !important;
  }

  body:not(.page-zawody) td:nth-child(1) {
    grid-area: date;
    font-size: 13px;
    color: var(--muted);
  }

  body:not(.page-zawody) td:nth-child(2) {
    grid-area: name;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body:not(.page-zawody) td:nth-child(3) {
    grid-area: place;
    text-align: right;
    font-size: 13px;
    color: var(--muted);
  }
}

body:not(.page-zawody) table tbody tr {
  grid-template-columns: 70px 1fr 70px 70px;
  grid-template-areas: "date name place cat";
}

.hero img {
  height: 240px;
}

.hero-text h2 {
  font-size: 22px;
}

/* przypisanie kolumn */

body:not(.page-zawody) td:nth-child(1) { grid-area: date; }
body:not(.page-zawody) td:nth-child(2) { grid-area: name; }
body:not(.page-zawody) td:nth-child(3) { grid-area: place; }
body:not(.page-zawody) td:nth-child(4) { grid-area: cat; }

/* INDEX – MOBILE – UKRYJ NAGŁÓWKI */

@media (max-width: 768px) {
  body:not(.page-zawody) h2 {
    display: none;
  }
}
/* statystyki sekcje */

.stats-grid {
  display: grid;
  grid-auto-flow: column;
  gap: 20px;
  overflow-x: auto;
}

.stat-block {
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  min-width: 280px;
}

.stats-grid {
  display: grid;
  grid-auto-flow: column;
  gap: 20px;
  overflow-x: auto;
}

.stat-baza { order: 1; }
.stat-last { order: 4; }
.stat-sinclair { order: 2; }
.stat-top { order: 3; }
.stat-ur { order: 5; }


.ad-main { order: 1; }
.ad-partner1 { order: 2; }
.ad-partner { order: 3; }
.ad-cta { order: 4; }

.stat-block.hide {
  display: none !important;
}

/* wspolpraca reklamy */

.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.ad-block {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
}

.ad-main {
  grid-column: span 2;
  height: 100%;
}

.ad-cta {
  background: #f8fafc;
  border-style: dashed;
}

.hero-images {
  display: none;
}

@media (max-width: 768px) {
  .logo {
    display: block !important;
    position: relative;
    z-index: 10;
    height: 48px;
  }
}

.ad-main {
  grid-column: span 1;
}

.section-separator {
  height: 20px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.0),
    rgba(255,255,255,0.25),
    rgba(255,255,255,0.0)
  );
  margin: 10px 0 20px;
}

.neg {
  color: #c00;
  font-weight: 700;
  text-decoration-line: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #c00;
}

.section-zawody-header {
  text-align: center;
  padding: 32px 16px;
}

.section-zawody-header .zawody-tytul {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}

.section-zawody-header .zawody-meta {
  font-size: 20px;
  font-weight: 600;
  opacity: 0.85;
}

table td:nth-child(3) {
  font-size: 0.85em;
  opacity: 0.85;
}

.bad {
  color: #e74c3c;
  font-weight: 600;
}

.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.ad-block {
  display: flex;
  flex-direction: column;
  height: 100%;
}

table td.neg {
  color: #c00;
  font-weight: 700;
}

.share-ico {
  display: inline-flex;
  width: 44px;
  height: 44px;
  margin: 0 6px;
  background: #fff;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}

.share-ico svg {
  width: 22px;
  height: 22px;
  max-width: 22px;
  max-height: 22px;
  display: block;
}
/* =========================================================
GLOBAL MOBILE BASE
========================================================= */

@media (max-width: 768px){

  main{
    margin:-40px auto 20px;
    padding:0 12px;
  }

  header{
    padding:10px 12px;
  }

  header nav{
    gap:12px;
    flex-wrap:wrap;
  }

  header nav a{
    font-size:13px;
  }

  .section{
    padding:14px;
    margin-bottom:18px;
  }

  h2{
    font-size:18px;
  }

  footer{
    margin-top:30px;
    padding:14px;
  }
}

/* =========================================================
MOBILE MENU FIX
========================================================= */

@media (max-width:768px){

  header{
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
  }

  header nav{
    width:100%;
    justify-content:center;
    flex-wrap:wrap;
    gap:10px;
  }

  header nav a{
    font-size:12px;
    padding:6px 4px;
  }
}

/* =========================================================
HAMBURGER MENU
========================================================= */

.hamburger{
  display:none;
  background:none;
  border:none;
  font-size:28px;
  color:#fff;
  cursor:pointer;
}

@media (max-width:768px){

  .hamburger{
    display:block;
    position:absolute;
    right:16px;
    top:16px;
    z-index:30;
  }

  #mobileMenu{
    position:absolute;
    top:70px;
    left:0;
    right:0;
    background:rgba(11,60,109,0.98);
    backdrop-filter:blur(6px);
    display:none;
    flex-direction:column;
    gap:0;
    padding:10px 0;
  }

  #mobileMenu a{
    display:block;
    padding:14px 20px;
    border-bottom:1px solid rgba(255,255,255,0.1);
    font-size:16px;
  }

  #mobileMenu.open{
    display:flex;
  }
}

/* skrócona data mobile YYYY-MM */

@media (max-width:768px){

  body:not(.page-zawody) td:nth-child(1){
    font-size:0;
  }

  body:not(.page-zawody) td:nth-child(1)::after{
    content: attr(data-label) " " attr(title);
    font-size:13px;
    color: var(--muted);
  }
}

/* data desktop/mobile switch */

.date-short{
  display:none;
}

@media (max-width:768px){
  .date-full{ display:none; }
  .date-short{
    display:inline;
    font-size:13px;
    color: var(--muted);
  }
}

/* =========================================================
MOBILE POLISH / SPACING
========================================================= */

@media (max-width:768px){

  table tbody tr{
    margin-bottom:12px !important;
    padding:10px 10px !important;
    border-radius:10px !important;
  }

  body:not(.page-zawody) td{
    font-size:13px;
  }

  body:not(.page-zawody) td:nth-child(2){
    font-size:14px;
    font-weight:700;
  }

  body:not(.page-zawody) td:nth-child(3),
  body:not(.page-zawody) td:nth-child(4){
    font-size:12px;
    opacity:.85;
  }

  .stats-grid{
    gap:12px;
  }

  .stat-block{
    min-width:240px;
    padding:16px;
  }
}

/* =========================================================
PAGINATION MOBILE
========================================================= */

@media (max-width:768px){

  .section[style*="text-align:center"]{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    padding:14px;
    font-size:14px;
  }

  .section[style*="text-align:center"] a{
    background:#0b3c6d;
    color:#fff;
    padding:10px 14px;
    border-radius:8px;
    min-width:90px;
    text-align:center;
  }
}

/* pagination mobile arrows only */

@media (max-width:768px){

  .section[style*="text-align:center"] a{
    font-size:0;
  }

  .section[style*="text-align:center"] a::before{
    font-size:18px;
  }

  .section[style*="text-align:center"] a[href*="page="]::before{
    content:"»";
  }

  .section[style*="text-align:center"] a[href*="page=1"]::before{
    content:"«";
  }
}

/* =========================================================
PEŁNE NAZWISKO
========================================================= */

.page-zawody td:nth-child(2) a{
  white-space:normal;
  font-weight:700;
}

/* =========================================================
WYNIKI ZAWODÓW – MOBILE FINAL
========================================================= */

@media (max-width:768px){

  .results-table{
    display:block;
  }

  .results-table thead{
    display:none;
  }

  .results-table tbody{
    display:block;
  }

  .results-table tbody tr{
    display:grid;
    grid-template-columns:38px 1fr 46px 1fr;
    grid-template-areas:
      "place name weight ."
      ". stats stats stats";
    gap:6px 10px;
    background:#fff;
    padding:12px;
    margin-bottom:14px;
    border-radius:12px;
    box-shadow:0 2px 8px rgba(0,0,0,.08);
    text-align:left;
  }

  .results-table td{
    border:none;
    padding:0;
    background:none;
  }

  .results-table .col-place{
    grid-area:place;
    font-weight:700;
  }

  .results-table .col-name{
    grid-area:name;
    font-weight:700;
    white-space:normal;
  }

  .results-table .col-weight{
    grid-area:weight;
  }

  .results-table .col-max,
  .results-table td:nth-last-child(2),
  .results-table td:last-child{
    grid-area:stats;
    display:inline-block;
    margin-right:14px;
    font-weight:700;
  }

  .results-table td:nth-child(3),
  .results-table .col-rw,
  .results-table .col-p,
  .results-table .col-m{
    display:none;
  }
}
/* =========================
STATYSTYKI – BAZA MOCNIEJ
========================= */

.stat-baza li{
  font-size:14px;
  margin-bottom:6px;
}

.stat-baza .stat-big{
  display:block;
  font-size:28px;
  font-weight:800;
  color:#0b3c6d; /* granat */
  letter-spacing:0.5px;
  transition:color .2s ease, transform .2s ease;
}

.stat-baza .stat-big:hover{
  color:#15803d; /* zieleń */
  transform:translateY(-1px);
}
/* =========================
STAT-Baza Slider
========================= */

.stat-baza ul{
  display:flex;
  gap:16px;
  overflow-x:auto;
  scroll-snap-type:x mandatory;
  padding-bottom:8px;
}

.stat-baza ul::-webkit-scrollbar{
  height:6px;
}

.stat-baza li{
  flex:0 0 220px;
  background:rgba(255,255,255,0.85);
  border-radius:10px;
  padding:14px;
  scroll-snap-align:start;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}

.stat-baza .stat-big{
  font-size:26px;
  font-weight:800;
  color:#0b3c6d;
  display:block;
  margin-top:6px;
}
/* wymuś przewijanie tylko w BAZA */

.stat-baza{
  overflow:hidden;
}

.stat-baza ul{
  display:flex !important;
  gap:16px;
  overflow-x:auto !important;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}

.stat-baza li{
  flex:0 0 240px;
  scroll-snap-align:start;
}

/* BAZA – slider pionowy poprawiony */

.stat-baza{
  height:240px;
  overflow:hidden;
}

.stat-baza ul{
  flex-direction:column !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scroll-snap-type:y mandatory;
  height:100%;
}

.stat-baza li{
  flex:0 0 170px;
  scroll-snap-align:start;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
}

/* BAZA – większe liczby */

.stat-baza .stat-big{
  display:block;
  text-align:center;
  font-size:50px;
  font-weight:900;
  color:#c62828; /* czerwony */
  letter-spacing:0.5px;
  transition:color .2s ease, transform .2s ease;
}

.stat-baza .stat-big:hover{
  color:#15803d; /* zieleń jak link */
  transform:translateY(-2px);
}
}

/* TOP +50% szerzej */

.stat-top{
  width: 420px;
}
/* STAT-BLOCK – równa wysokość */

.stats-grid{
  align-items: stretch;
}

.stat-block{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height: 230px;
}
/* domyślna szerokość kart */
.stat-block{
  width: 280px;
}

/* TOP +50% */
.stat-top{
  width: 420px;
}
/* Wyrównanie do góry – bez BAZA */

.stat-top,
.stat-sinclair,
.stat-last,
.stat-ur{
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}
/* TOP – mocniejsze nazwy */

.stat-top ul li a{
  font-weight: 800;
}