/* =========================================================
   PERUS
========================================================= */

* {
    box-sizing: border-box;
}

:root {
    --vihrea: #173d2b;
    --vihrea-tumma: #102d20;

    --kulta: #d4b15c;
    --kulta-tumma: #96752d;

    --vaalea: #f7f4ea;
    --vaalea-tumma: #eee8d8;

    --tausta: #102d20;
    --valkoinen: #ffffff;

    --teksti: #292622;
    --teksti-vaalea: #5a554d;

    --reunus: #ddd3bd;
    --reunus-tumma: #d2bf91;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--tausta);
    color: var(--teksti-vaalea);

    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.7;
}

img {
    max-width: 100%;
}

a {
    color: var(--kulta-tumma);
    text-decoration: none;
}

a:hover {
    color: var(--kulta);
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
}

h2 {
    margin: 0;

    color: var(--vihrea);

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.75rem;
    font-weight: 400;

    letter-spacing: 0.03em;
}


/* =========================================================
   PÄÄSIVU / SISÄLTÖ
========================================================= */

.main-container {
    width: min(1200px, 92%);
    margin: 0 auto;

    background: #f9f6ed;

    box-shadow:
            0 5px 30px rgba(60, 50, 35, 0.12);
}


/* =========================================================
   OTSIKKO
========================================================= */

.header-title {
    width: min(1200px, 92%);
    margin: 35px auto 0;

    padding: 45px 30px 35px;

    text-align: center;

    background: #f9f6ed;

    border-radius: 12px 12px 0 0;
}

.header-title h1 {
    margin: 0;

    color: #4b443a;

    font-family: "Lavishly Yours", "Meie Script", cursive;
    font-size: clamp(3.5rem, 7vw, 6rem);
    font-weight: 400;

    line-height: 1;
}


/* =========================================================
   NAVIGOINTI
========================================================= */

.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;

    gap: 10px;

    margin: 0;
    padding: 12px 20px;

    background: #f4f0e5;

    border-top: 1px solid #ddd3bd;
    border-bottom: 1px solid #ddd3bd;
}

.main-nav a {
    display: block;

    padding: 7px 18px;

    color: #5d5549;

    font-size: 0.95rem;
    letter-spacing: 0.04em;

    border-radius: 5px;

    transition:
            background 0.2s ease,
            color 0.2s ease;
}

.main-nav a:hover {
    background: #e7dfca;

    color: var(--kulta-tumma);

    text-decoration: none;
}


/* =========================================================
   NAVIGOINTI - MOBIILI
========================================================= */

@media (max-width: 700px) {

    .main-nav {
        gap: 3px;

        padding: 10px;
    }

    .main-nav a {
        padding: 6px 10px;

        font-size: 0.85rem;
    }

}
/* =========================================================
   TEKSTIT
========================================================= */

.main-container > p {
    width: min(760px, 86%);

    margin: 25px auto;

    color: var(--teksti-vaalea);

    font-size: 1rem;
    line-height: 1.85;
}

.allekirjoitus {
    margin: 35px auto 50px;
    text-align: center;
}
.allekirjoitus-koriste {
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    margin-bottom: 10px;
    opacity: 0.5;
}

.allekirjoitus-nimi {
    font-family: "Allura", "Great Vibes", cursive;
    font-size: 1.6rem;
    line-height: 1;
}

.allekirjoitus-titteli {
    margin-top: 5px;
    font-family: Georgia, serif;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.5;
}




.allekirjoitus-viiva {
    width: 65px;
    height: 1px;
    background: currentColor;
    margin: 10px auto 8px;
    opacity: 0.35;
}
/* =========================================================
   OSIOEROTIN
========================================================= */

.osio-erotin {
    width: 75%;
    margin: 50px auto 35px;

    display: flex;
    align-items: center;

    gap: 15px;
}

.osio-erotin span {
    flex: 1;

    height: 1px;

    background: rgba(154, 122, 50, 0.3);
}

.osio-merkit {
    color: #b08d2c;

    font-size: 11px;
    letter-spacing: 4px;
    line-height: 1;

    white-space: nowrap;
}


/* =========================================================
   HISTORIA
========================================================= */

.historia {
    width: 82%;

    margin: 35px auto 45px;

    padding: 30px 35px;

    background: var(--vaalea);

    border-left: 6px solid var(--kulta);

    border-radius: 10px;

    box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.10);
}

.historia .entry {
    color: #5c574e;
    font-style: italic;
}


/* =========================================================
   PALKKI / OSIOIDEN OTSIKOT
========================================================= */
.palkki {
    width: 90%;

    margin: 55px auto 35px;
    padding: 0 20px 18px;

    border-bottom: 1px solid rgba(150, 117, 45, 0.35);

    text-align: center;

    position: relative;
}

.palkki::after {
    content: "◆";

    position: absolute;

    left: 50%;
    bottom: -5px;

    transform: translateX(-50%);

    padding: 0 10px;

    background: #f9f6ed;

    color: var(--kulta-tumma);

    font-size: 0.55rem;
}

.palkki h2 {
    color: var(--vihrea);

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 400;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* =========================================================
   ETUSIVUN LINKIT
========================================================= */

.etusivu-linkit {
    max-width: 1100px;

    margin: 50px auto;
    padding: 0 20px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 24px;
}

.etusivu-linkki {
    display: block;

    padding: 30px;

    background: var(--valkoinen);

    color: var(--teksti);

    border: 1px solid rgba(23, 61, 43, 0.12);
    border-radius: 14px;

    box-shadow:
            0 8px 25px rgba(0, 0, 0, 0.05);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.etusivu-linkki:hover {
    color: var(--teksti);
    text-decoration: none;

    transform: translateY(-4px);

    box-shadow:
            0 14px 35px rgba(0, 0, 0, 0.09);
}

.etusivu-linkki__numero {
    display: block;

    margin-bottom: 15px;

    color: var(--kulta-tumma);

    font-size: 0.75rem;
    font-weight: 700;

    letter-spacing: 0.15em;
}

.etusivu-linkki h2 {
    margin: 0 0 12px;

    color: var(--vihrea);

    font-family: Georgia, "Times New Roman", serif;
}

.etusivu-linkki p {
    margin: 0;

    color: #666;

    line-height: 1.7;
}

.etusivu-linkki > span:last-child {
    display: block;

    margin-top: 20px;

    color: var(--vihrea);

    font-weight: 700;
}


/* =========================================================
   HENKILÖKUNTA
========================================================= */

.staff-list {
    width: min(1200px, calc(100% - 40px));

    margin: 50px auto 80px;

    display: flex;
    flex-direction: column;

    gap: 35px;
}


/* =========================================================
   HENKILÖKUNNAN KORTTI
========================================================= */

.staff-card {
    display: grid;

    grid-template-columns:
        minmax(320px, 420px)
        minmax(0, 1fr);

    background: var(--vaalea);

    border: 1px solid rgba(23, 61, 43, 0.12);
    border-radius: 18px;

    overflow: hidden;

    box-shadow:
            0 10px 30px rgba(16, 45, 32, 0.08);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.staff-card:hover {
    transform: translateY(-2px);

    box-shadow:
            0 16px 40px rgba(16, 45, 32, 0.13);
}


/* =========================================================
   HENKILÖKUNTA - KUVA
========================================================= */

.staff-card__visual {
    min-width: 0;

    background: var(--vaalea-tumma);
}

.staff-card__main-image {
    width: 100%;

    aspect-ratio: 4 / 5;

    overflow: hidden;
}

.staff-card__main-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.35s ease;
}

.staff-card:hover .staff-card__main-image img {
    transform: scale(1.02);
}

.staff-card__no-image {
    width: 100%;

    aspect-ratio: 4 / 5;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--kulta-tumma);

    font-size: 0.95rem;
    font-style: italic;
}


/* =========================================================
   HENKILÖKUNTA - KUVAGALLERIA
========================================================= */

.staff-gallery {
    display: flex;

    gap: 8px;

    padding: 10px;

    overflow-x: auto;

    background: var(--vihrea-tumma);
}

.gallery-button {
    flex: 0 0 68px;

    width: 68px;
    height: 68px;

    padding: 0;

    border: 2px solid transparent;
    border-radius: 8px;

    background: transparent;

    cursor: pointer;

    overflow: hidden;

    opacity: 0.65;

    transition:
            opacity 0.2s ease,
            border-color 0.2s ease,
            transform 0.2s ease;
}

.gallery-button:hover {
    opacity: 1;

    transform: translateY(-1px);
}

.gallery-button.is-active {
    opacity: 1;

    border-color: var(--kulta);
}

.gallery-button img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   HENKILÖKUNTA - SISÄLTÖ
========================================================= */

.staff-card__content {
    min-width: 0;

    padding: 40px 45px 45px;
}

.staff-card__top {
    margin-bottom: 28px;
}

.staff-card__name {
    margin: 0;

    color: var(--vihrea);

    font-family: Georgia, "Times New Roman", serif;

    font-size: clamp(1.8rem, 3vw, 2.5rem);

    line-height: 1.15;

    font-weight: 600;
}

.staff-card__title {
    margin: 8px 0 0;

    color: var(--kulta-tumma);

    font-size: 1rem;
    font-weight: 600;

    letter-spacing: 0.04em;
}


/* =========================================================
   HENKILÖKUNTA - FAKTAT
========================================================= */

.staff-facts {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    padding: 22px 0;

    margin-bottom: 28px;

    border-top: 1px solid rgba(23, 61, 43, 0.15);
    border-bottom: 1px solid rgba(23, 61, 43, 0.15);
}

.staff-fact {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.staff-fact__label {
    color: var(--kulta-tumma);

    font-size: 0.72rem;

    text-transform: uppercase;
    letter-spacing: 0.09em;

    font-weight: 700;
}

.staff-fact__value {
    color: var(--teksti);

    font-size: 0.98rem;
}


/* =========================================================
   HENKILÖKUNTA - TEKSTIOSIOT
========================================================= */

.staff-section {
    margin-top: 28px;
}

.staff-section h3 {
    position: relative;

    margin: 0 0 10px;

    padding-bottom: 8px;

    color: var(--vihrea);

    font-family: Georgia, "Times New Roman", serif;

    font-size: 1.25rem;
    font-weight: 600;
}

.staff-section h3::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 45px;
    height: 2px;

    background: var(--kulta);
}

.staff-section p {
    margin: 0;

    color: var(--teksti);

    font-size: 0.98rem;
    line-height: 1.75;
}


/* =========================================================
   HENKILÖKUNTA - TYHJÄ
========================================================= */

.staff-empty {
    padding: 60px 30px;

    text-align: center;

    background: var(--vaalea);

    border: 1px solid rgba(23, 61, 43, 0.12);
    border-radius: 16px;

    color: var(--teksti);
}

.staff-empty p {
    margin: 0;
}

.staff-card__details {
    display: none;
}

.staff-card.is-expanded .staff-card__details {
    display: block;
}
.staff-card__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    margin-top: 1.25rem;
    padding: 0.85rem 1rem;

    border: 1px solid var(--kulta);
    border-radius: 8px;

    background: var(--vaalea);
    color: var(--vihrea);

    font: inherit;
    font-weight: 600;

    text-align: left;
    cursor: pointer;

    transition:
            background-color 0.2s ease,
            color 0.2s ease,
            border-color 0.2s ease;
}

.staff-card__toggle:hover {
    background: var(--kulta);
    border-color: var(--kulta);
    color: var(--vihrea-tumma);
}

.staff-card__toggle-icon {
    font-size: 1.4rem;
    line-height: 1;
    color: var(--kulta-tumma);
}

.staff-card.is-expanded .staff-card__toggle-icon {
    transform: rotate(45deg);
}

/* =========================================================
   HEVOSET
========================================================= */

.hevoset-page {
    width: 100%;
}

.hevosryhma {
    width: 90%;
    margin: 0 auto 50px;
}

.hevosryhma .palkki {
    margin-top: 35px;
}

.hevosryhma .palkki h2 {
    font-family: "Courgette", cursive;
    font-size: 1.6rem;
}


/* =========================================================
   HEVOSKORTIT
========================================================= */

.hevoset-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.hevonen {
    display: grid;
    grid-template-columns:
        130px
        minmax(0, 1fr);
    min-width: 0;
    min-height: 150px;
    background: var(--vaalea);
    border: 1px solid var(--vaalea-tumma);
    border-left: 4px solid var(--kulta);
    border-radius: 10px;
    overflow: hidden;

    box-shadow:
            0 3px 10px rgba(0, 0, 0, 0.08);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.hevonen:hover {
    transform: translateY(-2px);
    box-shadow:
            0 6px 16px rgba(0, 0, 0, 0.13);
}


/* =========================================================
   HEVOSKORTTI - KUVA
========================================================= */

.hevonen-kuva {
    width: 110px;
    height: 150px;
}

.hevonen-kuva a {
    display: block;
    width: 100%;
    height: 100%;
}

.hevonen-kuva img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kuva-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
}

.kuva-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* =========================================================
   HEVOSKORTTI - KUVAN GRADIENTTI
========================================================= */

.kuva-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
            linear-gradient(
                    to top,
                    rgba(0, 0, 0, 0.65),
                    transparent 65%
            );

    pointer-events: none;
    z-index: 1;
}


/* =========================================================
   HEVOSKORTTI - TIEDOT
========================================================= */

.hevonen-tiedot {
    min-width: 0;
    padding: 15px 18px;
}

.hevonen-tiedot h3 {
    margin: 0 0 5px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    line-height: 1.2;
    font-weight: 600;
}

.hevonen-tiedot h3 a {
    color: var(--vihrea);
    text-decoration: none;
}

.hevonen-tiedot h3 a:hover {
    color: var(--kulta-tumma);
    text-decoration: none;
}

.hevonen-tiedot .rotu {
    margin: 0 0 10px;
    color: #625d54;
    font-size: 0.88rem;
    font-style: italic;
}

.hevonen-tiedot p {
    margin: 5px 0;
    color: var(--teksti);
    font-size: 0.88rem;
    line-height: 1.45;
}

.hevonen-tiedot strong {
    color: var(--vihrea);
}

.hevonen-tiedot .meriitit {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--vaalea-tumma);
    color: var(--kulta-tumma);
}



/* =========================================================
   HEVOSET - TYHJÄ
========================================================= */

.hevoset-empty {
    width: 100%;

    margin: 0 0 30px;
    padding: 25px;

    background: var(--vaalea);

    border-left: 4px solid var(--kulta);
    border-radius: 8px;

    color: var(--teksti);

    text-align: center;
}


/* =========================
   KASVATUSTOIMINTA
   ========================= */

.kasvatus-container {
    width: min(1000px, 88%);
    margin: 0 auto 70px;
}


/* YLÄOSIO */

.kasvatus-intro {
    max-width: 820px;
    margin: 0 auto 55px;
}

.kasvatus-heading {
    text-align: center;
    margin-bottom: 28px;
}

.kasvatus-heading-koriste,
.box-koriste {
    display: block;
    margin-bottom: 8px;
    color: var(--kulta-tumma);
    font-family: Georgia, serif;
    font-size: 0.58rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.7;
}

.kasvatus-heading h2,
.kasvatus-box h2 {
    margin: 0;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: 0.06em;
}

.kasvatus-teksti {
    color: var(--teksti-vaalea);
    font-size: 1rem;
    line-height: 1.85;
}

.kasvatus-teksti p {
    margin: 0 0 20px;
}

.kasvatus-teksti p:last-child {
    margin-bottom: 0;
}


/* TAVOITTEET + MYYNTIEHDOT */

.kasvatus-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 65px;
}

.kasvatus-box {
    padding: 30px 34px;
    background: var(--vaalea);
    border-top: 1px solid var(--reunus-tumma);
    border-bottom: 1px solid var(--reunus-tumma);
}

.kasvatus-box .box-koriste {
    margin-bottom: 10px;
}

.kasvatus-box h2 {
    margin-bottom: 22px;
}

.kasvatus-box p {
    margin: 0 0 18px;
    color: var(--teksti-vaalea);
    line-height: 1.8;
}

.kasvatus-box p:last-child {
    margin-bottom: 0;
}


/* MYYNTIEHDOT */
.myyntiehdot ul {
    margin: 0;
    padding-left: 20px;
}

.myyntiehdot li {
    margin: 0;
    padding: 13px 0 13px 4px;
    color: var(--teksti-vaalea);
    line-height: 1.65;
}

.myyntiehdot li + li {
    border-top: 1px solid var(--reunus);
}

.myyntiehdot li::marker {
    color: var(--kulta-tumma);
    font-size: 0.7em;
}


.rekisteritiedot {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(150, 117, 45, 0.22);
}

.rekisteritiedot h3 {
    margin: 0 0 14px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.rekisteri-rivi {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(150, 117, 45, 0.12);
    color: var(--teksti-vaalea);
    font-size: 0.9rem;
}

.rekisteri-rivi:last-child {
    border-bottom: 0;
}

.rekisteri-rivi span {
    opacity: 0.7;
}

.rekisteri-rivi strong {
    color: var(--vihrea);
    font-weight: 600;
}
.kasvatus-huom {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 24px;
    padding: 14px 16px;
    background: rgba(212, 177, 92, 0.08);
    border-left: 2px solid var(--kulta-tumma);
}

.huom-otsikko {
    flex-shrink: 0;
    color: var(--kulta-tumma);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.72rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.kasvatus-huom p {
    margin: 0 !important;
    color: var(--teksti-vaalea);
    font-size: 0.82rem;
    line-height: 1.55;
}

/* =========================================================
   KASVATIT
========================================================= */

.kasvatit-box {
    padding: 28px 30px;

    background: var(--vaalea);

    border: 1px solid #e0d7c3;
    border-radius: 10px;

    box-shadow:
            0 4px 15px rgba(0, 0, 0, 0.08);
}

.kasvatit-box .kasvatus-heading {
    margin-bottom: 18px;
}

.kasvatit-box .osio-erotin {
    margin-bottom: 30px;
}

.kasvatti-taulukko {
    width: 100%;

    overflow-x: auto;
}

.kasvatti-taulukko table {
    width: 100%;

    border-collapse: collapse;

    background: var(--vaalea);
}

.kasvatti-taulukko th {
    padding: 12px 14px;

    text-align: left;

    font-weight: 600;

    border-bottom: 3px solid var(--kulta);
}

.kasvatti-taulukko td {
    padding: 12px 14px;

    border-bottom: 1px solid var(--vaalea-tumma);

    vertical-align: top;
}

.kasvatti-taulukko tbody tr:nth-child(even) {
    background: var(--vaalea-tumma);
}

.kasvatti-taulukko a {
    color: var(--vihrea);

    text-decoration: none;
}

.kasvatti-taulukko a:hover {
    color: var(--kulta-tumma);

    text-decoration: underline;
}

.kasvatti-taulukko .numero {
    width: 60px;

    text-align: center;

    font-weight: 700;

    color: var(--kulta-tumma);
}

.kasvatti-taulukko .syntymapaiva {
    white-space: nowrap;
}

.kasvatti-taulukko .rotulyhenne {
    width: 70px;

    text-align: center;
}

.kasvatti-taulukko .hevosen-nimi {
    min-width: 220px;
}

.kasvatti-taulukko .sukupuoli {
    width: 70px;
}

.kasvatti-taulukko .vanhempi {
    min-width: 180px;
}

.ei-kasvatteja {
    padding: 1rem;

    background: var(--vaalea-tumma);

    border-left: 4px solid var(--kulta);
}


/* =========================================================
   TALLILLA TAPAHTUU
========================================================= */

.tapahtumat {
    width: 90%;

    margin: 0 auto 50px;

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 20px;
}
.tapahtuma {
    min-width: 0;

    padding: 24px 26px;

    background: #fbf9f2;

    border: 1px solid rgba(150, 117, 45, 0.18);
    border-top: 2px solid var(--kulta);

    border-radius: 4px;

    box-shadow: 0 5px 18px rgba(16, 45, 32, 0.06);

    transition:
            transform 0.2s ease,
            box-shadow 0.2s ease;
}

.tapahtuma:hover {
    transform: translateY(-3px);

    box-shadow:
            0 10px 25px rgba(16, 45, 32, 0.10);
}

.tapahtuma-meta {
    margin-bottom: 8px;

    color: var(--kulta-tumma);

    font-size: 0.78rem;

    letter-spacing: 0.06em;

    text-transform: uppercase;
}

.tapahtuma h3 {
    margin: 0 0 8px;

    color: var(--vihrea);

    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.45rem;
    font-weight: 500;

    line-height: 1.25;
}

.tapahtuma h3 a {
    color: inherit;

    text-decoration: none;
}

.tapahtuma h3 a:hover {
    color: var(--kulta-tumma);

    text-decoration: none;
}

.tapahtuma-hevonen {
    margin-bottom: 12px;

    color: var(--vihrea);

    font-size: 0.9rem;

    font-style: italic;
}

.tapahtuma-hevonen a {
    color: var(--vihrea);

    text-decoration: none;
}

.tapahtuma-hevonen a:hover {
    color: var(--kulta-tumma);

    text-decoration: underline;
}

.tapahtuma p {
    margin: 0;

    color: var(--teksti);

    font-size: 0.9rem;

    line-height: 1.6;
}

.tapahtumat-empty {
    grid-column: 1 / -1;

    padding: 30px;

    background: var(--vaalea);

    border-left: 4px solid var(--kulta);

    text-align: center;
}


/* =========================================================
   TALLIKIRJA
========================================================= */

.tallikirja-page {
    min-height: 100vh;

    background: var(--vaalea);
}

.tallikirja-hero {
    padding: 80px 24px;

    background:
            linear-gradient(
                    rgba(16, 45, 32, 0.8),
                    rgba(16, 45, 32, 0.8)
            );

    color: #fff;
}

.tallikirja-hero__inner {
    max-width: 1000px;

    margin: 0 auto;
}

.tallikirja-eyebrow {
    display: block;

    margin-bottom: 12px;

    color: var(--kulta);

    font-size: 0.78rem;
    font-weight: 700;

    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.tallikirja-hero h1 {
    margin: 0 0 16px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1;
}

.tallikirja-hero p {
    max-width: 650px;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    line-height: 1.7;
}

.tallikirja-list {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

.tallikirja-card {
    display: grid;
    grid-template-columns:
        100px
        minmax(0, 1fr);

    gap: 30px;
    margin-bottom: 24px;
    padding: 32px;
    background: #fff;
    border: 1px solid rgba(23, 61, 43, 0.08);
    border-radius: 18px;
    box-shadow:
            0 10px 30px rgba(0, 0, 0, 0.07);
}

.tallikirja-card__date {
    padding-right: 24px;
    border-right: 1px solid var(--vaalea-tumma);
    text-align: center;
}

.tallikirja-card__date span {
    display: block;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.tallikirja-card__date small {
    display: block;
    margin-top: 5px;
    color: #777;
}

.tallikirja-card__content h2 {
    margin: 0 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
}

.tallikirja-card__content h2 a {
    color: var(--vihrea);

    text-decoration: none;
}

.tallikirja-card__content h2 a:hover {
    color: var(--kulta-tumma);
}

.tallikirja-card__excerpt {
    margin: 0 0 24px;
    color: #555;
    line-height: 1.75;
}

.tallikirja-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.tallikirja-author img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
}

.tallikirja-author span,
.tallikirja-author strong,
.tallikirja-author small {
    display: block;
}

.tallikirja-author span {
    color: #888;
    font-size: 0.75rem;
}

.tallikirja-author strong {
    color: var(--vihrea);
}

.tallikirja-author small {
    margin-top: 2px;
    color: #777;
}

.tallikirja-card__read {
    display: inline-block;

    color: var(--vihrea);

    font-weight: 700;

    text-decoration: none;
}

.tallikirja-card__read:hover {
    color: var(--kulta-tumma);
}

.tallikirja-empty {
    padding: 60px 30px;
    background: #fff;
    border-radius: 18px;
    text-align: center;
}

.tallikirja-empty h2 {
    color: var(--vihrea);

    font-family: Georgia, "Times New Roman", serif;
}


/* =========================================================
   TALLIKIRJA - YKSITTÄINEN TARINA
========================================================= */

.tallikirja-story {
    min-height: 100vh;

    padding: 60px 24px 100px;

    background: var(--vaalea);
}

.tallikirja-story__article {
    max-width: 820px;

    margin: 0 auto;
}

.tallikirja-story__header {
    margin-bottom: 50px;

    text-align: center;
}

.tallikirja-story__back {
    display: inline-block;

    margin-bottom: 40px;

    color: var(--vihrea);

    font-weight: 700;

    text-decoration: none;
}

.tallikirja-story__back:hover {
    color: var(--kulta-tumma);
}

.tallikirja-story__date {
    margin-bottom: 15px;
    color: var(--kulta-tumma);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tallikirja-story__header h1 {
    margin: 0 auto 30px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.1;
}
.tallikirja-story__author {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    margin-top: 12px;
    padding: 0;
    text-align: center;
}

.tallikirja-story__author span {
    color: #888;
    font-size: 0.75rem;
}

.tallikirja-story__author strong {
    color: var(--kulta-tumma);
    font-size: 1.15rem;
    font-weight: 400;
    font-family: "Allura", "Great Vibes", cursive;
}

.tallikirja-story__author small {
    display: none;
}
.tallikirja-story__body {
    padding: 50px;

    background: #fff;

    border-radius: 18px;

    box-shadow:
            0 10px 35px rgba(0, 0, 0, 0.06);

    color: var(--teksti);

    font-size: 1.08rem;

    line-height: 1.9;
}

.tallikirja-story__body::first-letter {
    float: left;
    padding-top: 5px;
    padding-right: 8px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.8rem;
    line-height: 0.85;
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    margin-top: 60px;
    padding: 25px;
    border-top: 1px solid #d8cdb5;
    color: #777064;
    font-size: 0.8rem;
    text-align: center;
}


/* =========================================================
   TABLETTI
========================================================= */

@media (max-width: 900px) {

    .staff-card {
        grid-template-columns:
            300px
            minmax(0, 1fr);
    }

    .staff-card__content {
        padding: 30px;
    }

    .staff-card__name {
        font-size: 2rem;
    }

    .hevoset-grid {
        grid-template-columns: 1fr;
    }

    .tapahtumat {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .kasvatus-row {
        gap: 20px;
    }

}

.kasvatus-kuva {
    margin: 35px auto 0;
    max-width: 900px;
    text-align: center;
}

.kasvatus-kuva img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.kasvatus-kuva figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.5;
    opacity: 0.75;
}

/* =========================================================
   MOBIILI
========================================================= */

@media (max-width: 700px) {

    .main-container,
    .header-title {
        width: 94%;
    }

    .header-title {
        margin-top: 20px;

        padding: 30px 15px 25px;
    }

    .header-title h1 {
        font-size: clamp(3rem, 14vw, 4.5rem);
    }


    /* NAVIGOINTI */

    .navbar ul {
        gap: 3px;

        padding: 10px;
    }

    .navbar a {
        padding: 6px 10px;

        font-size: 0.85rem;
    }


    /* TEKSTIT */
    .historia {
        width: 82%;

        margin: 45px auto 50px;
        padding: 32px 40px;

        background: var(--vaalea);

        border-top: 1px solid var(--reunus-tumma);
        border-bottom: 1px solid var(--reunus-tumma);

        border-left: 0;
        border-radius: 0;

        box-shadow: none;
    }

    .historia .entry {
        color: #5c574e;

        font-family: Georgia, "Times New Roman", serif;
        font-size: 1.02rem;
        font-style: italic;

        line-height: 1.85;
    }


    /* ETUSIVUN LINKIT */

    .etusivu-linkit {
        grid-template-columns: 1fr;

        margin-top: 35px;
        margin-bottom: 35px;

        padding: 0 16px;
    }


    /* HEVOSRYHMÄ */

    .hevosryhma {
        width: 90%;
    }

    .hevoset-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hevonen {
        grid-template-columns:
            115px
            minmax(0, 1fr);
    }

    .hevonen-kuva {
        width: 115px;
        height: 150px;
    }

    .hevonen-tiedot {
        padding: 14px;
    }

    .hevonen-tiedot h3 {
        font-size: 1.15rem;
    }


    /* KASVATUS */

    .kasvatus-container {
        width: 90%;
    }

    .kasvatus-row {
        grid-template-columns: 1fr;
    }

    .kasvatus-full {
        grid-column: auto;
    }

    .kasvatus-box,
    .kasvatit-box {
        padding: 24px 20px;
    }


    /* KASVATIT */

    .kasvatti-taulukko {
        display: block;

        overflow-x: auto;

        -webkit-overflow-scrolling: touch;
    }

    .kasvatti-taulukko table {
        min-width: 700px;
    }


    /* HENKILÖKUNTA */

    .staff-list {
        width: min(100% - 24px, 600px);

        margin-top: 25px;
        margin-bottom: 50px;

        gap: 25px;
    }

    .staff-card {
        display: block;

        border-radius: 14px;
    }

    .staff-card__main-image {
        aspect-ratio: 4 / 5;
    }

    .staff-card__content {
        padding: 28px 22px 32px;
    }

    .staff-card__top {
        margin-bottom: 22px;
    }

    .staff-card__name {
        font-size: 1.8rem;
    }

    .staff-facts {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 16px 12px;

        padding: 20px 0;

        margin-bottom: 24px;
    }

    .staff-section {
        margin-top: 25px;
    }


    /* TALLILLA TAPAHTUU */

    .tapahtumat {
        width: 90%;

        grid-template-columns: 1fr;

        gap: 15px;
    }

    .tapahtuma {
        padding: 20px;
    }


    /* TALLIKIRJA */

    .tallikirja-hero {
        padding: 60px 20px;
    }

    .tallikirja-list {
        padding: 40px 16px 70px;
    }

    .tallikirja-card {
        grid-template-columns: 1fr;

        gap: 20px;

        padding: 24px;
    }

    .tallikirja-card__date {
        padding-right: 0;
        padding-bottom: 15px;

        border-right: 0;
        border-bottom: 1px solid var(--vaalea-tumma);

        text-align: left;
    }

    .tallikirja-card__date span,
    .tallikirja-card__date small {
        display: inline;
    }

    .tallikirja-card__date small {
        margin-left: 6px;
    }

    .tallikirja-story {
        padding: 40px 16px 70px;
    }

    .tallikirja-story__body {
        padding: 30px 24px;

        font-size: 1rem;
    }

}


/* =========================================================
   PIENI PUHELIN
========================================================= */

@media (max-width: 420px) {

    .header-title {
        width: 96%;
    }

    .navbar ul {
        padding: 8px 6px;
    }

    .navbar a {
        padding: 5px 8px;

        font-size: 0.8rem;
    }

    .historia {
        width: 92%;

        padding: 22px 20px;
    }


    /* HEVOSET */

    .hevosryhma {
        width: 92%;
    }

    .hevonen {
        grid-template-columns: 100px 1fr;
    }

    .hevonen-kuva {
        width: 100px;
    }

    .hevonen-tiedot {
        padding: 12px;
    }

    .hevonen-tiedot h3 {
        font-size: 1.05rem;
    }

    .hevonen-tiedot p {
        font-size: 0.82rem;
    }


    /* HENKILÖKUNTA */

    .staff-list {
        width: calc(100% - 16px);
    }

    .staff-card__content {
        padding: 24px 18px 28px;
    }

    .staff-facts {
        grid-template-columns: 1fr;
    }

    .gallery-button {
        flex-basis: 60px;

        width: 60px;
        height: 60px;
    }


    /* TALLIKIRJA */

    .tallikirja-card {
        padding: 20px;
    }

    .tallikirja-card__content h2 {
        font-size: 1.5rem;
    }

    .tallikirja-story__author {
        border-radius: 18px;
    }

}
/* =========================================================
   HEVONEN – YKSITTÄINEN HEVONEN
   Yhtenäinen tyyli muun sivuston kanssa
========================================================= */

.hevonen-page,
.hevonen-sivu {
    width: 100%;
}

.hevonen-header {
    width: min(1100px, 90%);
    margin: 0 auto 35px;
    padding: 35px 30px 25px;
    text-align: center;
}

.hevonen-header__ylateksti {
    margin: 0 0 12px;
    color: var(--kulta-tumma);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hevonen-header h1 {
    margin: 0 0 22px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.3rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
}

.hevonen-header__koriste {
    color: var(--kulta-tumma);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
}

.palkinnot-lista {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.palkinto {
    display: inline-block;
    padding: 5px 10px;
    background: var(--vihrea);
    color: var(--kulta);
    border: 1px solid rgba(150, 117, 45, 0.35);
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.3;
}


/* =========================================================
   HEVONEN – PÄÄKUVA
========================================================= */

.hevonen-kuvaosio {
    width: min(1100px, 90%);
    margin: 0 auto 45px;
}

.hevonen-paakuva {
    position: relative;
    width: min(100%, 1000px);
    margin: 0 auto;
    background: var(--vaalea);
    border: 1px solid rgba(23, 61, 43, 0.12);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(16, 45, 32, 0.08);
}

.paakuva-linkki {
    position: relative;
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

.paakuva-linkki img {
    display: block;
    width: 100%;
    height: auto;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.paakuva-linkki:hover img {
    filter: brightness(0.95);
}

.paakuva-alt {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 18px;
    background: rgba(212, 177, 92, 0.78);
    color: var(--teksti);
    font-size: 0.88rem;
    font-style: italic;
    line-height: 1.4;
    pointer-events: none;
}

.kuva-copyright {
    padding: 8px 14px;
    background: var(--vaalea);
    color: var(--teksti-vaalea);
    font-size: 0.75rem;
    text-align: right;
}

.kuva-copyright a {
    color: var(--kulta-tumma);
}

.kuva-copyright a:hover {
    color: var(--vihrea);
}


/* =========================================================
   HEVONEN – PERUSTIEDOT
========================================================= */

.tietotaulukko {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 190px minmax(0, 1fr);
    width: min(100%, 1100px);
    margin: 0 auto;
    border: 1px solid var(--vaalea-tumma);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 18px rgba(16, 45, 32, 0.06);
}

.tietotaulukko .tieto-label {
    padding: 15px 18px;
    background: var(--vihrea);
    color: var(--kulta);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(212, 177, 92, 0.25);
}

.tietotaulukko .tieto-arvo {
    min-width: 0;
    padding: 15px 18px;
    background: var(--vaalea);
    color: var(--teksti);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--vaalea-tumma);
}

.tietotaulukko .tieto-arvo:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.tietotaulukko a {
    color: var(--vihrea);
    text-decoration: none;
}

.tietotaulukko a:hover {
    color: var(--kulta-tumma);
    text-decoration: underline;
}

.tieto-tunnus {
    display: inline-block;
    margin-top: 2px;
    color: var(--kulta-tumma) !important;
    font-size: 0.8rem;
    font-weight: 400 !important;
}

.hevonen-maa-lippu {
    width: 20px;
    height: 12px;
    margin-left: 3px;
    object-fit: cover;
    vertical-align: middle;
    border-radius: 2px;
}


/* =========================================================
   HEVONEN – KORTIT JA TEKSTIT
========================================================= */

.kortti {
    width: min(1100px, 90%);
    margin: 55px auto 35px;
}

.kortti > h2,
.kortti > .historia-otsikko {
    margin: 0 0 20px;
    padding-bottom: 15px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.25;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(150, 117, 45, 0.35);
}

.historia-kortti,
.korttiluonne,
.sukuselvitys-kortti,
.box,
.competition-block {
    padding: 30px 34px;
    background: var(--vaalea);
    border-top: 1px solid var(--reunus-tumma);
    border-bottom: 1px solid var(--reunus-tumma);
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
}

.paivakirja-merkinta {
    background: var(--vaalea);
    border: 1px solid rgba(23, 61, 43, 0.10);
    border-left: 4px solid var(--kulta);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(16, 45, 32, 0.07);
}

.historia-kortti {
    width: 100%;
    margin: 0 0 25px;
    padding: 28px 32px;
}

.historia-otsikko {
    color: var(--vihrea);
}

.historia-teksti,
.sukuselvitys-teksti {
    color: var(--teksti);
    font-size: 0.98rem;
    line-height: 1.8;
}

.historia-teksti {
    font-style: italic;
}

.historia-teksti p,
.sukuselvitys-teksti p {
    margin: 0 0 1em;
}

.historia-teksti p:last-child,
.sukuselvitys-teksti p:last-child {
    margin-bottom: 0;
}

.korttiluonne {
    margin-bottom: 25px;
    padding: 28px 32px;
}

.teksti {
    margin-bottom: 28px;
}

.teksti:last-child {
    margin-bottom: 0;
}

.teksti h3 {
    position: relative;
    margin: 0 0 12px;
    padding-bottom: 8px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(23, 61, 43, 0.12);
}

.teksti h3::after {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin-top: 8px;
    background: var(--kulta);
}

.teksti-sisalto {
    color: var(--teksti);
    line-height: 1.8;
}

.teksti-sisalto p {
    margin-top: 0;
}


/* =========================================================
   HEVONEN – OSIOEROTIN
========================================================= */

.hevonen-page .osio-erotin,
.sivu .osio-erotin {
    width: min(75%, 900px);
    margin: 50px auto 35px;
}

.hevonen-page .osio-erotin span,
.sivu .osio-erotin span {
    background: rgba(154, 122, 50, 0.3);
}

.hevonen-page .osio-merkit,
.sivu .osio-merkit {
    color: var(--kulta-tumma);
}


/* =========================================================
   HEVONEN – GALLERIA
========================================================= */

.hevonen-galleria {
    width: 100%;
    margin: 45px 0;
    text-align: center;
}

.hevonen-galleria h2 {
    margin: 0 0 20px;
}

.galleria-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;

    width: 100%;
    margin: 0 auto;
}

.galleria-kuva {
    flex: 0 0 220px;

    width: 220px;
    height: 220px;

    padding: 0;
    border: 1px solid rgba(23, 61, 43, 0.10);
    border-radius: 12px;
    overflow: hidden;

    background: var(--vaalea);
    cursor: pointer;

    box-shadow: 0 6px 18px rgba(16, 45, 32, 0.07);
}

.galleria-kuva img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
            transform 0.25s ease,
            filter 0.25s ease;
}

.galleria-kuva:hover img {
    transform: scale(1.04);
    filter: brightness(0.96);
}


/* TABLETTI */

@media (max-width: 750px) {

    .galleria-kuva {
        flex-basis: 200px;
        width: 200px;
        height: 200px;
    }

}


/* PUHELIN */

@media (max-width: 480px) {

    .galleria-kuva {
        flex-basis: 160px;
        width: 160px;
        height: 160px;
    }

}


/* =========================================================
   HEVONEN – LIGHTBOX
========================================================= */

.galleria-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(16, 45, 32, 0.94);
}

.galleria-lightbox.aktiivinen {
    display: flex;
}

.lightbox-sisalto {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightboxKuva {
    display: block;
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-copyright {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    text-align: center;
}

.lightbox-copyright a {
    color: inherit;
    text-decoration: none;
}

.lightbox-copyright a:hover {
    text-decoration: underline;
}

.lightbox-sulje,
.lightbox-edellinen,
.lightbox-seuraava {
    position: fixed;
    z-index: 10000;
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox-sulje:hover,
.lightbox-edellinen:hover,
.lightbox-seuraava:hover {
    opacity: 1;
}

.lightbox-sulje {
    top: 18px;
    right: 28px;
    font-size: 40px;
}

.lightbox-edellinen {
    left: 25px;
    top: 50%;
    font-size: 40px;
}

.lightbox-seuraava {
    right: 25px;
    top: 50%;
    font-size: 40px;
}

/* =========================================================
   HEVONEN – SUKUTAULU
========================================================= */

.sukupuu {
    width: min(1100px, 95%);
    margin: 0 auto;
    overflow-x: auto;
    padding: 2px 0 10px;
}


/* =========================================================
   SUKUTAULUN GRID
========================================================= */

.suku-grid {
    display: grid;
    grid-template-columns:
        minmax(210px, 1fr)
        minmax(210px, 1fr)
        minmax(260px, 1.4fr);

    grid-template-rows: repeat(8, minmax(30px, auto));
    column-gap: 14px;
    row-gap: 10px;
    min-width: 760px;
    align-items: stretch;
}


/* Sukupolvien wrapperit eivät muodosta omia grid-sarakkeita */

.suku-polvi {
    display: contents;
}


/* =========================================================
   HEVOSLAATIKOT
========================================================= */

.suku-hevonen {
    position: relative;
    min-width: 0;
    padding: 2px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;

    background:
            linear-gradient(
                    135deg,
                    rgba(247, 244, 234, 0.98),
                    rgba(238, 232, 216, 0.94)
            );

    border: 1px solid var(--reunus);
    border-left: 4px solid var(--kulta);

    border-radius: 7px;

    box-shadow:
            0 2px 7px rgba(16, 45, 32, 0.08);

    transition:
            border-color 0.2s ease,
            box-shadow 0.2s ease,
            transform 0.2s ease;
}


/* Hieno kultainen korostus yläreunaan */

.suku-hevonen::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;

    height: 1px;

    background: var(--reunus-tumma);

    opacity: 0.55;
}


/* Hover */

.suku-hevonen:hover {
    border-color: var(--reunus-tumma);

    box-shadow:
            0 4px 12px rgba(16, 45, 32, 0.13);

    transform: translateY(-1px);
}


/* =========================================================
   HEVOSEN NIMI
========================================================= */

.suku-hevonen-nimi {
    color: var(--vihrea);

    font-size: 0.92rem;
    line-height: 1.3;
    font-weight: 500;
}

.suku-hevonen-nimi a {
    color: var(--vihrea);

    font-style: normal;
    text-decoration: none;

    transition: color 0.2s ease;
}

.suku-hevonen-nimi a:hover {
    color: var(--kulta-tumma);
    text-decoration: underline;
}


/* =========================================================
   i / e / ii / ie / iii...
========================================================= */

.suku-hevonen-tunnus {
    display: inline-block;

    min-width: 30px;
    margin-right: 4px;

    color: var(--kulta-tumma);

    font-size: 0.8em;
    font-weight: 700;

    letter-spacing: 0.02em;
}


/* =========================================================
   ROTU, VÄRI, SÄKÄ
========================================================= */

.suku-hevonen-tiedot {
    margin-top: 7px;

    color: var(--teksti-vaalea);

    font-size: 0.76rem;
    line-height: 1.4;
}


/* =========================================================
   MERIITIT
========================================================= */

.suku-hevonen-meriitit {
    margin-top: 3px;

    color: var(--kulta-tumma);

    font-size: 0.76rem;
    line-height: 1.4;
    font-weight: 500;
}


/* =========================================================
   SUKUPOLVIEN SIJOITTELU
========================================================= */

/* 1. sukupolvi */

.suku-polvi-1 .suku-hevonen:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 5;
}

.suku-polvi-1 .suku-hevonen:nth-child(2) {
    grid-column: 1;
    grid-row: 5 / 9;
}


/* 2. sukupolvi */

.suku-polvi-2 .suku-hevonen:nth-child(1) {
    grid-column: 2;
    grid-row: 1 / 3;
}

.suku-polvi-2 .suku-hevonen:nth-child(2) {
    grid-column: 2;
    grid-row: 3 / 5;
}

.suku-polvi-2 .suku-hevonen:nth-child(3) {
    grid-column: 2;
    grid-row: 5 / 7;
}

.suku-polvi-2 .suku-hevonen:nth-child(4) {
    grid-column: 2;
    grid-row: 7 / 9;
}


/* 3. sukupolvi */

.suku-polvi-3 .suku-hevonen:nth-child(1) {
    grid-column: 3;
    grid-row: 1;
}

.suku-polvi-3 .suku-hevonen:nth-child(2) {
    grid-column: 3;
    grid-row: 2;
}

.suku-polvi-3 .suku-hevonen:nth-child(3) {
    grid-column: 3;
    grid-row: 3;
}

.suku-polvi-3 .suku-hevonen:nth-child(4) {
    grid-column: 3;
    grid-row: 4;
}

.suku-polvi-3 .suku-hevonen:nth-child(5) {
    grid-column: 3;
    grid-row: 5;
}

.suku-polvi-3 .suku-hevonen:nth-child(6) {
    grid-column: 3;
    grid-row: 6;
}

.suku-polvi-3 .suku-hevonen:nth-child(7) {
    grid-column: 3;
    grid-row: 7;
}

.suku-polvi-3 .suku-hevonen:nth-child(8) {
    grid-column: 3;
    grid-row: 8;
}

/* =========================================================
   HEVONEN – SUKUSELVITYS
========================================================= */

.sukuselvitys-kortti {
    padding: 28px 32px;
}

.sukuselvitys-kortti h2 {
    margin-bottom: 15px;
    color: var(--vihrea);
}
.sukuselvitys-loput {
    display: none;
}

.sukuselvitys-loput.nakyvissa {
    display: block;
    padding-top: 10px;
}

/* Nappi keskelle */
.sukuselvitys-nappi {
    display: block;
    margin: 24px auto 0;
    padding: 10px 22px;

    background-color: var(--vaalea);
    color: var(--vihrea);

    border: 1px solid var(--kulta);
    border-radius: 4px;

    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;

    cursor: pointer;

    transition:
            background-color 0.2s ease,
            color 0.2s ease,
            border-color 0.2s ease,
            box-shadow 0.2s ease;
}

.sukuselvitys-nappi:hover {
    background-color: var(--vaalea-tumma);
    color: var(--vihrea-tumma);
    border-color: var(--kulta-tumma);

    box-shadow: 0 2px 6px rgba(16, 45, 32, 0.12);
}

.sukuselvitys-nappi:active {
    box-shadow: none;
}

.sukuselvitys-nappi:focus-visible {
    outline: 2px solid var(--kulta);
    outline-offset: 3px;
}



/* =========================================================
   HEVONEN – JÄLKELÄISET / JALOSTUS
========================================================= */

.laatikko {
    width: min(1100px, 90%);
    margin: 45px auto;
}

.boxes-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.box {
    flex: 1 1 45%;
    max-width: 550px;
}

.box h3 {
    margin: 0 0 22px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.25;
    text-align: center;
}

.box h3::after {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin: 12px auto 0;
    background: var(--kulta);
}

.jalostus-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    text-align: center;
}

.jalostus-list li {
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.varsa {
    line-height: 1.8;
}

.varsa-numero {
    margin-right: 4px;
    color: var(--kulta-tumma);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.varsa-tyyppi {
    font-weight: 400;
    opacity: 0.65;
}


/* =========================================================
   HEVONEN – KILPAILUT
========================================================= */

.competition-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.competition-block {
    flex: 1 1 45%;
    max-width: 550px;
    text-align: center;
}

.competition-block h3 {
    margin: 0 0 22px;
    color: var(--vihrea);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.25;
    text-align: center;
}

.competition-block h3::after {
    content: "";
    display: block;
    width: 42px;
    height: 2px;
    margin: 12px auto 0;
    background: var(--kulta);
}

.competition-list {
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: center;
}

.competition-list li {
    margin-bottom: 5px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--vaalea-tumma);
    font-size: 0.92rem;
}

.competition-list li:last-child {
    border-bottom: 0;
}

.competition-list strong {
    color: var(--vihrea);
}

.competition-list .sija {
    margin-left: 4px;
    color: var(--kulta-tumma);
    font-weight: 700;
}

.competition-list .prosentit {
    margin-left: 4px;
    color: var(--teksti-vaalea);
    font-style: italic;
}

.level-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 15px;
}

.circle {
    --size: 80px;
    --progress: 75;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--size);
    height: var(--size);
    flex: 0 0 var(--size);
    border-radius: 50%;
    background: conic-gradient(
            var(--vihrea) calc(var(--progress) * 1%),
            var(--vaalea-tumma) 0
    );
}

.circle::after {
    content: "";
    position: absolute;
    width: calc(var(--size) - 16px);
    height: calc(var(--size) - 16px);
    background: var(--vaalea);
    border-radius: 50%;
}

.level-number {
    position: relative;
    z-index: 2;
    color: var(--vihrea-tumma);
    font-size: 1.35rem;
    font-weight: 700;
}

.level-text {
    max-width: 220px;
    color: var(--teksti-vaalea);
    font-size: 0.88rem;
    line-height: 1.4;
}

.ominaisuudet {
    margin-top: 1rem;
}

.ominaisuudet h4 {
    margin: 0 0 7px;
    color: var(--vihrea);
    font-size: 1rem;
    font-weight: 700;
}

.ominaisuudet ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ominaisuudet li {
    margin: 2px 0;
    padding: 3px 0;
    border-bottom: 1px solid var(--vaalea-tumma);
    font-size: 0.9rem;
}


/* =========================================================
   HEVONEN – PÄIVÄKIRJA
========================================================= */

.paivakirja-osio {
    width: min(1100px, 90%);
    margin: 45px auto;
}

.paivakirja-osio > h2 {
    margin-bottom: 25px;
}

.paivakirja-lista {
    display: grid;
    gap: 20px;
}

.paivakirja-merkinta {
    margin: 0;
    padding: 25px 28px;
}

.paivakirja-paivamaara {
    margin-bottom: 7px;
    color: var(--vihrea);
    font-size: 1.35rem;
    font-weight: 600;
}

.paivakirja-otsikko {
    margin-bottom: 20px;
    color: var(--teksti);
    font-size: 1rem;
}

.paivakirja-erotin {
    margin: 0 6px;
    color: var(--kulta-tumma);
}

.paivakirja-tyyppi,
.paivakirja-kirjoittaja {
    color: var(--teksti-vaalea);
    font-style: italic;
}

.paivakirja-teksti {
    padding-top: 17px;
    border-top: 1px solid rgba(23, 61, 43, 0.12);
    color: var(--teksti);
    line-height: 1.8;
}


/* =========================================================
   HEVONEN – ALATUNNISTE
========================================================= */

.hevonen-page .site-footer,
.sivu .site-footer {
    margin-top: 55px;
    padding: 22px 20px;
    border-top: 1px solid rgba(150, 117, 45, 0.45);
    color: var(--teksti-vaalea);
    text-align: center;
}


/* =========================================================
   HEVONEN – RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .tietotaulukko {
        grid-template-columns: 165px minmax(0, 1fr) 165px minmax(0, 1fr);
    }


    .suku-grid {
        min-width: 620px;
    }

}

@media (max-width: 750px) {

    .boxes-wrapper,
    .competition-wrapper {
        gap: 0;
    }

    .box,
    .competition-block {
        flex-basis: 100%;
        max-width: none;
        padding: 24px 20px;
    }

    .hevonen-header {
        width: 92%;
        padding: 28px 18px 20px;
    }

    .hevonen-kuvaosio,
    .hevonen-galleria,
    .sukupuu,
    .laatikko,
    .paivakirja-osio,
    .kortti {
        width: 92%;
    }

    .tietotaulukko {
        grid-template-columns: 125px minmax(0, 1fr);
    }

    .tietotaulukko .tieto-label,
    .tietotaulukko .tieto-arvo {
        padding: 13px 12px;
    }


    .competition-block,
    .box {
        flex-basis: 100%;
        max-width: none;
    }

    .suku-grid {
        min-width: 560px;
        grid-template-columns: repeat(3, minmax(170px, 1fr));
    }

    .lightbox-edellinen {
        left: 10px;
    }

    .lightbox-seuraava {
        right: 10px;
    }

}

@media (max-width: 520px) {

    .hevonen-header h1 {
        font-size: clamp(2rem, 10vw, 2.7rem);
    }

    .hevonen-paakuva {
        border-radius: 12px;
    }

    .paakuva-alt {
        position: static;
        padding: 10px 12px;
        background: var(--vaalea);
        color: var(--teksti-vaalea);
        font-size: 0.8rem;
    }

    .tietotaulukko {
        grid-template-columns: 105px minmax(0, 1fr);
    }

    .tietotaulukko .tieto-label {
        font-size: 0.74rem;
    }

    .tietotaulukko .tieto-arvo {
        font-size: 0.88rem;
    }

    .historia-kortti,
    .korttiluonne,
    .sukuselvitys-kortti,
    .box,
    .competition-block,
    .paivakirja-merkinta {
        padding: 24px 20px;
    }

    .galleria-grid {
        gap: 9px;
    }

    .suku-grid {
        min-width: 500px;
        gap: 8px;
    }

    .suku-hevonen {
        padding: 8px 9px;
    }

    .suku-hevonen-nimi {
        font-size: 0.84rem;
    }

    .level-indicator {
        flex-direction: column;
    }

    .lightbox-sulje {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }

    .lightbox-edellinen,
    .lightbox-seuraava {
        font-size: 30px;
    }

    #lightboxKuva {
        max-width: 90vw;
        max-height: 75vh;
    }

}
