/* The Cosy One – Website
   Nachtblau als Markenfarbe (Kopf, Fuß, Bänder), heller Papierton als Lesefläche,
   gedecktes Türkis als Akzent, Cyan nur als Erinnerung an die alte Seite.
   Schriften: Libre Baskerville (Überschriften), Source Sans 3 (Text) – lokal, SIL OFL. */


:root {
    /* Nachtblau (Anklang an den alten Verlauf #060062 → #462df8) */
    --night: #0b0a4f;
    --night-deep: #07063a;
    --night-line: rgba(214, 211, 242, .18);
    --night-text: #d6d3f2;      /* 12:1 auf --night */
    --night-muted: #a9a5d8;     /* 7.7:1 */
    --cyan: #00ffff;            /* nur auf Nachtblau */
    --cyan-soft: #7fe3e0;

    /* Papier */
    --paper: #f6f1e7;
    --paper-2: #ede6d7;
    --ink: #1e1b33;             /* 14.8:1 */
    --ink-soft: #55516a;        /* 6.7:1 */
    --heading: #12105e;         /* Nachtblau auf Papier */
    --rule: #d9cfbc;
    --rule-strong: #b9ad95;
    --teal: #17676b;            /* 5.8:1 auf Papier */
    --teal-line: #2aa3a0;       /* nur Schmucklinie */
    --amber: #f2c14e;

    --serif: "Libre Baskerville", "Baskerville", "Times New Roman", serif;
    --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

    --gutter: 1rem;
    --measure: 40rem;
    --wide: 72rem;
    --margin-col: 16rem;
    --space: clamp(2.5rem, 2rem + 2.5vw, 4.5rem);
}
@media (min-width: 40rem) { :root { --gutter: 2rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.0625rem/1.65 var(--sans);
    font-kerning: normal;
    font-variant-numeric: oldstyle-nums proportional-nums;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
@media (min-width: 64rem) { body { font-size: 1.125rem; } }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--heading); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.masthead :focus-visible, .site-footer :focus-visible, .home-cats :focus-visible, .lightbox :focus-visible { outline-color: var(--cyan); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--heading); line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; }
.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.main { flex: 1; outline: none; padding-bottom: var(--space); }

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 200;
    background: var(--paper); color: var(--heading); padding: .75rem 1rem; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ------------------------------------------------------------ Vorschau */
.preview-bar {
    position: sticky; top: 0; z-index: 150;
    display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline;
    padding: .6rem var(--gutter); background: var(--amber); color: #2b2100; font-size: .95rem;
}
.preview-bar strong { text-transform: uppercase; letter-spacing: .12em; }
.preview-bar a { color: #2b2100; margin-left: auto; font-weight: 600; }
.draft-note {
    margin-top: 1rem; padding: .5rem .9rem; border-left: 4px solid var(--amber);
    background: #fbf1d3; color: #4a3800; font-size: .95rem;
}

/* ------------------------------------------------------------ Kopf */
.masthead {
    position: relative;
    background:
        radial-gradient(90rem 30rem at 85% -12rem, rgba(70, 45, 248, .42), transparent 70%),
        linear-gradient(180deg, #060062 0%, var(--night) 100%);
    color: #fff;
    border-bottom: 1px solid var(--night-deep);
}
.masthead::after {
    /* Haarlinie in Cyan als Erinnerung an die alten Überschriften */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, .55) 20%, rgba(0, 255, 255, .55) 80%, transparent);
}
.masthead-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.wordmark { display: inline-flex; flex-direction: column; color: #fff; text-decoration: none; line-height: 1.1; padding-block: .25rem; }
.wordmark:hover { color: #fff; }
.wordmark-main { font-family: var(--serif); font-size: 1.45rem; letter-spacing: .005em; }
.wordmark-sub { font-family: var(--serif); font-style: italic; font-size: .98rem; color: var(--night-text); margin-top: .2rem; }
.wordmark-amp { color: var(--cyan-soft); }
.wordmark-breed {
    font-family: var(--sans); font-size: .68rem; font-weight: 600; letter-spacing: .3em;
    text-transform: uppercase; color: var(--cyan-soft); margin-top: .45rem;
}
@media (min-width: 64rem) {
    .masthead-bar { padding-block: 1.9rem 1.4rem; }
    .wordmark { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: .7rem; }
    .wordmark-main { font-size: 2.15rem; }
    .wordmark-sub { font-size: 1.35rem; margin: 0; }
    .wordmark-breed { flex-basis: 100%; margin-top: .55rem; }
}

/* Menü-Schaltfläche (mobil). Ohne JavaScript öffnet der Anker #menu das Menü über :target. */
.menu-toggle {
    display: inline-flex; align-items: center; gap: .6rem; min-height: 3rem; padding: .5rem .9rem;
    color: #fff; text-decoration: none; font-weight: 600; letter-spacing: .04em;
    border: 1px solid var(--night-line);
}
.menu-toggle:hover { color: var(--cyan); border-color: var(--cyan-soft); }
.menu-toggle-lines, .menu-toggle-lines::before, .menu-toggle-lines::after {
    display: block; width: 1.15rem; height: 2px; background: currentColor; position: relative;
}
.menu-toggle-lines::before, .menu-toggle-lines::after { content: ""; position: absolute; left: 0; }
.menu-toggle-lines::before { top: -6px; }
.menu-toggle-lines::after { top: 6px; }

.site-nav { display: none; }
.nav-list, .sub-list { list-style: none; margin: 0; padding: 0; }

/* Mobil: Vollbild-Menü */
@media (max-width: 63.99rem) {
    .site-nav:target, .site-nav.is-open {
        display: block; position: fixed; inset: 0; z-index: 120; overflow-y: auto; overscroll-behavior: contain;
        background: var(--night); color: #fff; padding-bottom: 3rem;
    }
    .site-nav-head {
        display: flex; justify-content: space-between; align-items: center;
        padding: 1rem var(--gutter); border-bottom: 1px solid var(--night-line);
        position: sticky; top: 0; background: var(--night); z-index: 1;
    }
    .site-nav-title { font-family: var(--serif); font-size: 1.2rem; }
    .menu-close {
        display: inline-flex; align-items: center; min-height: 3rem; padding: .5rem 1rem;
        color: #fff; border: 1px solid var(--night-line); text-decoration: none; font-weight: 600;
    }
    .menu-close:hover { color: var(--cyan); }
    .nav-list { padding: .5rem var(--gutter) 0; }
    .nav-item { display: flex; flex-wrap: wrap; align-items: stretch; border-bottom: 1px solid var(--night-line); }
    .nav-link {
        flex: 1; display: flex; align-items: center; min-height: 3.6rem; padding: .6rem 0;
        font-family: var(--serif); font-size: 1.3rem; color: #fff; text-decoration: none;
    }
    .nav-link:hover, .nav-link[aria-current] { color: var(--cyan); }
    .nav-item.is-active > .nav-link { color: var(--cyan-soft); }
    .sub-toggle {
        width: 3.6rem; min-height: 3.6rem; margin-right: calc(-1 * var(--gutter) / 2);
        background: none; border: 0; border-left: 1px solid var(--night-line); color: #fff; cursor: pointer;
    }
    .sub-toggle::before {
        content: ""; display: block; width: .6rem; height: .6rem; margin: auto;
        border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
        transform: translateY(-25%) rotate(45deg); transition: transform .2s;
    }
    .sub-toggle[aria-expanded="true"]::before { transform: translateY(15%) rotate(-135deg); }
    .sub-list { flex-basis: 100%; padding: 0 0 .75rem 1rem; }
    .js .sub-toggle[aria-expanded="false"] + .sub-list { display: none; }
    .sub-item a {
        display: flex; align-items: center; min-height: 3rem; padding: .25rem 0;
        color: var(--night-text); text-decoration: none; font-size: 1.1rem;
    }
    .sub-item a:hover, .sub-item a[aria-current] { color: var(--cyan); }
    body.menu-open { overflow: hidden; }
}

/* Desktop: Hauptmenü unter der Wortmarke, Untermenüs als Aufklapper */
@media (min-width: 64rem) {
    .menu-toggle, .site-nav-head { display: none; }
    .site-nav { display: block; border-top: 1px solid var(--night-line); }
    .nav-list { display: flex; flex-wrap: wrap; gap: 0 .25rem; padding-left: calc(var(--gutter) - .75rem); }
    .nav-item { position: relative; display: flex; align-items: center; }
    .nav-link {
        display: block; padding: .95rem .75rem 1rem; color: var(--night-text);
        text-decoration: none; font-size: 1rem; letter-spacing: .02em; position: relative;
    }
    .nav-link:hover { color: #fff; }
    .nav-item.is-active > .nav-link { color: #fff; }
    .nav-item.is-active > .nav-link::after {
        content: ""; position: absolute; left: .75rem; right: .75rem; bottom: -1px; height: 2px; background: var(--cyan);
    }
    .sub-toggle {
        width: 1.6rem; height: 2.2rem; margin-left: -.6rem; margin-right: .1rem; padding: 0;
        background: none; border: 0; color: var(--night-muted); cursor: pointer;
    }
    .sub-toggle::before {
        content: ""; display: block; width: .4rem; height: .4rem; margin: auto;
        border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
        transform: translateY(-30%) rotate(45deg);
    }
    .sub-toggle:hover { color: var(--cyan); }
    .sub-list {
        position: absolute; top: 100%; left: 0; z-index: 50; min-width: 14rem;
        padding: .5rem 0; background: var(--night-deep); border: 1px solid var(--night-line); border-top: 2px solid var(--cyan);
        visibility: hidden; opacity: 0; transform: translateY(-.25rem);
        transition: opacity .15s, transform .15s, visibility 0s .15s;
    }
    .nav-item:hover > .sub-list, .nav-item:focus-within > .sub-list, .sub-toggle[aria-expanded="true"] + .sub-list {
        visibility: visible; opacity: 1; transform: none; transition: opacity .15s, transform .15s;
    }
    .js .nav-item:focus-within > .sub-toggle[aria-expanded="false"] + .sub-list:not(:hover) { visibility: hidden; opacity: 0; }
    .js .nav-item:hover > .sub-list { visibility: visible; opacity: 1; transform: none; }
    .sub-item a { display: block; padding: .55rem 1.1rem; color: var(--night-text); text-decoration: none; white-space: nowrap; }
    .sub-item a:hover, .sub-item a[aria-current] { color: #fff; background: rgba(255, 255, 255, .06); }
    .sub-item a[aria-current] { box-shadow: inset 2px 0 0 var(--cyan); }
}

/* ------------------------------------------------------------ Raster für Lesetext */
.page-head, .flow, .profile-section, .subpages, .posts-list, .pagination, .post-nav {
    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--gutter), 1fr)
        [wide-start] minmax(0, var(--margin-col))
        [content-start] min(var(--measure), 100% - 2 * var(--gutter))
        [content-end] minmax(0, var(--margin-col))
        [wide-end] minmax(var(--gutter), 1fr) [full-end];
}
.page-head > *, .flow > * { grid-column: content; }
.flow > .wide, .profile-section > *, .subpages > *, .posts-list > *, .pagination > *, .post-nav > * { grid-column: wide; }
/* Profil-, Wurf- und Listenseiten richten Titel und Text an der breiten Spalte aus */
.is-wide .page-head > * { grid-column: wide; }
.is-wide .flow > :not(.wide) { grid-column: wide; max-width: var(--measure); }
.flow { grid-auto-flow: row dense; row-gap: 1.4rem; align-items: start; }
.flow > .wide { margin-block: 1rem; }

.page-head { padding-top: clamp(2rem, 1.5rem + 2.5vw, 3.75rem); padding-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); }
.page-title { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.1rem); line-height: 1.12; letter-spacing: -.005em; }
.page-title::after { content: ""; display: block; width: 3.5rem; height: 2px; background: var(--teal-line); margin-top: 1.1rem; }
.page-meta { margin-top: .9rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.overline, .crumbs {
    font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--teal);
    margin-bottom: .9rem;
}
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.crumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--rule-strong); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.section-title { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
.section-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem;
    border-top: 1px solid var(--rule-strong); padding-top: 1.1rem; margin-bottom: 2rem;
}
.section-link, .more a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-link::after, .more a::after { content: " →"; }
.section-link:hover, .more a:hover { text-decoration: underline; }
.more { margin-top: 1.5rem; }
.empty-note { color: var(--ink-soft); font-style: italic; }

/* Fließtext */
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.55rem; margin-top: 2em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--teal); }
.prose strong { font-weight: 600; color: var(--heading); }
.prose blockquote {
    margin: 1.6em 0; padding: .2em 0 .2em 1.4rem; border-left: 2px solid var(--teal-line);
    font-family: var(--serif); font-style: italic; font-size: 1.15em; line-height: 1.55; color: var(--heading);
}
.prose table, .data-table { width: 100%; border-collapse: collapse; font-size: .95em; font-variant-numeric: lining-nums tabular-nums; }
.prose th, .prose td, .data-table th, .data-table td { text-align: left; padding: .55rem .75rem .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose thead th, .data-table thead th { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; border-bottom-color: var(--rule-strong); }
.data-table tbody th { font-weight: 600; color: var(--heading); }
.table-wrap { overflow-x: auto; }
.block-heading { font-size: 1.55rem; margin-top: 1.2rem; }
h3.block-heading { font-size: 1.2rem; }
.divider { border: 0; height: 1px; background: var(--rule-strong); margin: 1.5rem 0; width: 100%; }
.block-error { color: #8a1c1c; border-left: 3px solid #8a1c1c; padding-left: .75rem; }

/* Bilder */
figure { margin: 0; }
figcaption { margin-top: .6rem; font-size: .9rem; color: var(--ink-soft); font-style: italic; }
.block-image a, .gallery a, .profile-photo a, .home-lead-photo a { display: block; cursor: zoom-in; }
.block-image img { width: 100%; }
.block-image.size-medium { max-width: var(--measure); }
.block-image.size-small { max-width: min(20rem, 100%); }
.block-image.size-small.align-center { justify-self: center; }
.block-image.size-small.align-right { justify-self: end; }
@media (min-width: 78rem) {
    /* Kleine Bilder links/rechts stehen auf großen Bildschirmen in der Randspalte neben dem Text */
    .flow > .block-image.size-small.align-left { grid-column: wide-start / content-start; padding-right: 2rem; justify-self: end; margin-top: .4rem; }
    .flow > .block-image.size-small.align-right { grid-column: content-end / wide-end; padding-left: 2rem; justify-self: start; margin-top: .4rem; }
}

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 40rem) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
.gallery-n1 .gallery { grid-template-columns: 1fr; }
.gallery-n2 .gallery { grid-template-columns: repeat(2, 1fr); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-2); }
.gallery-n1 .gallery-item img { aspect-ratio: auto; }
.gallery figcaption { font-size: .85rem; margin-top: .4rem; }
@media (hover: hover) {
    .gallery a img, .block-image a img, .cat-card-photo img, .post-item-photo img, .subpage-photo img { transition: opacity .2s; }
    .gallery a:hover img, .block-image a:hover img { opacity: .9; }
}

.block-file a {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: .9rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-decoration: none;
}
.block-file-label { font-weight: 600; }
.block-file-label::before { content: "↓ "; color: var(--teal); }
.block-file-meta { color: var(--ink-soft); font-size: .9rem; white-space: nowrap; }

/* ------------------------------------------------------------ Katzennamen */
.cat-titles { font-family: var(--sans); font-size: .62em; font-weight: 700; letter-spacing: .08em; color: var(--teal); vertical-align: .25em; margin-right: .1em; }
.cattery { font-family: var(--sans); font-size: .58em; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; vertical-align: .2em; }
.page-title .cattery, .page-title .cat-titles { font-size: .4em; }
.page-title .cat-titles { vertical-align: .9em; }
.page-title .cattery { vertical-align: .55em; margin-left: .2em; }

/* ------------------------------------------------------------ Karten (ohne Kasten: Foto, Name, feine Angaben) */
.card-grid {
    list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem 1rem;
    grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, calc(50% - .5rem)), 1fr));
}
@media (min-width: 40rem) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 2.5rem 1.5rem; } }
.card-grid-small { grid-template-columns: repeat(auto-fill, minmax(min(8rem, calc(50% - .5rem)), 1fr)); }
@media (min-width: 40rem) { .card-grid-small { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); } }
.cat-card-inner { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.cat-card-photo { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); }
.cat-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
    background: var(--night); color: var(--cyan-soft); font-family: var(--serif); font-size: 3rem;
}
.cat-card-text { display: flex; flex-direction: column; gap: .2rem; padding-top: .8rem; border-top: 0; }
.cat-card-name { font-family: var(--serif); font-size: 1.12rem; line-height: 1.3; color: var(--heading); }
.cat-card-name .cattery { display: block; font-size: .6rem; margin-top: .3rem; vertical-align: 0; }
.cat-card-meta { font-size: .9rem; color: var(--ink-soft); line-height: 1.4; }
a.cat-card-inner:hover .cat-card-name .cat-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a.cat-card-inner:hover img { opacity: .92; }
.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--ink-soft); }
.status::before { content: ""; width: .5rem; height: .5rem; border: 1.5px solid currentColor; border-radius: 50%; }
.status-available, .status-current { color: var(--teal); }
.status-available::before, .status-current::before { background: currentColor; }
.status-placed { font-weight: 400; font-style: italic; }
.cat-card .status { margin-top: .3rem; }
.is-memorial .cat-card-photo img { filter: saturate(.85); }

/* ------------------------------------------------------------ Würfe */
.litter-feature + .litter-feature { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }
.litter-feature-head { margin-bottom: 1.75rem; max-width: 46rem; }
.litter-feature-head .overline { margin-bottom: .5rem; }
.litter-feature-title { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); }
.litter-feature-title a { color: inherit; text-decoration: none; }
.litter-feature-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.litter-feature-title .cattery { margin-left: .35em; }
.litter-feature-meta { margin-top: .5rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; }
.litter-feature-parents { margin-top: .25rem; }
.litter-feature-photo { display: block; }
.parents .cross { color: var(--ink-soft); margin: 0 .2em; }
.parents a { text-decoration: none; }
.parents a:hover .cat-name { text-decoration: underline; }
.parents .cattery { font-size: .62em; vertical-align: .15em; }
.parents .cat-titles { vertical-align: .15em; }
.unknown { color: var(--ink-soft); font-style: italic; }

.litter-year + .litter-year { margin-top: 2.5rem; }
.litter-year-title { font-family: var(--sans); font-size: .8rem; font-weight: 700; letter-spacing: .18em; color: var(--teal); padding-bottom: .5rem; border-bottom: 1px solid var(--rule-strong); }
.litter-rows { list-style: none; margin: 0; padding: 0; }
.litter-row {
    display: grid; grid-template-columns: 4.5rem 1fr; gap: .25rem 1rem; align-items: center;
    padding: .9rem 0; border-bottom: 1px solid var(--rule);
}
.litter-row-photo { grid-row: span 2; width: 4.5rem; aspect-ratio: 1; background: var(--paper-2); overflow: hidden; }
.litter-row-photo img { width: 100%; height: 100%; object-fit: cover; }
.litter-row-name { font-family: var(--serif); font-size: 1.15rem; color: var(--heading); }
.litter-row-name a { color: inherit; text-decoration: none; }
.litter-row-name a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.litter-row-name .cattery { margin-left: .4em; }
.litter-row-main { display: flex; flex-direction: column; gap: .15rem; }
.litter-row-parents { font-size: .95rem; }
.litter-row-meta { display: flex; flex-wrap: wrap; gap: 0 1rem; font-size: .9rem; color: var(--ink-soft); font-variant-numeric: lining-nums; }
@media (min-width: 48rem) {
    .litter-row { grid-template-columns: 5.5rem 1fr auto; }
    .litter-row-photo { grid-row: auto; width: 5.5rem; }
    .litter-row-meta { flex-direction: column; text-align: right; }
}

.litter-intro {
    display: grid; gap: 2.5rem; width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter));
    margin-inline: auto; padding-inline: var(--gutter);
}
@media (min-width: 52rem) {
    .litter-intro { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3.5rem; align-items: start; }
    .litter-intro.no-text { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); }
    .litter-intro.no-text .litter-parents { grid-column: 1; }
}
.stack { display: flex; flex-direction: column; gap: 1.4rem; min-width: 0; }
.litter-text { max-width: var(--measure); }
.parent-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.25rem; }
.parent a, .parent > div { display: flex; flex-direction: column; gap: .15rem; color: inherit; text-decoration: none; }
.parent-photo { display: block; aspect-ratio: 1; overflow: hidden; background: var(--paper-2); margin-bottom: .6rem; }
.parent-photo img { width: 100%; height: 100%; object-fit: cover; }
.parent-role { font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--teal); }
.parent-name { font-family: var(--serif); font-size: 1.1rem; color: var(--heading); }
.parent-name .cattery { display: block; margin-top: .2rem; font-size: .6rem; vertical-align: 0; }
.parent-meta { font-size: .9rem; color: var(--ink-soft); }
.parent a:hover .cat-name { text-decoration: underline; }

/* ------------------------------------------------------------ Beiträge */
.post-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.post-item {
    display: grid; grid-template-columns: 1fr 6.5rem; gap: .4rem 1.25rem;
    padding: 1.4rem 0; border-bottom: 1px solid var(--rule);
}
.post-item-date { grid-column: 1; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); font-variant-numeric: lining-nums; }
.post-item-text { grid-column: 1; }
.post-item-photo { grid-column: 2; grid-row: 1 / span 2; aspect-ratio: 1; overflow: hidden; background: var(--paper-2); }
.post-item-photo img { width: 100%; height: 100%; object-fit: cover; }
.post-item-title { font-size: 1.3rem; line-height: 1.3; }
.post-item-title a { color: var(--heading); text-decoration: none; }
.post-item-title a::after { content: ""; position: absolute; inset: 0; }
.post-item { position: relative; }
.post-item:hover .post-item-title a { text-decoration: underline; text-decoration-thickness: 1px; }
.post-item-excerpt { margin-top: .4rem; color: var(--ink-soft); font-size: .98rem; }
@media (min-width: 48rem) {
    .post-item { grid-template-columns: 11rem 1fr 13rem; gap: 2rem; padding: 1.75rem 0; align-items: start; }
    .post-item-date { grid-column: 1; padding-top: .35rem; }
    .post-item-text { grid-column: 2; }
    .post-item-photo { grid-column: 3; grid-row: 1; aspect-ratio: 3 / 2; }
    .post-item-title { font-size: 1.45rem; }
}

.pagination { margin-top: 2.5rem; }
.pagination > * { grid-column: wide; }
.pagination-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.pagination-pages { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; }
.pagination a, .pagination span[aria-current] {
    display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: 0 .75rem;
    text-decoration: none; border: 1px solid var(--rule); font-variant-numeric: lining-nums;
}
.pagination span[aria-current] { background: var(--heading); color: #fff; border-color: var(--heading); }
.pagination a:hover { border-color: var(--teal); }


.post-nav { margin-top: 3rem; }
.post-nav > * { grid-column: content; }
.post-nav a { display: block; padding: 1rem 0; border-top: 1px solid var(--rule); text-decoration: none; font-family: var(--serif); font-size: 1.1rem; color: var(--heading); }
.post-nav a span { display: block; font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: .2rem; }
.post-nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

/* ------------------------------------------------------------ Unterseiten-Verzeichnis */
.subpages { margin-top: var(--space); }
.posts-list { margin-top: 2rem; }
.subpages .section-title { margin-bottom: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--rule-strong); }
.subpage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); }
.subpage a { display: flex; flex-direction: column; gap: .35rem; color: inherit; text-decoration: none; }
.subpage-photo { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--paper-2); margin-bottom: .5rem; }
.subpage-rule { display: block; height: 2px; width: 3rem; background: var(--teal-line); margin-bottom: .5rem; }
.subpage-photo img { width: 100%; height: 100%; object-fit: cover; }
.subpage-title { font-family: var(--serif); font-size: 1.3rem; color: var(--heading); }
.subpage-excerpt { color: var(--ink-soft); font-size: .95rem; }
.subpage a:hover .subpage-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }

/* ------------------------------------------------------------ Katzenprofil */
.profile-intro {
    display: grid; gap: 1.75rem; width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter));
    margin-inline: auto; padding-inline: var(--gutter);
}
@media (min-width: 52rem) {
    .profile-intro { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3rem; align-items: start; }
}
.profile-photo img { width: 100%; }
.facts { margin: 0; border-top: 1px solid var(--rule-strong); }
.fact { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.fact dt { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); padding-top: .2rem; }
.fact dd { margin: 0; }
.fact dd a { text-decoration: none; }
.fact dd a:hover .cat-name, .fact dd a:hover { text-decoration: underline; }
.fact .cattery { font-size: .72em; vertical-align: .1em; }
.fact .cat-titles { vertical-align: .1em; }
.profile-text { margin-top: var(--space); }
.profile-section { margin-top: var(--space); }
.profile-section > .section-title { padding-top: 1.1rem; border-top: 1px solid var(--rule-strong); margin-bottom: 1.5rem; }
.section-intro { margin-bottom: 1.5rem; color: var(--ink-soft); }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem; }
.doc-list img { width: 12rem; border: 1px solid var(--rule); }
.memorial-note {
    margin-top: 1rem; font-family: var(--serif); font-style: italic; color: var(--ink-soft);
    display: flex; align-items: center; gap: .75rem;
}
.memorial-note::before { content: ""; width: 1.5rem; height: 1px; background: var(--rule-strong); }
.profile.is-memorial .page-title::after { background: var(--rule-strong); }

/* ------------------------------------------------------------ Startseite */
.home-lead { padding-top: clamp(1.5rem, 1rem + 3vw, 4rem); }
.home-lead-inner {
    display: grid; gap: 1.75rem; width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter));
    margin-inline: auto; padding-inline: var(--gutter);
}
.home-lead-photo { margin-inline: calc(-1 * var(--gutter)); }
.home-lead-photo figcaption { padding-inline: var(--gutter); }
.home-lead-photo img { width: 100%; max-height: 72vh; object-fit: cover; }
.home-title { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.2rem); line-height: 1.12; margin-bottom: 1.4rem; }
.home-title::after { content: ""; display: block; width: 3.5rem; height: 2px; background: var(--teal-line); margin-top: 1.1rem; }
.home-lead-text .prose { font-size: 1.06em; }
@media (min-width: 56rem) {
    .home-lead-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 3.5rem; align-items: center; }
    .home-lead-photo { margin-inline: 0; }
    .home-lead-photo figcaption { padding-inline: 0; }
}
.home-section {
    width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: var(--space) auto 0; padding-inline: var(--gutter);
}
.home-cats {
    margin-top: var(--space); padding-block: var(--space);
    background:
        radial-gradient(70rem 26rem at 10% 120%, rgba(70, 45, 248, .35), transparent 70%),
        var(--night);
    color: var(--night-text);
}
.home-cats-inner { width: 100%; max-width: calc(var(--wide) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.home-cats .section-head { border-top-color: var(--night-line); }
.home-cats .section-title { color: #fff; }
.home-cats .section-link { color: var(--cyan-soft); }
.home-cats .section-link:hover { color: var(--cyan); }
.home-cats .cat-card-name { color: #fff; }
.home-cats .cat-card-meta { color: var(--night-muted); }
.home-cats .cattery { color: var(--cyan-soft); }
.home-cats .cat-titles { color: var(--cyan-soft); }
.home-cats .cat-card-photo { background: var(--night-deep); }
.home-more { margin-top: var(--space); }

/* ------------------------------------------------------------ 404 */
.area-list { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--rule); }
.area-list a {
    display: flex; justify-content: space-between; align-items: center; min-height: 3.25rem; padding: .5rem 0;
    border-bottom: 1px solid var(--rule); font-family: var(--serif); font-size: 1.15rem; color: var(--heading); text-decoration: none;
}
.area-list a::after { content: "→"; color: var(--teal); font-family: var(--sans); }
.area-list a:hover { color: var(--teal); }

/* Kontakt- und Stammbaum-Bereich (Inhalte kommen aus anderen Teilen) */
.block-contact, .block-pedigree { min-width: 0; }
.block-pedigree { overflow-x: auto; }

/* ------------------------------------------------------------ Fuß */
.site-footer { background: var(--night-deep); color: var(--night-text); font-size: .95rem; padding-top: 3rem; }
.site-footer a { color: var(--night-text); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2.5rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; align-items: start; } }
.footer-wordmark { font-family: var(--serif); font-size: 1.35rem; color: #fff; }
.footer-wordmark span { display: block; font-style: italic; font-size: .85em; color: var(--night-text); margin-top: .2rem; }
.footer-note { margin-top: .6rem; font-size: .75rem; letter-spacing: .26em; text-transform: uppercase; color: var(--cyan-soft); font-weight: 600; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a { display: inline-block; padding: .35rem 0; }
.footer-counter { display: flex; flex-direction: column; }
.footer-counter-label { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--night-muted); font-weight: 600; }
.footer-counter-value { font-family: var(--serif); font-size: 1.5rem; color: #fff; font-variant-numeric: lining-nums tabular-nums; margin-top: .2rem; }
.footer-base {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
    padding-block: 1.25rem; border-top: 1px solid var(--night-line); color: var(--night-muted); font-size: .85rem;
}

/* ------------------------------------------------------------ Großansicht */
.lightbox {
    position: fixed; inset: 0; z-index: 300; width: 100%; height: 100%; max-width: none; max-height: none;
    margin: 0; padding: 0; border: 0; background: rgba(5, 4, 32, .96); color: #fff;
    display: none; touch-action: pan-y pinch-zoom;
}
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lightbox::backdrop { background: rgba(5, 4, 32, .96); }
.lightbox-top { display: flex; justify-content: space-between; align-items: center; padding: .5rem .5rem .5rem 1rem; font-size: .9rem; color: var(--night-text); font-variant-numeric: lining-nums; }
.lightbox-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 .5rem; }
.lightbox-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lightbox-caption { padding: .75rem 1rem 1.25rem; text-align: center; font-style: italic; color: var(--night-text); min-height: 3rem; }
.lightbox button {
    background: none; border: 1px solid transparent; color: #fff; cursor: pointer; font: inherit;
    min-width: 3rem; min-height: 3rem; display: inline-flex; align-items: center; justify-content: center;
}
.lightbox button:hover { color: var(--cyan); border-color: var(--night-line); }
.lightbox-close { font-size: 1rem; gap: .5rem; padding: 0 .75rem; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); width: 3.5rem; height: 5rem; }
.lightbox-prev { left: .25rem; }
.lightbox-next { right: .25rem; }
.lightbox-prev::before, .lightbox-next::before {
    content: ""; width: .9rem; height: .9rem; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
}
.lightbox-prev::before { transform: rotate(45deg); margin-left: .3rem; }
.lightbox-next::before { transform: rotate(-135deg); margin-right: .3rem; }
.lightbox-single .lightbox-prev, .lightbox-single .lightbox-next, .lightbox-single .lightbox-count { visibility: hidden; }
body.lightbox-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
    .masthead, .site-footer, .preview-bar, .skip-link { display: none; }
    body { background: #fff; color: #000; }
}

/* ------------------------------------------------------------ Bilder in links ausgerichteten Seiten */
/* Kleine Bilder beziehen sich auf die Textspalte, nicht auf die volle Breite */
.is-wide .flow > .block-image.size-small.align-center { justify-self: start; margin-inline-start: max(0px, (min(var(--measure), 100%) - min(20rem, 100%)) / 2); }
.is-wide .flow > .block-image.size-small.align-right { justify-self: start; margin-inline-start: max(0px, min(var(--measure), 100%) - min(20rem, 100%)); }
@media (min-width: 78rem) {
    .is-wide .flow > .block-image.size-small.align-left,
    .is-wide .flow > .block-image.size-small.align-right { grid-column: wide; padding: 0; margin-top: 0; }
    .is-wide .flow > .block-image.size-small.align-left { justify-self: start; }
}

/* ------------------------------------------------------------ Unterseiten: auf dem Handy kompakte Zeilen */
@media (max-width: 39.99rem) {
    .subpage-list { gap: 0; }
    .subpage { border-top: 1px solid var(--rule); }
    .subpage:last-child { border-bottom: 1px solid var(--rule); }
    .subpage a {
        display: grid; grid-template-columns: 5.5rem 1fr; column-gap: 1rem; row-gap: .15rem;
        align-items: center; padding: .9rem 0; min-height: 3.5rem;
    }
    .subpage-photo { grid-row: 1 / span 2; margin: 0; aspect-ratio: 1; }
    .subpage-rule { display: none; }
    .subpage-title { font-size: 1.15rem; grid-column: 2; }
    .subpage-excerpt { grid-column: 2; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .subpage a:not(:has(.subpage-photo)) .subpage-title,
    .subpage a:not(:has(.subpage-photo)) .subpage-excerpt { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------ Kontaktformular */
.contact-form { display: grid; gap: 1.1rem; max-width: 34rem; margin-top: .5rem; }
.contact-form .form-field { display: grid; gap: .35rem; }
.contact-form label { font-weight: 600; color: var(--ink); }
.contact-form .required, .contact-form .optional { font-weight: 400; color: var(--ink-soft); font-size: .9em; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form input[type="tel"],
.contact-form select, .contact-form textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fffdf8;
    border: 1px solid var(--rule-strong); border-radius: 2px; padding: .7rem .8rem; min-height: 3rem;
}
.contact-form textarea { min-height: 10rem; resize: vertical; line-height: 1.5; }
.contact-form select { appearance: none; padding-right: 2.5rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
    background-position: calc(100% - 1.25rem) 55%, calc(100% - .9rem) 55%; background-size: .35rem .35rem; background-repeat: no-repeat; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 3px solid var(--teal-line); outline-offset: 1px; border-color: var(--teal); }
.contact-form [aria-invalid="true"] { border-color: #a1262b; background: #fdf3f2; }
.contact-form .field-error { color: #a1262b; font-size: .92rem; margin: 0; }
.contact-form .form-errors { border-left: 3px solid #a1262b; background: #fdf3f2; padding: .8rem 1rem; color: #7d1d21; }
.contact-form .form-errors:focus { outline: none; }
.contact-form .form-check { grid-template-columns: auto 1fr; align-items: start; column-gap: .75rem; }
.contact-form .form-check input { width: 1.35rem; height: 1.35rem; margin-top: .2rem; accent-color: var(--teal); }
.contact-form .form-check label { font-weight: 400; }
.contact-form button[type="submit"], .button-primary {
    font: 600 1.05rem/1 var(--sans); color: #fff; background: var(--night); border: 0; border-radius: 2px;
    padding: 1rem 1.6rem; min-height: 3.2rem; cursor: pointer; letter-spacing: .02em;
}
.contact-form button[type="submit"]:hover, .button-primary:hover { background: var(--heading); box-shadow: inset 0 -3px 0 var(--teal-line); }
.contact-disabled { border-left: 3px solid var(--teal-line); padding: .25rem 0 .25rem 1rem; }

/* ------------------------------------------------------------ Bereichsnavigation neben Textseiten */
.section-nav { grid-column: wide; order: 99; margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--rule-strong); max-width: var(--measure); }
.section-nav-title { margin: 0 0 .6rem; font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.section-nav-title a { color: var(--teal); text-decoration: none; }
.section-nav ul { list-style: none; margin: 0; padding: 0; }
.section-nav li a {
    display: block; padding: .55rem 0 .55rem .9rem; border-left: 2px solid var(--rule);
    color: var(--ink-soft); text-decoration: none; line-height: 1.35;
}
.section-nav li a:hover { color: var(--heading); border-left-color: var(--teal-line); }
.section-nav li a[aria-current="page"] { color: var(--heading); font-weight: 600; border-left-color: var(--teal); }
@media (min-width: 75rem) {
    .has-aside .flow { position: relative; }
    /* Auf Textseiten bleiben auch große Bilder und Galerien in der Textspalte, rechts steht die Bereichsnavigation */
    .has-aside .flow > .wide { grid-column: wide; max-width: var(--measure); }
    .has-aside .section-nav {
        position: absolute; top: 0; bottom: 0; right: 0; margin: 0; padding: 0; border: 0;
        width: min(15rem, calc(100% - var(--measure) - 4rem));
        right: max(var(--gutter), (100% - var(--wide)) / 2);
    }
    .has-aside .section-nav-inner { position: sticky; top: 1.5rem; padding-left: 1.5rem; border-left: 1px solid var(--rule); }
    .has-aside .section-nav li a { border-left: 0; padding-left: 0; }
    .has-aside .section-nav li a { position: relative; }
    .has-aside .section-nav li a[aria-current="page"]::before {
        content: ""; position: absolute; left: calc(-1.5rem - 1px); top: .45rem; bottom: .45rem; width: 2px; background: var(--teal);
    }
}
