:root{
    --base: #463D3D;
    --surface: #322525;
    --text: #F3EEE8;
    --text-muted: #CFC4C0;
    --accent: #F2BD00;
    --accent-highlight: #FDCE24;
    --accent-on: #000;
    --max-width: 1040px;
    --measure: 65ch;
    --gap: clamp(1rem, 3vw, 2rem);
    --shadow: 0 6px 20px rgb(0 0 0 / .35);
}

* { box-sizing: border-box; }

html{
    background-color: var(--base);
}

body{
    margin: 0 auto;
    max-width: var(--max-width);
    min-height: 100vh;
    background-color: var(--surface);
    font-family: 'Fira Sans', system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    box-shadow: var(--shadow);
}

h1, h2{ line-height: 1.2; color: var(--text); }
h1{ font-size: clamp(1.7rem, 4vw, 2.125rem); font-weight: 300; margin: 0 0 1.25rem; }
h2{ font-size: clamp(1.35rem, 3vw, 1.625rem); font-weight: 500; margin: 2rem 0 .75rem; }
a { color: currentColor; text-underline-offset: .15em; }
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--accent-highlight);
    outline-offset: 2px;
}

.visually-hidden{
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Page grid: content + sidebar */
.page{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: var(--gap);
    padding: var(--gap);
    align-items: start;
}
main{ min-width: 0; }
main > :where(p, ul, ol, h2, h3){ max-width: var(--measure); }
main img{ max-width: 100%; height: auto; }

/* Header */
.site-header{
    position: relative;
    background: url(../images/ginkgo.jpg) center / cover no-repeat;
}
.site-header::before{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgb(50 37 37 / .1), rgb(50 37 37 / .8));
    pointer-events: none;
}
.header-inner{
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem var(--gap) 1.25rem;
}
#homeLink{
    display: block;
    width: min(306px, 55vw);
    filter: drop-shadow(0 2px 6px rgb(0 0 0 / .5));
}
#homeLink img{ display: block; width: 100%; height: auto; }

.header-call{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-decoration: none;
    color: var(--text);
    text-shadow: 0 1px 4px rgb(0 0 0 / .6);
}
.call-label{ font-size: .95rem; }
.call-number{
    color: var(--accent);
    font-size: clamp(1.35rem, 3.5vw, 1.9rem);
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
}
.header-call:hover .call-number{ color: var(--accent-highlight); }

/* Navigation */
.site-nav{
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--surface);
    border-bottom: 1px solid rgb(255 255 255 / .12);
}
.site-nav ul{
    list-style: none;
    margin: 0;
    padding: 0 var(--gap);
    display: flex;
    flex-wrap: wrap;
}
.site-nav a,
.site-nav span{
    display: block;
    padding: .8em .9em;
    min-height: 44px;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}
.site-nav a:hover{ color: var(--accent-highlight); }
.site-nav span[aria-current]{ border-bottom-color: var(--accent); }
.menu-button{ display: none; }

/* Sidebar: contact block */
.sidebar{ position: sticky; top: 4.5rem; }
.company{
    font-style: normal;
    border-top: 4px solid var(--accent);
    padding-top: 1rem;
}
.contact-lead{ margin: 0; color: var(--text-muted); }
.company .tel{
    display: block;
    color: var(--accent);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    margin-bottom: 1rem;
}
.company .tel:hover{ color: var(--accent-highlight); }
.company .name{ font-weight: 500; }
.company .email{ overflow-wrap: anywhere; }

/* Footer */
.site-footer{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem 2rem;
    padding: 1.25rem var(--gap);
    background-color: #241919;
    font-size: .9rem;
    color: var(--text-muted);
}
.site-footer a{ text-decoration: none; }
.site-footer a:hover{ color: var(--accent); text-decoration: underline; }
.site-footer .legal{ display: flex; gap: 1.5rem; flex-wrap: wrap; }
.site-footer .partners{ display: flex; gap: .25rem 1.5rem; flex-wrap: wrap; }
.site-footer .partners a{ text-decoration: underline; }

/* Per-page header images */
.room .site-header{ background-image: url(../images/ginkgo.jpg); }
.vorsorge .site-header{ background-image: url(../images/vorsorge.jpg); }
.hennen .site-header{ background-image: url(../images/hennen.jpg); }
.trauerfall .site-header{ background-image: url(../images/trauerfall.jpg); }
.leistungen .site-header{ background-image: url(../images/leistungen.jpg); }

/* Narrow screens */
@media (max-width: 760px){
    .page{ grid-template-columns: 1fr; }
    .sidebar{ position: static; }

    .menu-button{
        appearance: none;
        display: flex;
        align-items: center;
        gap: .75rem;
        width: 100%;
        min-height: 48px;
        padding: 0 var(--gap);
        background: none;
        border: 0;
        color: var(--text);
        font: inherit;
        font-weight: 500;
        text-align: left;
        cursor: pointer;
    }
    .menu-button::before{
        content: "";
        width: 1.25rem;
        height: 2px;
        background: currentColor;
        box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
    }
    .menu-button[aria-expanded="true"]{ color: var(--accent); }

    .site-nav ul{
        flex-direction: column;
        padding: 0 0 .5rem;
        border-top: 1px solid rgb(255 255 255 / .12);
    }
    .js .site-nav ul{ display: none; }
    .js .menu-button[aria-expanded="true"] + ul{ display: flex; }
    .site-nav a,
    .site-nav span{
        padding: .75em var(--gap);
        border-bottom: 0;
        border-left: 4px solid transparent;
    }
    .site-nav span[aria-current]{ border-left-color: var(--accent); color: var(--accent); }
}

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

/* Image gallery: justified rows, each figure grows with its aspect ratio */
.gallery{
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: .5rem;
    margin: 2rem 0;
}
.gallery figure{
    position: relative;
    display: grid;
    margin: 0;
    overflow: hidden;
    border-radius: 3px;
    background-color: var(--base);
    flex-grow: var(--ratio);
    flex-basis: calc(var(--ratio) * 12.5rem);
    max-width: calc(var(--ratio) * 18rem);
}
.gallery img{
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery figcaption{
    position: absolute;
    inset: auto 0 0;
    padding: 1.5rem .75rem .6rem;
    font-size: .9rem;
    line-height: 1.3;
    background: linear-gradient(to top, rgb(36 25 25 / .85), transparent);
}
