/* Global Box Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* all elements with fonts are this font by default */
* {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* all anchor tags by default */
a {
  text-decoration: none;
  color: black;
}

/* change cursor to pointer when hovering clickable things */
a,
button {
  cursor: pointer;
}

/* table and footer links color */
table a,
footer a {
  color: blue;
}

/* body background color, and centering */
body {
  background-color: lightcyan;
  text-align: center;
  font-family: inherit;
}

/* Skip to main content positioning */
body > a {
  position: absolute;
  top: -30px;
  left: 0;
  color: white;
  background-color: black;
  font-weight: bold;
}

/* brings skip to content to focus */
body a:focus {
  top: 5px;
  left: 5px;
}

/* General Text Styling */
h1,
h2 {
  text-align: center;
  width: 100%;
}

h1 {
  font-size: 2em;
  margin: 10px 0;
}

h2 {
  font-size: 1.1em;
  margin: 20px 0 5px 0;
}

/* Navigation Styles */
nav ul {
  padding: 0;
  text-align: center;
}

/* Menu Button */
#menu-button {
  background-color: #333;
  width: 100%;
  color: white;
  padding: 10px 20px;
  border: 2px solid black;
  font-size: 1rem;
  display: block;
  font-weight: bold;
}

/* Menu Dropdown Styles */
#menu {
  list-style: none;
  display: none;
  background-color: #222;
  padding: 0;
  line-height: 1em;
  border: 2px solid black;
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Menu [Home page, mens team, womens team] menu open */
#menu.show {
  display: block;
}

/* menu list item styling */
#menu li {
  display: block;
  text-align: center;
  font-weight: bold;
  color: white;
  border-bottom: 2px solid #555;
  width: 100%;
}

/* home page button link = width of li */
#menu > li:first-child a {
  display: block;
  width: 100%;
}

/* menu last child [womens team] no border on bottom */
#menu li:last-child {
  border-bottom: none;
  /* padding-bottom: 10px; */
}

/* menu list item last child [womens team] hover affect */
#menu li:last-child:hover {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* menu list item anchor tags and button text color and padding */
#menu li a,
button.team {
  color: white;
  padding: 10px 0;
}

/* submenu styling [athlete menus] */
.submenu {
  display: none;
  max-height: 33vh;
  overflow-y: auto;
  border: 1px solid white;
  margin: 0 20px 20px 20px;
}

/* displays submenu */
.submenu.show {
  display: block;
}

/* adjust line height of anchor tags/clickable links */
.submenu li a {
  display: block;
}

/* team button stying [mens team, womens team] */
button.team {
  border: none;
  background-color: inherit;
  width: 100%;
}

/* curve womens team bottom of submenu */
#menu li:nth-child(3) button.team {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* Image Styling */
img {
  display: block;
  width: 90%;
  border-radius: 10px;
  border: 2px solid black;
  margin: auto;
  box-shadow: 0 3px 8px black;
}

/* Table Styling */
table {
  width: 90%;
  margin: auto;
  table-layout: auto;
  border-spacing: 0;
  border-collapse: separate;
  box-shadow: 0 3px 8px black;
  border-radius: 5px;
}

tbody {
  font-size: 13px;
}

/* table head[th] and table data [td] styling */
th,
td {
  padding: 10px;
  text-align: left;
  border: 1px solid black;
  width: 50%;
}

/* table head [th] element styling */
thead th {
  background-color: #444;
  color: white;
  font-weight: bold;
}

/* Rounded Corners for Tables */
thead th:first-child {
  border-top-left-radius: 5px;
}

thead th:last-child {
  border-top-right-radius: 5px;
}

tbody tr:last-child td:first-child {
  border-bottom-left-radius: 5px;
}

tbody tr:last-child td:last-child {
  border-bottom-right-radius: 5px;
}

/* Athlete Table Specific */
#athlete-table thead th:nth-child(3) {
  border-top-right-radius: 5px;
}

#athlete-table tbody tr:last-child td:nth-child(3) {
  border-bottom-right-radius: 5px;
}

/* Alternate Table Row Colors */
tbody tr:nth-child(even) {
  background-color: lightblue;
}

tbody tr:nth-child(odd) {
  background-color: lightyellow;
}

/* remove 4th column from table for mobile version */
table#athlete-table thead tr th:nth-child(4) {
  display: none;
  border: none;
}

/* remove 4th column from table for mobile version */
table#athlete-table tbody tr td:nth-child(4) {
  display: none;
  border: none;
}

/* make table head sticky when scrolling farther down screen */
table#athlete-table thead {
  position: sticky;
  top: 0;
}

/* Footer Styling */
footer {
  margin-top: 25px;
  margin-bottom: 25px;
}

/* Home Page Styling */

/* header 1 styling */
.index-h1 {
  margin-top: 15px;
}

/* skyline image styling */
.logo {
  width: 50%;
  margin-top: 15px;
  border-radius: 10%;
  border: 3px solid;
}

address > a {
  text-decoration: underline;
}

/* All Hover Effects for pages */

/* turns athlete link boxes to a lighter grey background when hovering, allows the box being hovered to turn darker black */
.submenu,
#menu-button,
.submenu li,
#menu li button,
#menu > li:first-child,
button.team {
  transition: background-color 0.3s ease, font-size 0.3s ease, padding 0.3s ease;
}

/* main nav menu hover color change */
.submenu:hover,
#menu-button:hover {
  background-color: #666;
}

/* turns athlete link boxes to a lighter grey background when hovering, allows the box being hovered to turn darker black */
.submenu li:hover {
  background-color: #222;
}

/* menu list items hover effects */
#menu li button:hover,
#menu > li:first-child:hover {
  background-color: #666;
}

#menu > li:first-child:hover,
button.team:hover {
  font-size: 1.1rem;
}

#menu-button:hover {
  font-size: 1.09rem;
  padding: 9px 20px;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  .submenu,
  #menu-button,
  .submenu li,
  #menu li button,
  #menu > li:first-child,
  button.team {
    transition: none;
  }
}

/* Dark Mode Styles */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #222;
    color: white;
  }

  /* link color for footer */
  a {
    color: #add8e6;
  }

  /* menu button and items background color and text color */
  #menu-button,
  #menu li {
    background-color: #444;
    color: white;
  }

  .submenu li {
    background-color: #222;
  }

  thead th {
    background-color: #555;
  }

  footer a {
    color: rgb(24, 155, 255);
  }

  table {
    color: black;
  }

  #menu-button:hover {
    background-color: #222;
  }

  /* Individual submenu item hover effect */
  #menu .submenu li:hover {
    background-color: #555;
  }

  /* menu list items hover effects */
  #menu li button:hover,
  #menu > li:first-child:hover {
    background-color: #222;
  }

  #menu .submenu li {
    background-color: #222;
  }
}

/* Tablet Media Query */
@media (min-width: 600px) {
  table {
    border: 1px solid black;
    border-radius: 6px;
  }

  header img {
    width: 80%;
  }

  /* Show 4th column in the table */
  table#athlete-table thead tr th:nth-child(4),
  table#athlete-table tbody tr td:nth-child(4) {
    display: table-cell;
    border: 1px solid black;
  }

  /* Adjust border-radius for the 4th column corners */
  #athlete-table thead th:nth-child(4) {
    border-top-right-radius: 5px;
  }

  #athlete-table tbody tr:last-child td:nth-child(4) {
    border-bottom-right-radius: 5px;
  }

  /* remove third colum border radius */
  #athlete-table thead th:nth-child(3),
  #athlete-table tbody tr:last-child td:nth-child(3) {
    border-radius: 0;
  }

  tbody {
    font-size: 14px;
  }

  #athlete-table .result-row td {
    width: 25%;
  }

  #athlete-table {
    table-layout: fixed;
  }
}

/* Desktop Media Query */
@media (min-width: 1024px) {
  table {
    width: 70%;
    border: 1px solid black;
    border-radius: 6px;
  }

  header img {
    width: 60%;
  }

  /* Show 4th column in the table */
  table#athlete-table thead tr th:nth-child(4),
  table#athlete-table tbody tr td:nth-child(4) {
    display: table-cell;
    border: 1px solid black;
  }

  /* Adjust border-radius for the 4th column corners */
  #athlete-table thead th:nth-child(4) {
    border-top-right-radius: 5px;
  }

  #athlete-table tbody tr:last-child td:nth-child(4) {
    border-bottom-right-radius: 5px;
  }

  /* remove third colum border radius */
  #athlete-table thead th:nth-child(3),
  #athlete-table tbody tr:last-child td:nth-child(3) {
    border-radius: 0;
  }

  tbody {
    font-size: 15px;
  }

  #athlete-table .result-row td {
    width: 25%;
  }

  #athlete-table {
    table-layout: fixed;
  }
}
