/**
 * Template-level content: page header, entry content, post lists,
 * search results, pagination.
 */

/* ---------- Page header (chalkboard) ---------- */
.page-header {
    overflow: hidden; /* image-frame shadow must not bleed onto the light content */
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .625rem;
    margin: 0 0 1.375rem;
    padding: 0;
    list-style: none;
    font-size: .84375rem;
    letter-spacing: .02em;
    color: #9c978b;
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: .625rem;
    color: #9c978b;
}

.breadcrumb a {
    color: #9c978b;
}

.breadcrumb a:hover {
    color: var(--color-text-inverse);
}

.breadcrumb [aria-current] {
    color: var(--color-text-inverse-muted);
}

.page-header__hand {
    margin: 0 0 .625rem;
}

.page-header__inner {
    display: grid;
    gap: 2.5rem;
    align-items: center;
    padding-block: clamp(3rem, 2rem + 4vw, 4.375rem) clamp(3.5rem, 2.5rem + 4vw, 4.875rem);
}

@media (min-width: 62rem) {
    .page-header--image .page-header__inner {
        grid-template-columns: minmax(0, 1fr) minmax(0, 29.375rem);
        gap: clamp(3rem, 5vw, 4.5rem);
    }
}

.page-header__title {
    max-width: 17ch;
    margin: 0;
    font-size: clamp(2.5rem, 1.8rem + 3vw, 3.875rem);
    line-height: 1.06;
    color: var(--color-text-inverse);
}

.page-header .strich {
    margin-top: 1.25rem;
}

.page-header__lead {
    max-width: 56ch;
    margin: 1.625rem 0 0;
    font-size: var(--fs-big);
    line-height: 1.68;
}

/* Image: chalk frame for photos, bare for cut-out product shots */
.page-header--rahmen .page-header__media {
    padding: .75rem;
    border-radius: 1.375rem;
    background: rgba(245, 242, 233, .08);
    box-shadow: inset 0 0 0 1.5px rgba(245, 242, 233, .2), 0 44px 90px -44px rgba(0, 0, 0, .9);
}

.page-header--rahmen .page-header__img {
    width: 100%;
    aspect-ratio: 1 / .94;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.page-header--frei .page-header__media {
    display: flex;
    justify-content: center;
}

.page-header--frei .page-header__img {
    width: 100%;
    max-width: 25rem;
    height: auto;
}

@media (max-width: 61.99rem) {
    .page-header__media {
        max-width: 29.375rem;
    }
}

/* Running text: WPBakery text blocks, classic content and my_textimage.
   Scoped with :where() so section elements (my-*) keep their own styling. */
:where(.entry-content .wpb_text_column, .entry-content > :not(.vc_row, .wpb-content-wrapper), .my-textimage__content) :is(p, li) {
    color: var(--color-text-muted);
}

:where(.entry-content .wpb_text_column, .entry-content > :not(.vc_row, .wpb-content-wrapper), .my-textimage__content) strong {
    color: var(--color-text);
}

:where(.entry-content .wpb_text_column, .entry-content > :not(.vc_row, .wpb-content-wrapper), .my-textimage__content) a:not([class]) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
}

:where(.entry-content .wpb_text_column, .entry-content > :not(.vc_row, .wpb-content-wrapper), .my-textimage__content) ul:not([class]) {
    display: grid;
    gap: .75rem;
    margin: 0 0 1.25em;
    padding: 0;
    list-style: none;
}

:where(.entry-content .wpb_text_column, .entry-content > :not(.vc_row, .wpb-content-wrapper), .my-textimage__content) ul:not([class]) > li {
    position: relative;
    padding-left: 1.625rem;
}

:where(.entry-content .wpb_text_column, .entry-content > :not(.vc_row, .wpb-content-wrapper), .my-textimage__content) ul:not([class]) > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .6em;
    width: .5625rem;
    height: .5625rem;
    border-radius: var(--radius-pill);
    background: var(--color-accent);
}

:where(.entry-content .wpb_text_column, .entry-content .wpb_single_image) img {
    border-radius: var(--radius);
}

/* ---------- Post list ---------- */
.post-list,
.search-list {
    display: grid;
    gap: 1.5rem;
}

.post-teaser__link,
.search-result__link {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    border-radius: 1.375rem;
    background: var(--color-surface);
    color: inherit;
    box-shadow: inset 0 0 0 1px var(--color-border);
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.post-teaser__link:hover,
.search-result__link:hover {
    color: inherit;
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover), inset 0 0 0 1px var(--color-border);
}

@media (prefers-reduced-motion: reduce) {
    .post-teaser__link:hover,
    .search-result__link:hover {
        transform: none;
    }
}

/* The image never drives the card height: it fills a box sized by the text
   (desktop) or by a fixed ratio (mobile). */
.post-teaser__image {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--color-background-alt);
}

.post-teaser__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-teaser__text {
    padding: 1.5rem 1.75rem 1.75rem;
}

@media (min-width: 48rem) {
    .post-teaser__link {
        grid-template-columns: 21.25rem minmax(0, 1fr);
        align-items: center;
        gap: 2.25rem;
    }

    .post-teaser__image {
        align-self: stretch;
        aspect-ratio: auto;
        min-height: 13.75rem;
    }

    .post-teaser__text {
        padding: 1.875rem 2.5rem 1.875rem 0;
    }

    .post-teaser:not(.has-post-thumbnail) .post-teaser__link {
        grid-template-columns: 1fr;
    }

    .post-teaser:not(.has-post-thumbnail) .post-teaser__text {
        padding-left: 2.5rem;
    }
}

.post-teaser__date {
    font-size: .84375rem;
    color: var(--color-text-muted);
}

.post-teaser__title,
.search-result__title {
    margin: .625rem 0;
    font-size: var(--fs-h3);
}

.post-teaser__more {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1.125rem;
    font-size: .9375rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.post-teaser__link:hover .post-teaser__title,
.search-result__link:hover .search-result__title {
    color: var(--color-primary);
}

.post-teaser__excerpt,
.search-result__excerpt {
    max-width: 62ch;
    margin: 0;
    font-size: 1rem;
    line-height: 1.62;
    color: var(--color-text-muted);
}

.search-result__link {
    padding: 1.75rem 2rem;
}

/* ---------- Pagination ---------- */
.pagination {
    margin-top: 3rem;
}

.pagination__list {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.875rem;
    height: 2.875rem;
    padding: 0 .875rem;
    border-radius: var(--radius-pill);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: .96875rem;
    font-weight: var(--font-weight-bold);
    box-shadow: inset 0 0 0 1.5px var(--color-border);
}

.pagination a.page-numbers:hover {
    color: var(--color-text);
    box-shadow: inset 0 0 0 1.5px var(--color-text);
}

.pagination .page-numbers.current {
    background: var(--color-dark);
    color: var(--color-white);
    box-shadow: none;
}

.pagination .page-numbers.dots {
    background: transparent;
    box-shadow: none;
}

/* ---------- Search form ---------- */
.search-form {
    display: flex;
    gap: .75rem;
    max-width: 36rem;
}

.search-form label {
    flex: 1;
}

.search-form .search-submit {
    flex: none;
    min-height: 3.25rem;
    padding: 0 1.5rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--color-dark);
    color: var(--color-white);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
}

.search-form .search-submit:hover {
    background: var(--color-primary);
}

/* ---------- Landing page: sticky contact bar (page-landing.php) ---------- */
/* WCAG 2.4.11: keep focused elements / anchor targets clear of the bar */
html:has(.landing-bar) {
    scroll-padding-bottom: 5.5rem;
}

.landing-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: rgba(31, 35, 32, .97);
    color: var(--color-text-inverse);
    box-shadow: 0 -18px 40px -24px rgba(32, 32, 29, .7);
}

.landing-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 2rem;
    padding-block: .875rem;
}

.landing-bar__text {
    margin: 0;
    font-size: .96875rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-inverse);
}

.landing-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
}

.landing-bar .btn {
    min-height: 2.75rem;
    padding: .625rem 1.25rem;
    font-size: .90625rem;
}

@media (max-width: 47.99rem) {
    .landing-bar__text {
        display: none;
    }

    .landing-bar__actions {
        width: 100%;
    }

    .landing-bar__actions .btn {
        flex: 1;
    }
}
