@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

:root {
    --color-bg: #c5d4bc;
    --color-surface: #2d3a2e;
    --color-surface-alt: #243027;
    --color-text: #e8efe3;
    --color-text-dark: #1f2a1f;
    --color-accent: #7fa36e;
    --shadow-soft: 0 8px 24px rgba(20, 30, 20, 0.12);
    --radius: 12px;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    color: var(--color-text-dark);
    background: var(--color-bg);
    line-height: 1.6;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    box-shadow: var(--shadow-soft);
}

.site-header .header-item {
    float: none !important;
    padding: 0 !important;
    margin-left: 1rem;
    font-size: 0.95rem;
}

#headerLogo {
    width: auto;
    height: 46px;
    margin-left: 0;
}

.site-tabs {
    position: sticky;
    z-index: 90;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.55rem 1.25rem;
    box-shadow: var(--shadow-soft);
}

.site-tab {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.82;
}

.site-tab:hover {
    text-decoration: none;
    opacity: 1;
}

.site-tab-active {
    background: rgba(255, 255, 255, 0.14);
    opacity: 1;
}

.animal-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.animal-shop-grid-item .animal-card {
    height: 100%;
}

section {
    width: 100%;
    padding: 3rem 1.5rem;
}

.section-center {
    display: flex;
    justify-content: center;
}

.section-columns {
    display: grid;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

.section-columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 1.75rem;
    margin: 0 0 1rem;
    letter-spacing: 0.02em;
}

.text-content {
    font-size: 1.05rem;
}

.text-content p {
    margin: 0 0 1rem;
}

#cover,
#heroImage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem;
}

#heroImage img,
#gifimage img {
    max-width: min(420px, 80vw);
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.content-media-wrap,
.content-media {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.animal-media {
    position: relative;
}

.content-media-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.content-media-frame {
    position: relative;
    width: 100%;
    max-height: min(420px, 50vh);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    background: rgba(20, 30, 20, 0.08);
}

.content-media-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-caption,
#heroImage p {
    margin-top: 1.25rem;
    font-family: 'Raleway', sans-serif;
    font-size: 1.35rem;
    font-weight: 600;
}

section:has(.content-media-large-wrap) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

section:has(.content-media-large-wrap)>div {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.section-columns:has(.content-media-large-wrap) {
    overflow: visible;
}

.section-column:has(.content-media-large-wrap) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.content-media-large-wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    overflow: visible;
}

.content-media-large-link {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    text-decoration: none;
    color: inherit;
    overflow: visible;
}

.content-media-large {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    overflow: visible;
}

.content-media-large-visual {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-height: 0;
}

.content-media-large-visual img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.content-media-large-caption {
    flex-shrink: 0;
    margin-top: 1.25rem;
    text-align: center;
}

.animal-card {
    max-width: 480px;
    margin: 0 auto;
}

.animal-card h2 {
    text-align: center;
    margin-bottom: 0.35rem;
}

.animal-species {
    text-align: center;
    margin: 0 0 1rem;
    color: #5a6a52;
    font-size: 1rem;
}

.animal-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    margin: 1rem 0 0;
    font-size: 0.95rem;
}

.animal-meta dt {
    margin: 0;
    font-weight: 600;
}

.animal-meta dd {
    margin: 0;
}

.animal-gene[title] {
    cursor: help;
    border-bottom: 1px dotted rgba(45, 58, 46, 0.45);
}

.animal-description {
    margin-top: 1rem;
}

.animal-shop-cta {
    margin-top: 1rem;
    text-align: center;
}

.animal-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin: 1rem auto 0;
    flex-wrap: nowrap;
    width: fit-content;
    max-width: 100%;
}

.animal-card-actions .animal-shop-link {
    flex: 0 1 auto;
    min-width: 0;
}

.animal-shop-link {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    background: var(--color-accent);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none !important;
}

.animal-shop-link:hover {
    filter: brightness(1.05);
}

.pedigree-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pedigree-modal-overlay[hidden] {
    display: none !important;
}

.pedigree-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 18, 0.55);
}

.pedigree-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 900px);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    color: #1f2a1f;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.pedigree-modal-dialog h3,
.pedigree-modal-title,
.pedigree-detail-list {
    color: #1f2a1f;
}

.pedigree-modal-actions {
    margin-top: 1rem;
    text-align: right;
}

.pedigree-close-btn {
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: #f4f8f1;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
}

.pedigree-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: #fff;
    color: #2d3a2e;
    cursor: pointer;
}

.pedigree-open-btn svg {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
}

.animal-card .pedigree-open-btn {
    display: inline-flex;
    margin: 0;
    color: #2d3a2e;
    flex-shrink: 0;
}

body.pedigree-modal-open {
    overflow: hidden;
}

.animal-gender-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 54px;
    height: 54px;
    pointer-events: none;
    overflow: visible;
}

.animal-gender-badge svg {
    width: 100%;
    height: 100%;
    display: block;
}

#aboutText,
#meText,
#contactBlock {
    padding: 1rem 0;
}

@media (max-width: 900px) {

    .section-columns-2,
    .section-columns-3,
    .section-columns-4 {
        grid-template-columns: 1fr;
    }

    section {
        padding: 2rem 1rem;
    }

    .site-header {
        flex-wrap: wrap;
        height: auto !important;
        min-height: var(--header-height);
        padding: 0.75rem 1rem;
    }

    body {
        margin-top: 72px !important;
    }
}