/* Pagination styles for course.php */
.course-picture-page-link {
  display: inline-block;
  min-width: 2em;
  padding: 0.35em 0.85em;
  margin: 0 0.15em;
  background: rgba(255, 255, 255, 0.8);
  color: #222;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition:
    background 0.18s,
    transform 0.18s,
    font-weight 0.18s;
  cursor: pointer;
  border: none;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.course-picture-page-link:hover,
.course-picture-page-link:focus {
  background: rgba(220, 220, 220, 0.95);
  color: #111;
  font-weight: bold;
  transform: scale(1.05);
  outline: none;
}

.course-picture-page-current {
  display: inline-block;
  min-width: 2em;
  padding: 0.35em 0.85em;
  margin: 0 0.15em;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: 999px;
  text-align: center;
  font-weight: bold;
  font-size: 1em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: default;
  border: none;
}
:root {
  --container-max-width: 1100px;
  --container-radius: 20px;
  --container-shadow: 0 16px 44px rgba(15, 23, 42, 0.24);
  --container-padding-x: clamp(14px, 2.2vw, 28px);
  --container-padding-y: clamp(12px, 1.8vw, 22px);
  --content-spacing: clamp(14px, 2vw, 24px);

  --color-bg: #eef1f6;
  --color-surface: 255 255 255;
  --color-text: #141923;
  --color-heading: #000000;
  --color-muted: #5f677a;
  --color-border: 30 41 59;
  --color-link: #0f6cad;
  --color-nav-link: #35499f;
  --color-link-hover: #c7501a;
  --header-footer-surface: 225 232 244;
  --header-footer-alpha: 0.92;

  --surface-alpha: 0.9;
  --blur-strength: 10px;
}

:root[data-ot-theme="dark"] {
  --color-bg: #030712;
  --color-surface: 12 17 27;
  --color-text: #e6e8ee;
  --color-heading: #f5f7fb;
  --color-muted: #a5adc0;
  --color-border: 148 163 184;
  --color-link: #6ec7ff;
  --color-nav-link: #9fb4ff;
  --color-link-hover: #ff9a69;
  --header-footer-surface: 42 56 78;
  --header-footer-alpha: 0.9;
  --surface-alpha: 0.84;
  --container-shadow: 0 18px 50px rgba(2, 6, 23, 0.58);
}

body {
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.skip-link {
  position: absolute;
  left: 10px;
  top: -40px;
  z-index: 2000;
  padding: 8px 12px;
  border-radius: 8px;
  color: #ffffff;
  background: #111827;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(10px, 2vw, 24px);
}

.page-container {
  position: relative;
  width: 100%;
  z-index: 0;
  max-width: var(--container-max-width);
  margin: 0 auto;
  border-radius: var(--container-radius);
  border: 1px solid rgba(var(--color-border), 0.18);
  box-shadow: var(--container-shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: transparent !important; /* Ensure the main container is clear */
  isolation: isolate; /* Force les navigateurs à traiter les z-index internes proprement */
}

.page-container-blur {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  inset: 0;

  /* On le garde à 0 pour qu'il soit sous le contenu (z-index: 1) 
     mais au-dessus du fond du body */
  z-index: 0;

  /* Utilisation de background-color explicite pour Safari */
  /* background-color: rgba(var(--color-surface), var(--surface-alpha)); */
  background-color: rgba(255, 255, 255, 0.5) !important;

  /* Effet de flou avec préfixe pour iOS/Safari */
  -webkit-backdrop-filter: blur(var(--blur-strength));
  backdrop-filter: blur(var(--blur-strength));

  pointer-events: none;
}

.page-container > .ot-header,
.page-container > .ams-ad,
.page-container > .ot_content,
.page-container > .ot_footer {
  display: block;
  width: 100%;
  float: none;
  clear: both;
  justify-self: stretch;
  position: relative;
  z-index: 1;
}

.ot-header {
  background: rgba(var(--header-footer-surface), var(--header-footer-alpha));
  border-bottom: 1px solid rgba(var(--color-border), 0.15);
  box-shadow: inset 0 -1px 0 rgba(var(--color-border), 0.1);
  padding: var(--container-padding-y) 0;
}

.ot-content {
  contain: paint;
  position: relative;
  background: transparent !important;
}

.ot-header-inner,
.flex-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 0 var(--container-padding-x);
}

.logo img {
  max-width: 180px;
  height: auto;
}

.banner {
  flex-shrink: 0;
}

.main-nav {
  position: relative;
  width: 100%;
  /*
    Responsive layout for tablets and below (≤900px):
    - Adjusts background, header, banner, navigation, and flex layouts for better usability on tablets and mobile devices.
    - Consolidates previous 800px and 900px breakpoints for maintainability.
  */
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  gap: 0.2em 0.7em;
}

.main-nav li {
  margin: 0;
}

.main-nav a {
  color: var(--color-nav-link);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5em 0.2em;
  transition: color 0.2s;
}

.main-nav a:hover {
  color: var(--color-link-hover);
}

.main-nav a:focus-visible,
.footer-nav a:focus-visible,
.clubs-link:focus-visible {
  outline: 2px solid var(--color-link-hover);
  outline-offset: 2px;
  border-radius: 4px;
}

.ot_body.boxed {
  max-width: none;
  margin: 0;
  border-radius: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  margin-left: 1em;
}
.nav-toggle span {
  display: block;
  width: 28px;
  height: 4px;
  background: var(--color-link);
  border-radius: 2px;
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
    background-position: center top;
  }

  .flex-header {
    justify-content: center;
  }

  .banner {
    margin-top: 1em;
  }
}

/* Make navigation responsive for screens ≤800px */
@media (max-width: 800px) {
  .page-shell {
    align-items: flex-start;
  }

  .main-nav ul {
    display: none;
    flex-direction: column;
    align-items: center; /* Center links for better mobile feel */
    width: 100%;
  /*
    Hide banner on small screens (≤727px):
    - Prevents banner from taking up space on very small devices.
  */

    /* FIX: Solid background and positioning */
    background-color: rgb(var(--color-surface));
    position: relative; /* Changed from absolute to keep it above content */
    left: 0;
    top: 0;
    z-index: 1000;
    padding: 1em 0;
    border-bottom: 1px solid rgba(var(--color-border), 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  body.nav-open .main-nav ul {
    display: flex;
  }

  .main-nav li {
    margin: 0; /* Clean up margins */
    width: 100%;
    text-align: center;
  }

  .main-nav a {
    display: block;
    padding: 0.8em 0; /* Larger tap target for mobile */
    border-bottom: 1px solid rgba(var(--color-border), 0.05);
  }

  .main-nav li:last-child a {
    border-bottom: none;
  }

  /* Hamburger menu button */
  .nav-toggle {
    display: flex;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    margin-left: 1em;
  }
  .nav-toggle span {
    display: block;
    width: 28px;
    height: 4px;
    background: var(--color-link);
    border-radius: 2px;
  }
}

/* Style for source/date information */
.vusur {
  font-size: 0.85em;
  font-style: italic;
  color: var(--color-muted);
  margin-left: 0.4em;
}

.ot_footer {
  background: rgba(var(--header-footer-surface), var(--header-footer-alpha));
  color: var(--color-text);
  padding: 1.25em var(--container-padding-x) 1.1em;
  margin: 0;
  text-align: center;
  border-top: 1px solid rgba(var(--color-border), 0.15);
  box-shadow: inset 0 1px 0 rgba(var(--color-border), 0.1);
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1em 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5em;
}
.footer-nav a {
  color: var(--color-link);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--color-link-hover);
}

.footer-meta {
  font-size: 0.95em;
  color: var(--color-muted);
}

.ot_content {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: var(--content-spacing) var(--container-padding-x);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.ot_content h1,
.ot_content h2,
.ot_content h3,
.ot_content h4 {
  color: var(--color-heading);
}

/* 1. The Parent: This must be a flex container for vertical centering to work */
.flex-section {
  display: flex !important;      /* Forces flex layout */
  flex-direction: row;           /* Ensures photo and text are side-by-side */
  align-items: center !important; /* Forces vertical centering */
  justify-content: flex-start;   /* Keeps content aligned to the left */
  gap: 2em;
  margin: 2em 0;
  width: 100%;
}
}

.actus-photo {
  /* This forces the box to be exactly 160x160 and never shrink */
  flex: 0 0 160px;
  width: 160px;
  height: 160px;

  /* Centering the image inside the 160x160 box */
  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;
  overflow: hidden;

  /* Your shimmer effect */
  background: #eee
    linear-gradient(to right, #eeeeee 8%, #fafafa 18%, #eeeeee 33%);
  background-size: 800px 160px;
  animation: shimmer 1.5s linear infinite forwards;
}

.actus-photo img.photoframed {
  /* This ensures that even if the image is 150px, it stays 150px 
     and leaves the 5px gap you want inside the 160px container */
  max-width: 150px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;

  /* Keep your styling */
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.actus-photo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  object-fit: contain; /* Keeps the aspect ratio without cropping */
  display: block;
}

/* 3. The Animation */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

/* 4. Fix vertical alignment for long lists */
.flex-section {
  align-items: flex-start; /* Keeps photos at the top of the list, not floating in the middle */
  padding-top: 10px;
}

@media (max-width: 800px) {
  .flex-section {
    flex-direction: column;
    gap: 1em;
  }
  .actus-photo img {
    max-width: 100%;
  }
}
.google-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-items: center;
  justify-content: center;
  margin: 2em 0;
}
.visually-hidden {
  position: absolute;
  left: -9999px;
}
.forum-tip {
  font-size: 0.95em;
  color: #888;
  margin-top: 0.5em;
}
.clubs-link {
  display: inline-block;
  margin-top: 0.5em;
  color: #0073b1;
  font-weight: bold;
}
.clubs-link:hover {
  color: #e94e1b;
}

/* Hide banner on screens smaller than 728px */
@media (max-width: 727px) {
  .banner {
    display: none;
  }
}

/* Video page styles */
.video-section h2 {
  margin-bottom: 1.5em;
}

.video-grid {
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.video-item {
  margin-bottom: 1em;
  border-bottom: 1px solid #eee;
  padding-bottom: 2em;
}

.video-title {
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.2em;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.video-container .bbvideo {
  width: 100% !important;
  height: 0 !important;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  display: block;
}

.video-container .bbvideo > div {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

.ot_message {
  background: rgba(245, 245, 245, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 1em;
  margin-bottom: 1.5em;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .video-container {
    max-width: 100%;
  }
}

/* Athletes/Blogs page styles */
.blogs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2em 0;
}

.blogs-list li {
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #f0f0f0;
}

.elite-badge,
.amateur-badge {
  display: inline-block;
  padding: 0.2em 0.5em;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: bold;
  margin-right: 0.5em;
  text-transform: uppercase;
}

.elite-badge {
  background-color: #e94e1b;
  color: white;
}

.amateur-badge {
  background-color: #0073b1;
  color: white;
}

.blog-name {
  font-weight: 600;
}

.requirements-list {
  list-style: disc;
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.sub-requirements {
  list-style: circle;
  padding-left: 1.5em;
  margin-top: 0.5em;
}

.blog-platforms {
  background: #f8f8f8;
  padding: 1em;
  border-radius: 4px;
  margin-top: 1.5em;
}

.guidelines-section h2 {
  margin-top: 2em;
}

/* Clubs page styles */
.clubs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2em 0;
}

.clubs-list li {
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #f0f0f0;
}

.featured-club-badge,
.regular-club-badge {
  display: inline-block;
  padding: 0.2em 0.5em;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: bold;
  margin-right: 0.5em;
  text-transform: uppercase;
}

.featured-club-badge {
  background-color: #e94e1b;
  color: white;
}

.regular-club-badge {
  background-color: #0073b1;
  color: white;
}

.club-name {
  font-weight: 600;
}

/* Tools page styles */
.tools-intro {
  text-align: center;
  margin-bottom: 2em;
}

.tools-header-image {
  max-width: 100%;
  height: auto;
  margin-bottom: 1em;
}

.tools-grid {
  display: flex;
  gap: 2em;
  margin-bottom: 2em;
}

.tools-list {
  flex: 1;
}

.tool-item {
  margin-bottom: 1.5em;
  padding-bottom: 1em;
  border-bottom: 1px solid #f0f0f0;
}

.tool-item h3 {
  margin-bottom: 0.3em;
  font-size: 1.2em;
}

.tool-item a {
  color: #0073b1;
  text-decoration: none;
  transition: color 0.2s;
}

.tool-item a:hover {
  color: #e94e1b;
}

.tool-item p {
  margin-top: 0.2em;
  color: #666;
}

.tools-image {
  flex-shrink: 0;
  max-width: 226px;
}

.tools-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.external-resources {
  background: #f8f8f8;
  padding: 1em 1.5em;
  border-radius: 4px;
  margin-top: 1.5em;
}

.external-link {
  word-break: break-all;
}

@media (max-width: 768px) {
  .tools-grid {
    flex-direction: column;
  }

  .tools-image {
    max-width: 100%;
    margin-top: 1em;
    text-align: center;
  }

  .tools-image img {
    max-width: 300px;
  }
}

/* Photos page styles */
.photos-intro {
  text-align: center;
  margin-bottom: 2em;
}

.photos-header-image {
  max-width: 100%;
  height: auto;
}

.event-year {
  font-size: 1.6em;
  font-weight: bold;
  color: #0073b1;
  margin: 2em 0 1em 0;
  padding-bottom: 0.3em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
}

.event-card {
  display: flex;
  margin-bottom: 1.5em;
  padding-bottom: 1.5em;
}

.event-card,
.event-details,
.event-races {
  /* Forces these elements to stay on their own 'page' in the GPU */
  -webkit-transform: translateZ(0);

  /* Prevents the text from triggering complex sub-pixel math that kills the blur */
  -webkit-font-smoothing: antialiased;

  /* Ensures no unexpected clipping */
  overflow: visible !important;
}

.event-image {
  flex-shrink: 0;
  width: 160px;
  margin-right: 1.5em;
  
  /* --- Vertical Centering Logic --- */
  display: flex;
  flex-direction: column;   /* Keeps items stacked vertically */
  justify-content: center;  /* Centers items vertically */
  align-items: center;      /* Centers items horizontally */
  /* ------------------------------- */

  text-align: center;
}

.event-image img {
  border-radius: 0px !important;
  border: 2px solid #fff;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 1.5px 6px rgba(0, 0, 0, 0.1);
  transform: rotate(-3deg);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.event-photo {
  border-radius: 0px !important;
  border: 2px solid #fff;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 1.5px 6px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s;
}

.event-photo-filename {
  font-size: 0.5em;
}

.event-thumbnail {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-details {
  flex: 1;
}

.event-name {
  margin: 0;
  font-size: 1.2em;
  color: #333;
}

.event-location {
  font-weight: normal;
  font-style: italic;
  color: #666;
  font-size: 0.9em;
}

.event-stats {
  color: var(--color-text);
  font-style: italic;
  margin-bottom: 0.6em;
  font-size: 0.9em;
}

.stat-divider {
  margin: 0 0.5em;
}

.event-races {
  line-height: 1.5;

  /* This forces the text content into its own GPU layer */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);

  /* This prevents the text-rendering from 'leaking' into the parent's filter calculation */
  isolation: isolate;
}

.event-races a {
  color: #0073b1;
  text-decoration: none;
  transition: color 0.2s;
}

.event-races a:hover {
  color: #e94e1b;
}

@media (max-width: 600px) {
  .event-card {
    flex-direction: column;
  }

  .event-image {
    width: 100%;
    margin-right: 0;
    margin-bottom: 1em;
  }

  .event-thumbnail {
    max-width: 150px;
  }
}

/* Modern list styles with custom bullets */

/* Modern arrow bullets for all lists */
ul li {
  position: relative;
  padding-left: 1em;
  list-style: none;
}

ul li::before {
  content: "›";
  position: absolute;
  left: 0;
  top: -1px;
  color: #0073b1;
  font-size: 1.2em;
  font-weight: bold;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
}

.event-races span {
  display: inline-block;
  -webkit-transform: translateZ(
    0
  ); /* Isolates the text from the backdrop calculation */
}

/* Remove arrow bullets from navigation */
.main-nav ul li::before,
.footer-nav ul li::before {
  content: none;
  display: none;
}

.main-nav ul li,
.footer-nav ul li {
  padding-left: 0;
}

.gallery-container {
  width: 100%;
  margin: 0 auto;
}
.gallery-header {
  text-align: center;
  margin-bottom: 20px;
}
.back-link {
  display: inline-block;
  margin-bottom: 15px;
  color: var(--color-link);
  text-decoration: none;
  font-weight: 600;
}

/* Pagination Layout */
.pagination-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}
.page-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

/* Grid Logic */
.photo-grid {
  display: grid;
  /* Responsive columns: min 150px, auto-fill to width */
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.photo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease;
}
.photo-item:hover {
  transform: translateY(-3px);
}

.photo-link {
  display: block;
  line-height: 0;
}
.event-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-meta {
  margin-top: 8px;
  text-align: center;
  font-size: 0.8em;
  color: var(--color-muted);
  max-width: 150px;
}
.photo-id {
  display: block;
  font-weight: bold;
  color: var(--color-text);
}
.photo-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-footer {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}
.quick-jump select {
  padding: 5px;
  border-radius: 4px;
}

@media (max-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }
  .event-photo {
    width: 140px;
    height: 140px;
  }
}
