/* =========================
   ESCORANT STABLE v2
   ========================= */

body {
    margin: 0;
    background: #b4beb0 url(bagge.png);
    background-size: cover;
    background-attachment: fixed;
    font: 15px 'Assistant', sans-serif;
    line-height: 1.8;
    color: #3f3f3f;
}

a {
    color: #7a3f33;
    text-decoration: none;
}

a:hover {
    color: #a86a5a;
    text-decoration: underline;
}

/* ===== HEADER ===== */

#header {
    text-align: center;
    padding: 28px 0;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border-bottom: 2px solid rgba(168,106,90,0.35);
    font: 400 38px 'Zilla Slab';
    letter-spacing: 6px;
    color: #6b3d32;
}

#header::after {
    content: "";
    display: block;
    width: 140px;
    height: 2px;
    background: #a86a5a;
    margin: 10px auto 0 auto;
    opacity: 0.6;
}

.navi-circle {
    display: inline-block;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px solid rgba(107,61,50,0.3);
    margin-right: 20px;
}

.navi-header {
    font: 400 60px 'Zilla Slab';
    opacity: .25;
    color: #6b3d32;
}

/* ===== LAYOUT ===== */

#wrapper {
    width: 1200px;
    align-items: flex-start;
    margin: 30px auto;
    display: flex;
    gap: 25px;
}

/* SIDEBAR */

#sidebar {
    width: 290px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(0,0,0,0.08);
}

#sidebar img {
    width: 100%;
}

/* NAV LINKS */

#sidebar a {
    display: block;
    width: 85%;
    margin: 8px auto;
    padding: 10px;
    text-align: center;
    background: #a06f60;
    color: white;
    text-decoration: none;
    font: 13px 'Zilla Slab';
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

#sidebar a:hover {
    background: #a97a6e;
}

#sidebar a.icon {
    background: transparent;
    color: #6b3d32;
    font-size: 18px;
}

.hero {
    margin: -40px -65px 35px -65px;
}

.hero img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}

/* ===== MAIN ===== */

#main {
    flex: 1;
    max-width: 860px;
    min-width: 0;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.08);
    padding: 55px 80px;
}

/* ===== TYPOGRAFIA ===== */

h1 {
    font: 300 34px 'Zilla Slab';
    color: #7a3f33;
    text-align: center;
    letter-spacing: 1px;
}

h2 {
    font: 400 22px 'Zilla Slab';
    color: #6b3d32;
    border-bottom: 2px solid rgba(168,106,90,0.35);
    padding-bottom: 6px;
}

p {
    margin-bottom: 18px;
    text-align: justify;
    hyphens: auto;
}

/* ===== HIGHLIGHT ===== */

.highlight {
    background: rgba(168,106,90,0.10);
    border-left: 5px solid #a86a5a;
    padding: 15px 18px;
    margin: 20px 0;
}

/* ===== NEWS ===== */

.news article {
    padding: 12px 0;
    border-bottom: 1px dotted rgba(0,0,0,0.15);
}

.date {
    display: block;
    font-size: 12px;
    color: #8a6a5f;
}

/* =========================
   ESTATE PAGE
   ========================= */

.estate-hero {
    margin: 0 0 35px 0;
}

.estate-hero img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(0,0,0,0.08);
}

.lead {
    font-size: 18px;
    line-height: 2;
    text-align: center;
    color: #6b3d32;
    margin-bottom: 40px;
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 40px 0;
}

.fact {
    text-align: center;
    padding: 25px 15px;
    background: rgba(168,106,90,0.08);
    border-top: 3px solid #a86a5a;
}

.fact span {
    display: block;
    font: 400 34px 'Zilla Slab';
    color: #7a3f33;
}

.estate-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 40px 0;
}

.estate-gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.facility-table {
    margin-top: 50px;
}

.facility-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.6);
}

.facility-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.facility-table td:first-child {
    font-weight: 600;
    color: #6b3d32;
}

/* ===========================
   ESCORANT HORSE LIST
   =========================== */

.horse-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
    row-gap: 0;
    margin: 20px 0 35px;
}

/* HEVOSKORTTI */

.horse-card {
    min-width: 0;
    border-bottom: 1px solid rgba(122, 63, 51, 0.16);
}

.horse-card a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 112px;
    padding: 12px 0;
    color: inherit;
    text-decoration: none;
}

/* HEVOSKUVAN KEHYS */

.horse-card img {
    display: block;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    object-fit: cover;
    padding: 4px;
    background: #f8f5f0;
    border: 1px solid #c9b8aa;
    outline: 1px solid rgba(122, 63, 51, 0.12);
    outline-offset: 2px;
    box-shadow: 0 3px 8px rgba(65, 45, 35, 0.10);
    transition: all 0.25s ease;
}

/* HOVER */

.horse-card a:hover img {
    border-color: #a86a5a;
    box-shadow: 0 4px 12px rgba(65, 45, 35, 0.18);
    opacity: 1;
}


/* TEKSTIT */

.horse-info {
    flex: 1;
    min-width: 0;
    padding: 3px 0;
}

.horse-name {
    font-family: 'Zilla Slab', serif;
    font-size: 17px;
    line-height: 1.3;
    color: #7a3f33;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

.horse-generation {
    font-size: 11px;
    line-height: 1.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 4px;
}

.horse-merits {
    font-size: 12px;
    line-height: 1.5;
    color: #666;
    overflow-wrap: anywhere;
}

/* HOVER */

.horse-card a:hover .horse-name {
    color: #a86a5a;
}

.horse-card a:hover img {
    opacity: 0.85;
    transition: opacity 0.25s ease;
}

/* TYHJÄT MERIITIT */

.horse-merits:empty::before {
    content: "Ei saavutuksia";
    color: #999;
    font-style: italic;
}

/* OTSIKOT */

#main h2 {
    margin-top: 35px;
    margin-bottom: 12px;
}

/* HEVOSLISTAN MOBIILI */

@media (max-width: 700px) {
    .horse-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .horse-card img {
        width: 130px;
        height: 90px;
    }

    .horse-name {
        font-size: 18px;
    }
}

/* ===== FOOTER ===== */

#footer {
    text-align: center;
    padding: 35px 20px;
    font-size: 12px;
    line-height: 2;
    color: #6f6f6f;
    background: rgba(255,255,255,0.45);
    border-top: 1px solid rgba(168,106,90,0.25);
    margin-top: 40px;
    letter-spacing: 0.5px;
}

/* =========================
   BREEDING PAGE
   ========================= */

/* ===== BREEDING PAGE ===== */

.kasvatus-info {
    margin: 0 0 30px;
    color: #666;
    line-height: 1.8;
}

.vuosi {
    margin: 40px 0 15px;
    padding: 10px 18px;
    background: #a06f60;
    color: #fff;
    font-family: 'Zilla Slab', serif;
    font-size: 20px;
    letter-spacing: 1px;
}

.kasvatit {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    margin: 0 0 35px;
    font-size: 15px;
}

.kasvatit .kasvatti td {
    padding: 12px 8px 4px;
    border: 0;
    vertical-align: middle;
}

.kasvatit .kasvatti-tyyppi {
    width: 65px;
    white-space: nowrap;
    color: #9a756b;
    font-size: 13px;
}

.kasvatit .kasvatti-nimi {
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.kasvatit .kasvatti-palkinnot {
    color: #9a756b;
    font-size: 12px;
    white-space: nowrap;
}

.kasvatit .kasvatti-syntynyt {
    width: 115px;
    white-space: nowrap;
    color: #777;
    font-size: 14px;
}

.kasvatit .kasvatti-omistaja {
    width: 115px;
    white-space: nowrap;
    color: #777;
    font-size: 14px;
}

.kasvatit .kasvatti-lisatiedot td {
    padding: 0 8px 12px 73px;
    border-bottom: 1px solid rgba(122,63,51,.16);
    color: #99958e;
    font-size: 10px;
    line-height: 1.5;
}

.kasvatit tbody tr:hover {
    background: rgba(168,106,90,.045);
}

.kasvatit a {
    color: #7a3f33;
    text-decoration: none;
    font-weight: 600;
}

.kasvatit a:hover {
    color: #a86a5a;
}

@media (max-width: 600px) {
    .kasvatit {
        font-size: 13px;
    }

    .kasvatit .kasvatti td {
        padding-left: 4px;
        padding-right: 4px;
    }

    .kasvatit .kasvatti-tyyppi {
        width: 48px;
        font-size: 11px;
    }

    .kasvatit .kasvatti-nimi {
        font-size: 15px;
    }

    .kasvatit .kasvatti-palkinnot {
        font-size: 10px;
        white-space: normal;
    }

    .kasvatit .kasvatti-syntynyt {
        width: 88px;
        font-size: 12px;
    }

    .kasvatit .kasvatti-omistaja {
        width: 90px;
        font-size: 12px;
    }

    .kasvatit .kasvatti-lisatiedot td {
        padding-left: 52px;
        padding-right: 4px;
        font-size: 9px;
    }
}

/* =========================
   IMAGE CAROUSEL
   ========================= */

.carousel {
    margin: 40px 0;
}

.carousel-main {
    position: relative;
}

.carousel-main img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(0,0,0,0.08);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255,255,255,0.95);
    color: #6b3d32;
    font-size: 24px;
    cursor: pointer;
    transition: 0.25s;
}

.prev {
    left: 15px;
}

.next {
    right: 15px;
}

.carousel-thumbs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.thumb {
    width: 110px;
    height: 75px;
    object-fit: cover;
    cursor: pointer;
    opacity: 1;
    border: 2px solid transparent;
    transition: 0.25s ease;
}

.thumb.active {
    opacity: 1;
    border-color: #a86a5a;
}

/* =========================
   HORSE PAGE v3
   ========================= */

.horse-nav {
    width: 1100px;
    margin: 25px auto;
    text-align: center;
}

.horse-nav a {
    display: inline-block;
    margin: 0 4px;
    padding: 10px 16px;
    background: #a06f60;
    color: #fff;
    font: 13px 'Zilla Slab';
    text-transform: uppercase;
    transition: .25s;
}

.horse-nav a:hover {
    background: #a97a6e;
}

.horse-wrapper {
    width: 1100px;
    margin: 0 auto 40px auto;
}

.horse-main {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(0,0,0,.08);
    padding: 60px;
}

/* ===== HORSE PROFILE ===== */

.horse-profile {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 45px;
    align-items: start;
    margin-bottom: 60px;
}

/* KUVA */

.horse-slider {
    position: relative;
    width: 480px;
    padding: 12px;
    background: rgba(255,255,255,.75);
    border: 1px solid rgba(168,106,90,.15);
    box-shadow: 0 15px 35px rgba(0,0,0,.08);
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(255,255,255,.8);
    color: #6b3d32;
    font-size: 20px;
    cursor: pointer;
    z-index: 5;
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.horse-slider #horseMain {
    width: 100%;
    height: 320px;
    object-fit: contain;
    background: #f6f3f0;
    display: block;
    border: 1px solid rgba(0,0,0,.08);
}

.horse-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.horse-thumbs img {
    width: 90px;
    height: 65px;
    object-fit: cover;
    cursor: pointer;
    opacity: .65;
    transition: .25s;
}

.horse-thumbs img:hover {
    opacity: 1;
}

#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 9999;
}

#lightbox img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 40px rgba(0,0,0,.5);
}

#lightbox span {
    position: absolute;
    top: 25px;
    right: 35px;
    font-size: 48px;
    color: white;
    cursor: pointer;
}

/* TEKSTIT */

.horse-info {
    padding-top: 15px;
}

.horse-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a86a5a;
    margin-bottom: 10px;
}

.horse-info h1 {
    margin: 0;
    text-align: left;
    font: 300 46px 'Zilla Slab';
    color: #6b3d32;
}

.horse-pedigree {
    margin: 10px 0 20px;
    font: 400 24px 'Zilla Slab';
    color: #8a5c50;
}

.horse-titles {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    font: 400 18px 'Zilla Slab';
    color: #7a3f33;
}

.horse-facts {
    font-size: 15px;
    line-height: 2;
}

/* ===== TABS ===== */

.horse-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.tab {
    background: transparent;
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    font: 15px 'Zilla Slab';
    color: #6b3d32;
    transition: .25s;
}

.tab:hover {
    color: #a86a5a;
}

.tab.active {
    border-bottom: 3px solid #a86a5a;
}

/* ===== CONTENT ===== */

.tabcontent {
    display: none;
    animation: fade .25s ease;
}

.tabcontent.active {
    display: block;
}

@keyframes fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== PEDIGREE ===== */

.pedigree {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.pedigree td {
    position: relative;
    padding: 14px 18px;
    vertical-align: middle;
}

/* ISÄ / EMÄ */

.parent {
    width: 170px;
    font-family: 'Zilla Slab', serif;
    font-size: 22px;
    color: #7a3f33;
    white-space: nowrap;
}

.parent a {
    color: #7a3f33;
    text-decoration: none;
}

/* KESKIMMÄINEN SUKUPOLVI */

.horse {
    width: 280px;
    padding-left: 65px;
}

.horse::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 32px;
    border-top: 1px solid #d9cdc6;
}

.horse::before {
    content: "";
    position: absolute;
    left: 40px;
    top: 0;
    height: 100%;
    border-left: 1px solid #d9cdc6;
}

/* VAAKAVIIVA */

.horse {
    background-image: linear-gradient(#d9cdc6,#d9cdc6);
    background-size: 25px 1px;
    background-repeat: no-repeat;
    background-position: 40px 50%;
}

/* OIKEA SARake */

.pedigree td:last-child {
    padding-left: 28px;
    border-bottom: 1px solid #ece6df;
}

/* EMÄN JA ISÄN VÄLI */

.divider td {
    padding: 12px 0;
    border: none;
}

/* EVM */

.evm {
    margin-left: 6px;
    font-size: 10px;
    text-transform: uppercase;
    color: #b7b7b7;
    letter-spacing: 1px;
}

/* ===== RESULTS ===== */

.result-row {
    display: grid;
    grid-template-columns: 120px 120px 1fr;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

/* ===== OFFSPRING ===== */

.foal-row {
    padding: 15px 0;
    border-bottom: 1px solid rgba(168,106,90,.15);
}

.foal-name {
    font: 400 18px 'Zilla Slab';
    color: #7a3f33;
}

.foal-info {
    font-size: 14px;
    color: #666;
}

/* ===== GALLERY ===== */

.horse-gallery {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 15px;
}

.horse-gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1000px) {

    .horse-wrapper,
    .horse-nav {
        width: 95%;
    }

    .horse-main {
        padding: 35px;
    }

    .horse-hero {
        grid-template-columns: 1fr;
    }

    .horse-photo img {
        height: 320px;
    }

    .horse-details {
        grid-template-columns: 1fr;
    }

    .horse-gallery {
        grid-template-columns: 1fr;
    }

    #wrapper {
        width: 95%;
        flex-direction: column;
    }

    #sidebar {
        width: 100%;
    }

    #main {
        max-width: none;
        padding: 35px;
    }

    #header {
        font-size: 26px;
        letter-spacing: 3px;
    }

    .carousel-main img {
        height: 280px;
    }

    .thumb {
        width: 70px;
        height: 50px;
    }

    .facts {
        grid-template-columns: repeat(2, 1fr);
    }

    .estate-gallery {
        grid-template-columns: 1fr;
    }
}

/* KASVATTILISTAN MOBIILINÄKYMÄ */

@media (max-width: 600px) {

    .kasvatit {
        font-size: 12px;
    }

    .kasvatit .kasvatti td {
        padding: 8px 4px 2px;
    }

    .kasvatit .kasvatti-tyyppi {
        width: 48px;
        font-size: 10px;
    }

    .kasvatit .kasvatti-nimi {
        font-size: 13px;
    }

    .kasvatit .kasvatti-syntynyt {
        width: auto;
        font-size: 10px;
        white-space: nowrap;
    }

    .kasvatit .kasvatti-omistaja {
        width: auto;
        font-size: 10px;
        white-space: nowrap;
    }

    .kasvatit .kasvatti-lisatiedot td {
        padding: 0 4px 9px 56px;
        font-size: 10px;
    }

    .kasvatit .kasvatti-lisatiedot .palkinnot {
        margin-left: 5px;
        font-size: 9px;
    }

    .vuosi {
        font-size: 18px;
    }

    #main {
        padding: 25px 18px;
    }
}