/* alku asetukset */

body {

    font-family: 'Georgia', serif;

    margin: 0;

    padding: 0;

    min-height: 100vh;

    background-size: cover;

    background-attachment: fixed;

    background-position: center;

    display: flex;

    flex-direction: column;

}



/* Taustakuvat jokaiselle sivulle oma */

body.index {

    background: url('kuvat/kuva.jpg') no-repeat center center fixed;

    background-size: cover;

}



body.elamanfilosofia {

    background: url('kuvat/kuva2.jpg') no-repeat center center fixed;

    background-size: cover;

}



body.minusta {

    background: url('kuvat/kuva1.jpg') no-repeat center center fixed;

    background-size: cover;

}



body.matkakanssasi {

    background: url('kuvat/kuva3.jpg') no-repeat center center fixed;

    background-size: cover;

}



body.valokuvamuistoja {

    background: url('kuvat/kuva4.jpg') no-repeat center center fixed;

    background-size: cover;

}



body.muistojatarinoita {

    background: url('kuvat/kuva5.jpg') no-repeat center center fixed;

    background-size: cover;

}



body.elamanpieniailoja {

    background: url('kuvat/kuva6.jpg') no-repeat center center fixed;

    background-size: cover;

}



body.raittiudentie {

    background: url('kuvat/kuva7.jpg') no-repeat center center fixed;

    background-size: cover;

}

body.vertaistuki {

    background: url('kuvat/kuva8.jpg') no-repeat center center fixed;

    background-size: cover;

}

body.matkapaivakirja {
	
    background: url('kuvat/kuva10.jpg') no-repeat center center fixed;
  
    background-size: cover;
}

body.chpesis {

    background: url('kuvat/chpesis1.jpg') no-repeat center center fixed;

    background-size: cover;

}


/* Navihärpäke */

nav {

    background-color: rgba(0, 0, 0, 0.7); /* Tumma tausta */

    padding: 0.5rem 1rem; /* Vähemmän korkeutta */

    text-align: center;

    box-shadow: 0 2px 10px rgba(0,0,0,0.2);

    position: sticky;

    top: 0;

    z-index: 1000;

}



nav a {

    margin: 0 0.8rem;

    text-decoration: none;

    color: #fff; /* Vaalea teksti */

    font-weight: bold;

    font-size: 0.95rem; /* Pienempi fonttikoko */

    letter-spacing: 0.5px;

    transition: color 0.3s ease;

}



nav a:hover {

    color: #f0c040;

}



/* Sisältölaatikko */

.content {

    background-color: rgba(255, 255, 255, 0.85);

    margin: 6rem auto 2rem;

    padding: 2rem;

    border-radius: 1.5rem;

    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);

    max-width: 900px;

    flex: 1;

    animation: fadeIn 2s ease;

}



/* Otsikot ja teksti */

h1, h2 {

    text-align: center;

    color: #2c3e50;

}



h1 {

    font-size: 2.5rem;

    margin-bottom: 0.5rem;

}



h2 {

    font-size: 1.5rem;

    margin-bottom: 2rem;

}



p {

    color: #333;

    line-height: 1.8;

    text-align: justify;

    margin-bottom: 1.5rem;

}



/* Sydän */

.heart {

    text-align: center;

    font-size: 3rem;

    margin-top: 2rem;

}



/* Videoiden tyylit */

video {

    width: 100%;

    max-width: 800px;

    height: auto;

    display: block;

    margin: 2rem auto;

    border-radius: 16px;

    box-shadow: 0 4px 20px rgba(0,0,0,0.3);

}



/* Footer */

footer {

    background-color: rgba(0, 0, 0, 0.7);

    color: #ccc;

    text-align: center;

    padding: 1rem;

    font-size: 0.9rem;

}



/* Lightbox */

.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);

    animation: fadeIn 0.6s;

}



.lightbox-content {

    margin: auto;

    display: block;

    max-width: 90%;

    max-height: 80%;

    border-radius: 16px;

}



.lightbox:target {

    display: block;

}



.close {

    position: absolute;

    top: 30px;

    right: 30px;

    color: #fff;

    font-size: 40px;

    font-weight: bold;

    text-decoration: none;

    transition: color 0.3s ease;

}



.close:hover {

    color: #f0c040;

}



/* Zoom kuville */

a img {

    transition: transform 0.3s ease;

}



a:hover img {

    transform: scale(1.05);

}



/* Palaa alkuun */

.top-link {

    display: block;

    text-align: center;

    margin: 4rem 0;

}



.top-link a {

    text-decoration: none;

    font-size: 1.1rem;

    font-weight: bold;

    color: #2c3e50;

    background: rgba(255,255,255,0.8);

    padding: 0.6rem 1.2rem;

    border-radius: 10px;

    box-shadow: 0 4px 10px rgba(0,0,0,0.2);

    transition: background 0.3s;

}



.top-link a:hover {

    background: #f0c040;

    color: #333;

}



/* Animaatio */

@keyframes fadeIn {

    from {opacity: 0;}

    to {opacity: 1;}

}



.gallery-section {

  max-width: 1000px;

  margin: 4rem auto;

  padding: 0 1rem;

  text-align: center;

}



.gallery-section h2 {

  color: #2c3e50;

  margin-bottom: 2rem;

}



.gallery-grid {

  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));

  gap: 2rem;

}



.gallery-item {

  background: rgba(255, 255, 255, 0.85);

  padding: 1rem;

  border-radius: 1rem;

  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);

  transition: transform 0.2s ease;

}



.gallery-item:hover {

  transform: scale(1.02);

}



.gallery-item img {

  width: 100%;

  height: auto;

  border-radius: 0.8rem;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

}



.gallery-item p {

  margin-top: 0.8rem;

  font-style: italic;

  color: #555;

  font-size: 0.95rem;

}

/* Estä vaakavieritys */
html, body { overflow-x: hidden; }

/* Kaikki kuvat skaalautuvat oikein */
img, picture, video, iframe {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

/* Estä zoomaaminen rikkomasta leveyttä */
a:hover img { transform: none !important; }

.content img {
  width: min(680px, 70%);
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* --- Matkapäiväkirja: lisätyylit, turvallisesti rajattu --- */

/* Aktiivinen linkki navissa tälle sivulle */
body.matkapaivakirja nav a[href*="matkapaivakirja.php"] {
  background: rgba(240, 192, 64, 0.25);
  border-radius: 10px;
  padding: .25rem .5rem;
}

/* Artikkelikortit */
body.matkapaivakirja .entry{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 1rem;
  margin: 1rem 0 1.25rem;
  box-shadow: 0 6px 22px rgba(0,0,0,.15);
}

body.matkapaivakirja .entry h3{
  margin: .25rem 0 .4rem;
  font-size: 1.25rem;
  color: #2c3e50;
}

body.matkapaivakirja .meta{
  font-size: .95rem;
  color: #555;
  margin: .25rem 0 .75rem;
}

/* Painikenäköiset linkit */
body.matkapaivakirja .linkbtn, 
body.matkapaivakirja button{
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.9);
  color: #2c3e50;
  padding: .5rem .8rem;
  border-radius: .6rem;
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow .15s ease, transform .04s ease, border-color .15s ease, background .15s ease;
}

body.matkapaivakirja .linkbtn:hover, 
body.matkapaivakirja button:hover{
  border-color: rgba(240,192,64,0.8);
  box-shadow: 0 0 0 .25rem rgba(240,192,64,.25);
  background: #fff;
}

body.matkapaivakirja .danger{
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
}

body.matkapaivakirja .danger:hover{
  box-shadow: 0 0 0 .25rem rgba(239,68,68,.25);
}

/* Kuvagalleria artikkelin sisällä */
body.matkapaivakirja .images{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .7rem;
  margin-top: .75rem;
}

body.matkapaivakirja .images a{
  display:block; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: transparent;
}

/* HUOM: sinulla on jo globaali sääntö, joka estää zoomauksen hoverissa.
   Jos haluat kevyen zoomin vain Matkapäiväkirjaan, poista oma !important
   -sääntö tai lisää tämä !important: */
body.matkapaivakirja .images img{
  width:100%; object-fit: cover; object-position: center;
  transition: transform .25s ease, opacity .25s ease;
}

body.matkapaivakirja .images a:hover img{
  transform: scale(1.03);
  opacity: .96;
}

/* Lomakekortit (kirjautuminen, uusi merkintä, muokkaus) */
body.matkapaivakirja .login-form,
body.matkapaivakirja .entry-form{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 6px 22px rgba(0,0,0,.15);
}

body.matkapaivakirja .login-form label, 
body.matkapaivakirja .entry-form label{
  display:block; margin: .6rem 0;
}

body.matkapaivakirja .login-form input[type="password"],
body.matkapaivakirja .entry-form input[type="text"],
body.matkapaivakirja .entry-form input[type="file"],
body.matkapaivakirja .entry-form textarea{
  width: 100%;
  padding: .62rem .7rem;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: .55rem;
  background: rgba(255,255,255,0.85);
  color: #2c3e50;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

body.matkapaivakirja .entry-form textarea{ min-height: 9rem; resize: vertical; }

body.matkapaivakirja .login-form input:focus,
body.matkapaivakirja .entry-form input:focus,
body.matkapaivakirja .entry-form textarea:focus{
  border-color: #f0c040;
  box-shadow: 0 0 0 .25rem rgba(240,192,64,.25);
}

/* Kuvien hallinnan ruudukko editorissa */
body.matkapaivakirja .images-manage{
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: .4rem 0 1rem;
}
body.matkapaivakirja .img-check{
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .5rem;
  padding: .4rem; border: 1px dashed rgba(0,0,0,0.2); border-radius: .6rem;
}
body.matkapaivakirja .img-check img{ width: 100%; height: 110px; object-fit: cover; border-radius: .45rem; }

/* Toiminnot artikkelissa */
body.matkapaivakirja .actions{ display:flex; gap:.5rem; align-items:center; margin:.5rem 0 .25rem; }

/* Pienet ruudut */
@media (max-width: 600px){
  body.matkapaivakirja .images img{ height: 180px; }
}


