:root {
  --primary: #1B7F5A;
  --accent: #7C3AED;
  --bg: #F7F7F2;
  --text: #111827;
  --muted: #6B7280;
  --border: #E5E7EB;

  --radius: 18px;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
}

/* Box sizing helpottaa layoutia */
* {
  box-sizing: border-box;
}

/* Poistetaan selaimen oletusmarginaalit */
html,
body {
  margin: 0;
  padding: 0;
}

/* Sivun perusasetukset */
body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main täyttää sivun keskiosan */
main {
  flex: 1;
}

/* Linkit */
a {
  color: inherit;
  text-decoration: none;
}

/* Container keskittää sisällön */
.container {
  width: 90%;
  max-width: 70rem;
  margin: 0 auto;
}

/* HEADER */

.header {
  background: rgba(247, 247, 242, 0.95);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2% 0;
}

/* LOGO */

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 40%;
  min-width: 5rem;
  height: auto;
  mix-blend-mode: multiply;
}

/* NAV LINKS */

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  font-weight: 700;
  padding: 0.5rem 0.8rem;
  border-radius: 0.6rem;
}

.nav-links a:hover {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent);
}

.nav-links a.active {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent);
}

/* Otsikot */

h1,
h2,
h3,
h4 {
  color: #1b7f5a;
  text-align: center;
}

h1 {
  margin: 0;
}

/* Kuvat */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Sections container kolmelle laatikolle */

.sections-container {
  display: flex;
  gap: 1.5rem;
  margin: 2rem;
  flex-wrap: wrap;
}

section {
  flex: 1;
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px #7c3aed;
}

/* Uutiset */

#uutiset {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 2rem;
}

.uutiset-left,
.uutiset-right {
  flex: 1;
}

.news-image {
  width: 100%;
  max-width: 350px;
  height: auto;
}

/* KALENTERI */

.calendar-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 0.5rem;
  margin: 1.5rem 0;
  min-width: 700px;
}

.weekday {
  background-color: #1b7f5a;
  color: #f7f7f2;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: bold;
  border-radius: 4px;
  white-space: nowrap;
}

.day,
.empty {
  background-color: #f0f0f0;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border-radius: 4px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.day.friday,
.day.sunday {
  background-color: #e8f5e9;
  border: 2px solid #1b7f5a;
  font-weight: bold;
}

.event {
  display: block;
  font-size: 0.72rem;
  color: #1b7f5a;
  margin-top: 0.35rem;
  font-weight: bold;
  line-height: 1.2;
  word-break: break-word;
}

.empty {
  background-color: transparent;
}

/* FOOTER */

footer {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 2%;
  margin-top: 5%;
}

footer p {
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* MOBILE */

@media (max-width: 900px) {
  .nav {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4% 0;
  }

  .brand {
    justify-content: center;
    width: 100%;
  }

  .brand-logo {
    width: 80%;
    max-width: 20rem;
    min-width: 0;
    margin: 0 auto;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .sections-container {
    flex-direction: column;
    margin: 1rem;
  }

  .sections-container section {
    width: 100%;
  }

  #uutiset {
    flex-direction: column;
    margin: 1rem;
  }

  .calendar {
    gap: 0.35rem;
    min-width: 630px;
    grid-template-columns: repeat(7, minmax(80px, 1fr));
  }

  .weekday {
    font-size: 0.8rem;
    padding: 0.6rem 0.35rem;
  }

  .day,
  .empty {
    min-height: 80px;
    padding: 0.5rem 0.35rem;
    font-size: 0.8rem;
  }

  .event {
    font-size: 0.62rem;
  }

  footer {
    padding: 4% 0;
  }

  footer .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 5%;
  }
}