:root {
  --bg-light: white;
  --text-light: black;
  --border-light: #ccc;
  --bg-dark: #121212;
  --text-dark: #ffffff;
  --border-dark: #444;
}

html {
  transition: all 0.5s ease;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-light);
  color: var(--text-light);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color 0.5s ease, color 0.5s ease;
}

h2 {
  text-align: center;
  margin-top: 2rem;
}

.card-image {
  width: 400px;
  height: 300px;
  object-fit: cover;
}

.link {
  margin-top: 20px;
  font-size: 20px;
  text-decoration: none;
  color: var(--text-light);
}

.link:hover {
  text-decoration: underline;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 2rem;
}

.gallery img, .gallery video {
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}

.gallery img:hover, .gallery video:hover {
  transform: scale(1.05);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

h1 {
  position: sticky;
  top: 0;
  margin: 0;
  padding: 1rem 0;
  text-align: center;
  font-size: 2rem;
  z-index: 10;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.album-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 40px;
  padding: 1rem 0;
}

.album-item {
  width: 300px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  font-family: Helvetica Neue, sans-serif;
}

.album-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  transition: transform 0.3s;
}

.album-item img:hover {
  transform: scale(1.05);
}

.album-title {
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

.wayback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.contactstuff {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1rem 3rem;
  font-size: 1.2rem;
}

.holyspirit {
  font-style: italic;
  font-size: 8px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 1rem;
}

@media (max-width: 1000px) {
  .album-grid {
    gap: 20px 30px;
  }
}

@media (max-width: 700px) {
  .album-grid {
    flex-direction: column;
    align-items: center;
  }
}

/* UUSI KLIKKAAVA TEMA-VAIHTAJA */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0 2rem 0;
  position: relative;
  z-index: 9999;
}

.current-theme {
  width: 56px;
  height: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: inherit;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.current-theme img {
  width: 36px;
  height: 36px;
}

.arrow-icon {
  width: 32px;
  height: 32px;
  transition: transform 0.2s ease;
}

.arrow-icon:hover {
  transform: scale(1.15);
}

[data-theme="dark"] .arrow-icon {
  content: url("icons/arrow_white.svg");
}

.footer {
  text-align: center;
  margin: 2rem 0;
  padding: 0 1rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.footer .theme-toggle {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.footer p {
  margin: 1rem 0;
  font-size: 1.2rem;
  line-height: 1.4;
}

.footer p.holyspirit {
  font-size: 9px !important;
}

.footer a {
  text-decoration: none;
  color: #0077cc;
}

.footer a:hover {
  text-decoration: underline;
}

.techinfo {
  font-size: 6px;
  font-style: italic;
  text-align: center;
  margin-top: 1rem;
  opacity: 0.6;
}

.techinfo a {
  color: var(--text-light);
  text-decoration: none;
}

.techinfo a:hover {
  text-decoration: underline;
  opacity: 1;
}

[data-theme="dark"] .techinfo a {
  color: var(--text-dark);
}

/* --- Terminal-linkki footerissa --- */
.terminal-link {
  text-align: center;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.terminal-link a {
  font-size: 0.9rem;
  color: var(--text-light);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.terminal-link a:hover {
  opacity: 1;
  text-decoration: underline;
}

[data-theme="dark"] .terminal-link a {
  color: var(--text-dark);
}

/* Mobiiliystävällisyys pienille näytöille */
@media (max-width: 600px) {
  body {
    padding: 1rem;
    font-size: 15px;
    line-height: 1.6;
  }

  h1, h2, h3 {
    font-size: 1.4em;
  }

  .gallery a {
    display: inline-block;
    width: 100%;
    margin-bottom: 1rem;
  }

  .gallery img {
    width: 100%;
    height: auto;
    border-radius: 6px;
  }

  nav, footer {
    text-align: center;
  }
}

[data-theme="light"] h1 {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] h1 {
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.1);
}
