@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=EB+Garamond:ital,wght@0,400;0,500;1,400&family=Montserrat:wght@300;400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color: #2c2c2c;
  font: 400 15px/1.8 'Montserrat', Arial, sans-serif;
  text-align: justify;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #f5f4f0;
}

a {
  color: #1a4a8a;
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}
a:hover {
  color: #1a4a8a;
}

::selection {
  background: #2e3f52;
  color: #ffffff;
}

.ylapalkki {
  height: 65px;
  background: #2e3f52;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ylapalkki-sisalto {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
}

.paanavigointi {
  display: flex;
  gap: 40px;
  align-items: center;
}

.paanavigointi a {
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s, color 0.2s;
}

.paanavigointi a:hover {
  opacity: 1;
  color: #fff;
}

.keskipalkki {
  height: 50px;
  background: #191919;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keskipalkki-sisalto {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 50px;
  display: flex;
  justify-content: flex-end;
}

.alanavi {
  display: flex;
  gap: 34px;
}

.alanavi a {
  color: #cccccc;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
  padding: 4px 0;
}

.alanavi a:hover {
  color: #ffffff;
  border-bottom-color: #b8972a;
}

.hevonen-kuva {
  position: absolute;
  bottom: 0;
  left: calc(50% - 620px + 50px);
  height: 316px;
  width: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: darken;
  filter:
    saturate(0.45)
    sepia(0.45)
    hue-rotate(178deg)
    brightness(0.75)
    contrast(1.08);
}

.otsikko {
  background: #212121 url(https://helmililja.net/sabitzer/img/tausta.png) center center / cover no-repeat;
  height: 260px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.otsikko::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 28, 50, 0.72) 0%,
    rgba(20, 40, 80, 0.55) 50%,
    rgba(10, 18, 36, 0.80) 100%
  );
  mix-blend-mode: multiply;
  z-index: 1;
}

.otsikko::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
  z-index: 1;
  pointer-events: none;
}

.otsikko > * {
  position: relative;
  z-index: 2;
}

.otsikko-sisalto {
  position: relative;
  max-width: 1100px;
  width: 100%;
  padding: 0 50px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
  height: 100%;
}

.otsikko-teksti {
  position: relative;
  z-index: 3;
  text-align: right;
  align-self: center;
  margin-bottom: 0;
}

.talli-nimi {
  font-family: 'Cinzel', serif;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
  background: #2e3f52;
  padding: 14px 30px 10px 40px;
  display: inline-block;
  text-transform: uppercase;
}

.sisalto-wrapper {
  background: #ffffff;
  min-height: 400px;
  position: relative;
  z-index: 2;
}

.sisalto {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 50px 15px 50px;
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: 38px;
  font-weight: 400;
  color: #2e3f52;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0;
}

h3 {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #2e3f52;
  margin: -10px 0 0 0;
}

.kisa {
	margin-top: -15px;
}

.sisalto p {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 28px;
  color: #2c2c2c;
  margin: 0 auto 22px;
  max-width: 1100px;
  text-align: justify;
}

.hevoslista {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  gap: 50px;
  padding: 10px 0 20px 0;
  max-width: 1100px;
  margin: 0 auto;
}

.hevoskortti {
  background: #2e3f52;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 300px;
  transition: opacity 0.2s;
}

.hevoskortti img {
  width: 300px;
  height: 200px;
  object-fit: cover;
  display: block;
}

.hevoskortti-nimi {
  color: #ffffff;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px 10px 6px;
  width: 100%;
}

.hevostiedot {
  color: #a8b8c8;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.8;
  text-align: center;
  padding: 0 10px 12px;
  width: 100%;
  display: block;
}

.suodatin-rivi {
  display: flex;
  flex-wrap: wrap;
  column-gap: 28px;
  row-gap: 3px;
  padding: 20px 0 20px;
  margin-bottom: 0;
}

.suodatin-viiva-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 50px;
  box-sizing: border-box;
}

.suodatin-viiva {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 0 0 10px;
}

.suodatin-ryhmä {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.suodatin-otsikko {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888888;
  margin-right: 4px;
}

.suodatin-nappi {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #555555;
  background: transparent;
  border: 1px solid #cccccc;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.suodatin-nappi:hover {
  border-color: #2e3f52;
  color: #2e3f52;
}

.suodatin-nappi.active {
  background: #2e3f52;
  border-color: #2e3f52;
  color: #ffffff;
}

/* ── Hevosprofiili ─────────────────────────────── */

.hevosprofiili-kehys {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  max-width: 1000px;
  margin: 20px auto 0;
  margin-bottom: 30px;
}

.hevosprofiili {
  flex: 0 0 calc(50%);
  min-width: 0;
  background: #f5f4f0;
  border: 1px solid #ddd8d0;
  padding: 20px 20px 26px;
  position: relative;
}

.hevosprofiili-vasen {
  min-width: 0;
  padding-left: 14px;
  padding-right: 14px;
}

.hevosprofiili-otsikko {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #2e3f52;
  margin: 0 0 6px;
  line-height: 1.2;
}

.hevosprofiili-rotu {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #2c2c2c;
  letter-spacing: 0.3px;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hevosprofiili-rotu .vh-koodi {
  font-weight: 500;
  font-size: 11px;
  color: #888;
  letter-spacing: 0.5px;
  line-height: 1;
  position: relative;
  top: 1px;
}

.hevosprofiili-rotu .vh-koodi a {
  color: #888;
  font-weight: 500;
}

.hevosprofiili-rotu .vh-koodi a:hover {
  color: #666;
}

.hevosprofiili-taulukko {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.hevosprofiili-taulukko tr {
  border-top: 1px solid #e0dbd4;
}

.hevosprofiili-taulukko tr:last-child {
  border-bottom: 1px solid #e0dbd4;
}

.hevosprofiili-taulukko td {
  padding: 9px 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  vertical-align: middle;
}

.hevosprofiili-taulukko td:first-child {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
  width: 174px;
  padding: 9px 16px 9px 0;
  vertical-align: middle;
}

.hevosprofiili-taulukko td:last-child {
  color: #2c2c2c;
  font-weight: 400;
}

.hevosprofiili-tagit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: -10px;
}

.hevosprofiili-tagi {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #555;
  border: 1px solid #bbb;
  padding: 5px 12px;
  background: transparent;
}

.hevosprofiili-kuva-kehys {
  flex: 0 0 calc(50% - 12px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0;
}

.hevosprofiili-kuva {
  max-width: 100%;
  max-height: 315px;
  object-fit: cover;
  display: block;
  border: 1px solid #ddd8d0;
  padding: 8px;
  background: #f5f4f0;
  box-sizing: border-box;
}

.kuvaaja {
  display: block;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #999;
  margin-top: 8px;
}

/* ── 2-polvinen sukutaulu + jälkeläiset ──────── */

.suku2-wrapper {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.suku2-vasen {
  flex: 0 0 50%;
  min-width: 0;
}

.suku2-vasen .suku {
  margin-bottom: 0;
}

.suku2-oikea {
  flex: 1 1 0;
  min-width: 0;
  padding-top: 4px;
}

.suku2-oikea p {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #2c2c2c;
  margin: 0;
  text-align: left;
}

/* ── Sukutaulu ─────────────────────────────── */

.suku {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  background: #f5f4f0;
  border: 1px solid #ddd8d0;
  margin-bottom: 30px;
  line-height: 1.4;
}

.suku td {
  border-bottom: 1px solid #ddd8d0;
  padding: 14px 10px;
}

.suku tr:last-child td {
  border-bottom: none;
}

.suku .kursori {
  width: 30px;
  font-size: 60pt;
  font-family: 'EB Garamond', serif;
  color: #ddd8d0;
  padding: 0 12px 0 2px;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
  text-shadow: 1px 1px #fff;
  border-bottom: 1px solid #ddd8d0;
}

.suku .kursori2 {
  width: 36px;
  font-size: 36pt;
  font-family: 'EB Garamond', serif;
  color: #ddd8d0;
  padding: 0 12px 0 2px;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
  border-bottom: 1px solid #ddd8d0;
  text-shadow: 1px 1px #fff;
}

.suku .td1 {
  vertical-align: middle;
  text-align: left;
  padding-left: 30px;
}

.td1 small, .td2 small {
  display: block;
  margin-top: 4px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.suku .td2 {
  vertical-align: middle;
  text-align: left;
  padding-left: 20px;
}

.suku .td3 {
  vertical-align: middle;
  text-align: left;
  padding-left: 20px;
}

.evm {
  display: inline-block;
  padding: 2px 6px 3px 6px;
  background: #ddd8d0;
  color: #666;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-left: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.suku3-wrapper {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.suku3-vasen {
  flex: 0 0 50%;
  min-width: 0;
}

.suku3-vasen .suku {
  margin-bottom: 0;
}

.suku3-oikea {
  flex: 1 1 0;
  min-width: 0;
  padding-top: 4px;
}

.suku3-oikea p {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: #2c2c2c;
  margin: 0;
  text-align: left;
}

.tulokset-lista {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.tulos-rivi {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tulos-ylarivi {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.tulos-nimi {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
}

.tulos-palkki-kehys {
  width: 100%;
  height: 8px;
  background: #e8e4de;
  position: relative;
  overflow: hidden;
}

.tulos-palkki {
  height: 100%;
  background: #2e3f52;
  transition: width 0.6s ease;
}

.tulos-arvo {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #888;
  text-transform: uppercase;
}

.ominaisuudet {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 4px;
  margin-bottom: 20px;
}

.ominaisuus {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
}

.erotin {
  border: none;
  border-top: 1px solid #dddddd;
  margin: 44px auto;
  max-width: 880px;
}

.alapalkki {
  background: #191919;
  padding: 40px 0 38px;
}

.alapalkki-sisalto {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 50px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.alapalkki-vasen {
  flex: 2 1 0;
  min-width: 0;
}

.alapalkki-oikea {
  flex: 3 1 0;
  min-width: 0;
  border-left: 1px solid #333333;
  padding-left: 40px;
}

.alapalkki-viiva {
  display: none;
}

.alapalkki p,
.alapalkki-vasen p,
.alapalkki-oikea p {
  color: #888888;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
  text-align: left;
}

.alapalkki p:last-child,
.alapalkki-vasen p:last-child,
.alapalkki-oikea p:last-child {
  margin-bottom: 0;
}

.alapalkki a {
  color: #aaaaaa;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.alapalkki a:hover {
  color: #ffffff;
}

.alapalkki .copy {
  display: block;
  color: #555555;
  margin-top: 10px;
}

.copy a {
  font: inherit;
  color: inherit;
}

.virtuaali {
  display: inline-block;
  margin-top: 3px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #444444;
}


/* ── Image popup ─────────────────────────────── */

.kuva-popup-tausta {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.kuva-popup-tausta.auki {
  display: flex;
}

.kuva-popup-sisalto {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.kuva-popup-sisalto img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: 6px solid #fff;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ── Kasvatit-taulukko ───────────────────────── */

.kasvatit-taulukko {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  margin: 20px 0 30px;
}

.kasvatit-taulukko thead tr {
  background: #2e3f52;
}

.kasvatit-taulukko th {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

.kasvatit-taulukko tbody tr {
  border-bottom: 1px solid #e8e4de;
  transition: background 0.15s;
}

.kasvatit-taulukko tbody tr:last-child {
  border-bottom: 2px solid #2e3f52;
}

.kasvatit-taulukko tbody tr:hover {
  background: #f5f4f0;
}

.kasvatit-taulukko td {
  padding: 11px 14px;
  color: #2c2c2c;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .ylapalkki-sisalto {
    padding: 0 20px;
  }
  .paanavigointi {
    gap: 20px;
  }
  .alanavi {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .talli-nimi {
    font-size: 32px;
    letter-spacing: 4px;
    padding: 10px 24px;
  }
  .sisalto {
    padding: 36px 24px;
  }
}