/* Baubiologie Lutz – static site. Layout and colours follow the former Contao theme.
   Breakpoints: phone < 768px, tablet 768–1024px, desktop > 1024px.
   Font sizes per font (see --fs-*): Lato 12 / 15 / 22 px, Raleway (headings) 17 / 22 / 30 px.
   Both web fonts only contain Latin letters – the Russian pages use Verdana, as on the old site. */

@font-face { font-family: 'Lato'; src: url('../fonts/lato-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Raleway'; src: url('../fonts/raleway-900.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

:root {
    --text: #000;
    --text-2: #333;
    --muted: #7f7f7f;
    --nav: #666;
    --accent: #a1003f;
    --brown: #6a6048;
    --line: #e5e8ee;
    --box: #ebebeb;
    --footer: #313131;
    --footer-text: #ccc;
    --footer-head: #707070;
    --bg: #d6c395;
    --fs-s: 12px;     /* Lato */
    --fs-m: 15px;     /* Lato */
    --fs-l: 22px;     /* Lato */
    --fs-h3: 17px;    /* Raleway */
    --fs-h2: 22px;    /* Raleway */
    --fs-h1: 30px;    /* Raleway */
    --page: 1140px;
    --pad: 40px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font: 400 var(--fs-m)/1.56 'Lato', Arial, sans-serif;
    color: var(--text);
    background: var(--bg) url('../img/layout/bg.png');
    -webkit-font-smoothing: antialiased;   /* as on the old site; also makes the synthetic bold of Lato visible on macOS */
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }

a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus-visible { color: var(--accent); }

h1, h2, h3, h4 { font-family: 'Raleway', Arial, sans-serif; font-weight: 900; line-height: 1.3; margin: 0 0 15px; hyphens: auto; }
h1 { font-size: var(--fs-h1); color: var(--accent); }
h2 { font-size: var(--fs-h2); }
h3, h4 { font-size: var(--fs-h3); }
.main h4 { color: var(--accent); }

/* Russian: Verdana for everything (no Cyrillic in Lato/Raleway); Black would be too heavy */
body.lang-ru, .lang-ru h1, .lang-ru h2, .lang-ru h3, .lang-ru h4, .lang-ru button { font-family: Verdana, Geneva, sans-serif; }
.lang-ru h1, .lang-ru h2, .lang-ru h3, .lang-ru h4 { font-weight: 700; }

p, ul, ol, table, figure { margin: 0 0 15px; }
ul, ol { padding-left: 21px; }
.main ul > li { color: var(--accent); }   /* bullet and plain item text crimson, nested elements black */
.main ul > li > * { color: var(--text); }
.main li a { color: var(--text); }
strong { font-weight: 700; }
u { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.gap { margin-top: 38px; }      /* former empty spacer paragraphs */
.ce--gap { margin-bottom: 38px; }

.skip-link { position: absolute; left: 10px; top: -60px; z-index: 300; padding: 8px 14px; background: #fff; color: var(--text); }
.skip-link:focus { top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ------------------------------------------------------------------ header */

.site-header { background: #fff; box-shadow: 0 2px 2px rgba(0, 0, 0, .2); position: relative; z-index: 50; }

.topbar { background: #f5f5f5; font-size: var(--fs-s); color: var(--muted); }
.topbar__inner {
    display: flex;
    align-items: center;
    gap: 10px 24px;
    max-width: var(--page);
    min-height: 40px;
    margin: 0 auto;
    padding: 0 var(--pad);
}
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover, .topbar a:focus-visible { color: var(--accent); }
.topbar__contact { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 0 auto 0 0; padding: 0; list-style: none; }
.topbar__contact li { display: flex; align-items: center; gap: 4px; color: var(--muted); line-height: 40px; }
.topnav ul { display: flex; gap: 0 10px; margin: 0; padding: 0; list-style: none; }
.topnav li { color: var(--muted); }

.langswitch { position: relative; }
.langswitch summary { display: flex; align-items: center; gap: 5px; padding: 8px 4px; list-style: none; cursor: pointer; line-height: 1; }
.langswitch summary::-webkit-details-marker { display: none; }
.langswitch summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.langswitch summary .icon { width: 10px; height: 10px; }
.langswitch ul {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 60;
    min-width: 150px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, .2);
}
.langswitch li { color: var(--text); }
.langswitch li a { display: flex; align-items: center; gap: 8px; padding: 6px 14px; color: #404040; line-height: 1.4; }
.langswitch li a[aria-current] { font-weight: 700; }
.langswitch li a span { font-weight: 700; }

.brandbar { border-top: 1px solid var(--line); }
.brandbar__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    max-width: var(--page);
    margin: 0 auto;
    padding: 10px var(--pad);
}
.logo { display: block; flex: none; width: 300px; }
.logo img { display: block; }
.claim { margin: 0 0 4px; font-size: var(--fs-l); line-height: 1.5; color: var(--accent); text-align: right; }

.navbar { border-top: 1px solid var(--line); }
.mainnav { max-width: var(--page); margin: 0 auto; padding: 0 calc(var(--pad) - 12px); }
.mainnav__list, .mainnav__sub { list-style: none; margin: 0; padding: 0; }
.mainnav__list { display: flex; flex-wrap: wrap; }
.mainnav__list > li { position: relative; color: var(--nav); }
.mainnav__list > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 20px 12px;
    font-size: var(--fs-s);
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.6;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--nav);
}
.mainnav__list > li > a .icon { width: 10px; height: 10px; }
.mainnav__list > li.is-active > a { color: var(--brown); }
.mainnav__list > li.is-active > a::after {   /* short line under the active item */
    content: '';
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 28px;
    height: 2px;
    background: var(--brown);
}
.mainnav__list > li > a:hover, .mainnav__list > li > a:focus-visible { color: var(--brown); }

.mainnav__sub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60;
    width: 190px;
    padding: 8px 0;
    border-top: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    box-shadow: 0 0 3px rgba(0, 0, 0, .2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.mainnav__list > li:hover > .mainnav__sub,
.mainnav__list > li:focus-within > .mainnav__sub { opacity: 1; visibility: visible; transform: none; }
.mainnav__sub li { color: #404040; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.mainnav__sub li:last-child { border-bottom: 0; }
.mainnav__sub a {
    display: block;
    padding: 10px 14px;
    font-size: var(--fs-s);
    letter-spacing: 1px;
    line-height: 1.5;
    color: #404040;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.mainnav__sub a:hover, .mainnav__sub a:focus-visible, .mainnav__sub a[aria-current] { background: var(--brown); color: #fff; }
.mainnav__sub a[aria-current] { font-weight: 700; text-transform: uppercase; }

.mainnav__toggle { display: none; }

/* Desktop: once the header has scrolled away, a compact version stays at the top (main.js sets .is-fixed) */
@media (min-width: 1025px) {
    html { scroll-padding-top: 120px; }   /* in-page jumps (skip link) end below the compact header */
    .site-header.is-fixed { position: fixed; top: 0; left: 0; right: 0; animation: header-in .5s ease-out; }
    .site-header.is-fixed .topbar { display: none; }
    .site-header.is-fixed .brandbar { border-top: 0; }
    .site-header.is-fixed .brandbar__inner { align-items: center; }
    .site-header.is-fixed .logo { width: 88px; }
    .site-header.is-fixed .claim { margin: 0; }
    .site-header.is-fixed .mainnav__list { padding: 8px 0; }
    .site-header.is-fixed .mainnav__list > li > a { padding: 10px 12px; }
    .site-header.is-fixed .mainnav__list > li.is-active > a::after { bottom: 6px; }
    @keyframes header-in { from { transform: translateY(-100%); } to { transform: none; } }
}

/* ------------------------------------------------------------------ page box */

.page { max-width: var(--page); margin: 0 auto; }

.slider { position: relative; aspect-ratio: 1140 / 300; overflow: hidden; background: #ddd; }
.slider__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease-in-out; }
.slider__slide.is-active { opacity: 1; z-index: 1; }
.slider__slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
html:not(.js) .slider__slide:first-child { opacity: 1; }
.slider__dots { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 2; display: flex; justify-content: center; gap: 2px; }
.slider__dots button { width: 20px; height: 20px; padding: 5px; border: 0; background: none; cursor: pointer; }
.slider__dots button::before { content: ''; display: block; width: 10px; height: 10px; border-radius: 50%; background: #666; }
.slider__dots button[aria-current="true"]::before { background: #000; }

.main {
    display: flow-root;
    padding: 30px var(--pad) 50px;
    background: #fff;
    box-shadow: 0 2px 2px rgba(0, 0, 0, .3);
    overflow-wrap: break-word;
}
.main ul.beside { display: flow-root; }   /* list next to a floated image keeps its bullets beside the image */
.main--aside { display: grid; grid-template-columns: minmax(0, 1fr) 250px; column-gap: 40px; align-items: start; }
.main--aside > :not(.aside) { grid-column: 1; }
.main--aside > .aside { grid-column: 2; grid-row: 1 / span 20; }
.aside .img { margin-bottom: 20px; }
.aside ul { padding-left: 18px; }

.ce { display: flow-root; margin-bottom: 15px; }
.ce > :last-child { margin-bottom: 0; }
.article + .article { margin-top: 30px; }

.img--left { float: left; margin: 4px 32px 10px 0; }
.img--right { float: right; margin: 4px 0 10px 32px; }
.img--above { margin: 0 0 15px; }
.img--below { margin: 15px 0 0; clear: both; }
figure.img { position: relative; max-width: 50%; }
figure.img--above, figure.img--below { max-width: 100%; }
figure.img img { display: block; }
figure figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3px 6px;
    background: rgba(255, 255, 255, .7);
    font-size: var(--fs-s);
    line-height: 1.5;
}

.gallery { margin: 0 0 20px; }
.gallery__grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 0 0; margin: 0; padding: 0; list-style: none; }
.gallery--cols-2 { --cols: 2; }
.gallery--cols-4 { --cols: 4; }
.gallery__grid li { color: var(--text); }
.gallery__grid figure { position: relative; display: inline-block; margin: 0; }
.gallery__grid figure img { display: block; }

.contentbox { margin: 0 0 6px; padding: 25px 25px 10px; background: var(--box); color: var(--text-2); }
.contentbox h3 { margin-bottom: 10px; color: var(--text-2); }

.small { font-size: inherit; }

table { width: 100%; border-collapse: collapse; border-bottom: 3px solid #7a7a7a; }
th { padding: 8px; background: #ccc; text-align: left; }
td { padding: 12px; border-top: 1px solid #e3e3e3; }

/* ------------------------------------------------------------------ footer */

.site-footer { background: var(--footer); color: var(--footer-text); box-shadow: 0 0 2px rgba(0, 0, 0, .3); }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 30px; padding: 70px var(--pad) 40px; }
.site-footer h4, .footer-col__head { min-height: 31px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(112, 112, 112, .3); color: var(--footer-head); }
.site-footer p { margin: 0 0 4px; }
.site-footer strong { font-weight: 700; }
.site-footer a { color: var(--footer-text); text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: #fff; }
.footer-lines, .footer-links { margin: 0; padding: 0; list-style: none; }
.footer-lines li, .footer-links li { display: flex; align-items: center; gap: 8px; color: var(--footer-text); }
.footer-lines .icon { width: 14px; height: 14px; }
.footer-links a[aria-current], .topnav a[aria-current] { font-weight: 700; }
.footer-bottom { margin: 0; padding: 20px var(--pad); background: #f2f2f2; color: var(--text); font-size: var(--fs-s); }
.footer-bottom a { color: var(--text); text-decoration: none; }
.footer-bottom a:hover, .footer-bottom a:focus-visible { color: var(--accent); }

.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--brown);
    color: #fff;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.to-top .icon { width: 20px; height: 20px; }
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover, .to-top:focus-visible { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ lightbox (built by main.js) */

html.lightbox-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 40px 60px; background: rgba(0, 0, 0, .85); opacity: 0; transition: opacity .25s; }
.lb[hidden] { display: none; }
.lb.is-visible { opacity: 1; }
.lb__figure { margin: 0; text-align: center; }
.lb__img { max-width: 100%; max-height: calc(100vh - 110px); width: auto; height: auto; background: #fff; padding: 6px; }
.lb__caption { margin-top: 8px; color: #fff; font-size: var(--fs-s); }
.lb__btn { position: absolute; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #fff; cursor: pointer; }
.lb__btn svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.lb__btn:hover, .lb__btn:focus-visible { color: var(--bg); }
.lb__prev { left: 8px; top: 50%; margin-top: -22px; }
.lb__next { right: 8px; top: 50%; margin-top: -22px; }
.lb__close { right: 8px; top: 8px; }
.lb__btn[hidden] { display: none; }

/* ------------------------------------------------------------------ tablet + phone */

@media (max-width: 1024px) {
    .topbar__contact { display: none; }
    .topbar__inner { justify-content: flex-end; }
    .claim { font-size: var(--fs-m); }

    .navbar { position: relative; }
    .mainnav { padding: 0 var(--pad); }
    .mainnav__toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 10px 0;
        padding: 8px 12px;
        border: 1px solid #ccc;
        border-radius: 3px;
        background: #fff;
        color: var(--nav);
        font: inherit;
        font-size: var(--fs-s);
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        cursor: pointer;
    }
    .mainnav__burger, .mainnav__burger::before, .mainnav__burger::after { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .25s, background-color .25s; }
    .mainnav__burger { position: relative; }
    .mainnav__burger::before, .mainnav__burger::after { content: ''; position: absolute; left: 0; }
    .mainnav__burger::before { top: -6px; }
    .mainnav__burger::after { top: 6px; }
    .mainnav.is-open .mainnav__burger { background: transparent; }
    .mainnav.is-open .mainnav__burger::before { transform: translateY(6px) rotate(45deg); }
    .mainnav.is-open .mainnav__burger::after { transform: translateY(-6px) rotate(-45deg); }

    .js .mainnav__list { display: none; padding: 0 0 15px; }
    .js .mainnav.is-open .mainnav__list { display: block; }
    .mainnav__list > li > a { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .mainnav__list > li > a .icon { display: none; }
    .mainnav__list > li.is-active > a::after { content: none; }
    .mainnav__sub { position: static; min-width: 0; padding: 0 0 6px 16px; border: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; }
    .mainnav__sub a { padding: 7px 0; }
    html:not(.js) .mainnav__list { gap: 0 16px; }
    html:not(.js) .mainnav__list > li > a { border-bottom: 0; }

    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
}

@media (max-width: 767px) {
    :root { --pad: 16px; --fs-h1: 24px; --fs-h2: 19px; }

    .topnav { margin-right: auto; }
    .brandbar__inner { flex-direction: column; align-items: flex-start; gap: 6px; }
    .logo { width: 200px; }
    .claim { text-align: left; }

    .main { padding-top: 25px; }
    .main--aside { display: block; }
    .aside { margin-top: 30px; }
    .img--left, .img--right { float: none; max-width: 100%; margin: 0 0 15px; }
    figure.img { max-width: 100%; }
    .gallery__grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .table-scroll, table { display: block; overflow-x: auto; }
    .contentbox { padding: 18px 16px 6px; }

    .footer-cols { grid-template-columns: minmax(0, 1fr); padding-top: 40px; }
    .footer-col__head { display: none; }
    .footer-bottom { padding-right: 70px; }   /* keep clear of the to-top button */

    .lb { padding: 50px 6px; }
    .lb__img { max-height: calc(100vh - 100px); padding: 3px; }
    .lb__prev, .lb__next { background: rgba(0, 0, 0, .35); }
}

@media (max-height: 500px) and (orientation: landscape) {
    .lb { padding: 8px 50px; }
    .lb__img { max-height: calc(100vh - 16px); }
}

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

@media print {
    body { background: #fff; }
    .topbar, .navbar, .slider, .to-top, .site-footer { display: none !important; }
    .main { box-shadow: none; }
}
