/* ==========================================================================
   atelier für architektur burkhalter – Frontend
   Inspiriert von extra-ag.ch: sehr clean, viel Weissraum, grosse Bilder.
   ========================================================================== */

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }

/* -------- Tokens -------- */
:root {
    --c-bg:        #ffffff;
    --c-ink:       #111111;
    --c-ink-soft:  #555555;
    --c-muted:     #8a8a8a;
    --c-line:      #e6e6e6;
    --c-surface:   #f5f5f4;
    --c-accent:    #111111;

    --f-sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

    --fs-xs: 0.78rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.5rem;
    --fs-xl: clamp(1.75rem, 3vw, 2.5rem);
    --fs-hero: clamp(2rem, 5vw, 4rem);

    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-7: 5rem;
    --space-8: 8rem;

    --radius: 0;
    --transition: 200ms ease;
}

/* -------- Basis -------- */
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--f-sans);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--c-ink);
    background: var(--c-bg);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }

p { margin-bottom: var(--space-3); }
p:last-child { margin-bottom: 0; }

a { transition: color var(--transition); }
a:hover { color: var(--c-ink-soft); }

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

@media (max-width: 640px) {
    .container { padding: 0 var(--space-3); }
}

/* -------- Header -------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--c-bg);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    gap: var(--space-4);
    max-width: 1600px;
    margin: 0 auto;
}
.site-logo { display: inline-flex; align-items: center; }
.site-logo img {
    height: 28px;
    width: auto;
    display: block;
}
.site-nav {
    display: flex;
    gap: var(--space-5);
}
.site-nav a {
    font-size: var(--fs-md);
    position: relative;
    padding-bottom: 2px;
}
.site-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: currentColor;
}

/* Hamburger (nur mobile) */
.nav-toggle {
    display: none;
    width: 32px;
    height: 22px;
    position: relative;
    padding: 0;
}
.nav-toggle span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--c-ink);
    border-radius: 1px;
    transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { top: 14px; }

/* Mobile Full-Screen-Menu (immer im DOM, nur mobile sichtbar) */
.mobile-menu {
    display: none;
}

@media (max-width: 768px) {
    .header-inner {
        padding: 14px var(--space-3);
    }
    .site-logo img { height: 22px; }
    .nav-toggle { display: block; }
    .site-nav { display: none; }

    .mobile-menu {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0;
        z-index: 200;
        background: var(--c-bg);
        padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 220ms ease, transform 220ms ease;
    }
    .mobile-menu.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .mobile-menu__top {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 14px var(--space-3);
        border-bottom: 1px solid var(--c-line);
    }
    .mobile-menu__logo img { height: 22px; width: auto; display: block; }

    .mobile-menu__close {
        position: absolute;
        right: var(--space-3);
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 22px;
    }
    .mobile-menu__close span {
        position: absolute;
        left: 0; right: 0;
        top: 50%;
        height: 2px;
        background: var(--c-ink);
        border-radius: 1px;
    }
    .mobile-menu__close span:nth-child(1) { transform: rotate(45deg); }
    .mobile-menu__close span:nth-child(2) { transform: rotate(-45deg); }

    .mobile-menu__nav {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--space-4);
        padding: var(--space-5);
    }
    .mobile-menu__nav a {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        font-weight: 500;
        letter-spacing: -0.01em;
        position: relative;
        padding: 4px 0;
        color: var(--c-ink);
    }
    .mobile-menu__nav a.is-active::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: -4px;
        transform: translateX(-50%);
        width: 32px;
        height: 2px;
        background: var(--c-ink);
    }

    .mobile-menu__foot {
        padding: var(--space-4) var(--space-3) calc(var(--space-4) + env(safe-area-inset-bottom));
        text-align: center;
        font-size: var(--fs-sm);
        color: var(--c-ink-soft);
        border-top: 1px solid var(--c-line);
    }
    .mobile-menu__foot a { border-bottom: 1px solid var(--c-line); padding-bottom: 1px; }

    /* Body-Scroll sperren wenn Menü offen */
    body.menu-open { overflow: hidden; }
}

/* -------- Main -------- */
.site-main {
    min-height: 60vh;
    padding-bottom: var(--space-7);
}

/* -------- Page Intro (Title Block) -------- */
.page-intro {
    padding-top: var(--space-6);
    padding-bottom: var(--space-5);
}
.page-intro h1 {
    font-size: var(--fs-xl);
    max-width: 900px;
    margin-bottom: var(--space-3);
}
.page-intro p {
    max-width: 720px;
    color: var(--c-ink-soft);
    font-size: var(--fs-md);
}

/* -------- Grid / Karten -------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: var(--c-line);
}
.card-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 900px) {
    .card-grid,
    .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .card-grid,
    .card-grid--2 { grid-template-columns: 1fr; }
}

.card {
    position: relative;
    display: block;
    background: var(--c-surface);
    aspect-ratio: 4/3;
    overflow: hidden;
}
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease, filter 400ms ease;
}
.card:hover img { transform: scale(1.03); }

/* Sättigungs-Filter NUR auf der Startseite — sorgt für einheitliche Bildsprache. */
.page-index .card img,
.page-index .news-item .thumb img {
    filter: saturate(0.82) contrast(0.98);
}
.page-index .card:hover img,
.page-index .news-item:hover .thumb img {
    filter: saturate(1) contrast(1);
}

.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-surface);
    color: var(--c-ink);
    text-align: center;
    padding: var(--space-5);
    width: 100%;
    height: 100%;
}
.card-placeholder .t {
    font-size: var(--fs-md);
    font-weight: 500;
    max-width: 240px;
}

/* Overlay-Caption: auf Desktop per Hover, auf Touch-Geräten immer sichtbar. */
.card-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-3);
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.card-overlay .t { font-weight: 600; }
.card-overlay .m { font-size: var(--fs-sm); opacity: .85; }

@media (hover: hover) {
    .card:hover .card-overlay { opacity: 1; }
}
/* Auf Touch-Geräten oder schmalen Viewports ist Hover nicht möglich – Caption immer zeigen. */
@media (hover: none), (max-width: 768px) {
    .card-overlay { opacity: 1; }
}

/* -------- Projekt-Detail -------- */
.project-detail {
    padding-top: var(--space-5);
}
.project-hero {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--c-surface);
    margin-bottom: var(--space-5);
    overflow: hidden;
}
.project-hero img {
    width: 100%; height: 100%; object-fit: cover;
}
.project-meta {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--c-line);
    margin-bottom: var(--space-5);
}
@media (max-width: 720px) {
    .project-meta { grid-template-columns: 1fr; gap: var(--space-3); }
}
.project-meta h1 {
    font-size: var(--fs-xl);
    margin-bottom: var(--space-3);
}
.project-meta dl {
    display: grid;
    grid-template-columns: 1fr 2fr;
    row-gap: var(--space-1);
    column-gap: var(--space-3);
    font-size: var(--fs-sm);
}
.project-meta dt { color: var(--c-muted); }
.project-meta dd { color: var(--c-ink); }

.project-description {
    max-width: 780px;
    font-size: var(--fs-md);
    color: var(--c-ink-soft);
    margin-bottom: var(--space-6);
}
.project-description p { margin-bottom: var(--space-3); }

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    background: var(--c-line);
}
@media (max-width: 640px) {
    .project-gallery { grid-template-columns: 1fr; }
}
.project-gallery figure {
    margin: 0;
    background: var(--c-surface);
    aspect-ratio: 4/3;
    overflow: hidden;
}
.project-gallery img {
    width: 100%; height: 100%; object-fit: cover;
}
.project-gallery figure.full { grid-column: 1 / -1; aspect-ratio: 16/9; }

.project-nav {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--c-line);
    font-size: var(--fs-sm);
    color: var(--c-ink-soft);
}

/* -------- Projektliste (Text-Tabelle, wie im Mockup) -------- */
.project-list {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    column-gap: var(--space-4);
    row-gap: var(--space-2);
    max-width: 900px;
    font-size: var(--fs-base);
    padding: var(--space-5) 0;
}
.project-list h2 {
    grid-column: 1 / -1;
    font-size: var(--fs-md);
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--c-line);
}
.project-list h2:first-child { margin-top: 0; }
.project-list a.row {
    display: contents;
}
.project-list a.row .t,
.project-list a.row .l {
    padding: var(--space-1) 0;
    transition: color var(--transition);
}
.project-list a.row:hover .t,
.project-list a.row:hover .l {
    color: var(--c-muted);
}
.project-list .l { color: var(--c-ink-soft); }

/* -------- News -------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6) var(--space-5);
    padding: var(--space-5) 0;
}
@media (max-width: 720px) { .news-grid { grid-template-columns: 1fr; } }
.news-item h3 { margin: var(--space-3) 0 var(--space-1); }
.news-item .date { font-size: var(--fs-sm); color: var(--c-muted); }
.news-item .thumb {
    background: var(--c-surface);
    aspect-ratio: 16/10;
    overflow: hidden;
}
.news-item .thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: filter 400ms ease;
}

.news-detail {
    max-width: 780px;
    margin: 0 auto;
    padding: var(--space-5) 0;
}
.news-detail .date { color: var(--c-muted); font-size: var(--fs-sm); }
.news-detail h1 { margin: var(--space-2) 0 var(--space-5); font-size: var(--fs-xl); }
.news-detail .cover { margin-bottom: var(--space-5); }

/* -------- Atelier -------- */
.atelier-intro { max-width: 780px; padding: var(--space-6) 0; font-size: var(--fs-md); }
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    padding-bottom: var(--space-6);
}
@media (max-width: 720px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .team-grid { grid-template-columns: 1fr; } }

.team-member .photo {
    background: var(--c-surface);
    aspect-ratio: 1;
    margin-bottom: var(--space-3);
    overflow: hidden;
}
.team-member .photo img { width: 100%; height: 100%; object-fit: cover; }
.team-member .photo.empty {
    display: flex; align-items: center; justify-content: center;
    color: var(--c-muted);
}
.team-member .photo.empty::before {
    content: "";
    display: block;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--c-ink);
    opacity: .9;
}
.team-member .name { font-weight: 600; }
.team-member .role { color: var(--c-ink-soft); font-size: var(--fs-sm); }
.team-member .email { font-size: var(--fs-sm); color: var(--c-ink-soft); }

/* -------- Kontakt -------- */
.contact-block {
    max-width: 900px;
    padding: var(--space-7) 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}
@media (max-width: 640px) { .contact-block { grid-template-columns: 1fr; } }
.contact-block a { border-bottom: 1px solid currentColor; }

/* -------- Footer -------- */
.site-footer {
    background: var(--c-surface);
    padding: var(--space-6) 0;
    font-size: var(--fs-sm);
    color: var(--c-ink-soft);
}
.footer-inner {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: var(--space-5);
    align-items: start;
}
@media (max-width: 720px) {
    .footer-inner { grid-template-columns: 1fr; gap: var(--space-4); }
}
.footer-logo { height: 24px; width: auto; margin-bottom: var(--space-2); }
.footer-contact { display: flex; gap: var(--space-5); }
.footer-meta a:hover { color: var(--c-ink); }
.footer-legal { margin-top: var(--space-3); color: var(--c-muted); }
.footer-legal a { border-bottom: 1px solid var(--c-line); }

/* -------- Flash Messages -------- */
.flash {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    border-left: 3px solid;
    background: var(--c-surface);
    font-size: var(--fs-sm);
}
.flash--success { border-color: #2f7a3a; }
.flash--error { border-color: #b93131; color: #7b1f1f; }

/* -------- Utility -------- */
.u-ink-soft { color: var(--c-ink-soft); }
.u-mt-5 { margin-top: var(--space-5); }
.u-text-center { text-align: center; }
