/* MAIN CONTENT */

/* Properties of the news-grid */
.news-grid {
  display: grid;
  grid-template-rows: auto auto; /* Rows have the same height */
  height: 50%; /* It occupies half the homepage */
  grid-template-columns: 65% 35%;
  grid-gap: 0.5em; /* Space between grid items */
  margin-bottom: 2em; /* Creates space between the news grid and the events */
}

/* Properties of the grid items */
.cell1 {
  position: relative;
  grid-row: 1 / span 2;
}

.cell2 {
  position: relative;
  width: 100%;
  height: 100%;
}

.cell1 img, .cell2 img  {
  position: relative;
  width: 100%; /* The image occupies the entire area of the grid item */
  height: 100%;
  object-fit: cover; /* It keeps the image's aspect ratio */
}

/* Properties of the headlines */
.news-grid > a {
  color: white;
}

.news-grid > a:hover {
  color: #cd171e;
}

/* It sets the black transparent box behind the headlines and text properties */
.headline {
  position: absolute;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* Black background with transparency */
  width: 100%;
  text-shadow: 2px 2px black;
  font-variant: small-caps;
}

#main-cell {
  padding: 0.4em;
  font-size: 2.5em;
}

#second-cell {
  padding: 0.3em;
  font-size: 1.5em;
}

/* All news are piled when the screen becomes smaller */
@media (max-width: 990px) {
  .news-grid {
      grid-template-columns: 1fr;
      grid-template-rows: auto;
  }
}

.past-events, .future-events {
  margin-bottom: 3em;
}

/* Tables with past and future events */
.events table {
  text-align: left;
  border-left: 0.3em solid #cd171e;
  margin-left: 2em;
}

.events th {
  font-size: 1.75em;
  padding-left: 0.5em; /* Separates table header from its left border */
}

.events td {
  font-size: 1em;
  line-height: 2em;
  text-indent: 0.5em; /* The date of an event is indented */
  font-weight: bold;
  color: #888;
  padding: 1.5em 0 0 1em; /* Creates space around events */
}

.events a {
  color: black;
  font-weight: normal; /* In contrast with dates, links are not bold */
  text-decoration: none; /* Remove underline */
}

.events a:hover {
  color: #cd171e;
}

#section-link {
  text-align: center;
  font-size: 1.2em;
  text-decoration: underline;
}

/* SIDEBAR */

/* It sets the boxes for Judoca of the month and CJT results */
.jm, .results {
  background-color: rgba(220, 224, 223, 0.2);
  border: solid 0.1em #dce0df;
  margin-bottom: 1em;
  padding: 1em;
  text-align: center;
}

/* Judoca of the month */

.jm h3 {
  padding-bottom: 0.25em;
}

.jm img {
  max-width: 11.5em;
  max-height: 20em;
  padding-bottom: 0.75em;
}

.jm ul {
  margin: 0;
  text-align: left;
}

/* CJT results */

.results h3, .results h5 {
  padding-bottom: 0.25em;
}

.btn-group {
  padding-bottom: 1em;
}

.btn-group button:not(:last-child) {
  border-right: none; /* Prevents double borders */
}

.btn {
  background-color: transparent;
  border: solid 0.1em #cd171e;
}

.btn img {
  width: 2em;
}

.btn:focus {
  outline: none; /* It removes the blue box around button after click */
  box-shadow: none;
}

.active-btn, .btn:hover {
  background-color: #231f20;
}

#gold_row {
  background-color: #ffd700;
}

#silver_row {
  background-color: #c0c0c0;
}

#bronze_row {
  background-color: #cd7f32;
}

.results table {
  border-collapse: collapse;
  margin: 0 auto;
}

.results td {
  padding: 0.5em 0.75em; /* Enlarges table's cells with CJT results */
}

/* CJT achievements unlocked */

.about-us {
  background-color: rgba(35,31,32,0.8);
  border: solid 0.1em #231f20;
  color: white;
  margin-bottom: 1em;
  padding: 1em 1em 0 1em;
  font-size: 1em;
  line-height: 2.75em;
}

#first-letter-1 {
  font-family: 'Rock Salt';
  font-size: 1.4em;
  color: #cd171e;
}

#first-letter-2 {
  font-family: 'Rock Salt';
  font-size: 1.4em;
  color: white;
}
