:root {
  --darkest-blue: #050b1a;
  --darker-blue: #0e181e;
  --dark-blue: #1e3441;
  --slate-blue: #2b485b;
  --gold: #b38b45;
  --light-gold: #d4af37;
  --white: #ffffff;
  --gray: #e9f0f5;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "EB Garamond", serif;
  margin: 0;
  padding: 0;
  background-color: var(--gray);
  color: var(--darkest-blue);
  font-size: 1.2rem;
  line-height: 1.7;
}

/* --- HEADER & NAV --- */
header {
  background-color: var(--dark-blue);
  color: var(--light-gold);
  padding: 60px 20px 40px;
  text-align: center;
  border-bottom: 2px solid var(--gold);
  position: relative;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, transparent 20%, var(--darker-blue) 90%);
  pointer-events: none;
}

header h1 {
  font-family: "Luxurious Script", cursive;
  color: var(--white);
  font-size: 7rem;
  margin: 0;
  font-weight: 400;
  line-height: 0.7;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

header p {
  font-family: "EB Garamond", serif;
  color: var(--light-gold);
  font-style: italic;
  font-size: 1.6rem;
  margin-top: 30px;
  letter-spacing: 3px;
}

header span {
  font-size: 2rem;
  font-weight: 200;
}

nav {
  background-color: var(--slate-blue);
  padding: 20px 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

nav a {
  font-family: "Barlow Condensed", sans-serif;
  color: var(--white);
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  margin: 0 35px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

nav a:hover {
  color: var(--light-gold);
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
  letter-spacing: 3px;
}

/* --- YLEISET RAKENTEET --- */
.wrapper {
  max-width: 70%;
  margin: 70px auto;
  padding: 40px 80px 60px 80px;
  background: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.wrapper a {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
}

.wrapper a:hover {
  color: var(--light-gold);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}

hr {
  border: 0;
  height: 1px;
  background-image: linear-gradient(
    to right,
    rgba(0, 0, 0, 0),
    rgba(212, 175, 55, 1),
    rgba(0, 0, 0, 0)
  );
  margin: 2em auto;
  position: relative;
  overflow: visible;
  width: 50%;
}

hr::after {
  content: "\265B";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 15px;
  background-color: var(--gray);
  font-size: 1.5rem;
  color: var(--dark-blue);
}

h2 {
  font-family: "Oswald", sans-serif;
  font-size: 2rem;
  text-transform: uppercase;
  color: var(--navy);
  text-align: center;
  margin-bottom: 50px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 7px rgba(0, 0, 0, 0.25);
}

h2::after {
  content: "";
  display: block;
  width: 125px;
  height: 2px;
  background: var(--gold);
  margin: 15px auto;
}

h3 {
  font-family: "Oswald", sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--navy);
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.25);
}

h3::after {
  content: "";
  display: block;
  width: 75px;
  height: 1px;
  background: var(--gold);
  margin: 8px auto;
}

h4 {
  font-family: "Oswald", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--navy);
  text-align: center;
  margin: 30px 0 20px 0;
  letter-spacing: 2px;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.25);
}

h4::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: var(--light-gold);
  margin: 4px auto;
}

.tunnus {
  font-family:
    "Barlow Condensed",
    sans serif !important;
  color: #888;
  font-size: 0.9em;
  letter-spacing: 1px;
}

.center {
  text-align: center;
}

/* --- TAULUKOT (Etusivu & Hevossivu) --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Barlow Condensed", sans-serif;
  margin-top: 30px;
}

.data-table small {
  font-weight: 500;
  font-size: 0.8rem;
  color: #888;
}

.data-table th {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  text-align: center;
  background: #f8f8f8;
  padding: 18px;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px solid var(--light-gold);
}

.data-table td {
  text-align: center;
  padding: 18px;
  border-bottom: 1px solid #eee;
  font-size: 1.1rem;
  vertical-align: middle;
}

.data-table a:hover {
  letter-spacing: 1px;
  color: var(--light-gold);
}

#our_horses .data-table td:nth-child(1) {
  width: 25%;
}

#our_horses .data-table img {
  height: 1.2em;
  width: auto;
  vertical-align: -5px;
  margin-left: 8px;
}

#stallions .stallion-breed img {
  height: 1.2em;
  width: auto;
}

#breeding .data-table td:nth-child(3),
#breeding .data-table td:nth-child(4),
#breeding .data-table td:nth-child(5) {
  width: 25%;
}

.offspring .data-table td:nth-child(4) a:hover,
.offspring .data-table td:nth-child(5) a:hover {
  letter-spacing: 0px !important;
}

/* JALOSTUSORIT etusivulla */

.breeding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 250px));
  gap: 30px;
  margin-top: 40px;
  justify-content: center;
  justify-items: center;
}

.stallion-card {
  position: relative;
  background: #fff;
  border: 1px solid #eee;
  overflow: hidden;
  transition: transform 0.3s ease;
  width: 100%;
  max-width: 250px;
}

.stallion-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Kuva ja sen säiliö */
.stallion-image-wrapper {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--dark-blue);
}

.stallion-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

/* Himmennys ja lisätiedot hoverissa */
.stallion-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(14, 24, 30, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: var(--white);
  opacity: 0;
  transition: opacity 0.4s ease;
  text-align: center;
}

.stallion-card:hover .stallion-image-wrapper img {
  opacity: 0.3;
  transform: scale(1.05);
}

.stallion-card:hover .stallion-overlay {
  opacity: 1;
}

.stallion-info {
  padding: 20px;
  text-align: center;
}

.stallion-breed {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 5px;
}

.stallion-name {
  font-family: "Oswald", sans-serif;
  font-size: 1.2rem;
  text-transform: uppercase;
  margin: 0 0 10px 0;
}

.stallion-name a {
  text-decoration: none;
  letter-spacing: 1px;
}

.stallion-name a:hover {
  letter-spacing: 2px;
}

.stallion-merits {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: #888;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.overlay-stats {
  font-family: "Barlow Condensed", sans-serif;
  list-style: none;
  padding: 0;
  font-size: 1.1rem;
}

.overlay-stats li {
  margin-bottom: 8px;
  border-bottom: 1px dotted rgba(212, 175, 55, 0.35);
}

/* --- HEVOSSIVUN ERITYISET TYYLIT --- */
.horse-intro {
  display: flex;
  gap: 40px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  align-items: stretch;
}

.horse-image,
.horse-stats {
  flex: 1;
  min-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.horse-image img {
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  border: 2px solid var(--gold);
  box-shadow: 7px 7px 15px rgba(0, 0, 0, 0.15);
}

.horse-stats img {
  height: 1.2em;
  width: auto;
  vertical-align: -5px;
  margin-left: 8px;
}

.horse-stats a:hover {
  letter-spacing: 1px;
  color: var(--light-gold);
}

.stats-table {
  font-family: "Barlow Condensed", sans-serif;
  width: 100%;
  border-collapse: collapse;
}

.stats-table small {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: #888;
}

.stats-table td {
  border-bottom: 1px solid #eee;
  border-top: 1px solid #eee;
}

.stats-label {
  padding: 8px 0 !important;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  text-align: center;
  background: #f8f8f8;
  padding: 18px;
  font-size: 1rem;
  color: #555;
  width: 40%;
  border-right: 1px solid var(--light-gold);
}

.stats-info {
  padding: 8px 40px !important;
  font-size: 1.1rem;
}

/* Meriitit keskitettynä */
.merit-section {
  padding: 40px;
  text-align: center;
}

.merit-section h3 {
  margin-bottom: 25px;
}

.merit-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  list-style: none;
  padding: 0;
  max-width: 100%;
  margin: 0 auto;
}

.merit-list li {
  font-family: "Barlow Condensed", sans-serif;
  padding: 10px 20px;
  border-left: 3px solid var(--light-gold);
  font-size: 1.1rem;
  box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.1);
  background: #f8f8f8;
  color: #555;
  display: flex;
  align-items: center;
  text-align: left;
  min-width: 200px;
}

.merit-list li strong {
  color: var(--gold);
  margin-right: 20px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 1px;
}

/* Sukutaulu */
.pedigree-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Barlow Condensed", sans-serif;
  table-layout: fixed;
  margin-top: 30px;
}

.pedigree-table td {
  padding: 15px 18px;
  border: 1px solid #e9f0f5;
  font-size: 1.1rem;
  vertical-align: middle;
  transition: all 0.3s ease;
}

.pedigree-table td:hover {
  background-color: var(--gray);
}

.pedigree-table strong {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--darker-blue);
  display: block;
  margin-bottom: 4px;
}

.pedigree-table small {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: #888;
  padding-left: 5%;
}

.pedigree-table a {
  text-decoration: none;
  transition: all 0.3s ease;
}

.pedigree-table a:hover {
  letter-spacing: 1px;
  color: var(--light-gold);
}

.pedigree-top-row {
  border-top: 2px solid var(--light-gold) !important;
}

/* Info-Grid */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

/* Edistymismittari */
.progress-bg {
  background: #eee;
  border-radius: 10px;
  height: 10px;
  border: 1px solid #ddd;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--gold), var(--light-gold));
  height: 100%;
}

/* --- FOOTER --- */
footer {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.8em;
  margin-top: 80px;
  padding: 60px 20px;
  background: var(--dark-blue);
  color: #888;
  text-align: center;
}

footer .brand {
  font-family: "Luxurious Script", cursive;
  color: var(--white);
  font-size: 3rem;
  display: block;
}
