:root {
    --ink: #2c3338;
    --muted: #6b7480;
    --line: #e4e8ec;
    --accent: #8b6f47;
    --bg: #faf9f7;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 1rem 0;
    position: relative;
    z-index: 10; /* logo strokes overflow the header bottom edge, must paint above main */
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; justify-content: space-between; }
.brand { text-decoration: none; display: block; align-self: center; }
.brand-logo { display: block; height: auto; width: auto; max-width: 260px; max-height: 61px; margin: 13px 0 -26px; }
.main-nav { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .95rem; }
.main-nav a { text-decoration: none; color: var(--muted); }
.main-nav a:hover { color: var(--accent); }

@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: center; gap: .6rem 0; }
    .brand-logo { margin: 0; } /* stacked layout: no stroke overhang onto the menu */
    .main-nav { justify-content: center; }
}

.hero { padding: 3rem 0 2rem; text-align: center; }
.hero h1 { font-size: 2.2rem; margin-bottom: .5rem; }
.hero p { color: var(--muted); max-width: 46rem; margin: 0 auto; }

.content-page { padding-top: 2.5rem; }
.content-page h1 { margin: 0 0 1.5rem; }
.page-anchor-nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: 1.5rem; padding-left: 0; }
.page-anchor-nav a { color: var(--accent); text-decoration: none; padding: .2rem 0; border-bottom: 1px solid transparent; }
.page-anchor-nav a:hover { border-bottom-color: var(--accent); }

.page-section { scroll-margin-top: 1.5rem; }
.page-section + .page-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.page-section h2 { font-size: 1.3rem; margin: 0 0 1rem; }

/* narrower reading column so long lines don't stretch on big screens */
.page-section-body { max-width: 60ch; }

/* anchored terms (Fachbegriffe) + tight term-to-text distance */
.page-section-body h4 { margin: 1.3rem 0 .15rem; }
.page-section-body h4 + p { margin-top: .25rem; }
.h-anchor { color: var(--muted); text-decoration: none; margin-right: .35rem; }
.h-anchor svg { width: .72em; height: .72em; }
.h-anchor:hover { color: var(--accent); }

/* sections with photos: text left, photo tiles right */
.page-section--media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
    gap: 0 2.5rem;
    align-items: start;
}
.page-section--media .page-section-main { grid-column: 1; grid-row: 1; }
.page-section--media .page-gallery {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    grid-template-columns: 1fr;
    gap: .8rem;
    max-width: none;
}
.page-section--media .page-gallery-item img { aspect-ratio: 15 / 13; }
@media (max-width: 800px) {
    .page-section--media { grid-template-columns: 1fr; gap: 1.5rem; }
    .page-section--media .page-gallery { grid-column: auto; grid-row: auto; margin: 0; }
}

.section-title { margin: 2.5rem 0 1rem; font-size: 1.3rem; border-bottom: 1px solid var(--line); padding-bottom: .4rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s ease;
}
.card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.08); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card > span { padding: .75rem .9rem; }
.product-name { font-weight: bold; }
.product-price { color: var(--accent); }

/* Proportional ("Maßstab") vs frame-filling detail thumbnails in overview */
.card .card-thumbs {
    position: relative;
    display: block;
    aspect-ratio: 1;
    padding: 0;
    overflow: hidden;
}
.card-thumbs img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    opacity: 1;
    transition: opacity .18s ease;
}
.card-thumbs .thumb-proportional { display: none; }
.products.view-detail .card-thumbs .thumb-proportional { display: none; }
.products.view-scale .card-thumbs .thumb-proportional { display: block; }
.products.view-scale .card-thumbs .thumb-detail { display: none; }

.category-tools { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.view-toggle { display: inline-flex; gap: .25rem; padding: .2rem; background: #f2f2f2; border-radius: 6px; }
.view-toggle-btn {
    font: inherit; border: 0; background: transparent; padding: .45rem .7rem;
    border-radius: 5px; cursor: pointer; color: var(--muted);
}
.view-toggle-btn svg { display: block; fill: currentColor; }
.view-toggle-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.breadcrumb { font-size: .85rem; color: var(--muted); margin: 1.2rem 0; }
.breadcrumb span { color: var(--ink); }

.category-head { margin: 1rem 0 1.5rem; }

.product-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.2fr); gap: 2.5rem; margin: 1.5rem 0 3rem; }
@media (max-width: 800px) { .product-layout { grid-template-columns: 1fr; } .category-head { flex-direction: column; } }
.main-image { border: 1px solid var(--line); border-radius: 6px; width: 100%; height: auto; display: block; }
.thumbs { display: flex; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }

.short-desc { color: var(--muted); font-style: italic; }
.price-big { font-size: 1.5rem; font-weight: bold; }

.inquiry-form { display: grid; gap: .8rem; margin-top: 1rem; }
.inquiry-form label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }
.inquiry-form input, .inquiry-form textarea, .inquiry-form select {
    font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.inquiry-form fieldset {
    border: 0; border-top: 1px solid var(--line);
    margin: 1.2rem 0 0; padding: .9rem 0 0;
    display: grid; gap: .8rem;
}
.inquiry-form fieldset:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.inquiry-form legend {
    font-weight: bold; font-size: .95rem; color: var(--accent);
    padding: 0 .5rem 0 0;
}
.inquiry-form .sr-only {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.btn {
    background: var(--accent); color: #fff; border: 0; padding: .7rem 1.4rem;
    font: inherit; border-radius: 4px; cursor: pointer; justify-self: start;
}
.btn:hover { filter: brightness(.94); }

.notice { padding: .8rem 1rem; border-radius: 4px; margin: 1rem 0; }
.notice.success { background: #e8f5ec; border: 1px solid #b8e0c4; }

.muted { color: var(--muted); }

/* image gallery / lightbox */
.main-image.zoomable { cursor: zoom-in; }
.thumbs button {
    display: block; flex: 0 0 auto; line-height: 0;
    padding: 0; border: 1px solid var(--line); border-radius: 4px;
    background: none; cursor: pointer; width: 72px; height: 72px; overflow: hidden;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }

.lightbox {
    display: none;
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(20, 18, 15, .92);
}
.lightbox.open { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; max-width: 92vw; text-align: center; }
.lightbox .lb-img {
    max-width: 92vw; max-height: 86vh; width: auto; height: auto;
    border-radius: 4px; box-shadow: 0 6px 40px rgba(0,0,0,.5);
}
.lightbox .lb-counter { color: #cfc8bd; font-size: .9rem; margin-top: .6rem; }
.lightbox button {
    position: fixed; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.08); color: #f5f2ec; border: 0;
    font-size: 2.4rem; line-height: 1; padding: .8rem 1rem; cursor: pointer; border-radius: 6px;
}
.lightbox button:hover { background: rgba(255,255,255,.18); }
.lightbox .lb-prev { left: 1rem; }
.lightbox .lb-next { right: 1rem; }
.lightbox .lb-close { top: 1rem; right: 1rem; transform: none; font-size: 2rem; }
body.lb-open { overflow: hidden; }

/* static gallery grid on content pages */
.page-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem;
    max-width: 780px;
    margin: 2rem auto;
}
.page-gallery-item {
    display: block; padding: 0; border: 1px solid var(--line); border-radius: 6px;
    background: #fff; overflow: hidden; cursor: zoom-in; line-height: 0;
    transition: box-shadow .15s ease;
}
.page-gallery-item:hover { box-shadow: 0 3px 14px rgba(0,0,0,.08); border-color: var(--accent); }
.page-gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
@media (max-width: 640px) {
    .page-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; max-width: 420px; }
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    margin-top: 3rem;
    padding: 1.5rem 0 2rem;
    font-size: .9rem;
    text-align: center;
    color: var(--muted);
    display: grid;
    gap: .2rem;
}
