@import url('https://fonts.googleapis.com/css2?family=Yusei+Magic&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
img {
  max-width: 100%;
  height: auto;
}

html, body {
  font-family: "Yusei Magic", sans-serif;
  font-weight: 400;
  line-height: 1.7em;
  background-color: #D7D4DA;
}
a {
  color: #2f5a7a;
  text-decoration: none;
  font-family: "Yusei Magic", sans-serif;
  font-size: large;
}
h1 {
  padding-bottom: 20px;
  color: #fff;
}
h2 {
  color: #fff;
}

/* Konteinerid */
.container-header {
  margin: auto;
  max-width: 1100px;
  padding: 0 20px;
  overflow: auto; 
}
.container-middle {
  margin: auto;
  max-width: 1700px;
  padding: 0 20px;
  overflow: auto; 
  border-radius: 10px;
}
.container-middle h1 {
  margin-top: 10px;
  background: #427AA1;
  font-size: 45px;
  text-align: center;
  padding-top: 20px;
  border-radius: 10px;
}
.container {
  margin: auto;
  max-width: 1700px;
  padding: 20px 20px;
  overflow: auto;
  border-radius: 10px;
}

.bg-primary {
  padding: 10px;
  background: #9F9AA4;
  color: rgb(255, 255, 255);
  border-radius: 10px;
}
.overlay-text {
  position: absolute;
  background-color: #427AA1;
  align-items: center;  
  border-radius: 10px;
}

/* Navbar */
#navbar {
  background: #427AA1;
  color: #fff;
  overflow: auto;
}
#navbar a {
  color: #fff;
}
#navbar ul {
  float: right;
  list-style: none;
}
#navbar ul li {
  float: left;
}
#navbar ul li a {
  display: block;
  padding: 20px;
  text-align: center;
}
#navbar ul li a:hover,
#navbar ul li a.current {
  border-radius: 200px;
  background: #9FC0D8;
  color: #427AA1;
}
#navbar h1 {
  padding-top: 20px;
  float: left;
}

/* Tekstikastid ja Pildid */
#text-kast1 {
  padding-left: 0px;
}
#text-kast1 .info-right {
  float: right;
  padding: 8px;
  width: 55%;
  min-height: 10%;
}
#text-kast1 .pilt img {
  width: 100%;
  max-width: 630px;
  float: left;
  margin-right: 10px;
  border: 10px solid #427AA1;
  border-radius: 10px;
}

#text-kast2 {
  padding-left: 0px;
  border-radius: 10px;
}
#text-kast2 .info-right {
  float: right;
  padding: 8px;
  width: 60%;
  min-height: 10%;
  border-radius: 10px;
}
#text-kast2 .pilt img {
  width: 100%;
  max-width: 540px;
  float: left;
  margin-right: 10px;
  border: 10px solid #427AA1;
  border-radius: 10px;
}

#text-kast3 .pilt2 {
  text-align: center;
  padding: 20px;
}
#text-kast3 .pilt2 img {
  width: 100%;
  max-width: 530px;
  margin-top: 10px;
  border: 10px solid #427AA1;
  border-radius: 10px;
}
#text-kast4 {
  padding-left: 0px;
}
#text-kast4 .info-right {
  float: right;
  padding: 8px;
  width: 59%;
  min-height: 20%;
}
#text-kast4 .pilt img {
  width: 100%;
  max-width: 670px;
  float: left;
  margin-right: 10px;
  border: 10px solid #427AA1;
  border-radius: 10px;
}

#pildid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
}
#pildid .pilt3 {
  flex: 1;
  min-width: 300px;
  padding: 10px;
  text-align: center;
  border-radius: 10px;
}
#pildid .pilt3 img {
  margin-bottom: 10px;
  width: 100%;
  max-width: 530px;
  border: 10px solid #427AA1;
  border-radius: 10px;
}
#pildid .pilt-valikud {
  flex: 1;
  min-width: 250px;
  text-align: center;
  border-radius: 10px;
}
#pildid .pilt-valikud img {
  margin-bottom: 10px;
  width: 100%;
  border-radius: 10px;
}
#pildid .pildi-link {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}
.tekst-peal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.8);
  background: rgba(0, 0, 0, 0.2); 
  border-radius: 10px; 
}
#pildid .pildi-link img {
  display: block;
  margin: 0;
  width: 100%; 
  border-radius: 10px;
}
#pildid .pildi-link:hover .tekst-peal {
  background: rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease;
}

/* --- Sinu olemasolev galerii CSS (jääb samaks) --- */
#galerii .pilt4 {
  float: right;
  width: 45%;
  padding: 10px;
  text-align: center;
  border-radius: 10px;
}
#galerii .pilt4 img {
  margin-bottom: 10px;
  width: 100%;
  max-width: 600px;
  border: 10px solid #427AA1;
  border-radius: 10px;
}
#galerii .pilt5 {
  float: left;
  width: 45%; 
  padding: 10px;
  text-align: center;
  border-radius: 10px;
}
#galerii .pilt5 img {
  margin-bottom: 10px;
  width: 100%;
  max-width: 600px;
  border: 10px solid #427AA1;
  border-radius: 10px;
}

/* --- UUS: Burger menüü loogika ja asukoht VASAKUL ÜLEVAL --- */

/* Pildi ümbris, mis hoiab nuppu paigal pildi suhtes */
.pilt-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 600px;
}

/* Peidame checkboxi */
.menu-checkbox {
  display: none;
}

/* Burger nupp - positsioonitud VASAKULE ÜLEVALE */
.burger-button {
  position: absolute;
  top: 25px;   /* 10px sinist raami + 15px pildi seest nihet */
  left: 25px;  /* 10px sinist raami + 15px pildi seest nihet */
  width: 40px;
  height: 35px;
  background: #427AA1;
  border-radius: 6px;
  cursor: pointer;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 6px;
  box-sizing: border-box;
  transition: background 0.3s ease;
}

.burger-button:hover {
  background: #2f5a7a;
}

/* Kolm valget kriipsu */
.burger-button span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Infoaken - Avaneb nupu alt vasakult */
.info-panel {
  position: absolute;
  top: 70px;
  left: 25px;
  width: 220px;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  font-family: sans-serif;
  z-index: 25;
  text-align: left; /* Tekst joondub viisakalt vasakule */
  
  /* Peitmise animatsioon */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.info-panel h3 {
  margin: 0 0 5px 0;
  font-size: 18px;
  color: #427AA1; /* Pealkiri kasutab sinu lehe sinist raamitooni! */
}

.info-panel hr {
  border: 0;
  height: 1px;
  background: #ddd;
  margin-bottom: 10px;
}

.info-panel p {
  margin: 6px 0;
  font-size: 14px;
}

/* --- ANIMATSIOONID (Kui klikitakse) --- */

/* Näitame akent */
.menu-checkbox:checked ~ .info-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Teeme kolmest kriipsust risti (X) */
.menu-checkbox:checked ~ .burger-button span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-checkbox:checked ~ .burger-button span:nth-child(2) {
  opacity: 0;
}
.menu-checkbox:checked ~ .burger-button span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

#pildid .small-box {
  margin: auto;
  font-size: 20px;
  padding: 2px;
  background: #9F9AA4;
  color: rgb(255, 255, 255);
  border-radius: 10px;
}

footer {
  font-size: 20px;
  text-align: center;
  padding: 20px;
  background: #427AA1;
  color: #fff;
  clear: both;
}

/* Kontakt */
#kontakt-vorm {
  padding: 40px 20px;
  font-family: sans-serif;
}
.vormi-konteiner {
  max-width: 500px;
  margin: 0 auto; 
  background-color: #f8f9fa; 
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.vormi-konteiner h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}
.sisend-grupp {
  margin-bottom: 15px;
}
.sisend-grupp label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}
.sisend-grupp input,
.sisend-grupp textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  font-family: sans-serif;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}
.sisend-grupp input:focus,
.sisend-grupp textarea:focus {
  border-color: #427AA1;
  outline: none;
}
.saada-nupp {
  width: 100%;
  background-color: #427AA1;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.saada-nupp:hover {
  background-color: #2f5a7a;
}

/* Slideshow */
.slideshow {
  width: 100%; 
  max-width: 1650px;
  height: 400px;
  position: relative;
  overflow: hidden;
  margin: 50px auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  background-color: #1a1a1a;
}
.slideshow-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10; /* Hoiab teksti piltidest kõrgemal */
  color: white;
  font-family: sans-serif;
  text-align: center;
  background: rgba(0, 0, 0, 0.4); /* Ühtlane viisakas tumendus üle bänneri */
}
.slideshow-overlay h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}
.slideshow-overlay p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
}
.btn {
  padding: 10px 20px;
  font-size: 1rem;
  background-color: #427AA1;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
}
.btn:hover {
  background-color: #9FC0D8;
}
/* 1. Määra uueks pikkuseks 60s (15 pilti * 4 sekundit) */
.slide {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  z-index: 1;
  animation: slideAnimatsioon 60s infinite;
}
.slide img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

/* 2. Igale pildile oma algusaeg (suureneb 4 sekundi kaupa) */
.slide:nth-child(2) { animation-delay: 0s; }
.slide:nth-child(3) { animation-delay: 4s; }
.slide:nth-child(4) { animation-delay: 8s; }
.slide:nth-child(5) { animation-delay: 12s; }
.slide:nth-child(6) { animation-delay: 16s; }
.slide:nth-child(7) { animation-delay: 20s; }
.slide:nth-child(8) { animation-delay: 24s; }
.slide:nth-child(9) { animation-delay: 28s; }
.slide:nth-child(10) { animation-delay: 32s; }
.slide:nth-child(11) { animation-delay: 36s; }
.slide:nth-child(12) { animation-delay: 40s; }
.slide:nth-child(13) { animation-delay: 44s; }
.slide:nth-child(14) { animation-delay: 48s; }
.slide:nth-child(15) { animation-delay: 52s; }
.slide:nth-child(16) { animation-delay: 56s; }

/* --- SUJUV RIST-SULANDUMINE (CROSSFADE) --- */
@keyframes slideAnimatsioon {
  0% { opacity: 0; }
  2% { opacity: 1; }       /* Pilt sulandub sisse (~1.2 sekundit) */
  6.6% { opacity: 1; }     /* Pilt püsib paigal kuni 4. sekundini */
  8.6% { opacity: 0; }     /* Pilt kaob sujuvalt samal ajal kui järgmine juba ilmub */
  100% { opacity: 0; }     /* Ootab pimeduses oma uut ringi */
}
/* MOBIILIVAATE JA KOHANDUMISE (RESPONSIVE) LISAD             */
/* See plokk käivitub, kui ekraani laius on alla 900 piksli   */

@media (max-width: 900px) {
  
  /* Päästame Navbari */
  #navbar h1 {
    float: none;
    text-align: center;
    padding-bottom: 10px;
  }
  #navbar ul {
    float: none;
    display: flex;
    flex-direction: column;
    padding: 0;
  }
  #navbar ul li {
    float: none;
    width: 100%;
  }

  /* Tekstikastide ja piltide üksteise alla lükkamine */
  #text-kast1 .info-right, 
  #text-kast2 .info-right {
    float: none;
    width: 100%;
    margin-top: 20px;
  }
  
  #text-kast1 .pilt img, 
  #text-kast2 .pilt img {
    float: none;
    display: block;
    margin: 0 auto;
  } 

  /* Galerii piltide kordategemine mobiilis */
  #galerii .pilt4, 
  #galerii .pilt5 {
    float: none;
    width: 100%;
    margin: 0 auto 20px auto;
  }
  
  /* Slideshow teksti kohandamine */
  .slideshow-overlay h1 {
    font-size: 2rem;
  }
  .slideshow {
    height: 300px;
  }
  
  /* Pealkirjade väiksemaks muutmine mobiilis */
  .container-middle h1 {
    font-size: 30px;
  }
}

