/* =========================================================
   RESET
========================================================= */

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

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

body {
  font-family: "Montserrat", sans-serif;
  background: #050505;
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

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

.calendar-hero {
  --hero-image: url("/img/heroes/calendar.webp");
  min-height: 100vh;
  position: relative;
  padding: 160px 60px 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.calendar-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.56),
      rgba(0, 0, 0, 0.52),
      rgba(0, 0, 0, 0.25)
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.88)),
    var(--hero-image) center / cover no-repeat;
  transform: scale(1.03);
  z-index: -2;
}

.hero-content {
  max-width: 980px;
  text-align: center;
}

h1 {
  font-size: clamp(72px, 8.8vw, 125px);
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-weight: 900;
  line-height: 1;
}

h1 span {
  color: #e10600;
}

.hero-content p {
  margin: 28px auto 0;
  max-width: 650px;
  font-size: 19px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.74);
}

/* =========================================================
   CALENDAR
========================================================= */

.calendar-section {
  padding: 90px 44px;
  max-width: 1600px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 36px;
}

.filters-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.season-title {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-radius: 18px;
  border: 1px solid rgba(255, 40, 35, 0.55);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: white;
  white-space: nowrap;
}

.season-title span {
  color: #ffffff;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  font-family: "Montserrat", sans-serif;
}

.filter-btn {
  min-width: 150px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  padding: 17px 26px;
  border-radius: 17px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: 0.25s ease;
  font-family: "Montserrat", sans-serif;
}

.filter-btn.active,
.filter-btn:hover {
  background: linear-gradient(180deg, #f20b05, #b00602);
  color: #fff;
}

/* =========================================================
   CARDS
========================================================= */

.race-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}

@media (max-width: 620px) {
  .calendar-hero {
    --hero-image: url("/img/heroes/mobile/calendar.webp");
  }
}

.calendar-list-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.race-card {
  position: relative;
  padding: 22px;
  border-radius: 28px;
  width: calc((100% - 66px) / 4);
  overflow: hidden;
  transition: 0.3s ease;
  display: grid;
  grid-template-columns: 95px 1fr;
  gap: 18px;
  min-height: 390px;
}

.race-card:hover {
  transform: translateY(-8px);
}

/* =========================================================
   COUNTRY BACKGROUNDS
========================================================= */

.race-card.austria {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.72)),
    url("/img/countries/austria.webp");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

.race-card.spain {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/spain.webp");
  background-size: cover;
  background-position: center;
}

.race-card.portugal {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/portugal.webp");
  background-size: cover;
  background-position: center;
}

.race-card.czech {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/czech-republic.webp");
  background-size: cover;
  background-position: center;
}

.race-card.germany {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/germany.webp");
  background-size: cover;
  background-position: center;
}

.race-card.italy {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/italy.webp");
  background-size: cover;
  background-position: center;
}

.race-card.poland {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/poland.webp");
  background-size: cover;
  background-position: center;
}

.race-card.switzerland {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/switzerland.webp");
  background-size: cover;
  background-position: center;
}

.race-card.slovenia {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/slovenia.webp");
  background-size: cover;
  background-position: center;
}

.race-card.croatia {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.68)),
    url("/img/countries/croatia.webp");
  background-size: cover;
  background-position: center;
}

/* =========================================================
   CARD DETAILS
========================================================= */

.race-date {
  height: 100px;
  padding: 0 12px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.race-date strong {
  display: block;
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
}

.race-date span {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.58);
}

.track-layout {
  height: 100px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.track-layout img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  transition: 0.3s ease;
}

.race-info {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.race-info h3 {
  margin-top: 14px;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.race-meta {
  grid-column: 1 / -1;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.track {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: white;
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1280px) {
  .race-card {
    width: calc((100% - 44px) / 3);
  }
}

@media (max-width: 980px) {
  .calendar-hero {
    min-height: 90vh;
    padding: 140px 24px 70px;
  }

  h1 {
    font-size: clamp(64px, 11vw, 82px);
  }

  .hero-content p {
    font-size: 17px;
  }

  .calendar-section {
    padding: 80px 24px;
  }

  .filters-row {
    align-items: stretch;
    flex-direction: column;
  }

  .season-title {
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    min-width: 150px;
    flex: 0 0 auto;
  }

  .race-card {
    width: calc((100% - 22px) / 2);
  }
}

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

@media (max-width: 620px) {
  .calendar-hero {
    min-height: 100svh;
    padding: 128px 18px 56px;
  }

  .calendar-hero::before {
    background-position: center;
  }

  h1 {
    font-size: 52px;
    line-height: 0.95;
  }

  .hero-content p {
    font-size: 16px;
    line-height: 1.7;
  }

  .calendar-section {
    padding: 70px 18px;
  }

  .section-header {
    margin-bottom: 28px;
  }

  .filters-row {
    gap: 14px;
  }

  .season-title {
    padding: 16px 18px;
    font-size: 12px;
    line-height: 1.4;
  }

  .season-title span {
    font-size: 24px;
  }

  .filter-tabs {
    width: 100%;
    overflow-x: visible;
    border-radius: 18px;
    padding: 7px;
  }

  .filter-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 6px;
    border-radius: 14px;
    font-size: clamp(8px, 2.5vw, 10px);
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .race-list {
    gap: 18px;
  }

  .race-card {
    width: 100%;
    min-height: 340px;
    grid-template-columns: 82px 1fr;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
  }

  .race-card:hover {
    transform: none;
  }

  .race-date,
  .track-layout {
    height: 86px;
    border-radius: 15px;
  }

  .race-date strong {
    font-size: 36px;
  }

  .race-info h3 {
    font-size: 21px;
  }
}
