@import url("https://fonts.googleapis.com/css2?family=Saira+Semi+Condensed:wght@600;700&family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap");


/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
  --cs-yellow: #ffd23f;            /* yellow jersey */
  --cs-yellow-deep: #e9b400;
  --cs-asphalt: #2b2f36;           /* menu bar */
  --cs-asphalt-2: #3a3f48;
  --cs-sky: #77b5fe;               /* the club's panel colour */
  --cs-sky-deep: #1f5fae;          /* links */

  --cs-ground: #f3f4f0;
  --cs-paper: #ffffff;
  --cs-line: #dfe2e6;
  --cs-ink: #1d2127;
  --cs-ink-soft: #545b66;

  --cs-font-head: "Saira Semi Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --cs-font-text: "Atkinson Hyperlegible", Verdana, "Segoe UI", Arial, sans-serif;

  --cs-container: 1180px;
  --cs-gutter: clamp(0.9rem, 3vw, 1.5rem);
  --cs-radius: 10px;
  --cs-shadow: 0 1px 2px rgba(29, 33, 39, 0.06), 0 10px 24px -16px rgba(29, 33, 39, 0.35);
}


/* ==========================================================================
   2. Base (and the pages' inline overrides)
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* the pages add a 100px top margin inline */
html body {
  margin: 0;
  padding: 0;
  font-family: var(--cs-font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--cs-ink);
  background-color: var(--cs-ground);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

a {
  color: var(--cs-sky-deep);
}

a:hover {
  color: var(--cs-ink);
}

h1, h2, h3, h4 {
  font-family: var(--cs-font-head);
  font-weight: 700;
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
}

p.aheader2:empty,
#data section:empty {
  display: none;
}


/* ==========================================================================
   3. Header: yellow jersey band with the logos and the page name
   ========================================================================== */

body > header {
  background-color: var(--cs-yellow);
}

body > header > table:first-of-type {
  width: 100%;
  max-width: var(--cs-container);
  margin: 0 auto;
  border-collapse: collapse;
}

body > header > table:first-of-type td {
  padding: 1rem var(--cs-gutter);
  vertical-align: middle;
  background-color: transparent !important;   /* the centre cell is bgcolor="yellow" */
}

body > header > table:first-of-type td > br:first-child {
  display: none;
}

/* Side logos (federation, regional league) on small white tiles */
body > header > table:first-of-type td:first-child img,
body > header > table:first-of-type td:last-child img {
  width: auto;
  height: auto;
  max-height: 88px;
  padding: 6px;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

body > header > table:first-of-type td:nth-child(2) img {
  max-height: 120px;
  width: auto;
}

/* The page name ("Accueil" etc.) */
body > header .texte {
  display: block;
  width: fit-content;
  margin: 0.6rem auto 0;
  padding: 0.15rem 0.9rem;
  font-family: var(--cs-font-head);
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem);
  font-weight: 700;
  color: var(--cs-yellow);
  background-color: var(--cs-asphalt);
  border-radius: 999px;
}

@media (max-width: 599px) {
  body > header > table:first-of-type td {
    padding: 0.75rem 0.4rem;
  }

  body > header > table:first-of-type td:first-child img,
  body > header > table:first-of-type td:last-child img {
    max-height: 52px;
    padding: 3px;
  }

  body > header > table:first-of-type td:nth-child(2) img {
    max-height: 72px;
  }
}


/* ==========================================================================
   4. Menu bar: asphalt with a dashed road line
   ========================================================================== */

body > header > table:nth-of-type(2),
body > header > table:nth-of-type(2) > tbody,
body > header > table:nth-of-type(2) tr,
body > header > table:nth-of-type(2) td {
  display: block;
  width: 100%;
}

body > header > table:nth-of-type(2) {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-bottom: 6px;
  background:
    linear-gradient(90deg, var(--cs-yellow) 0 50%, transparent 50% 100%) left bottom / 44px 4px repeat-x,
    var(--cs-asphalt);
}

header nav #p7PMnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: var(--cs-container);
  margin: 0 auto;
  padding: 0 var(--cs-gutter);
  list-style: none;
}

header nav #p7PMnav > li {
  position: relative;
  float: none;
  margin: 0;
  list-style: none;
}

header nav #p7PMnav > li > a {
  display: block;
  padding: 0.85rem 1rem;
  font-family: var(--cs-font-head);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  background: none;
}

header nav #p7PMnav > li > a:hover,
header nav #p7PMnav > li:focus-within > a {
  color: var(--cs-yellow);
}

/* Dropdowns: open on hover or keyboard focus (also when the menu script runs) */
header nav #p7PMnav ul {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 110;
  display: block;
  min-width: 14rem;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  background-color: var(--cs-paper);
  border-top: 3px solid var(--cs-yellow);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 18px 36px -16px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

header nav #p7PMnav > li:hover > ul,
header nav #p7PMnav > li:focus-within > ul {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

header nav #p7PMnav ul li {
  float: none;
  width: auto;
  list-style: none;
}

header nav #p7PMnav ul a {
  display: block;
  padding: 0.5rem 1.1rem;
  font-size: 0.975rem;
  color: var(--cs-ink);
  text-decoration: none;
  background: none;
}

header nav #p7PMnav ul a:hover {
  color: var(--cs-sky-deep);
  background-color: var(--cs-ground);
}

/* Phones: the main sections as a sideways strip */
@media (max-width: 767px) {
  body > header > table:nth-of-type(2) td {
    overflow-x: auto;
    scrollbar-width: none;
  }

  body > header > table:nth-of-type(2) td::-webkit-scrollbar {
    display: none;
  }

  header nav #p7PMnav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: max-content;
    padding-inline: calc(var(--cs-gutter) - 0.6rem);
  }

  header nav #p7PMnav > li > a {
    padding: 0.8rem 0.6rem;
  }

  header nav #p7PMnav ul {
    display: none;
  }
}


/* ==========================================================================
   5. Page layout: content beside a column of sidebar cards
   ========================================================================== */

body > #wrapper {
  max-width: calc(var(--cs-container) + 2 * var(--cs-gutter));
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) var(--cs-gutter) clamp(2rem, 4vw, 3rem);
}

#wrapper > #main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
  grid-template-rows: repeat(10, auto) 1fr;
  column-gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

#main > #data {
  grid-column: 1;
  grid-row: 1 / -1;
  min-width: 0;
}

#main > aside {
  grid-column: 2;
  margin-bottom: 1.1rem;
}

/* Sidebar boxes with nothing in them, and the frozen visitor counter */
#main > aside:not(:has(img, li, a)),
#main > aside:has(.table_affiche) {
  display: none;
}

@media (max-width: 899px) {
  #wrapper > #main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  #main > #data,
  #main > aside {
    grid-column: 1;
    grid-row: auto;
  }

  #main > #data {
    margin-bottom: 1.25rem;
  }
}


/* ==========================================================================
   6. Content panels (sky blue, set by the pages) and the photo grid
   ========================================================================== */

#data article article {
  margin-bottom: 1.25rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-radius: var(--cs-radius);
  box-shadow: var(--cs-shadow);
}

#data article article > header > p:last-child {
  margin-bottom: 0;
}

#data .img_article {
  display: inline-block;
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.45);
}

/* Panel headlines written with inline styles */
#data article article span[style*="font-size"] {
  font-family: var(--cs-font-head);
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.55rem) !important;
  line-height: 1.25;
}

/* Slideshow: all photos as a grid (the pages fix it at 600 x 800px and
   stack the photos; the script that rotated them is not needed) */
#data #container {
  position: static;
  width: auto;
  height: auto;
}

#data #container ul.slideshow {
  position: static;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr));
  gap: 0.6rem;
  width: auto;
  margin: 0;
  padding: 0;
}

#data #container ul.slideshow li {
  position: static;
  display: block;
  opacity: 1 !important;
}

#data #container ul.slideshow img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px !important;
}

#data center {
  display: block;
}

/* The spacer paragraph before the photo grid, and room after it */
#data section > p:first-child:has(+ center) {
  display: none;
}

#data section:has(#container) {
  margin: 1rem 0 1.25rem;
}


/* ==========================================================================
   7. Sidebar cards
   ========================================================================== */

#main > aside {
  padding: 1.1rem 1.2rem;
  text-align: center;
  background-color: var(--cs-paper);
  border-radius: var(--cs-radius);
  box-shadow: var(--cs-shadow);
}

#main > aside img.logo {
  max-height: 120px;
  width: auto;
}

/* Quick links (Gazettes, Semaine fédérale, Météo) */
.menu-parcours > table,
.menu-parcours > table > tbody,
.menu-parcours > table tr,
.menu-parcours > table td {
  display: block;
  width: 100%;
}

.menu-parcours #wrapper {
  display: none;
}

.menu-parcours #p7PMnav {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.menu-parcours #p7PMnav li {
  float: none;
  list-style: none;
}

.menu-parcours #p7PMnav a {
  display: block;
  padding: 0.65rem 0.9rem;
  font-family: var(--cs-font-head);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--cs-ink);
  text-decoration: none;
  background-color: var(--cs-ground);
  border-left: 5px solid var(--cs-yellow);
  border-radius: 6px;
}

.menu-parcours #p7PMnav a:hover {
  background-color: #fff6d6;
  border-left-color: var(--cs-yellow-deep);
}

/* Partners */
.logotxt {
  text-align: left;
}

.logotxt > p {
  margin-bottom: 0.5rem;
  font-family: var(--cs-font-head);
  font-size: 1.15rem;
  font-weight: 700;
}

.logotxt .ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.logotxt .li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.1rem;
  font-size: 0.95rem;
  line-height: 1.4;
  border-top: 1px solid var(--cs-line);
}

.logotxt .li::before {
  content: "";
  position: absolute;
  top: 0.85em;
  left: 0.1rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background-color: var(--cs-yellow-deep);
}


/* ==========================================================================
   8. Footer, focus and motion
   ========================================================================== */

body > footer:empty {
  height: 10px;
  background:
    linear-gradient(90deg, var(--cs-yellow) 0 50%, transparent 50% 100%) left center / 44px 3px repeat-x,
    var(--cs-asphalt);
}

:focus-visible {
  outline: 2px solid var(--cs-sky-deep);
  outline-offset: 2px;
}

header nav :focus-visible {
  outline-color: var(--cs-yellow);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}