* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

main.homepage {
  margin: 15px;
  display: flex;
  flex: 1;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 60px;
}

.etusivu-tieto {
  background: beige;
  padding: 15px;
  margin-top: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px darkgray;
}

.etusivu-tieto h2 {
  font-size: 27px; 
}

.etusivu-tieto p {
  font-size: 18px;
  margin-top: 10px;
}

.gallery-box {
  background: beige;
  padding: 15px;
  margin-top: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px darkgrey;
}

.gallery-box h2 {
  font-size: 27px;
  margin-bottom: 10px;
}

.gallery-grid {
  display: grid;
  justify-content: center;
  grid-template-columns: repeat(3, minmax(0,600px));
  gap: 10px;
  margin: 0 auto;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  max-height: 400px;
  border-radius: 8px;
  object-fit: cover;
}

.rokkiralli {
  background: beige;
  padding: 15px;
  margin-top: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px darkgrey;
  max-width: 700px;
}

.rokkiralli h2 {
  font-size: 27px;
  margin-bottom: 10px;
}

.rokkiralli p {
  font-size: 18px
}

.rokkiralli a {
  display: inline-block;
  text-decoration: none;
  color: #EAF4EB;
  background-color: #333;
  border-radius: 8px;
  border: none;
  padding: 5px 15px;
  margin-top: 10px;
}

.rokkiralli a:hover {
  background-color: #555;
}

.facebook-desktop {
  background: beige;
  padding: 15px;
  margin-top: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px darkgrey;
  max-width: 700px;
}

.facebook-desktop h2 {
  font-size: 27px;
}

.facebook-desktop a {
  display: inline-block;
  text-decoration: none;
  color: #EAF4EB;
  background-color: #0b72e0;
  border-radius: 8px;
  border: none;
  padding: 5px 15px;
  margin-top: 10px;
}

.facebook-desktop a:hover {
  background-color: #555;
}

.facebook-mobile {
  display: none;
}

.sidebar {
  flex: 0 0 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.main-content {
  flex: 3;
}

.event-box,
.news-box {
  background: beige;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 2px 5px darkgray;
  margin-top: 15px;
}

.event-box h2,
.news-box h2 {
  margin-bottom: 10px;
}

.event-box li,
.news-box li {
  margin-bottom: 8px;
}

.event-box ul,
.news-box ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f5f5f5;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #333;
  color: #EAF4EB;
  margin: 0;
  height: 125px;
  padding: 10px 10px;
}

.etusivu {
  background-color: #f5f5f5;
  border-radius: 6px;
  padding: 2px 8px;
  text-decoration: none;
  color: #030303;
  font-weight: bold;
}

.admin-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #333;
  color: #EAF4EB;
  margin: 0;
  height: auto;
  padding: 10px 10px;
}

.logo {
  height: 125px;
  width: auto;
}

.logo-area {
  display: flex;
  align-items: center;
}

.team-name {
  font-size: 50px;
  font-weight: bold;
  color: #EAF4EB;
  margin-left: 10px;
  white-space: nowrap;
}

footer {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #333;
  color: #EAF4EB;
  position: fixed;
  bottom: 0;
}

.footer-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px 0 10px;
}

.footer-content p {
  font-size: 20px;
  margin: 0;
}

.footer-content a {
  position: absolute;
  right: 20px;
  background: #030303;
  color: #EAF4EB;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
}

nav {
  display: flex;
  align-items: center;
  margin-right: 50px;
}

nav a {
  color: #EAF4EB;
  margin-left: 35px;
  text-decoration: none;
  font-size: 45px;
  white-space: nowrap;
}

nav a:hover {
  color: lightgray;
}

nav a.active {
  color: gray;
}

.media-gallery {
  justify-content: center;
  margin: 0 auto;
}

.event-gallery {
  background: beige;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.media-grid img, .media-grid iframe {
  width: 100%;
  height: 400px;
  border-radius: 8px;
  object-fit: cover;
}

main.contact-team-Page {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  padding-top: 60px;
}

.contact-team {
  min-width: 750px;
  background-color: beige;
  border-radius: 15px;
  box-shadow: 0 2px 5px darkgray;
  text-align: center;
  align-items: center;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
}

.contact-team div {
  padding: 15px;
  background: #ccc;
  border-radius: 8px;
  margin-bottom: 15px;
  width: 100%;
  max-width: 500px;
}
.contact-team h2 {
  font-size: 27px;
}
.contact-team p {
  font-size: 18px;
}

.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; 
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

#lightbox-caption {
  text-align: center;
  color: #EAF4EB;
  margin-top: 10px;
  font-size: 18px;
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #EAF4EB;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* --- MOBIILIYSTÄVÄLLISYYS --- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    height: auto;
    padding: 10px;
    text-align: center;
  }

  .contact-team {
    min-width: 250px;
    min-height: 200px;
  }

  .logo {
    height: 100px;
  }

  .team-name {
    font-size: 32px;
    margin-left: 0;
    margin-top: 8px;
  }

  nav {
    margin: 10px 0 0 0;
  }

  nav a {
    font-size: 22px;
    margin: 0 10px;
  }

  main.homepage {
    flex-direction: column;
    margin: 10px;
  }

  .sidebar {
    flex: 1 1 auto;
    width: 100%;
  }

  .facebook-desktop {
    display: none;
  }

  .facebook-mobile {
  display: block;
  background: beige;
  padding: 15px;
  margin-top: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px darkgrey;
  max-width: 700px;
}

.facebook-mobile h2 {
  font-size: 27px;
}

.facebook-mobile a {
  display: inline-block;
  text-decoration: none;
  color: #EAF4EB;
  background-color: #0b72e0;
  border-radius: 8px;
  border: none;
  padding: 5px 15px;
  margin-top: 10px;
}

.facebook-mobile a:hover {
  background-color: #555;
}

  .main-content {
    width: 100%;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  } 

  .gallery-grid img {
    max-height: 200px;
  }

  .gallery-grid img:nth-child(n+3) {
    display: none;
  }

  .event-box,
  .news-box {
    margin-top: 10px;
    padding: 20px;
  }

  .media-grid {
    grid-template-columns: 1fr 1fr; /* 2 kuvaa rinnakkain mobiilissa */
  }

  .media-grid img,
  .media-grid iframe {
    height: 150px; /* Pienemmäksi puhelimessa */
  }

  footer {
    font-size: 14px;
    height: auto;
  }

  .footer-content p {
    font-size: 13px;
    margin-right: 40px;
  }

  .footer-content a {
    right: 5px;
    padding: 5px 8px;
    font-size: 12px;
  }
}
