/* ============================================
   Header – component styles (always dark)
   ============================================ */

/* Header: dropdown right-aligned so it doesn't break layout or overflow */
.header-right .lang-dropdown-wrap .lang-dropdown-panel {
  left: auto;
  right: 0;
}

/* Header: language trigger same style as other header elements (Bebas Neue, 20px) */
.site-header .lang-dropdown-wrap .lang-trigger {
  color: #ffffff;
}

.site-header .lang-dropdown-wrap .lang-code {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: calc(20px * var(--header-scale, 1));
  line-height: 100%;
  letter-spacing: 0;
  vertical-align: middle;
  color: inherit;
}

/* ============================================
   Page wrap & Header (always dark)
   ============================================ */
/* Sticky footer: page-wrap fills space below header, main grows to push footer down */
.page-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1920px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-dark);
  width: 100%;
}

.page-wrap main,
.page-wrap .main-content {
  flex: 1;
  margin: 0;
}

body.sidebar-open {
  overflow: hidden;
}

.header-greyed-zone {
  display: contents;
}

/* When sidebar is open: header above backdrop so header-left is not greyed; only header-left is clickable, greyed zone passes clicks to backdrop */
body.sidebar-open .site-header {
  z-index: 200;
  pointer-events: none;
}

body.sidebar-open .site-header .header-left {
  pointer-events: auto;
  max-width: 400px;
}

body.sidebar-open .site-header .header-greyed-zone {
  pointer-events: none;
}

body.sidebar-open .site-header .main-nav,
body.sidebar-open .site-header .header-right {
  opacity: 0.35;
  pointer-events: none;
}

/* When sidebar is open at full width: show only logo + X (close) in header; header-left can use full width */
@media (max-width: 768px) {
  body.sidebar-open .site-header .main-nav,
  body.sidebar-open .site-header .header-right {
    display: none;
  }
  body.sidebar-open .site-header .header-left {
    max-width: none;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #000000;
  border-bottom: 1px solid #2a2a2a;
  width: 100%;
  --header-scale: 1;
}

.site-header .header-inner {
  background: transparent;
}

.site-header .main-nav a,
.site-header .header-signin,
.site-header .header-live,
.site-header .btn-icon,
.site-header .btn-menu {
  color: #ffffff;
}

.site-header .main-nav a:hover,
.site-header .header-signin:hover,
.site-header .btn-icon:hover,
.site-header .btn-menu:hover {
  color: #ffffff;
}

.header-inner {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 calc(1.25rem * var(--header-scale, 1));
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: calc(1rem * var(--header-scale, 1));
}

.header-left {
  display: flex;
  align-items: center;
  gap: calc(1rem * var(--header-scale, 1));
  min-width: 0;
  grid-column: 1;
  justify-content: flex-start;
}

.logo {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.logo-img {
  width: 100%;
  height: auto;
  max-width: calc(191px * var(--header-scale, 1));
}

.btn-menu {
  width: calc(40px * var(--header-scale, 1));
  height: calc(40px * var(--header-scale, 1));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-menu:hover {
  color: #EA0029;
  transform: scale(1.15);
}

.btn-menu:hover .menu-icon-img,
.btn-menu:hover .close-icon-img {
  transform: scale(1.1);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: calc(1.75rem * var(--header-scale, 1));
  justify-content: center;
  grid-column: 2;
  justify-self: center;
  max-width: 1440px;
  margin: 0 auto;
}

.main-nav a {
  color: #ffffff;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: calc(20px * var(--header-scale, 1));
  line-height: 100%;
  letter-spacing: 0;
  vertical-align: middle;
  leading-trim: none;
  white-space: nowrap;
}

.main-nav .studios-text {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: calc(20px * var(--header-scale, 1));
  line-height: 100%;
  letter-spacing: 0;
  vertical-align: middle;
  leading-trim: none;
  text-transform: none;
}

.main-nav .studios-text-red {
  color: #EA0029;
}

.main-nav .studios-text-white {
  color: #ffffff !important;
}

html.theme-light .main-nav .studios-text-white,
html[data-theme="light"] .main-nav .studios-text-white {
  color: #ffffff !important;
}

.main-nav a {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.main-nav a:hover:not(.active) {
  color: #EA0029;
  transform: scale(1.15);
}

.main-nav a.active {
  color: #EA0029;
}

.main-nav a.nav-item.active[href*="studios"] .studios-text,
.main-nav a.nav-item.active[href*="studios"] .studios-text-white {
  color: #EA0029 !important;
}

.main-nav a.active:hover {
  color: #EA0029;
}

.main-nav a.active:hover .studios-text-red {
  color: #EA0029;
}

.main-nav a.active:hover .studios-text-white {
  color: #ffffff !important;
}

html.theme-light .main-nav a.active:hover .studios-text-white,
html[data-theme="light"] .main-nav a.active:hover .studios-text-white {
  color: #ffffff !important;
}

.main-nav a:hover:not(.active) .studios-text-red {
  color: #EA0029;
}

.main-nav a:hover:not(.active) .studios-text-white {
  color: #ffffff !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: calc(0.5rem * var(--header-scale, 1));
  flex-shrink: 0;
  overflow: visible;
  grid-column: 3;
  justify-content: flex-end;
  justify-self: flex-end;
}

.header-signin-live {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.header-live {
  display: inline-flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-live:hover {
  transform: scale(1.15);
  opacity: 0.9;
}

.header-live:hover .live-logo {
  filter: brightness(1.1);
}

.site-header .header-live .live-logo {
  height: calc(32px * var(--header-scale, 1));
  width: auto;
  display: block;
}

.header-signin {
  display: inline-flex;
  align-items: center;
  gap: calc(0.4rem * var(--header-scale, 1));
  height: calc(36px * var(--header-scale, 1));
  padding: 0 calc(0.5rem * var(--header-scale, 1));
  color: #ffffff;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: calc(20px * var(--header-scale, 1));
  line-height: 100%;
  letter-spacing: 0;
  vertical-align: middle;
  leading-trim: none;
  white-space: nowrap;
}

.header-signin .profile-icon-img {
  width: calc(26px * var(--header-scale, 1));
  height: calc(26px * var(--header-scale, 1));
}

.header-signin-text {
  display: inline-block;
  line-height: 100%;
  transform: translateY(2px);
}

.header-signin {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-signin:hover {
  color: #EA0029;
  transform: scale(1.15);
}

.header-signin:hover .header-signin-text {
  transform: translateY(2px) scale(1.05);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(0.2rem * var(--header-scale, 1));
  min-width: calc(36px * var(--header-scale, 1));
  height: calc(36px * var(--header-scale, 1));
  padding: 0 calc(0.5rem * var(--header-scale, 1));
  background: none;
  border: none;
  color: #ffffff;
  font-size: calc(0.8rem * var(--header-scale, 1));
  font-family: inherit;
  cursor: pointer;
}

.btn-icon {
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: #EA0029;
  transform: scale(1.05);
}


.btn-theme-header {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-theme-header:hover {
  transform: rotate(15deg) scale(1.1);
}

.btn-theme-header:active {
  transform: rotate(8deg) scale(1.05);
}

html.theme-light .btn-theme-header:hover,
html[data-theme="light"] .btn-theme-header:hover {
  transform: rotate(-15deg) scale(1.1);
}

html.theme-light .btn-theme-header:active,
html[data-theme="light"] .btn-theme-header:active {
  transform: rotate(-8deg) scale(1.05);
}

.btn-theme-header .theme-toggle-img {
  display: block;
  height: calc(26px * var(--header-scale, 1));
  width: auto;
  object-fit: contain;
}

/* ============================================
   Header – responsive
   Hide order as width goes down: theme + lang →
   boxing/golf/tennis → rest of nav → sign in.
   Always keep: logo, live, search (+ menu).
   ============================================ */
/* Large screens - constrain navigation to 1440px */
@media (min-width: 1441px) {
  .main-nav {
    max-width: 1440px;
    margin: 0 auto;
  }
}

@media (max-width: 1400px) {
  .site-header {
    --header-scale: 0.95;
  }
  .main-nav {
    gap: 1.5rem;
    grid-column: 2;
    justify-self: center;
    max-width: none;
  }
}

/* Step 1: hide theme toggle + language selector */
@media (max-width: 1440px) {
  .header-right .btn-theme-header,
  .header-right .lang-dropdown-wrap {
    display: none;
  }
}

@media (max-width: 1100px) {
  .site-header {
    --header-scale: 0.9;
  }
  .main-nav {
    gap: 1.25rem;
  }
}

/* Step 2: hide boxing, golf, tennis */
@media (max-width: 1024px) {
  .site-header {
    --header-scale: 0.88;
  }
  .header-inner {
    padding: 0 1rem;
  }
  .header-right {
    margin-left: auto;
    justify-content: flex-end;
  }
  .main-nav .nav-item-priority-1 {
    display: none;
  }
}

/* Step 3: hide rest of nav (soccer, motosport, basketball, ice hockey, studios) */
@media (max-width: 900px) {
  .main-nav .nav-item-priority-2 {
    display: none;
  }
  .main-nav {
    display: none;
  }
}

/* Scale down further so elements fit */
@media (max-width: 768px) {
  .site-header {
    --header-scale: 0.82;
  }
  .header-inner {
    padding: 0 0.75rem;
  }
  .header-right {
    margin-left: auto;
    justify-content: flex-end;
  }
}

/* Step 4: hide sign in; always keep logo + live + search */
@media (max-width: 640px) {
  .site-header {
    --header-scale: 0.75;
  }
  .header-inner {
    padding: 0 0.5rem;
  }
}

/* At 390px hide sign in and live; keep logo + menu + search */
@media (max-width: 390px) {
  .site-header .header-signin-live {
    display: none;
  }
}

/* ============================================
   Header – Search functionality
   ============================================ */

/* Search container - hidden by default */
.header-search-container {
  display: none;
  width: 100%;
  grid-column: 1 / -1;
  align-items: center;
  padding: 0 1.25rem;
  height: var(--header-h);
  gap: 1rem;
}

.header-search-left {
  flex-shrink: 0;
}

.header-search-logo {
  display: flex;
  align-items: center;
}

.header-search-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}


.header-search-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 1.25rem;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  color: #ffffff;
  font-family: 'Open Sans', sans-serif;
  font-size: 18px;
  font-weight: 400;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-search-input::placeholder {
  color: #888888;
}

.header-search-input:focus {
  border-color: #EA0029;
  background: #0f0f0f;
}


.btn-search-close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-search-close:hover {
  color: #EA0029;
  transform: scale(1.15);
}

.btn-search-close:hover .close-icon-img {
  transform: scale(1.1);
}

/* When search is open */
body.search-open .header-left,
body.search-open .header-greyed-zone {
  display: none;
}

body.search-open .header-search-container {
  display: flex !important;
}

/* Search results container */
.search-results-container {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-dark, #000000);
  z-index: 99;
  display: none;
  overflow-y: auto;
}

body.search-open .search-results-container {
  display: block;
}

.search-results-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.search-results-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-results-title {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 24px;
  line-height: 100%;
  letter-spacing: 0%;
  vertical-align: middle;
  color: var(--accent, #EA0029);
  margin: 0;
  padding: 0;
}

.search-results-content {
  /* Content area for search results */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Latest stories card */
.latest-story-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.latest-story-image-wrap {
  flex-shrink: 0;
}

.latest-story-image {
  width: 300px;
  height: 170px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.latest-story-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.latest-story-title {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 22px;
  line-height: 100%;
  letter-spacing: 0%;
  vertical-align: middle;
  color: var(--text-primary);
  margin: 0;
  padding: 0;
}

.latest-story-description {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: 0%;
  vertical-align: middle;
  color: var(--text-muted);
  margin: 0;
  padding: 0;
}

.latest-story-date {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 14px;
  line-height: 100%;
  letter-spacing: 0%;
  vertical-align: middle;
  color: var(--text-muted);
  margin: 0;
  padding: 0;
}

/* Latest story card hover - theme-aware */
.latest-story-card:hover .latest-story-title {
  color: var(--accent, #EA0029);
}

.latest-story-card-divider {
  border: none;
  border-top: 1px solid var(--border, #2a2a2a);
  margin: 0;
  width: 100%;
  display: none;
}

@media (max-width: 768px) {
  .latest-story-card-divider {
    display: block;
  }
}

/* Popular searches pills */
.popular-searches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.popular-search-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 1rem;
  border-radius: 4px;
  background: #EA0029;
  color: #FFFFFF;
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 100%;
  letter-spacing: 0%;
  vertical-align: middle;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.popular-search-pill:hover {
  background: #c50023;
  transform: scale(1.05);
  color: #FFFFFF;
}

.popular-search-pill:active {
  transform: scale(0.98);
}

/* Mobile: Hide Popular searches, make Latest stories full width */
@media (max-width: 768px) {
  .search-results-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 1rem;
  }

  .search-results-popular {
    display: none;
  }

  .search-results-latest {
    width: 100%;
  }

  .popular-search-pill {
    font-size: 16px;
    height: 30px;
    padding: 0 0.875rem;
  }

  .popular-searches-list {
    gap: 0.5rem;
  }

  /* Latest stories mobile styles */
  .latest-story-card {
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
  }

  .latest-story-image-wrap {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
  }

  .latest-story-image {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }

  .latest-story-content {
    flex: 1;
    gap: 0.75rem;
    min-width: 0;
  }

  .latest-story-title {
    font-size: 18px;
  }

  .latest-story-description {
    display: none;
  }

  .latest-story-date {
    font-size: 12px;
  }
}

/* Prevent body scroll when search is open */
body.search-open {
  overflow-y: scroll;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

body.search-open .site-header {
  width: 100%;
}

/* Mobile search styles */

@media (max-width: 640px) {
  body.search-open .header-search-left {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .header-search-container {
    padding: 0 0.75rem;
    gap: 0.75rem;
  }

  .header-search-input-wrap {
    gap: 0.5rem;
  }

  .header-search-input {
    height: 36px;
    font-size: 14px;
    padding: 0 0.75rem;
  }

  .btn-search-close {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .header-search-container {
    padding: 0 0.5rem;
    gap: 0.5rem;
  }

  .header-search-input-wrap {
    gap: 0.5rem;
  }
}

/* ============================================
   Back to top button
   ============================================ */
body.sidebar-open .back-to-top-btn {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.back-to-top-btn {
  position: fixed !important;
  bottom: 2rem !important;
  right: max(2rem, calc((100vw - 1920px) / 2 + 2rem));
  width: 54px;
  height: 54px;
  padding: 0;
  border: none;
  border-radius: 4.03px;
  background-color: #EA0029 !important;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  z-index: 9999 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-to-top-btn img,
.back-to-top-btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top-btn:hover {
  background-color: #c40024;
  transform: scale(1.05);
}

.back-to-top-btn:active {
  transform: scale(1.02);
}

html[data-theme="light"] .back-to-top-btn,
html.theme-light .back-to-top-btn {
  background-color: #191919;
}

html[data-theme="light"] .back-to-top-btn:hover,
html.theme-light .back-to-top-btn:hover {
  background-color: #2a2a2a;
}

@media (max-width: 600px) {
  .back-to-top-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 54px;
    height: 54px;
  }
}
