/* Värit ja fontit */
:root {
  --sand: #DDD0BC;
  --paper: #FCFAF6;
  --petrol: #24494B;
  --ink: #314343;
  --muted: #68716B;
  --line: #D5CDBF;
  --amber: #D99A32;
  --amber-light: #EDC066;
  --amber-ink: #916020;
  --link-amber: #9C6014;
  --link-amber-light: #F3CB76;
  --body: "Inter", Arial, sans-serif;
  --display: "essonnes-display", Georgia, serif;
  --heading: "essonnes-headline", Georgia, serif;
  --label: "soleil", Arial, sans-serif;
}

/* Sivun perusasetukset */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  min-width: 1280px;
  overflow-x: hidden;
}

body {
  font: 17px/1.7 var(--body);
  color: var(--ink);
  background: var(--sand);
}

img {
  display: block;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--petrol);
  outline-offset: 6px;
}

/* Kiinteä sivuleveys säilyttää esikatselun sommittelun */
.wrap {
  width: 1180px;
  margin: 0 auto;
}

.site-shell {
  position: relative;
  width: 100%;
  min-width: 1280px;
  overflow: hidden;
}

/* Päävalikko */
.topbar {
  position: relative;
  z-index: 3;
  background: var(--petrol);
  border-bottom: 1px solid rgba(246, 241, 232, .15);
}

.topbar .wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 48px;
  padding: 14px 0;
}

.topbar a {
  padding: 6px 12px;
  margin: -6px -2px;
  color: var(--paper);
  text-decoration: none;
  font: 400 21px/1.3 var(--display);
  font-synthesis: none;
  letter-spacing: .025em;
  transition: color .22s ease, text-shadow .22s ease;
}

.topbar a:hover,
.topbar a:focus-visible {
  color: var(--amber-light);
  text-shadow: 0 0 8px rgba(237, 192, 102, .42), 0 0 18px rgba(237, 192, 102, .2);
}

.topbar a:focus-visible {
  outline-color: var(--amber-light);
}

/* Pääkuva ja tallin nimi */
.hero {
  position: relative;
  width: 100%;
  height: 940px;
  overflow: hidden;
}

.hero > img {
  position: absolute;
  top: 52px;
  left: -280px;
  width: calc(100% + 280px);
  height: 740px;
  object-fit: cover;
  object-position: center 45%;
  filter: saturate(.85) contrast(.96);
  -webkit-mask-image: linear-gradient(#000 0%, #000 52%, transparent 100%);
  mask-image: linear-gradient(#000 0%, #000 52%, transparent 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(270deg, rgba(24, 54, 56, .84) 0%, rgba(24, 54, 56, .56) 33%, rgba(24, 54, 56, .08) 64%, transparent 90%);
  -webkit-mask-image: linear-gradient(#000 0%, #000 38%, transparent 80%);
  mask-image: linear-gradient(#000 0%, #000 38%, transparent 80%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 1180px;
  height: 345px;
  margin: 0 auto;
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.home-page .hero-content {
  height: 294px;
}

.hero-copy {
  max-width: 650px;
}

.hero-copy h1 {
  margin: 0;
  padding-right: 28px;
  font: 600 117px/1.03 "bickham-script-pro-3", cursive;
  letter-spacing: normal;
  text-shadow: 0 3px 20px rgba(15, 37, 37, .24);
}

.site-subtitle {
  margin: 12px 28px 0 0;
  text-align: center;
  font: italic 400 26px/1.35 var(--display);
  font-synthesis: none;
  letter-spacing: .025em;
  color: var(--paper);
}

/* Esittely ja tallin tiedot */
.main-panel {
  position: relative;
  z-index: 2;
  width: 1180px;
  margin: -540px auto 54px;
  background: var(--paper);
  border: 1px solid rgba(36, 73, 75, .08);
  box-shadow: 0 14px 36px rgba(60, 59, 43, .09);
  scroll-margin-top: 24px;
}

.home-page .main-panel {
  margin-top: -590px;
}

.main-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
}

.intro {
  padding: 36px 34px 34px;
}

.intro small,
.section-head small,
.band-copy small {
  display: block;
  text-transform: uppercase;
  font: 600 12px/1.5 var(--label);
  letter-spacing: .16em;
  margin-bottom: 11px;
}

.intro small,
.section-head small {
  color: var(--amber-ink);
}

.intro h2 {
  margin: 0 0 17px;
  color: var(--petrol);
  font: 400 39px/1.2 var(--heading);
  letter-spacing: -.012em;
}

.intro p {
  margin: 0 0 15px;
  color: #4F5C57;
}

/* Etusivun allekirjoitus */
.home-page .home-signoff {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
  text-align: center;
}

.home-page .intro .home-signature {
  margin: 0 0 4px;
  color: var(--petrol);
  font: 400 38px/1.1 "bickham-script-pro-3", cursive;
}

.home-page .intro .home-owner-id {
  margin: 0;
  color: var(--muted);
  font: 12px/1.4 var(--body);
}

.split-note {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 25px;
  align-items: start;
  margin-top: 25px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.statbox {
  background: #EAE8DD;
  border: 1px solid var(--line);
  padding: 17px;
}

.statbox h3 {
  margin: 0 0 11px;
  color: var(--petrol);
  font: 600 12px/1.5 var(--label);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.statbox ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.statbox li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #D5DAD0;
  font-size: 13px;
}

.statbox li:last-child {
  border-bottom: 0;
}

.side-photo {
  position: relative;
  overflow: hidden;
  background: #D4D8CC;
  min-height: 0;
}

.side-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 45% center;
  transform: scaleX(-1);
}

/* Jalostushevoskortit */
.section {
  width: 1180px;
  margin: 0 auto 50px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 40px;
  margin-bottom: 24px;
}

.section-head > div {
  flex: 1;
  min-width: 0;
}

.section-head h2 {
  margin: 0;
  color: var(--petrol);
  font: 400 37px/1.2 var(--heading);
  letter-spacing: -.012em;
}

.section-head > p {
  flex: 0 0 340px;
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--paper);
  border: 1px solid rgba(36, 73, 75, .1);
  scroll-margin-top: 24px;
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 45%;
  filter: saturate(.85);
}

.card-body {
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
  border-top: 3px solid var(--amber);
}

.card h3 {
  margin: 0 0 4px;
  color: var(--petrol);
  font: 400 29px/1.18 var(--heading);
}

.horse-breed {
  margin: 0 0 5px;
  color: var(--petrol);
  font: italic 400 21px/1.15 var(--display);
  font-synthesis: none;
}

.horse-training {
  margin: 0 0 4px;
  color: #4F5C57;
  font: 400 15px/1.25 var(--body);
}

.horse-awards {
  margin: 0 0 14px;
  color: var(--ink);
  font: 400 15px/1.25 var(--body);
}

.horse-more {
  text-decoration: none;
  align-self: flex-start;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: none;
  font: 500 15px/1.35 var(--body);
  color: var(--link-amber);
  cursor: pointer;
  transition: color .22s ease;
}

.horse-more:hover {
  color: var(--amber-ink);
}

/* Varsanosto ja kasvatussivun kuva */
.band {
  position: relative;
  z-index: 2;
  width: 1180px;
  margin: 0 auto 52px;
  background: var(--petrol);
  color: var(--paper);
  overflow: hidden;
}

.band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.band-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 36px;
}

.band-copy small {
  color: var(--amber-light);
}

.band-copy h2 {
  margin: 0 0 15px;
  font: 400 38px/1.2 var(--heading);
}

.band-copy p {
  margin: 0 0 22px;
  color: rgba(246, 241, 232, .87);
}

.band-photo {
  position: relative;
  min-height: 380px;
}

.band-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(.85);
}

.breeding-page .side-photo img {
  transform: none;
  object-position: 40% center;
}

.breeding-page .intro h3 {
  margin: 22px 0 10px;
  color: var(--petrol);
  font: 400 26px/1.25 var(--heading);
}

.breeding-page .main-panel {
  margin-bottom: 0;
}

/* Footer ja sinivihreä kuvatausta */
.footer {
  isolation: isolate;
  position: relative;
  width: 100%;
  margin: 66px 0 0;
  background: var(--petrol);
  color: #fff;
  overflow: hidden;
}

.footer-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 65%;
  filter: grayscale(1) contrast(1.05);
  mix-blend-mode: luminosity;
  z-index: 0;
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(rgba(36, 73, 75, .79), rgba(24, 54, 56, .95));
}

.footer-grid {
  position: relative;
  z-index: 2;
  width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 64px;
  padding: 47px 0 48px;
}

.footer h3 {
  margin: 0 0 18px;
  color: #fff;
  font: 400 29px/1.3 var(--heading);
}

.footer p,
.footer li {
  font: 400 14px/1.8 var(--body);
  color: #fff;
}

.footer p {
  margin: 0 0 12px;
}

.footer .footer-name {
  font: 400 16px/1.6 var(--label);
  color: #fff;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer li + li {
  margin-top: 5px;
}

.footer-links a {
  display: inline-block;
  font: 400 17px/1.6 var(--display);
  font-synthesis: none;
  letter-spacing: .015em;
}

.footer .footer-note {
  max-width: 310px;
  font-size: 12px;
}

/* Hevosten tietodialogit */
.horse-profile {
  width: min(720px, calc(100vw - 48px));
  max-height: calc(100vh - 64px);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 80px rgba(24, 54, 56, .3);
}

.horse-profile::backdrop {
  background: rgba(24, 54, 56, .66);
}

.profile-content {
  padding: 32px 36px;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.profile-header small {
  display: block;
  margin-bottom: 7px;
  font: 600 11px/1.5 var(--label);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--amber-ink);
}

.profile-header h2 {
  margin: 0;
  color: var(--petrol);
  font: 400 40px/1.2 var(--heading);
}

.profile-header form {
  margin: 0;
}

.profile-close {
  padding: 5px 0;
  border: 0;
  background: none;
  color: var(--petrol);
  font: 400 14px/1.5 var(--body);
  cursor: pointer;
  white-space: nowrap;
}

.profile-close::after {
  content: "×";
  font-size: 20px;
  margin-left: 8px;
}

.horse-more:focus-visible,
.profile-close:focus-visible {
  outline: 2px solid var(--petrol);
  outline-offset: 5px;
}

.profile-facts {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 6px 14px;
  margin: 0 0 25px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
}

.profile-facts dt {
  font-weight: 500;
  color: var(--petrol);
}

.profile-facts dd {
  margin: 0;
}

.horse-profile h3 {
  margin: 22px 0 9px;
  color: var(--petrol);
  font: 400 25px/1.3 var(--heading);
}

.horse-profile p,
.profile-merits {
  margin: 0;
  color: #4F5C57;
  font: 400 15px/1.75 var(--body);
}

.profile-merits {
  padding-left: 20px;
}

.horse-profile .profile-note {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

/* Tekstilinkkien värit ja pehmeät hover-tilat */
.intro p a {
  color: var(--link-amber);
  font-weight: 500;
  text-decoration: none;
  transition: color .22s ease;
}

.intro p a:hover,
.intro p a:focus-visible {
  color: var(--amber-ink);
}

.band-link {
  align-self: flex-start;
  color: var(--link-amber-light);
  text-decoration: none;
  font: 500 15px/1.55 var(--body);
  transition: color .22s ease;
}

.footer a {
  color: var(--link-amber-light);
  text-decoration: none;
  transition: color .22s ease;
}

.band-link:hover,
.band-link:focus-visible,
.footer a:hover,
.footer a:focus-visible {
  color: #FFE0A0;
}

.band-link:focus-visible,
.footer a:focus-visible {
  outline-color: var(--amber-light);
}

@media (prefers-reduced-motion: reduce) {
  .topbar a,
  .intro p a,
  .footer a,
  .horse-more,
  .band-link {
    transition: none;
  }
}

/* Hevoslistat: omat vaaleat tekstialueet jokaiselle roturyhmälle */
.horse-listing {
  /* Nimipalkin kultasävy: viimeinen luku säätää läpikuultavuutta. */
  --horse-name-background: rgba(237, 192, 102, .72);
  position: relative;
  z-index: 2;
  width: 1180px;
  margin: -590px auto 54px;
}

/* Listasivun tekstialue alkaa samasta korkeudesta kuin etusivun esittelypaneeli. */
.listing-page .hero-content,
.horse-page-body .hero-content {
  height: 294px;
}

.breed-section {
  padding: 32px 34px 34px;
  margin-bottom: 30px;
  background: var(--paper);
  border: 1px solid rgba(36, 73, 75, .08);
  box-shadow: 0 14px 36px rgba(60, 59, 43, .09);
  scroll-margin-top: 24px;
}

.breed-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.breed-nav a {
  padding: 10px 23px;
  border: 1px solid rgba(36, 73, 75, .16);
  border-radius: 5px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(60, 59, 43, .06);
  color: var(--petrol);
  font: 400 20px/1.35 var(--display);
  text-decoration: none;
  transition: color .22s ease, background-color .22s ease, border-color .22s ease;
}

.breed-nav a:hover,
.breed-nav a:focus-visible {
  background: #F3E4C6;
  border-color: var(--amber);
  color: var(--amber-ink);
}

.breed-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}

.breed-heading h2 {
  margin: 0;
  color: var(--petrol);
  font: 400 31px/1.2 var(--heading);
}

.breed-heading > p {
  margin: 0;
  color: var(--muted);
  font: 400 13px/1.5 var(--body);
}

.horse-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 27px 20px;
}

.horse-list-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--petrol);
  box-shadow: 0 5px 14px rgba(36, 73, 75, .12);
}

.horse-photo-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 220px;
  background: #EAE8DD;
}

.horse-photo {
  display: block;
  width: auto;
  height: 220px;
  max-width: 100%;
  border-radius: 8px 8px 0 0;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: center top;
}

.horse-summary {
  flex: 1;
  padding: 14px 12px 16px;
  color: #F8F6EE;
  background: var(--petrol);
}

.horse-card-name {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 10px 12px;
  color: var(--petrol);
  background: var(--horse-name-background);
  font: 400 23px/1.15 var(--heading);
}

.horse-card-name a {
  color: inherit;
  text-decoration: none;
  transition: color .22s ease;
}

.horse-card-name a:hover,
.horse-card-name a:focus-visible {
  color: #183638;
  text-shadow: 0 0 8px rgba(252, 250, 246, .28);
}

.horse-card-name a:focus-visible {
  outline-color: var(--petrol);
}

.horse-breed-info {
  margin: 0 0 4px;
  color: #F8F6EE;
  font: 700 13px/1.4 var(--body);
}

.listing-facts {
  margin: 0;
  color: #E2EBE6;
  font: 400 13px/1.4 var(--body);
}

.listing-merits {
  margin: 7px 0 0;
  color: var(--link-amber-light);
  font: 600 13px/1.45 var(--label);
  letter-spacing: .035em;
}

@media (prefers-reduced-motion: reduce) {
  .breed-nav a,
  .horse-card-name a {
    transition: none;
  }
}

/* Rotupainikkeet vierittävät sivun omaan tekstilaatikkoonsa. */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Yhteisen linkkipalkin pieni kaksikielinen merkintä. */
.topbar .site-disclaimer {
  position: absolute;
  top: 7px;
  right: 17px;
  margin: 0;
  color: rgba(252, 250, 246, .82);
  font: italic 400 12px/1.25 var(--display);
  text-align: right;
  letter-spacing: .025em;
  pointer-events: none;
}
.site-disclaimer span { display: block; }
.footer-grid { grid-template-columns: .75fr 1.1fr 1.15fr; gap: 48px; }
.footer-disclaimer p { font-size: 12px; line-height: 1.5; }
.footer-disclaimer p + p { margin-top: 13px; }
