.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.carousel-snap { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
/* Marquee / ticker styles */
.marquee { position: relative; overflow: hidden; }
.marquee__wrapper { display: flex; gap: 2.5rem; align-items: center; will-change: transform; animation: marquee var(--marquee-duration,20s) linear infinite; }
.marquee__item { display: inline-flex; align-items: center; gap: .6rem; white-space: nowrap; }
.marquee__badge { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: .5rem; font-size: .9rem; }
.marquee:hover .marquee__wrapper,
.marquee:focus-within .marquee__wrapper { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0%); }
  to   { transform: translateX(-50%); }
}
/* Slider scrollbar hide and dragging cursor */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.is-dragging { cursor: grabbing; cursor: -webkit-grabbing; }

/* Tabs styling for "Deportistas destacados" */
.fa-tabgroup { display: inline-flex; background: #f3f4f6; border-radius: 9999px; padding: 4px; gap:4px; }
.fa-tab { cursor: pointer; border-radius: 9999px; padding: 6px 12px; font-weight: 600; font-size: 0.875rem; line-height: 1; transition: box-shadow .12s, transform .08s; }
.fa-tab[aria-selected="true"] { background: white; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.fa-tab:focus { outline: 2px solid transparent; box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* Titulares convertidos en enlaces: estilos y hover adaptativo */
.news-link {
  display: inline-block;
  position: relative;
  color: inherit;
  text-decoration: none;
  transition: color .18s ease, transform .12s ease;
}
.news-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, rgba(59,130,246,.95), rgba(14,165,233,.85));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
  border-radius: 2px;
}
.news-link:hover, .news-link:focus {
  color: #1e40af;
  transform: translateY(-1px);
}
.news-link--no-underline::after {
  display: none;
}
.news-link:hover::after, .news-link:focus::after {
  transform: scaleX(1);
}
.news-link:focus {
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
  outline: none;
}

/* Variante para titulares con texto claro sobre fondo oscuro (hero) */
.news-link--inverse {
  display: inline-block;
  position: relative;
  color: inherit;
  text-decoration: none;
}
.news-link--inverse::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 100%;
  background: currentColor; /* same color as the text */
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
  border-radius: 2px;
}
.news-link--inverse:hover, .news-link--inverse:focus {
  color: inherit; /* keep text color unchanged on hover */
  transform: translateY(-1px); /* small upward movement restored */
}
.news-link--inverse:focus {
  box-shadow: 0 0 0 4px rgba(250,204,21,.12);
  outline: none;
}

/* Accessibility: show underline if user prefers reduced motion or focus-visible */
@media (prefers-reduced-motion: reduce) {
  .news-link, .news-link--inverse { transition: none; }
  .news-link::after, .news-link--inverse::after { transition: none; }
}

/* Mobile navigation - Marca.com style sliding menu from left */
@media (max-width: 767px) {
  /* Sidebar menu that slides in from left */
  #main-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: white;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto; /* hide scrollbar visuals */
    scrollbar-width: none; /* Firefox */
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding-top: 4rem;
  }
  #main-nav::-webkit-scrollbar { display: none; } /* WebKit */
  
  /* Show menu when active */
  #main-nav.active {
    transform: translateX(0);
  }
  
  /* Menu links styling */
  #main-nav > a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s;
    text-align: left; /* left-align text */
  }
  
  #main-nav > a:hover {
    background-color: #f5f5f5;
    color: #2563eb;
  }
  
  /* Dropdown containers */
  #main-nav > div {
    border-bottom: 1px solid #f0f0f0;
  }
  
  /* Dropdown buttons */
  #main-nav > div > button {
    width: 100%;
    padding: 1rem 1.5rem;
    text-align: left; /* left-align text */
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s;
  }
  
  #main-nav > div > button:hover {
    background-color: #f5f5f5;
    color: #2563eb;
  }
  
  /* Chevron rotation */
  #main-nav > div > button svg {
    transition: transform 0.3s ease;
  }
  
  #main-nav > div > button[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }
  
  /* Submenus - hidden by default */
  #main-nav [role="menu"] {
    position: static;
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: none;
    pointer-events: none;
    box-shadow: none;
    background: transparent; /* remove boxed background */
    transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.2s;
    margin: 0;
    padding: 0;
    align-items: flex-start;
  }
  
  /* Show submenu when expanded */
  #main-nav > div > button[aria-expanded="true"] + [role="menu"] {
    visibility: visible;
    opacity: 1;
    max-height: 600px;
    pointer-events: auto;
  }
  
  /* Submenu items */
  #main-nav [role="menuitem"] {
    padding: 0.75rem 2.5rem;
    display: block;
    color: #555;
    font-size: 0.875rem;
    border-bottom: none; /* remove boxed borders */
    transition: background-color 0.2s;
    text-align: right; /* right-align text */
  }
  
  #main-nav [role="menuitem"]:last-child {
    border-bottom: none;
  }
  
  #main-nav [role="menuitem"]:hover {
    background-color: #f5f5f5; /* match top-level hover */
    color: #2563eb;
  }
  
  /* Disable desktop hover behavior only when submenu is collapsed */
  #main-nav .group:hover button[aria-expanded="false"] + [role="menu"] {
    visibility: hidden;
    opacity: 0;
  }
  
  /* Overlay */
  #mobile-overlay.active {
    display: block;
  }
}

/* Image links for athlete photos and regional media — no hover effects */
.img-link { display: inline-block; line-height: 0; }
.img-link img { display: block; border-radius: inherit; transition: none !important; }
.img-link:hover img { transform: none !important; }
.img-link:focus { outline: 2px solid rgba(59,130,246,.12); outline-offset: 2px; }
.no-hover { cursor: pointer; }

/* Athlete name links: reuse headline style but slightly smaller */
.font-semibold .news-link, .athlete-link { font-weight: 700; }

/* Últimas noticias: uniform image sizes and consistent layout */
.latest-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.latest-news-article {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.latest-news-article .img-link {
  flex-shrink: 0;
  width: 140px;
  height: 100px;
}

.latest-news-article .img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}

.latest-news-article .news-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100px;
}

.latest-news-article h3 {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.latest-news-article .news-meta {
  margin-top: auto;
  padding-top: 0.5rem;
}

@media (max-width: 767px) {
  .latest-news-grid {
    grid-template-columns: 1fr;
  }
  
  .latest-news-article .img-link {
    width: 120px;
    height: 90px;
  }
  
  .latest-news-article .news-content {
    height: 90px;
  }
  
  .latest-news-article h3 {
    font-size: 0.9rem;
  }
}

/* Noticias por región: fully responsive tabs and content */
.nrr-tabs-container {
  display: inline-flex;
  background: #f3f4f6;
  border-radius: 9999px;
  padding: 0.25rem;
  gap: 0.5rem;
  white-space: nowrap;
  min-width: min-content;
}

.nrr-tab {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  background: transparent;
  transition: all 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}

.nrr-tab:hover {
  background: #e5e7eb;
}

.nrr-tab-active {
  background: #2563eb !important;
  color: white !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Grid for news articles */
.nrr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.nrr-article {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: box-shadow 0.2s;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.nrr-article:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nrr-media-container {
  flex-shrink: 0;
  width: 140px;
  height: 100px;
  background: #f3f4f6;
  overflow: hidden;
  border-radius: 0.375rem;
}

.nrr-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nrr-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nrr-title {
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
  color: #111827;
}

.nrr-lead {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #6b7280;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Tab text variants: full text on desktop, short on mobile */
.nrr-tab-short {
  display: none;
}

.nrr-tab-full {
  display: inline;
}

/* Mobile responsive styles */
@media (max-width: 767px) {
  .nrr-tabs-container {
    padding: 0.25rem;
    gap: 0.375rem;
  }
  
  .nrr-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .nrr-tab-short {
    display: inline;
  }
  
  .nrr-tab-full {
    display: none;
  }
  
  .nrr-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  
  .nrr-article {
    padding: 0.625rem;
    gap: 0.625rem;
  }
  
  .nrr-media-container {
    width: 110px;
    height: 90px;
  }
  
  .nrr-title {
    font-size: 0.875rem;
    -webkit-line-clamp: 3;
  }
  
  .nrr-lead {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
  }
}

/* Small mobile adjustments */
@media (max-width: 390px) {
  .nrr-tab {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }
  
  .nrr-media-container {
    width: 95px;
    height: 80px;
  }
}
