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

body {
    margin: 0;

    background: #b4beb0 url(https://www.sudenmarja.org/escorant/bagge.png);
    background-size: cover;
    background-attachment: fixed;

    font: 15px 'Assistant', sans-serif;
    line-height: 1.8;

    color: #3f3f3f;
}

a {
    color: #7a3f33; /* Escorant ruskea */
    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;   /* 👈 LEVEYS TÄSSÄ */
    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 (LEVEMPI SISÄLTÖALUE) ===== */

#main {
    flex: 1;

    max-width: 860px;   /* 👈 TÄRKEÄ LEVEYSKONTROLLI */

    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;
}

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

/* =========================
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;
}

@media (max-width: 800px) {


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

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


}


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

.horse-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
    gap:18px;
    margin:25px 0;
}

.horse-card{
    display:flex;
    align-items:center;
    background:#faf8f6;
    border:1px solid #d7cdc7;
    overflow:hidden;
}

.horse-card a{
    display:flex;
    width:100%;
    text-decoration:none;
    color:inherit;
}

.horse-card img{
    width:150px;
    height:105px;
    object-fit:cover;
    flex-shrink:0;
    border-right:1px solid #ddd;
}

.horse-info{
    padding:12px 15px;
    flex:1;
}

.horse-name{
    font-family:'Zilla Slab',serif;
    font-size:18px;
    color:#7a3f33;
    margin-bottom:8px;
    line-height:1.2;
}

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

.horse-merits{
    font-size:13px;
    color:#555;
    line-height:1.5;
}

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

@media (max-width:700px){

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

.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 ===== */

/* Kasvattilista */

.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:'Playfair Display',serif;
    font-size:20px;
    letter-spacing:1px;
}

.kasvatit{
    width:100%;
    border-collapse:collapse;
    margin-bottom:35px;
    font-size:14px;
}

.kasvatit thead th{
    padding:12px 15px;
    background:#ece6df;
    color:#7a3f33;
    text-align:left;
    font-weight:600;
    border-bottom:2px solid #d7c7bd;
}

.kasvatit td{
    padding:12px 15px;
    border-bottom:1px solid #e7ddd7;
    vertical-align:middle;
}

.kasvatit tr{
    transition:.25s;
}

.kasvatit tbody tr:hover{
    background:#f8f5f2;
}

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

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

.kasvatit td:nth-child(2){
    width:120px;
}

.kasvatit td:nth-child(4){
    width:140px;
}

.kasvatit td:last-child{
    width:140px;
}

/* =========================
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.75);

color: #6b3d32;

font-size: 24px;

cursor: pointer;

transition: 0.25s;

}

.carousel-btn {
background: rgba(255,255,255,0.95);
}

.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: 0.55;

border: 2px solid transparent;

transition: 0.25s ease;

}

.thumb {
opacity: 1;
}

.thumb.active {
opacity: 1;

border-color: #a86a5a;

}

@media (max-width: 800px) {

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

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

}



/* =========================
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 */

/* Ulompi kehys */
.horse-slider {
    position: relative;
    display: table;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    box-sizing: border-box;

    background: rgba(255,255,255,.85);
    border: 1px solid rgba(168,106,90,.15);
    box-shadow: 0 15px 35px rgba(0,0,0,.08);
}

/* Sisempi, tarkoituksellinen kerros */
.horse-slider > .horse-slider {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Hevoskuva */
.horse-slider #horseMain {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 320px;

    object-fit: contain;
    background: transparent;
    border: 1px solid 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-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;
}

.horse-slider.single-image {
    position: relative;
}

.horse-slider.single-image .slide-btn {
    display: none;
}

#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 35px '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: 1.8;
}

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

/* =========================
HEVOSEN VÄLILEHDET
========================= */

.horse-tabs{

    display:flex;

    width:100%;

    margin:45px 0 35px;

    background:#a06f60;

    border:1px solid #956556;

}

.tab{

    flex:1;

    padding:14px 10px;

    background:transparent;

    border:none;

    border-right:1px solid rgba(255,255,255,.18);

    color:#f6f2ef;

    font:400 15px 'Zilla Slab';

    text-transform:uppercase;

    letter-spacing:1px;

    cursor:pointer;

    transition:.25s;

}

.tab:last-child{

    border-right:none;

}

.tab:hover{

    background:rgba(255,255,255,.08);

}

.tab.active{

    background:#fff;

    color:#7a3f33;

    border-top:3px solid #7a3f33;

    margin-top:-1px;

}

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

.tabcontent {

    display: none;

    animation: fade .25s ease;
}

.tabcontent.active {

    display: block;
}

@keyframes fade {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

.pedigree{

    width:100%;
    border-collapse:collapse;
    margin-top:25px;

    font-size:14px;

}

.pedigree td{

    padding:12px 18px;

    border-bottom:1px solid #e7ddd7;

    vertical-align:middle;

}

/* Isä / Emä */

.pedigree .parent{

    width:250px;

    font-family:'Zilla Slab',serif;

    font-size:17px;

    font-weight:400;

    line-height:1.5;

}


/* Muut sukupolvet */

.pedigree td:not(.parent){

    color:#555;

}

/* EVM */

.evm{

    margin-left:6px;

    font-size:10px;

    text-transform:uppercase;

    letter-spacing:1px;

    color:#aaa;

}


/* =========================
   SAAVUTUKSET
========================= */

/* Sukutaulun palkinnot */

.pedigree-awards {
    display: block;
    margin-top: 8px;
    font-family: 'Assistant', sans-serif;
    font-size: 11px;
    line-height: 1.5;
    color: #89695e;
    overflow-wrap: anywhere;
}

.pedigree-awards span + span::before {
    content: " · ";
    color: #b7a197;
}


/* =========================
ARVONIMET
========================= */

.awards{

    display:flex;
    flex-wrap:wrap;
    gap:18px;

    margin:25px 0 35px;

    justify-content:flex-start;

}

.award{

    width:180px;

    padding:18px;

    box-sizing:border-box;

    background:#faf8f6;

    border:1px solid #e6ddd7;

    border-top:3px solid #a06f60;

}

.award-title{

    font:400 22px 'Zilla Slab';

    color:#7a3f33;

    margin-bottom:12px;

}

.award-info{

    font-size:13px;

    color:#777;

    line-height:1.5;

    min-height:38px;

}

.award-date{

    margin-top:14px;

    padding-top:10px;

    border-top:1px solid #ece6df;

    font-size:12px;

    letter-spacing:1px;

    color:#999;

}

.results-box{

max-height:420px;

overflow-y:auto;

padding:18px;

background:#faf8f6;

border:1px solid #e3d9d3;

line-height:1.9;

margin-bottom:40px;

}

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

.foals{

width:100%;

border-collapse:collapse;

}

.foals th{

background:#a06f60;
color:#fff;
padding:12px;

text-align:left;
}

.foals td{

padding:12px;

border-bottom:1px solid #ece6df;

}

.foals tr:hover{

background:#faf8f6;

}

/* ===== 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;
}


/* ==========================================
   ESCORANT – MOBIILIKORJAUKSET
   ========================================== */

/* Yleiset mitoitukset */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* ==========================================
   TABLETTI JA PIENEMPI TIETOKONE
   ========================================== */

@media (max-width: 1100px) {

    .horse-wrapper {
        width: 94%;
    }

    .horse-nav {
        width: 94%;
    }

    .horse-main {
        padding: 35px;
    }

    .horse-profile {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
        gap: 30px;
    }

    .horse-slider {
        width: 100%;
    }

    .horse-slider #horseMain {
        max-width: 100%;
        max-height: 300px;
    }

    .horse-tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1 1 20%;
        min-width: 110px;
    }

    .pedigree {
        font-size: 13px;
    }

    .pedigree td {
        padding: 10px;
        overflow-wrap: anywhere;
    }

}

/* ==========================================
   MOBIILI
   ========================================== */

@media (max-width: 700px) {

    /* TAUSTA */

    body {
        background-attachment: scroll;
        font-size: 14px;
        line-height: 1.7;
    }

    /* OTSIKKO */

    #header {
        padding: 22px 12px;
        font-size: 25px;
        letter-spacing: 2px;
        line-height: 1.3;
    }

    #header::after {
        width: 90px;
        margin-top: 12px;
    }

    .navi-circle {
        display: block;
        width: 48px;
        height: 48px;
        margin: 0 auto 10px;
    }

    .navi-header {
        font-size: 36px;
        line-height: 48px;
    }

    .header-inner {
        display: block;
        text-align: center;
    }

    /* NAVIGAATIO */

    .horse-nav {
        width: 94%;
        margin: 15px auto 20px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .horse-nav a {
        display: block;
        width: 100%;
        margin: 0;
        padding: 11px 5px;
        font-size: 12px;
        letter-spacing: .5px;
        text-align: center;
    }

    .horse-nav a:last-child {
        grid-column: 1 / -1;
    }

    /* PÄÄSISÄLTÖ */

    .horse-wrapper {
        width: 94%;
        margin: 0 auto 25px;
    }

    .horse-main {
        width: 100%;
        padding: 20px 15px;
    }

    /* HEVOSPROFIILI */

    .horse-profile {
        display: flex;
        flex-direction: column;
        gap: 25px;
        margin-bottom: 35px;
    }

    .horse-slider {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        padding: 9px;
    }

    .horse-slider #horseMain {
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: 340px;
        object-fit: contain;
    }

    .slide-btn {
        width: 36px;
        height: 40px;
        font-size: 17px;
        background: rgba(255,255,255,.88);
    }

    .prev {
        left: 8px;
    }

    .next {
        right: 8px;
    }

    /* HEVOSEN TIEDOT */

    .horse-info {
        width: 100%;
        padding: 0 5px;
        text-align: center;
    }

    .horse-info h1 {
        font-size: 30px;
        text-align: center;
    }

    .horse-type {
        font-size: 10px;
    }

    .horse-titles {
        margin-bottom: 15px;
        padding-bottom: 12px;
        font-size: 17px;
    }

    .horse-facts {
        font-size: 14px;
        overflow-wrap: anywhere;
    }

    /* VÄLILEHDET */

    .horse-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        margin: 30px 0 25px;
    }

    .tab {
        min-width: 0;
        width: 100%;
        padding: 13px 5px;
        font-size: 12px;
        letter-spacing: .4px;
        border-bottom: 1px solid rgba(255,255,255,.18);
    }

    .tab:last-child {
        grid-column: 1 / -1;
    }

    .tab.active {
        margin-top: 0;
        border-top: 3px solid #7a3f33;
    }

    /* OTSIKOT */

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 20px;
        line-height: 1.4;
    }

    /* SUKUTAULU */

    #suku {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pedigree {
        width: 100%;
        min-width: 480px;
        font-size: 12px;
        table-layout: fixed;
    }

    .pedigree td {
        padding: 9px 7px;
        overflow-wrap: anywhere;
        line-height: 1.5;
    }

    .pedigree .parent {
        font-size: 13px;
    }

    .evm {
        display: inline-block;
        margin-left: 2px;
        font-size: 9px;
    }

    .pedigree-awards {
        font-size: 10px;
    }

    /* JÄLKELÄISET */

    #jalkelaiset {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .foals {
        min-width: 650px;
        font-size: 12px;
    }

    .foals th,
    .foals td {
        padding: 10px 8px;
    }

    /* ARVONIMET */

    .awards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .award {
        width: 100%;
        padding: 13px;
    }

    .award-title {
        font-size: 19px;
    }

    .award-date {
        font-size: 10px;
        letter-spacing: .3px;
    }

    /* KILPAILUT */

    .results-box {
        padding: 12px;
        font-size: 12px;
        line-height: 1.9;
        overflow-wrap: anywhere;
        max-height: 350px;
        overflow-y: auto;
    }

    /* MUUT TAULUKOT */

    .kasvatit {
        font-size: 12px;
    }

    .kasvatit td,
    .kasvatit th {
        padding: 9px 7px;
    }

    /* GALLERIAT */

    .horse-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .horse-gallery img {
        height: 140px;
    }

    /* LIGHTBOX */

    #lightbox img {
        max-width: 94vw;
        max-height: 82vh;
    }

    #lightbox span {
        top: 12px;
        right: 18px;
        font-size: 42px;
    }

    /* ALATUNNISTE */

    #footer {
        padding: 25px 15px;
        font-size: 11px;
        line-height: 1.9;
        overflow-wrap: anywhere;
    }

}

/* ==========================================
   PIENET PUHELIMET
   ========================================== */

@media (max-width: 380px) {

    #header {
        font-size: 22px;
    }

    .horse-main {
        padding: 15px 10px;
    }

    .horse-info h1 {
        font-size: 26px;
    }

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

    .tab {
        font-size: 11px;
    }

    .awards {
        grid-template-columns: 1fr;
    }

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

}
