/* Hevoskohtainen värimaailma: pink. Sisältää alkuperäisen asettelun ja oman väripaletin. */
/*
 * MAISON EQUESTRE — YHDISTETYT TYYLIT
 * Päällekkäiset määrittelyt yhdistetty ja käyttämättömät valitsimet poistettu
 * alkuperäiseen HTML-rakenteeseen verraten.
 * Hero ja teemakohtaiset liukuväritaustat säilytetty.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Cormorant+Garamond:wght@400;500;600&family=Lato:wght@400;500;700&display=swap');

@font-face {
    font-family: Arniya;
    src: url("Arniya-Regular.otf");
    font-weight: 400;
}

/* PERUSTA JA FONTIT */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --forest: #985a78;
    --sage: #ecd1df;
    --gold: #b79a6c;
    --pink: #dba8be;
    --paper: #FFF8F2;
    --ink: #70465c;
    --font1: Lato;
    --font2: Arniya;
    --luxury-ivory: #fcf9f3;
    --luxury-line: #d9d1c2;
    --luxury-brass: #aa9068;
    --atelier-gold: #ad926b;
    --atelier-dark: #78465f;
    --atelier-hairline: rgba(154,133,101,.25);
    --maison-cream: #fff5f8;
    --maison-white: #fffdf8;
    --maison-ink: #654257;
    --maison-gold: #b9955b;
    --maison-gold-light: #e4ceaa;
    --maison-line: rgba(126,104,69,.23);
}

body {
    margin: 0;
    background: var(--maison-cream);
    color: var(--maison-ink);
    font-family: var(--font1);
    font-size: 15px;
    line-height: 1.7;
    text-align: justify;
}

::selection {
    background: #d6bd8f;
    color: #654257;
}

.heritage-green a:link, .heritage-green a:active, .heritage-green a:visited, .facts a:link, .facts a:active, .facts a:visited { color: var(--pink); text-decoration:none; }
.heritage-green a:hover, .facts a:hover { color: var(--forest); }
.plain-band a:link, .plain-band a:active, .plain-band a:visited { color: var(--forest); text-decoration:none; }
.plain-band a:hover { color: var(--pink); }

/* HERO */

.hero {
    background: #985a78;
    overflow: hidden;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 30px 28px;
    color: #fffaf5;
    background: radial-gradient(ellipse at 40% 35%,#c18fa9,#95546f 75%);
}

.crest { margin-bottom: 10px; }
.crest img { filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.5)); }

.hero h1 {
    color: var(--sage);
    font-family: var(--font2);
    font-size: 60px;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 1.01;
    letter-spacing: .065em;
    margin: 0;
    text-shadow: 0 0 3px #000000;
}

.tagline {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--font1);
    font-weight: 500;
    font-size: 16px;
    margin-top: 22px;
    white-space: nowrap;
    text-shadow: 0 0 3px #000000;
}

.tagline span {
    display: block;
    width: 55px;
    height: 1px;
    background: #b4a99a;
    text-shadow: 0 0 3px #000000;
}

/* NAVIGAATIO */

.quick-nav a:hover,.quick-nav a.active {
    color: #b58d60;
}

.quick-nav a:focus-visible,.gallery-item:focus-visible,.expand-panel summary:focus-visible,.diary-entry summary:focus-visible {
    outline: 2px solid var(--atelier-gold);
    outline-offset: 4px;
}

.quick-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    gap: clamp(12px,2.7vw,35px);
    padding: 15px 20px;
    background: rgba(249,245,237,.94);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(170,136,78,.35);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    box-shadow: 0 9px 24px rgba(51, 32, 42,.07);
}

.quick-nav a {
font-family: var(--font2);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    color: #5f4653;
    transition: color .2s;
    position: relative;
    padding: 5px 0;
text-decoration:none;
}

.quick-nav a:after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--maison-gold);
    transition: width .25s;
}

.quick-nav a:hover:after,.quick-nav a.active:after {
    width: 100%;
}

/* PERUSTIEDOT */

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    font-size: 10pt;
    color: #949494;
}

.tooltiptext {
    font-size: 13pt;
    visibility: hidden;
    width: 150px;
    background: url(img/raita.jpg);
    box-shadow: 0px 0px 1px #000000;
    color: #333333;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    top: -12px;
    left: 105%;
    text-transform: none;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
}

.details-content {
    width: 100%;
    min-width: 0;
}

.facts dl {
    margin: 0;
}

.facts dl>div:last-child {
    border-bottom: 0;
}

.portrait-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.details {
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
    align-items: center;
    gap: clamp(28px, 4vw, 58px);
    width: min(1160px, 92%);
    max-width: none;
    margin-inline: auto;
    padding: 50px 0;
}



.portrait-wrap {
    position: relative;
    width: 100%;
    height: 490px;
    overflow: hidden;
    border-radius: 90px 5px 90px 5px;
    box-shadow: 14px 16px 0 -8px rgba(216,165,165,.20),
                0 18px 42px rgba(47, 23, 35,.14);
}

.portrait-wrap:after {
    content: "";
    position: absolute;
    inset: 12px;
    pointer-events: none;
    border: 1px solid rgba(255,248,227,.55);
    border-radius: 80px 3px 80px 3px;
}

.section-title {
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.section-title h2 {
    font-weight: 400 !important;
    color: #503041;
    white-space: normal;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    font-family: Arniya, Georgia, serif;
    font-size: 26px;
    line-height: 1.3;
    text-align: center;
}

.section-title h2 i {
    font-style: normal;
    color: #bd8c85;
}

.section-title span {
    background: linear-gradient(90deg,transparent,#b9955b,transparent);
    opacity: .55;
}

.facts {
    padding: 12px 25px 18px;
    background: linear-gradient(130deg,rgba(255,255,255,.86),rgba(250,246,237,.67));
    border: 1px solid var(--maison-line);
    box-shadow: 0 18px 45px rgba(61, 43, 52,.055);
    position: relative;
    width: 100%;
    min-width: 0;
}

.facts:before,.facts:after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: var(--maison-gold);
    border-style: solid;
    pointer-events: none;
}

.facts:before {
    top: 7px;
    left: 7px;
    border-width: 1px 0 0 1px;
}

.facts:after {
    right: 7px;
    bottom: 7px;
    border-width: 0 1px 1px 0;
}

.facts dl>div {
    border-bottom: 1px solid rgba(160,140,107,.2);
    min-height: 45px;
    border-bottom-color: rgba(170,144,104,.2);
    padding: 9px 0;
    display: grid;
    grid-template-columns: minmax(0, 35%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.facts dt {
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    font-weight: 500;
    text-indent: 0;
    color: var(--forest);
    line-height: 1.3;
    font-weight: 400 !important;
    min-width: 0;
    overflow-wrap: break-word;
    font-family: Arniya, Georgia, serif;
}

.facts dd {
    margin: 0;
    line-height: 1.55;
    color: #4c3541;
    min-width: 0;
    overflow-wrap: anywhere;
}

.facts a {
    text-decoration: underline;
    text-decoration-color: #c9a46e;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

.details > .portrait-wrap,
.details > .details-content {
    min-width: 0;
}

.section-title > span {
    display: block;
    flex: 1 1 0;
    min-width: 14px;
    height: 1px;
}

.facts dd img {
    display: inline-block;
    max-width: 28px;
    max-height: 20px;
    width: auto;
    height: auto;
    vertical-align: middle;
}

/* OSIOT JA LUONNEKUVAUS */

.green {
    background: radial-gradient(ellipse at 40% 35%,#c18fa9,#95546f 75%);
    overflow: hidden;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.intro {
    padding: 45px 0 45px;
    border-top: 1px solid #e7ded5;
}

.section-head h2 {
    font-size: clamp(25px,3vw,35px);
    letter-spacing: .055em;
    line-height: 1.25;
}

.intro-layout h2 {
    margin-bottom: 29px;
}

.section-shell {
    width: min(1160px,90%);
    margin: 0 auto;
}

.block {
    padding: 40px 0 ;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    margin-bottom: 7px;
    position: relative;
    padding: 0 0 19px;
}


.section-head h2,.intro h2 {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: .07em;
    margin: 0;
    color: #4a2a3b;
    font-family: Arniya,Georgia,serif !important;
    font-weight: 400 !important;
    text-transform: none;
}


.plain-band {
    background: linear-gradient(155deg,#faf7f1,#f5efe5 90%);
}

.intro.section-shell {
    width: 100%;
    max-width: none;
    padding: 0;
    background: linear-gradient(120deg,#fcfaf5,#f4eee4);
}

.intro-layout {
    display: block;
}


.intro.section-shell>div {
width: 90%; max-width: 1160px; margin: 0 auto;

}

.intro-layout .muted {
    color: #998e7d;
    font-size: 12px;
}

.intro-layout > div {
    width: 100%;
    max-width: none;
    columns: 1;
    display: block;
}


.section-head h2, .section-title h2 {
    text-wrap: balance;
}

.section-head > p {
    margin: 0;
    text-wrap: pretty;
}

.section-shell.block > :last-child {
    margin-bottom: 0;
}

/* SUKUTAULU JA SUKUSELVITYS */

.pedigree-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
}

.ped-column {
    min-width: 0;
}

.ped-grid.two {
    grid-template-rows: repeat(2,1fr);
}

.ped-grid.four {
    grid-template-rows: repeat(4,1fr);
}

.ped-grid.eight {
    grid-template-rows: repeat(8,1fr);
}

.ped-person span {
    font-size: 11px;
    color: #a38d98;
}

.ped-person.compact small {
    font-size: 11px;
}

.expand-panel summary,.diary-entry summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.expand-panel summary::-webkit-details-marker,.diary-entry summary::-webkit-details-marker {
    display: none;
}

.plus,.diary-toggle {
    font-size: 27px;
    font-weight: 300;
    color: #9b8065;
    transition: transform .2s;
}

.expand-panel[open] .plus,.diary-entry[open] .diary-toggle {
    transform: rotate(45deg);
}

.expand-body p {
    margin: 10px 0;
}

.ped-person, .ped-person.compact {
    background: #fcfbf7;
    border-left: 2px solid var(--pink);
    border-radius: 2px;
    padding: 11px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    border-left-width: 2px;
    box-shadow: none;
    transition: border-color .2s,transform .2s;
}

.ped-person:hover {
    border-color: rgba(173,146,107,.65);
    transform: translateY(-1px);
}

.expand-panel summary:hover {
    background: rgba(173,146,107,.06);
}

.pedigree {
    display: grid;
    grid-template-columns: 1fr 1fr 1.1fr;
    gap: 11px;
    min-width: 730px;
}

.ped-grid {
    display: grid;
    gap: 7px;
    height: 650px;
}

.column-label {
    display: block;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #9b9c91;
    margin-bottom: 13px;
    color: #f0ddbd !important;
}

.ped-person strong {
    font-family: var(--font2);
    font-size: 16px;
    line-height: 1.13;
    color: #573647;
    font-weight: 400;
    letter-spacing: 1px;
}

.ped-person.compact strong {
    font-size: 15px;
}

.ped-person small {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .11em;
    color: #a18d74;
}

.expand-panel {
    margin-top: 21px;
    background: #fffdf9;
    border: 1px solid rgba(173,146,107,.33);
    border-radius: 2px;
    box-shadow: none;
    border-radius: 3px 13px 3px 13px !important;
    overflow: hidden;
    border: 1px solid #d6c29c !important;
    background: #fffcf5 !important;
    box-shadow: 0 10px 28px rgba(38, 17, 28,.13) !important;
}

.expand-panel summary {
    padding: 17px 22px;
    transition: background .2s;
}

.expand-panel summary b {
    display: block;
    font-family: Arniya;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #503543;
}

.expand-panel summary small {
    display: block;
    color: #867d6c;
    font-size: 11px;
}

.expand-body p, .diary-content p {
    margin: 0 0 1.15em;

}

.expand-body p:last-child, .diary-content p:last-child {
    margin-bottom: 0;
}

.expand-body {
    border-top: 1px solid #ece6df;
    padding: 22px 26px 26px;
    color: #6b5661;
    font-size: 14px;
    background: #faf6ed;
    line-height: 1.9;
}

/* JÄLKELÄISET */

.mini-facts {
    margin: 0;
}

.mini-facts div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #e8e6df;
    padding: 11px 0;
    font-size: 13px;
}

.foal-card .mini-facts dd {
    text-align: left;
    overflow-wrap: anywhere;
}

.foal-breed,.mini-facts dt {
    color: #957a88;
}

.foal-grid {
    display: flex;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 0;
    flex-direction: column;
    border-top: 1px solid #cbb998;
}

.foal-card {
    background: rgba(255,255,255,.35);
    border: 0;
    border-radius: 0;
    padding: 16px 17px;
    box-shadow: none;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, .7fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 9px 20px;
    transition: background .2s,border-color .2s,transform .2s;
    border-left: 3px solid transparent;
}

.foal-card:nth-child(even) {
    background: rgba(236,229,216,.42);
}

.foal-card:hover {
    background: #fffdf8;
    border-left-color: #b9955b;
    transform: translateX(2px);
}

.foal-card h3 {
    font-family: var(--font2);
    font-size: 18px;
    font-weight: 400;
    margin: 0;
    line-height: 1.8;
    letter-spacing: 1.5px;
    color: #502f40;
}

.chip {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .09em;
    text-transform: uppercase;
    background: #e9dde3;
    color: #5f4251;
    padding: 3px 11px;
    border-radius: 100px;
    border: 1px solid #d6c5ce;
}

.foal-breed {
    font-size: 14px;
    color: #8c806e;
    margin: 0;
}

.foal-breed i { padding: 0 5px; }

.foal-card .mini-facts div {
    padding: 2px 0;
    border: 0;
    display: grid;
    grid-template-columns: 105px minmax(0,1fr);
    gap: 8px;
    font-size: 11.5px;
    line-height: 1.55;
}

.mini-facts dt {
    color: #93846f;
    font-size: 10px;
}

.mini-facts dd {
    margin: 0;
    text-align: right;
    font-weight: 500;
    font-size: 11.5px;
    color: #533a47;
}

.demo-note {
    color: #a58e9a;
    font-size: 10px;
    margin: 18px 0 0;
    font-style: italic;
    opacity: .72;
    letter-spacing: .03em;
    margin-top: 16px;
}

.foal-card h3, .foal-card p, .foal-card dl {
    margin-top: 0;
    margin-bottom: 0;
}

.foal-card .mini-facts {
    grid-column: 3;
    grid-row: 1 / span 2;
    display: grid;
    gap: 3px;
    row-gap: 5px;
}

/* TULOSTAULUKOT */

.result-table tbody tr {
    transition: background .2s;
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid #cdbd9f;
    border-radius: 3px 13px 3px 13px;
    background: #fffdf9;
    border-color: #dedbd0;
    box-shadow: 0 10px 25px rgba(51, 36, 44,.065);
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.result-table th {
    background: #e9dce3;
    color: #563b49;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: left;
    padding: 14px 17px;
    white-space: nowrap;
    font-weight: 700;
    border-bottom: 1px solid #bea476;
}

.result-table td {
    padding: 15px 17px;
    color: #4a3540;
    border-bottom-color: rgba(173,146,107,.15);
    border-bottom: 1px solid rgba(161,139,103,.2);
}

.result-table tbody tr:nth-child(even) {
    background: #f4f2e9;
}

.result-table tbody tr:hover {
    background: #ede8d9;
}

.result-pill {
    display: inline-block;
    background: #f2ead8;
    border: 1px solid #cbb68e;
    border-radius: 100px;
    color: #665337;
    font-size: 10px;
    font-weight: 500;
    padding: 5px 12px;
    white-space: nowrap;
}

.result-table td, .result-table th {
    line-height: 1.5;
    vertical-align: middle;
}

/* GALLERIA */

.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(26, 12, 19,.93);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
}

.lightbox img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 25px;
    background: none;
    border: 0;
    color: #fff;
    font-size: 42px;
    cursor: pointer;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(min(100%,235px),1fr));
    gap: 17px;
}

.gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #e7e8df;
    border-radius: 3px 32px 3px 32px;
    box-shadow: 0 9px 26px rgba(34, 19, 27,.1);
    border: 1px solid rgba(234,219,193,.3);
    border: 5px solid rgba(252,249,238,.96) !important;
    box-shadow: 0 16px 30px rgba(34, 14, 24,.22) !important;
}

.gallery-item:only-child {
    max-width: 650px;
    aspect-ratio: 3/2;
    width: 100%;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease,filter .5s;
}

.gallery-item:hover img {
    transform: scale(1.06);
    filter: saturate(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 38px 20px 15px;
    background: linear-gradient(transparent,rgba(37, 18, 28,.65));
    color: #fff;
    font-size: 10px;
    letter-spacing: .16em;
}

/* PÄIVÄKIRJA */

.diary-heading {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.diary-content p {
    margin: 12px 0;
}

.diary-list {
    display: grid;
    gap: 0;
}

.diary-entry {
    background: rgba(255,253,248,.76);
    border: 0;
    border-radius: 20px 0; margin: 10px 0;
}

.diary-entry summary {
    padding: 19px 16px;
    transition: background .2s;
    gap: 18px; border-radius: 20px 0;
}

.diary-entry[open] {
    background: rgba(255,253,248,.76);
    box-shadow: inset 3px 0 #bd985e;
}

.diary-date {
font-family: var(--font2);
    font-size: 15px;
    color: #a17f50;
    min-width: 110px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .09em;
}

.diary-heading strong {
    font-family: var(--font2);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 1px;
    color: #4d2f3f;
}

.diary-heading small {
    color: #928471;
    font-size: 13px;
    margin-top: 4px;
    letter-spacing: .05em;
}

.diary-toggle,.plus {
    color: #b58c52;
    font-size: 25px;
}

.diary-content {
    padding: 20px 27px 25px;
    color: #59434e;
}

/* ALATUNNISTE */

.site-footer {
    background: var(--sage);
    text-align: center;
    padding: 23px 20px;
    color: #4c313f;
    letter-spacing: .15em;
    font-family: var(--font1);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.site-footer span {
    font-family: var(--font1);
    padding: 0px 20px;
    color: #aa8455;
}

/* MUUT */

.heritage-green .section-head>p,.heritage-green .demo-note {
    color: #e1d5db;
}

.heritage-green .column-label {
    color: #e7dce2;
}

.heritage-green .ped-person strong {
    color: #4e3240;
}

.heritage-green .ped-person small {
    color: #886e50;
}

.heritage-green .ped-person span {
    color: #856a78;
}

.heritage-green .expand-panel {
    background: #faf9f4;
    color: #70465c;
    border-color: #d9cbd2;
}

.heritage-green .expand-body {
    color: #654d59;
}

.heritage-green .result-table th {
    background: #e7dbe1;
    color: #573748;
}

.heritage-green .gallery-item {
    box-shadow: 0 12px 32px rgba(34, 14, 24,.2);
}

.heritage-green {
    background: radial-gradient(ellipse at 40% 35%,#c18fa9,#95546f 75%);
    box-shadow: 0 4px 8px rgba(0,0,0,.2),0 6px 20px rgba(0,0,0,.19);
    color: #fffaf5;
}

.heritage-green .section-head h2 {
    color: var(--pink);
    text-shadow: 0 1px 0 rgba(0,0,0,.1);
}

.heritage-green .section-head>p {
    color: #e8dce2;
}

.heritage-green .section-head:after {
    background: linear-gradient(90deg,#e8d3a9,#ad8d5e);
}

.heritage-green .ped-person {
    background: linear-gradient(130deg,#fffdf7,#f0eee5);
    border-color: #e0d6db;
    border-left-color: #b79a6c;
    border: 1px solid rgba(198,172,123,.44);
    border-left: 3px solid var(--pink);
    border-radius: 3px 13px 3px 13px;
    padding: 19px 13px;
    box-shadow: 0 6px 16px rgba(37, 17, 27,.1);
}

.heritage-green .ped-person:hover {
    border-color: #d5b681;
    transform: translateY(-2px);
}

.heritage-green .table-scroll {
    border-color: #d5c39f;
    box-shadow: 0 12px 29px rgba(33, 16, 25,.17);
}













@media (max-width:900px) {




    .facts {
        padding: 12px 16px;
    }



    .block {
        padding: 63px 0 70px;
    }

}

@media (max-width:850px) {
    .foal-card {
        grid-template-columns: minmax(130px,1fr) minmax(180px,1.4fr);
    }

    .foal-breed {
        grid-column: 1;
        grid-row: 3;
    }

    .foal-card .mini-facts {
        grid-column: 2;
        grid-row: 1 / span 3;
    }

}

@media (max-width:800px) {
    .hero {
        height: 340px;
        grid-template-columns: 55% 45%;
    }

    .hero h1 {
        font-size: clamp(28px,5vw,44px);
    }

    .hero h1 em {
        margin-left: 0;
    }

    .tagline {
        font-size: 10px;
        gap: 8px;
        letter-spacing: .12em;
    }

    .tagline span {
        width: 15px;
    }



    .section-title h2 {
        letter-spacing: .12em;
    }

    .facts {
        gap: 14px;
    }

    .facts dl+dl {
        padding-left: 14px;
    }

    .facts dl>div {
        padding: 8px 0;
    }

    .facts dd {
        font-size: 16px;
    }

    .section-head {
        align-items: start;
    }

    .section-head>p {
        max-width: 190px;
    }

    .intro-layout {
        gap: 30px;
    }

    .block {
        padding: 68px 0 74px;
    }



    .facts dt {
        font-size: 13px;
    }

}

@media (max-width:650px) {
    .quick-nav {
        justify-content: flex-start;
        padding: 12px 5%;
    }

    .details {
        flex-direction: column;
    }

    .portrait-wrap {
        margin: auto;
    }



    .facts {
        padding: 10px 17px;
    }

    .facts dt {
        font-size: 12px;
    }

    .facts dd {
        font-size: 12px;
    }

    .section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .section-head h2 {
        font-size: 28px;
    }

    .section-head>p {
        font-size: 11px;
    }

    .intro.section-shell {
        padding: 49px 6% 57px;
    }

    .intro h2 {
        font-size: 31px;
    }

    .block {
        padding: 53px 0 60px;
    }

    .pedigree {
        min-width: 680px;
    }

    .ped-grid {
        height: 425px;
    }

    .foal-card {
        grid-template-columns: 1fr;
        padding: 14px 10px;
        gap: 4px;
    }

    .foal-card h3 {
        font-size: 23px;
    }

    .foal-card .mini-facts div {
        grid-template-columns: 110px minmax(0,1fr);
    }

    .diary-entry summary {
        padding: 16px 8px;
    }

    .diary-heading strong {
        font-size: 22px;
    }

    .diary-date {
        font-size: 10px;
    }

    .gallery-item:only-child {
        width: 100%;
    }

    .intro-layout p {
        font-size: 13px;
        line-height: 1.85;
        margin-bottom: 1em;
    }

    .expand-body {
        padding: 18px 19px 22px;
    }

    .diary-content {
        padding: 18px 18px 22px;
    }

    .section-head > p {
        max-width: 100%;
    }

}

@media (max-width:580px) {
    .hero {
        height: auto;
        grid-template-columns: 1fr;
    }

    .hero-copy {
        min-height: 270px;
    }

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

    .quick-nav {
        justify-content: flex-start;
    }

    .portrait-wrap {
        max-width: 400px;
        margin: auto;
    }



    .section-shell {
        width: 88%;
    }

    .section-head {
        display: block;
    }

    .intro {
        padding: 40px 0 65px;
    }

    .intro-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .diary-date {
        min-width: 80px;
        font-size: 10px;
    }

    .diary-content {
        padding: 12px 18px 20px;
    }

    .site-footer span {
        padding: 0 5px;
    }

    .heritage-green .section-head>p {
        color: #e9e1e5;
    }

    .foal-top,.foal-card h3,.foal-breed,.foal-card .mini-facts {
        grid-column: 1;
        grid-row: auto;
    }

    .foal-card h3 {
        font-size: 23px;
    }

    .foal-breed {
        margin-bottom: 6px;
    }

    .foal-card .mini-facts div {
        grid-template-columns: 115px minmax(0,1fr);
    }

    .details {
        flex-direction: column;
        padding-top: 45px;
        padding-bottom: 45px;
    }

    .section-head>p {
        margin-top: 12px;
        max-width: none;
        font-size: 12px;
    }

    .diary-entry summary {
        padding: 17px 8px;
    }

    .portrait-wrap,.portrait-wrap img {
        border-radius: 3px 55px 3px 55px;
    }

    .section-head h2 {
        font-size: 27px;
    }

    .intro h2 {
        font-size: 31px;
    }

    .intro.section-shell {
        padding: 55px 6% 65px;
    }



    .facts dt {
        font-size: 12px;
    }

    .facts dd {
        font-size: 12px;
    }

    .foal-card {
        padding: 16px 6px;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .diary-heading strong {
        font-size: 22px;
    }

    .block {
        padding: 58px 0 66px;
    }

}

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

    * {
        transition: none !important;
    }

    .gallery-item img,.foal-card,.ped-person,.quick-nav a:after {
        transition: none !important;
    }

}

.contact-flag{display:inline-block;width:22px;height:auto;vertical-align:middle;margin-left:6px;border-radius:2px}

/* Keyboard accessible color-gene tooltip */
.tooltip {display:inline-block;position:relative;cursor:help;}
.tooltip:focus .tooltiptext,.tooltip:focus-within .tooltiptext {visibility:visible;opacity:1;}

/* Alkuperäisen värigeenivihjeen hover-ulkoasu sekä näppäimistötuki */
.tooltip:focus .tooltiptext,.tooltip:focus-within .tooltiptext {visibility:visible;}

/* Saavutukset – alkuperäisen hevossivun värimaailma */
.achievement-band { background: #eee6ea; color: #3c2933; }
.achievement-band .achievement-heading { color:#bb873c; font-family:inherit; text-transform:uppercase; font-size:1.15rem; font-weight:500; letter-spacing:.16em; margin:0 0 1.2rem; }
.achievement-columns { display:grid; grid-template-columns:minmax(0,2.1fr) minmax(220px,1fr); gap:2rem; }
.achievement-entry { margin-bottom:1rem; line-height:1.7; }
.achievement-line { display:flex; flex-wrap:wrap; align-items:baseline; gap:.4rem; }
.achievement-entry p,.achievement-title-entry p { margin:.25rem 0 .8rem; white-space:normal; line-height:1.7; }
.achievement-titles h3 { font-size:1rem; margin:0 0 .55rem; }
.achievement-title-entry { margin-bottom:.4rem; line-height:1.6; }
.achievement-band a { color:#b78543; text-decoration:underline; }
@media(max-width:720px){.achievement-columns{grid-template-columns:1fr;gap:1rem}}

/* Saavutusten tausta vastaa sukutaulun vihreää osuutta. */
.achievement-band { background:radial-gradient(ellipse at 40% 35%,#c18fa9,#95546f 75%); color:#fffdf8; }
.achievement-band .achievement-heading { color:#e6c58e; }
.achievement-band .achievement-line strong, .achievement-band .achievement-line strong a { font-weight:700; }
.achievement-band .achievement-titles h3 { font-weight:700; color:#fffdf8; }
.achievement-band a { color:#f0d19a; }
.achievement-band .achievement-entry p { font-weight:400; }

/* Saavutusten korostukset alkuperäisen teeman pinkillä. */
.achievement-band .achievement-line strong,
.achievement-band .achievement-titles h3 { color: var(--pink); }
.achievement-band a:link, .achievement-band a:visited,
.achievement-band a:hover, .achievement-band a:active { color: var(--pink); }
.achievement-band .fa-medal { margin-right: .35em; }

/* Kilpailu- ja näyttelykortit */
.event-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1.4rem}.event-card{border:1px solid rgba(123, 98, 111,.3);border-radius:8px;padding:1.25rem;background:#faf8f3;color:#3f2f37;box-shadow:0 2px 9px rgba(0,0,0,.05)}.event-card h3{font-size:1.1rem;margin:.6rem 0}.event-card p{margin:.4rem 0;line-height:1.6}.event-card-top{display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap;font-size:.85rem}.event-result{background:#e9dfe4;color:#95546f;border-radius:20px;padding:.25rem .7rem}.event-muted{opacity:.82;font-size:.9rem}.event-card a{color:#95546f;text-decoration:underline}.competition-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:1.4rem 0}.competition-controls label{font-size:.85rem;font-weight:700}.competition-controls input,.competition-controls select{box-sizing:border-box;display:block;width:100%;margin-top:.45rem;padding:.75rem;border:1px solid #c4b5bd;border-radius:5px;background:#fff;color:#5d3b4d;font:inherit}.competition-stats{padding:1.1rem;background:#f1e9ed;border-radius:8px;color:#5d3b4d}.competition-stats h3{margin:0 0 1rem}.stats-scroll{overflow-x:auto}.competition-stats table{width:100%;border-collapse:collapse;min-width:540px;text-align:left}.competition-stats th,.competition-stats td{padding:.55rem;border-bottom:1px solid #d7c9d0}.stats-help{font-size:.82rem;margin:.8rem 0 0}.competition-card[hidden],#competition-no-results[hidden]{display:none!important}@media(max-width:720px){.event-card-grid{grid-template-columns:1fr}.competition-controls{grid-template-columns:1fr}}
/* Saavutusten lihavoitu teksti normaaliksi, vain mitali pinkiksi. */
.achievement-band .achievement-line strong,.achievement-band .achievement-titles h3,.achievement-band .achievement-line a{color:inherit!important}.achievement-band .fa-medal{color:var(--pink)!important}

/* Koko rivin kilpailu- ja näyttelykortit */
.event-card-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;width:100%}
.event-card{width:100%;box-sizing:border-box;background:var(--cream,#f8f6f0);border:1px solid rgba(109, 83, 96,.24);border-left:4px solid var(--green,#6d5461);border-radius:3px;box-shadow:none;padding:1.15rem 1.4rem;color:var(--dark,#42313a)}
.event-card-body{display:flex;justify-content:space-between;align-items:center;gap:1.5rem}
.event-card-main{min-width:0;flex:1}.event-card-top{display:flex;justify-content:flex-start;gap:1rem;flex-wrap:wrap;font-size:.82rem;letter-spacing:.03em;color:#7a616e}
.event-card h3{font-size:1.18rem;margin:.45rem 0 .35rem;font-weight:700}.event-card h3 a{color:inherit;text-decoration:none;border-bottom:1px solid currentColor}.event-card p{margin:.2rem 0}.event-sport{text-transform:uppercase;letter-spacing:.09em}.event-card-result{flex-shrink:0;min-width:100px;text-align:center;padding:.7rem 1rem;border-left:1px solid #d6c9d0}.event-card-result span{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;color:#816774}.event-card-result strong{display:block;font-size:1.3rem;color:#975d79;margin-top:.25rem}
.competition-stats{background:transparent;border:1px solid rgba(109, 83, 96,.25);border-radius:3px;padding:1.4rem;margin:1.5rem 0;color:inherit}.competition-stats h3{font-size:1.18rem;margin:0 0 .9rem}.competition-stats table{min-width:550px}.competition-stats thead{background:rgba(114, 87, 101,.12)}.competition-stats th,.competition-stats td{padding:.8rem .65rem;border-bottom:1px solid rgba(109, 83, 96,.18)}.competition-stats tbody tr:last-child th,.competition-stats tbody tr:last-child td{border-bottom:0}.stats-help{color:#7d6471}
@media(max-width:600px){.event-card{padding:1rem}.event-card-body{align-items:flex-start;gap:.65rem}.event-card-result{min-width:65px;padding:.4rem .2rem .4rem .65rem}.event-card-result strong{font-size:1.1rem}}

/* Competition and show cards: full-width, aligned rows with quiet original-site palette */
.event-card-grid{display:flex;flex-direction:column;gap:10px}
.event-card{background:var(--cream,#f8f6f0);border:1px solid rgba(106, 85, 96,.35);border-radius:0;padding:0;box-shadow:none}
.event-card-body{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:0}
.event-card-main{padding:15px 20px;min-width:0}
.event-card-top{margin-bottom:5px;gap:12px;font-size:.84rem}
.event-card h3{margin:3px 0 5px;font-size:1.08rem}
.event-card p{margin:3px 0;font-size:.94rem}
.event-card-result{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:120px;padding:12px 18px;border-left:1px solid rgba(106, 85, 96,.25);background:rgba(106, 85, 96,.07)}
.event-card-result strong{font-size:1.3rem;color:var(--green,#975d79)}
.event-card-highlight{border-color:var(--pink,#dba8be)}
.event-card-highlight .event-card-result{background:rgba(216,165,165,.13)}
@media(max-width:600px){.event-card-main{padding:12px}.event-card-result{min-width:72px;padding:10px}.event-card-body{grid-template-columns:minmax(0,1fr) auto}}

/* Kilpailukortit: alkuperäisen esimerkin kolmipalstainen asettelu */
.event-card.competition-card{padding:0;border:1px solid #d9d3cc;border-left:5px solid #a18aaf;background:#fffdfb;color:var(--dark,#3b2f35);border-radius:3px;overflow:hidden}
.horse-event-layout{display:grid;grid-template-columns:92px minmax(0,1fr) 140px;min-height:110px}
.horse-event-date{background:#eee8f0;color:#51325d;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;text-align:center;padding:12px 5px}
.horse-event-date strong{font-size:1.6rem;line-height:1.1;white-space:nowrap}.horse-event-date span{font-size:.82rem;font-weight:700}
.horse-event-center{padding:18px 24px;min-width:0}.horse-event-header{display:grid;grid-template-columns:1fr 1fr;gap:15px;align-items:center}.horse-event-tags{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:.83rem}.horse-event-discipline{background:#eee8f0;color:#543160;text-transform:uppercase;font-weight:700;font-size:.72rem;letter-spacing:.1em;padding:8px 10px}
.horse-event-identity h3{margin:8px 0 0;font-size:1.15rem;color:#533460}.horse-event-identity h3 a{color:inherit;text-decoration:none}.horse-event-identity h3 a:hover{text-decoration:underline}.horse-event-info{font-size:.87rem;color:#88768b;margin:0!important}
.horse-event-result{border-left:1px solid #e2dcd6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:12px;text-align:center}.horse-event-result>span{font-size:.72rem;text-transform:uppercase;color:#817987}.horse-event-result strong{font-size:1.55rem;font-weight:400;color:#51365e;line-height:1.2}.event-card-highlight .horse-event-result strong{color:var(--pink,#dba8be)}.horse-event-result small{color:#8c7893;font-size:.78rem}
.horse-event-tests{border-top:1px solid #e3ded8;margin-top:12px;padding-top:12px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;text-align:center}.horse-event-tests span{display:block;text-transform:uppercase;font-size:.7rem;color:#86778a}.horse-event-tests strong{display:block;font-weight:400;font-size:.83rem;color:#6c5671;margin-top:4px}
@media(max-width:680px){.horse-event-layout{grid-template-columns:68px minmax(0,1fr) 85px}.horse-event-date strong{font-size:1.05rem}.horse-event-center{padding:12px}.horse-event-header{grid-template-columns:1fr}.horse-event-result{padding:7px}.horse-event-result strong{font-size:1.1rem}.horse-event-tests{gap:3px}.horse-event-tests span{font-size:.58rem}.horse-event-tests strong{font-size:.68rem}}

/* Kilpailu- ja näyttelykorttien yhtenäinen hevossivun teema */
.event-card.competition-card,.event-card.show-card{background:var(--cream,#faf9f4);border-color:rgba(90, 59, 75,.25);border-left-color:var(--green,#ad7892);color:inherit;box-shadow:none}
.horse-event-date{background:rgba(104, 67, 86,.11);color:var(--green,#95546f)}
.horse-event-date strong,.horse-event-date span{color:inherit}
.horse-event-discipline{background:rgba(104, 67, 86,.12);color:var(--green,#95546f)}
.horse-event-identity h3,.horse-event-identity h3 a{color:var(--green,#95546f)}
.horse-event-identity h3 a,.horse-event-identity h3 a:link,.horse-event-identity h3 a:visited,.horse-event-identity h3 a:hover,.horse-event-identity h3 a:focus{text-decoration:none!important;border-bottom:0!important}
.horse-event-info,.horse-event-result>span,.horse-event-result small,.horse-event-tests span{color:var(--green,#b58aa1)}
.horse-event-result strong,.horse-event-tests strong{color:inherit}
.event-card-highlight .horse-event-result strong{color:var(--pink,#dba8be)}
.horse-event-result,.horse-event-tests{border-color:rgba(90, 59, 75,.2)}
.competition-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:720px){.competition-controls{grid-template-columns:1fr}}

/* Näyttelykortit: päivämäärä / näyttely / tuomari ja kuva / palkinto */
.event-card.show-card{padding:0;overflow:visible;border:1px solid rgba(90, 59, 75,.25);border-left:5px solid var(--green,#ad7892);background:var(--cream,#faf9f4);border-radius:3px;color:inherit}
.horse-show-layout{display:grid;grid-template-columns:92px minmax(0,1.5fr) minmax(150px,1fr) 135px;min-height:112px}
.horse-show-identity,.horse-show-judge,.horse-show-prize{padding:17px 20px;min-width:0}
.horse-show-identity h3{margin:10px 0 0;font-size:1.15rem}.horse-show-identity h3 a{color:inherit;text-decoration:none;border:0}.horse-show-identity h3 a:hover{text-decoration:none}
.horse-show-judge{border-left:1px solid rgba(90, 59, 75,.2);display:flex;flex-direction:column;gap:5px;justify-content:center}
.show-label{font-size:.72rem;letter-spacing:.08em;color:var(--green,#b58aa1)}
.horse-show-prize{border-left:1px solid rgba(90, 59, 75,.2);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;text-align:center}
.horse-show-prize strong{font-size:1.4rem;color:inherit}.horse-show-prize small{font-size:.83rem}
.horse-show-notes{grid-column:2/4;border-top:1px solid rgba(90, 59, 75,.2);padding:13px 20px;line-height:1.6;font-size:.9rem}
.show-image-tooltip{display:inline-block;position:relative;align-self:flex-start;cursor:help;font-size:.76rem;font-weight:700;color:var(--green,#ad7892);margin-top:8px}
.show-image-preview{display:none;position:absolute;bottom:calc(100% + 10px);left:0;width:min(300px,65vw);padding:6px;background:var(--cream,#faf9f4);border:1px solid var(--green,#ad7892);box-shadow:0 6px 24px #0004;z-index:30}
.show-image-preview img{display:block;width:100%;height:auto;max-height:350px;object-fit:contain}
.show-image-tooltip:hover .show-image-preview,.show-image-tooltip:focus .show-image-preview,.show-image-tooltip:focus-within .show-image-preview{display:block}
@media(max-width:720px){.horse-show-layout{grid-template-columns:65px minmax(0,1fr) 105px}.horse-show-identity{grid-column:2}.horse-show-judge{grid-column:2;grid-row:2;border-left:0;border-top:1px solid rgba(90, 59, 75,.2)}.horse-show-prize{grid-column:3;grid-row:1/3}.horse-show-notes{grid-column:2/4}.horse-show-identity,.horse-show-judge,.horse-show-prize{padding:12px}.horse-show-layout>.horse-event-date{grid-row:1/3}}

/* Näyttelykortin tuomari- ja palkintotiedot: sama tumma ink kuin muu sisältö. */
.event-card.show-card .horse-show-judge,
.event-card.show-card .horse-show-prize,
.event-card.show-card .horse-show-judge > span:not(.show-image-tooltip),
.event-card.show-card .horse-show-prize > span,
.event-card.show-card .horse-show-prize strong,
.event-card.show-card .horse-show-prize small {
    color: var(--ink);
}

/* Näyttelyiden haku ja luokkatyyppisuodatin */
.show-filters{display:flex;gap:16px;flex-wrap:wrap;margin:0 0 20px}.show-filters label{display:flex;flex-direction:column;gap:6px;flex:1 1 210px;color:var(--ink);font-size:.88rem}.show-filters input,.show-filters select{width:100%;padding:10px 12px;border:1px solid #c8b9c1;border-radius:3px;background:#fff;color:var(--ink);font:inherit}.show-card[hidden],#show-filter-empty[hidden]{display:none!important}


/* Näyttelykalenterin luettavuus: vaaleat kortit, tumma teksti.
   Rajataan vain näyttelyihin, jotta muu hevossivu säilyy ennallaan. */
.event-card.show-card {
    background: var(--maison-white, #fffdf8);
    color: var(--ink, #70465c);
    border: 1px solid var(--luxury-line, #d9d1c2);
    border-left: 5px solid var(--forest, #985a78);
    font-family: var(--font1, Lato, sans-serif);
}
.event-card.show-card .horse-event-date {
    background: #eee6ea;
    color: var(--ink, #70465c);
}
.event-card.show-card .horse-event-date strong,
.event-card.show-card .horse-event-date span,
.event-card.show-card .horse-show-identity,
.event-card.show-card .horse-show-identity h3,
.event-card.show-card .horse-show-judge,
.event-card.show-card .horse-show-judge > span:not(.show-image-tooltip),
.event-card.show-card .horse-show-prize,
.event-card.show-card .horse-show-prize strong,
.event-card.show-card .horse-show-prize small,
.event-card.show-card .horse-show-notes,
.event-card.show-card .horse-event-tags > span:not(.horse-event-discipline) {
    color: var(--ink, #70465c);
    opacity: 1;
}
.event-card.show-card .show-label {
    color: var(--forest, #985a78) !important;
    font-weight: 700;
}
.event-card.show-card .horse-event-discipline {
    background: #ebe1e6;
    color: #442636;
    font-weight: 700;
}
.event-card.show-card .horse-show-identity h3 a,
.event-card.show-card .horse-show-identity h3 a:link,
.event-card.show-card .horse-show-identity h3 a:visited {
    color: var(--ink, #70465c) !important;
    text-decoration: none;
}
.event-card.show-card .horse-show-identity h3 a:hover,
.event-card.show-card .horse-show-identity h3 a:focus-visible {
    color: var(--forest, #985a78) !important;
}
.event-card.show-card .show-image-tooltip {
    color: #4a2639 !important;
    font-weight: 700;
}
.event-card.show-card .show-image-tooltip:hover,
.event-card.show-card .show-image-tooltip:focus-visible {
    color: #361828 !important;
    text-decoration: underline;
}
.event-card.show-card .show-image-preview {
    background: var(--maison-white, #fffdf8);
    border-color: var(--forest, #985a78);
}
.show-filters label { color: var(--ink, #70465c); font-weight: 700; }
.show-filters input, .show-filters select {
    background: #fffdf8;
    color: var(--ink, #70465c);
    border-color: #9a808d;
    opacity: 1;
}
.show-filters input::placeholder { color: #68535e; opacity: 1; }
.show-filters input:focus-visible, .show-filters select:focus-visible {
    outline: 2px solid var(--forest, #985a78);
    outline-offset: 2px;
}
#show-filter-empty { color: var(--ink, #70465c); }

/* Näyttelykalenteri: pinkit linkit ja vaaleat suodatinotsikot. */
.event-card.show-card .horse-show-identity h3 a,
.event-card.show-card .horse-show-identity h3 a:link,
.event-card.show-card .horse-show-identity h3 a:visited,
.event-card.show-card .show-image-tooltip,
.event-card.show-card .show-image-tooltip:link,
.event-card.show-card .show-image-tooltip:visited {
  color: var(--pink, #dba8be);
}
.event-card.show-card .horse-show-identity h3 a:hover,
.event-card.show-card .horse-show-identity h3 a:focus-visible,
.event-card.show-card .show-image-tooltip:hover,
.event-card.show-card .show-image-tooltip:focus-visible {
  color: var(--pink, #dba8be);
}
.show-filters label {
  color: var(--cream, #faf9f4);
  font-weight: 700;
}

/* Näyttelykortin reunat: pinkki ulkoreuna vasemmalla, sisäinen erotin vain palkinnossa. */
.event-card.show-card {
  border-left: 5px solid var(--pink, #dba8be);
}
.event-card.show-card .horse-show-judge {
  border: 0;
}
.event-card.show-card .horse-show-notes {
  border: 0;
}
.event-card.show-card .horse-show-prize {
  border: 0;
  border-left: 1px solid rgba(90, 59, 75,.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
@media (max-width: 720px) {
  .event-card.show-card .horse-show-judge { border: 0; }
  .event-card.show-card .horse-show-prize { border-left: 1px solid rgba(90, 59, 75,.2); }
}

/* Näyttelykortti: päivämäärä ja palkinto ulottuvat koko kortin korkeudelle.
   Mahdolliset lisätiedot ovat niiden välissä omalla rivillään. */
.event-card.show-card .horse-show-layout {
  grid-template-columns: 92px minmax(0,1.5fr) minmax(150px,1fr) 135px;
  grid-template-rows: auto auto;
}
.event-card.show-card .horse-show-layout > .horse-event-date {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
}
.event-card.show-card .horse-show-identity { grid-column: 2; grid-row: 1; }
.event-card.show-card .horse-show-judge { grid-column: 3; grid-row: 1; }
.event-card.show-card .horse-show-prize {
  grid-column: 4;
  grid-row: 1 / -1;
  align-self: stretch;
}
.event-card.show-card .horse-show-notes {
  grid-column: 2 / 4;
  grid-row: 2;
  padding: 0 20px 17px;
  border: 0;
}
@media (max-width: 720px) {
  .event-card.show-card .horse-show-layout {
    grid-template-columns: 65px minmax(0,1fr) 105px;
    grid-template-rows: auto auto auto;
  }
  .event-card.show-card .horse-show-layout > .horse-event-date {
    grid-column: 1;
    grid-row: 1 / -1;
  }
  .event-card.show-card .horse-show-identity { grid-column: 2; grid-row: 1; }
  .event-card.show-card .horse-show-judge { grid-column: 2; grid-row: 2; border: 0; }
  .event-card.show-card .horse-show-prize { grid-column: 3; grid-row: 1 / -1; }
  .event-card.show-card .horse-show-notes {
    grid-column: 2;
    grid-row: 3;
    padding: 0 12px 12px;
  }
}

/* Nayttelykortin luokkatyyppi ja luokan nimi selkeasti lihavoituina. */
.event-card.show-card .horse-show-identity .horse-event-tags > span,
.event-card.show-card .horse-show-identity .horse-event-tags > .horse-event-discipline {
  font-weight: 800;
}

/* Kilpailukortin laji ja luokan nimi vahvemmalla fontilla. */
.event-card.competition-card .horse-event-identity .horse-event-tags > span {
  font-weight: 800;
}

/* Lajikohtaiset tilastot – kilpailukalenterin korttityyli */
.competition-stats {
    background: var(--cream, #faf9f4);
    color: var(--ink, #70465c);
    border: 1px solid rgba(90, 59, 75,.25);
    border-left: 5px solid var(--green, #ad7892);
    border-radius: 3px;
    box-shadow: none;
    padding: 20px 22px;
    margin: 1.5rem 0;
}
.competition-stats h3 {
    color: var(--ink, #70465c);
    font-weight: 800;
    font-size: 1.15rem;
    margin: 0 0 14px;
}
.competition-stats .stats-scroll { overflow-x: auto; }
.competition-stats table {
    width: 100%;
    min-width: 550px;
    border-collapse: collapse;
    color: var(--ink, #70465c);
    text-align: left;
}
.competition-stats thead { background: rgba(90, 59, 75,.09); }
.competition-stats thead th {
    color: var(--ink, #70465c);
    font-weight: 800;
    font-size: .82rem;
    letter-spacing: .025em;
}
.competition-stats tbody th {
    color: var(--ink, #70465c);
    font-weight: 800;
}
.competition-stats td { color: var(--ink, #70465c); }
.competition-stats th, .competition-stats td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(90, 59, 75,.18);
}
.competition-stats tbody tr:last-child th,
.competition-stats tbody tr:last-child td { border-bottom: 0; }
.competition-stats tbody tr:hover { background: rgba(90, 59, 75,.045); }
.competition-stats .stats-help {
    color: var(--ink, #70465c);
    opacity: .85;
    font-size: .82rem;
    line-height: 1.6;
    margin: 14px 0 0;
}
@media (max-width: 720px) {
    .competition-stats { padding: 16px 12px; }
    .competition-stats th, .competition-stats td { padding: 10px 8px; }
}

/* Kilpailutilastojen otsakerivi: selkea tumma vihrea palkki */
.competition-stats { padding: 0; overflow: hidden; }
.competition-stats .stats-scroll { overflow-x: auto; }
.competition-stats thead { background: var(--green, #ad7892); }
.competition-stats thead th {
  background: var(--green, #ad7892);
  color: #fff !important;
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .045em;
  padding: 16px 13px;
  border-bottom: 3px solid var(--pink, #dc829d);
  white-space: nowrap;
}
.competition-stats tbody th, .competition-stats tbody td { padding: 13px; }
.competition-stats tbody tr:nth-child(even) { background: rgba(90, 59, 75,.045); }

/* Tilastotaulukko: luvut keskella, laji vasemmalla; hillitty otsakerivi. */
.competition-stats thead,
.competition-stats thead th { background: #e9e1e5; }
.competition-stats thead th {
  color: var(--ink, #70465c) !important;
  border-bottom: 0;
}
.competition-stats thead th:not(:first-child),
.competition-stats tbody td { text-align: center; }
.competition-stats thead th:first-child,
.competition-stats tbody th { text-align: left; }
.competition-stats thead th:last-child { border-right: 0; }

/* Tilastotaulukon otsakerivilla ei ole ala- eika oikeaa reunusta. */
.competition-stats thead th { border-bottom: 0 !important; border-right: 0 !important; }

/* Luonnekuvauksen valit korjattu: aiempi .intro.section-shell { padding: 0 }
   ohitti .intro-saannon, joten kaytetaan samaa tarkempaa valitsinta. */
.intro.section-shell {
    box-sizing: border-box;
    padding-top: 45px;
    padding-bottom: 45px;
}
@media (max-width: 720px) {
    .intro.section-shell {
        padding-top: 45px;
        padding-bottom: 45px;
    }
}

/* Jälkeläiskortti: lisätiedot omassa sarakkeessa toisen vanhemman oikealla puolella. */
.foal-card > .foal-other-parent { grid-column: 3; min-width: 0; overflow-wrap: anywhere; }
.foal-card > .foal-notes { grid-column: 4; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 850px) {
  .foal-card > .foal-other-parent { grid-column: 1; }
  .foal-card > .foal-notes { grid-column: 2; }
}
@media (max-width: 600px) {
  .foal-card > .foal-other-parent, .foal-card > .foal-notes { grid-column: 1; }
}

/* Kilpailupaikan maatunnus ja ruusukkeet */
.competition-venue-flag{display:inline-block!important;width:22px;height:auto;max-height:17px;object-fit:contain;vertical-align:middle;margin-right:5px;border:0;border-radius:0}.horse-rosettes{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0;margin:18px auto 0}.horse-rosettes img{display:block;max-height:150px;max-width:min(180px,90vw);width:auto;height:auto;object-fit:contain;margin:5px}

/* Kilpailupaikan lippu */
.competition-card .competition-venue-flag { display:inline-block; width:auto; height:16px; max-width:26px; object-fit:contain; vertical-align:middle; margin-right:5px; }

/* Kilpailupaikan lippu alkuperäisessä kuvakoossa, ilman pakotettua korkeutta. */
.competition-card .competition-venue-flag,
.competition-venue-flag {
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: initial;
  margin-right: 5px;
}

/* Yhteystietojen alkuperäistyylinen pienikokoinen lisätieto nimen vieressä. */
.facts dd .pikkuinfo {font-size: .8em; font-family: Lato, sans-serif; font-weight: 400; white-space: normal; color: inherit;}
.facts dd .pikkuinfo a {color: var(--pink); text-decoration: none;}
.facts dd .pikkuinfo a:hover {text-decoration: underline;}

/* Jalkelaisten, kilpailujen ja nayttelyiden korttien kulmat */
.foal-card,
.event-card.competition-card,
.event-card.show-card {
  border-radius: 20px 0;
}

/* Näyttelykortin päivämäärän tausta seuraa kortin pyöristettyä vasenta yläkulmaa. */
.event-card.show-card .horse-show-layout > .horse-event-date {
    border-top-left-radius: 15px;
}
/* Jälkeläiskortit erillisinä, ilman listan yläreunan viivaa. */
.foal-grid {
    border-top: 0;
    gap: 10px;
}
.foal-card {
    border-top: 0;
}

/* Jalkelaiskortit: kilpailukalenterin tausta ja reunus. */
.foal-grid .foal-card,
.foal-grid .foal-card:nth-child(even) {
  background: var(--cream, #faf9f4);
  border: 1px solid rgba(90, 59, 75,.25);
  border-left: 5px solid var(--green, #ad7892);
  border-radius: 20px 0;
  box-shadow: none;
}
.foal-grid .foal-card:hover {
  background: var(--cream, #faf9f4);
  border-left-color: var(--green, #ad7892);
}


/* Kilpailutilastot: korttipohjainen esitys kilpailukalenterin tyyliin. */
.competition-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 370px), 1fr));
  gap: 12px;
  margin: 1.5rem 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.competition-stat-card {
  min-width: 0;
  background: var(--cream, #faf9f4);
  border: 1px solid rgba(90, 59, 75,.25);
  border-left: 5px solid var(--green, #ad7892);
  border-radius: 20px 0;
  padding: 18px 20px;
  color: var(--ink, #70465c);
}
.competition-stat-sport {
  color: var(--ink, #70465c);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(90, 59, 75,.16);
}
.competition-stat-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.competition-stat-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  text-align: center;
}
.competition-stat-metric span {
  font-size: .71rem;
  font-weight: 700;
  color: var(--ink, #70465c);
  opacity: .78;
}
.competition-stat-metric strong {
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--ink, #70465c);
  white-space: nowrap;
}
@media (max-width: 580px) {
  .competition-stat-card { padding: 16px 14px; }
  .competition-stat-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
}

/* Ulkoinen päiväkirjalinkki päiväkirjamerkintöjen yläpuolella */
.external-diary-link { margin: 0 0 22px; }
.external-diary-link a { color: var(--pink); font-weight: 800; text-decoration: none; }
.external-diary-link a:hover, .external-diary-link a:focus-visible { text-decoration: underline; }

/* Näyttelypalkinnolle hieman lisää tilaa, vain palkinnon arvo pienemmäksi. */
@media (min-width: 721px) {
  .event-card.show-card .horse-show-layout {
    grid-template-columns: 92px minmax(0, 1.5fr) minmax(140px, 1fr) 155px;
  }
}
.event-card.show-card .horse-show-prize strong { font-size: 1.15rem; }
/* Kilpailun tulosarvo pienemmäksi; Tulos-otsikko säilyy ennallaan. */
.event-card.competition-card .horse-event-result strong { font-size: 1.25rem; }
@media (max-width: 680px) {
  .event-card.competition-card .horse-event-result strong { font-size: 1rem; }
}

/* Näyttelypalkinnolle hiukan lisää leveyttä; korostettu kilpailutulos vahvemmaksi. */
@media (min-width: 721px) {
  .event-card.show-card .horse-show-layout {
    grid-template-columns: 92px minmax(0, 1.5fr) minmax(140px, 1fr) 170px;
  }
}
.event-card.competition-card.event-card-highlight .horse-event-result strong {
  font-weight: 800;
}

/* Nayttelypalkinnon arvo pienemmaksi, otsikko ennallaan. */
.event-card.show-card .horse-show-prize strong { font-size: 1rem; }
/* Kilpailu- ja nayttelykorttien luokkatyypit vahvemmalla fontilla. */
.event-card.competition-card .horse-event-discipline,
.event-card.show-card .horse-event-discipline { font-weight: 900; }

/* Nayttelykortin palkinto-osiolle hieman enemman tilaa. */
@media (min-width: 721px) {
  .event-card.show-card .horse-show-layout {
    grid-template-columns: 92px minmax(0, 1.5fr) minmax(140px, 1fr) 185px;
  }
}

/* Päiväkirjan tekstikappaleiden normaalit välit. */
.diary-content p { margin: 0 0 0.65em; line-height: 1.65; }
.diary-content p:last-child { margin-bottom: 0; }

/* Saavutusten ja näyttelyarvonimien selkeämpi palstajako. */
.achievement-band .achievement-columns {
    grid-template-columns: minmax(0, 3fr) minmax(190px, .85fr);
    column-gap: clamp(3rem, 6vw, 6rem);
    row-gap: 2.5rem;
}
@media (max-width: 720px) {
    .achievement-band .achievement-columns {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 2.5rem;
    }
}

/* Sukuhevosen meriitit omalla rivillään perustietojen alla */
.ped-person .ped-merits { display:block; margin-top:5px; font-size:.9em; line-height:1.4; overflow-wrap:anywhere; }
