@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital@0;1&family=Montserrat:ital,wght@0,400;0,700;1,400;1,700&display=swap');
body {
  background-image: url('tausta.jpg');
  background-repeat: none;
  background-size: cover;
  background-attachment: fixed;
  background-position: center top;
  margin: 0;
  padding: 0;
}

a {
  color: #4988b1;
  text-shadow: 0px 2px 5px rgba(0,0,0, 0.15);
  position: relative;
}

a:hover, .content-dark a:hover, footer a:hover {
  color: #6e3a2a;
  -webkit-transition: color .5s; 
  transition: color .5s;
  text-shadow: 0px 2px 5px rgba(0, 0, 0, 0.15);
}

.content-dark a, footer a {
  color: #a4c7d7;
}

header {
  width: 1100px;
  height: 350px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: url(otsikko.png) no-repeat top right;
}

.heppaotsikko {
  margin: -60px 0 0 0;
  position: relative;
  z-index: 10;
}

.wrapper {
  width: 1100px;
  margin: 0 auto;
}

.link-bg {
  width: 100%;
  height: 61px;
  background-color: rgba(63, 105, 132, 0.8);
  box-shadow: 0px 0px 14.7px 0.3px rgba(0, 0, 0, 0.3);
}

nav {
  width: 1100px;
  z-index: 35;
  margin: -61px auto 0 auto;
  position: relative;
  z-index: 30;
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0 0 0 300px;
  position: relative;
  z-index: 30;
  box-sizing: border-box;
  width: 750px;
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
}

nav ul li {
  display: inline-block;
  margin: 0;
  width: 100%;
  position: relative;
  z-index: 40;
}

nav ul li a {
  color: #fff;
  font-family: 'Playfair Display', serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 16px;
  text-shadow: 0px 0px 15px rgba(166, 224, 255, 0.5);
  text-decoration: none;
  position: relative;
  z-index: 40;
  padding: 20px 25px;
  margin: 0;
  display: block;
  text-align: center;
  box-sizing: border-box;
}

nav ul li a:hover, nav ul li:hover a {
  color: #fff;
  text-shadow: 0px 0px 15px rgba(0,0,0, 0.5);
  -webkit-transition: all 0.3s ease-in-out 0s;
  transition: all 0.3s ease-in-out 0s;
  background-color: rgba(63, 105, 132, 0.8);
}

.content-area {
  overflow: initial;
  position: relative;
  z-index: 15;
  width: 100%;
  margin: 0 auto;
}

.content {
  z-index: 15;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: 30px 60px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #272727;
  line-height: 1.7;
  text-align: justify;
  background: rgba(255,255,255,.9);
  overflow: auto;
}

.content-dark {
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  padding: 30px 60px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: #dde5e9;
  line-height: 1.7;
  text-align: justify;
  overflow: auto;
  background-color: rgba(63, 105, 132, 0.9);
  box-shadow: 0px 0px 19.6px 0.4px rgba(0, 0, 0, 0.15);
}

footer {
  position: relative;
  z-index: 35;
  width: 1100px;
  line-height: 1.7;
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  letter-spacing: 1px;
  color: #dde5e9;
  padding: 10px;
  margin: 0 auto 20px auto;
  box-sizing: border-box;
  z-index: 25;
  text-shadow: 0px 0px 6px rgba(0,0,0, 0.4);
}

h1 {
  color: #6e3a2a;
  font-weight: normal;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 30px;
  margin-left: 40px;
  text-shadow: 0px 1px 5px rgba(0,0,0, 0.2);
  display: block;
}
  
h2 {
  color: #456d87;
  font-family: 'Playfair Display', serif;
  font-weight: normal;
  font-style: italic;
  font-size: 22px;
  text-shadow: 0px 1px 10px rgba(0,0,0, 0.15);
  margin-bottom: 0px;
}

h3 {
  color: #6e3a2a;
  font-family: 'Playfair Display', serif;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 15px;
  text-shadow: 0px 1px 5px rgba(0,0,0, 0.2);
  margin-bottom: 0px;
}

h4 {
  color: white;
  font-family: 'Playfair Display', serif;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 15px;
  text-shadow: 0px 1px 5px rgba(0,0,0, 0.2);
  margin-bottom: 0px;
}

.content-dark h2 {
  color: #a4c7d7;
}

.content-dark h1, .content-dark h3 {
  color: #fff;
}

hr {
  border-bottom: 1px solid #eee;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  margin: 20px auto;
  width: 80%;
  height: 1px;
  background-color: transparent;
  box-shadow: 0px 4px 25px 1px rgba(0,0,0, 0.15);
}

.clearfix {
  clear: both;
}

.content ul li, .content-dark ul li {
  list-style-type: circle;
}

.keski {
  text-align: center;
}

/* Heppasivu */

.isokuva {
  max-width: 650px;
  max-height: 600px;
  margin: 10px auto 20px auto;
  display: block;
  box-shadow: 0px 4px 15px 1px rgba(0,0,0, 0.15);
}

.perustiedot, .sukutaulu {
  width: 100%;
  border-collapse: collapse;
}

.perustiedot td {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.perustiedot td:nth-child(odd) {
  width: 20%;
  color: #6e3a2a;
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  text-shadow: 0px 1px 5px rgba(0,0,0, 0.2);
}

.perustiedot td:nth-child(even) {
  width: 30%;
}

.kuvagalleria {
  text-align: center;
  margin: 20px auto;
}

.kuvagalleria img {
  height: 120px;
  box-shadow: 0px 4px 15px 1px rgba(0,0,0, 0.15);
  margin: 10px;
}

.kuvagalleriaa {
    width:100%;
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    align-items:stretch;
    overflow:hidden;
}    
    
/*N채ist채 voit muutella korkeuksia ja marginia oman maun mukaan.*/
.kuva {height:150px;text-align:center;margin:.3em;}
.kuva.kolmekuvaa {height:200px;}
.kuva.kaksikuvaa {height:300px;}
.kuva.yksikuva {height:400px;}

.kuva img {height:100%;flex-basis:25%;flex-grow:1; flex-shrink:1; box-shadow: 3px 4px 4px 0px rgba(0,0,0, 0.15);
    
}

.kuvagalleriaa + p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: #456d87;
  margin: 5px auto 20px auto;
  text-align: center;
    
}

.kuvagalleria p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: #456d87;
  margin-top: 0;
}

.sukutaulu td {
  padding: 10px;
  border-bottom: 1px solid #709bb2;
}


.sukutaulu strong {
  font-family: 'Playfair Display', serif;
}


.sukutaulu small {
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

.sijoitukset {
  text-align: center;
  color: #6e3a2a;
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  text-shadow: 0px 1px 5px rgba(0,0,0, 0.2);
}

.kisat {
  width: 49%;
  float: left;
}

.kisat b, .kisat strong {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: #456d87;
} 
  
.nayttelyt {
  width: 70%;
  float: left;
}

.nayttelyt b, .nayttelyt strong {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: #456d87;

}

.kisat .win {
  color: #6e3a2a;
  text-shadow: 0px 1px 5px rgba(0,0,0, 0.2);
  text-decoration: underline;
}

.kisakalenteri td {
  padding: 2px 5px;
}

/* Heppalista */

.heppa {
  width: 24%;
  float: left;
  text-align: center;
  padding: 10px;
  box-sizing: border-box;
  font-family: 'Playfair Display', serif;
  font-size: 12px;
}

.heppa h3 a {
  text-decoration: none;
  letter-spacing: 0;
  font-style: italic;
  text-transform: none;
}

.infobox {
  text-align: center;
}

.tab-btn {
  display: inline-block;
  padding: 5px 10px;
  margin: 5px;
  color: #fff;
  background-color: #6e3a2a;
  font-family: 'Playfair Display', serif;
}

.tab-btn:hover {
  background-color: #456d87;
  color: #fff;
}

.tab-open {
  background-color: #456d87;
}



/* Myyntisivu */


.staulu td {
  width: 350px;
  padding: 10px;
}


.staulu strong {
  font-family: 'Playfair Display', serif;
}


.staulu small {
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

.varsa {
  width: 100%;
  padding: 10px;
  border: 2px solid #a4c7d7;
  margin: 0;
}

.varsa1 {
  width: 30%;
  float: left;
  text-align: center;
  padding: 3px;
  border: 2px solid #a4c7d7;
  margin: 4px;
}

.varsa2 td {
  padding: 15px;

}

.varsa2 img {
  border-radius: 25px;
}


/*heppalistaus uusi*/

/* Kuvan ja varjostuksen sisältävä kortti */
.image-card1 {
  position: relative;
  display: inline-block;
  overflow: hidden; /* Estää varjostuksen ja tekstin ylittymisen */
  border-radius: 16px; /* Pyöristää reunat */
  width: 250px; /* Muutettu leveys (voit säätää tarpeen mukaan) */
  height: 150px; /* Muutettu korkeus */
}

/* Itse kuva */
.image1 {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* Varjostus ja tekstikenttä */
.overlay1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  
  /* Tekstin keskittäminen */
  display: flex;
  flex-direction: column;
  justify-content: center; /* Teksti keskelle pystysuunnassa */
  align-items: center; /* Teksti keskelle vaakasuunnassa */
  text-align: center;
  color: white;
  padding: 8px; /* Pienempi padding, jotta teksti mahtuu pienemmälle kuvalle */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  border-radius: inherit;
}

/* Kun hiiri viedään kuvan päälle, varjostus ja teksti näkyvät */
.image-card1:hover .overlay1 {
  opacity: 1;
}

/* Kuvatekstin tyyli */
.overlay1 p {
  margin: 0;
  width: 90%; /* Rajoittaa tekstin leveyttä */
  font-size: 12px; /* Pienempi fonttikoko pienemmälle kuvalle */
  word-break: break-word; /* Pitkät sanat katkeavat */
  white-space: normal; /* Sallii rivityksen */
}

/* Kuvien asettelu rinnakkain ja rivittyminen */
.image-list1 {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/*TOinen uusi*/

 
       .container {
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
        }
        .infobox.tabs {
            margin-bottom: 20px;
        }
        .gallery {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            padding: 10px;
            justify-content: center; /* Tämä keskittää galleriakuvat vaakasuunnassa */
        }
        .gallery-item {
            position: relative;
            width: 250px;
            height: 150px;
            overflow: hidden;
            border-radius: 15px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }
        .gallery-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%); /* Keskittää sisällön */
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            opacity: 0;
            transition: opacity 0.3s ease;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 10px;
        }
        .gallery-item:hover .overlay {
            opacity: 1;
        }
        .overlay h4 {
            margin: 0;
            font-size: clamp(7px, 3vw, 13px); /* Teksti skaalautuu välillä 10px - 16px */
        }
        .overlay a {
            color: white;
            text-decoration: none;
            font-size: 16px;
        }
        
        
    /*Uusi*/
    
.container {
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
        }
        .gallery1 {
            display: flex;
            flex-wrap: wrap;
            gap: 20px; /* Väli kuvien välillä */
            padding: 10px;
            justify-content: center; /* Keskittää galleriakuvat */
        }
        .gallery1-item {
            position: relative;
            width: 250px;
            height: 150px;
            overflow: hidden;
            border-radius: 15px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            transition: transform 0.3s ease; /* Animaatio kuvan nostamiseksi */
        }
        .gallery1-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* Alussa kapeampi tekstilaatikko */
        .bottom-text1 {
            position: absolute;
            bottom: 0;
            width: 100%;
            background-color: rgba(0, 0, 0, 0.7); /* Läpinäkyvä musta tausta */
            color: white;
            font-size: 14px;
            text-align: center;
            opacity: 0.8;
            height: 45px; /* Alussa kapeampi laatikko */
            overflow: hidden;
            transition: height 0.3s ease, opacity 0.3s ease; /* Animaatio laajentamiseen ja näkyvyyteen */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        /* Kun hiiri viedään päälle, laatikko laajenee koko kuvan päälle */
        .gallery1-item:hover .bottom-text1 {
            height: 100%;
            opacity: 1;
        }

        /* Hevosen nimi */
        .bottom-text1 h4 {
    color: white;
    font-family: 'Playfair Display', serif;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 15px;
    text-shadow: 0px 1px 5px rgba(0,0,0, 0.2);
    margin: 0;
    text-align: center; /* Varmistaa, että teksti on keskellä vaakasuunnassa */
    width: 100%;
}

/* Poistetaan linkiltä oletustyylit */
.bottom-text1 h4 a {
    color: inherit;  /* Perii tekstin värin */
    text-decoration: none;  /* Ei alleviivausta */
    display: block;  /* Ottaa koko h4:n alueen klikkattavaksi */
    width: 100%;
}

        /* Lisätiedot, piilotetaan aluksi */
        .extra-info {
            opacity: 0;
            max-height: 0;
            transition: opacity 0.3s ease, max-height 0.3s ease;
            overflow: hidden;
            font-size: 13px;
        }

        /* Kun laatikko laajenee, lisätiedot tulevat näkyviin */
        .gallery1-item:hover .extra-info {
            opacity: 1;
            max-height: 100px;
        }
        
        
/*MYYNTISIVU*/

.container1 {
  display: flex;
  flex-wrap: wrap;
  gap: 25px 10px;  /* ensimmäinen arvo = rivien väli, toinen = korttien väli */
  justify-content: flex-start;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.horse-card {
  flex: 0 0 31%;     /* kiinteä leveys, 3 korttia mahtuu ~100% leveydelle */
  max-width: 31%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* Kuva */
.horse-card img {
  width: 185px;
  height: 247px;
  object-fit: contain;
  border-radius: 25px;
  margin-bottom: 10px;
}

/* Tekstit */
.horse-card h3 {
  margin: 10px 0 5px 0;
}

.horse-card p {
  margin: 2px 0;
}

/* Responsiivisuus */
@media (max-width: 900px) {
  .horse-card {
    flex: 0 0 48%;
    max-width: 48%;
  }
}

@media (max-width: 600px) {
  .horse-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
}