/*
Theme Name: Baustation
Theme URI: https://baustation.ch
Author: Baustation
Description: Reduziertes Onepage-Theme für interne Bauprojekte.
Version: 2.5.1
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: baustation
*/

:root {
    --ink: #25282c;
    --muted: #6c7074;
    --paper: #f7f5f1;
    --white: #ffffff;
    --sand: #ebe5dc;
    --accent: #a67d54;
    --line: #d9d3ca;
    --content: 1160px;
    --legal-content: 860px;
    --shadow: 0 18px 48px rgba(30, 32, 35, 0.09);
}

/* =====================================================
   BASIS
   ===================================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 128px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(calc(100% - 48px), var(--content));
    margin-inline: auto;
}

.site-main section {
    padding: clamp(82px, 8.5vw, 126px) 0;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--ink);
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.04em;
}

p {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    flex: 0 0 28px;
    background: var(--accent);
}

/* =====================================================
   HEADER
   ===================================================== */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    background: rgba(247, 245, 241, 0.96);
    border-bottom: 1px solid rgba(37, 40, 44, 0.08);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 128px;
    padding-top: 20px;
    padding-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
}

.site-logo {
    min-width: 0;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.site-logo > a,
.site-logo .custom-logo-link {
    display: block;
    line-height: 0;
}

.site-logo img,
.site-logo .custom-logo,
.site-logo .custom-logo-link img {
    display: block;
    width: 300px;
    max-width: none;
    max-height: 78px;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

/* =====================================================
   NAVIGATION
   ===================================================== */

.primary-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.primary-nav a {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.primary-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -7px;
    height: 1px;
    background: var(--accent);
    transition: right 0.2s ease;
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
    right: 0;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 1px;
    margin: 6px auto;
    background: var(--ink);
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =====================================================
   EINSTIEG / ARBEITSWEISE MIT BILD
   ===================================================== */

.statement-section {
    background: var(--sand);
}

.statement-first {
    min-height: 76vh;
    display: grid;
    align-items: center;
    padding-top: clamp(176px, 15vw, 220px) !important;
    padding-bottom: clamp(82px, 8vw, 120px) !important;
}

.statement-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.88fr)
        minmax(480px, 1.12fr);
    align-items: center;
    gap: clamp(48px, 6vw, 90px);
}

.statement-copy {
    min-width: 0;
}

.statement-copy h1 {
    max-width: 680px;
    margin-top: 17px;
    font-size: clamp(2.8rem, 5.45vw, 5.3rem);
}

.statement-copy p {
    max-width: 650px;
    margin-top: 27px;
    font-size: clamp(1.02rem, 1.3vw, 1.15rem);
    line-height: 1.7;
}

.statement-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 11;
    background: #ded6cb;
}

.statement-image::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(37, 40, 44, 0.08);
}

.statement-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* =====================================================
   PROJEKTE
   ===================================================== */

.projects-section {
    background: var(--paper);
}

.split-head {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: end;
    margin-bottom: 54px;
}

.split-head h2 {
    margin-top: 15px;
    font-size: clamp(2.15rem, 4.5vw, 4rem);
}

.split-head > p {
    max-width: 520px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.project-card {
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--line);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.project-card > img,
.project-card > img.project-fallback,
.project-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.project-card > img.project-fallback {
    filter: saturate(0.78) contrast(1.02);
}

.project-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #f1ece5, #e3dbd0);
}

.project-placeholder img {
    width: 96px;
    max-height: 96px;
    object-fit: contain;
}

.project-meta {
    padding: 22px;
}

.project-meta span {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.project-meta h3 {
    margin-top: 9px;
    font-size: 1.5rem;
}

.project-meta p {
    margin-top: 9px;
    font-size: 0.93rem;
    line-height: 1.6;
}

/* =====================================================
   FOOTER
   ===================================================== */

.site-footer {
    padding: 24px 0 30px;
    background: var(--paper);
    border-top: 1px solid rgba(37, 40, 44, 0.08);
}

.footer-inner {
    display: grid;
    grid-template-columns:
        72px
        minmax(0, 1fr)
        auto
        auto;
    align-items: center;
    gap: 18px 24px;
}

.footer-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 72px;
}

.footer-icon img {
    width: 62px;
    height: 62px;
    max-width: none;
    object-fit: contain;
}

.footer-contact {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 0.84rem;
}

.footer-contact span {
    line-height: 1.45;
}

.footer-email-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    color: var(--white) !important;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.footer-email-button:hover,
.footer-email-button:focus-visible {
    background: transparent;
    color: var(--ink) !important;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 18px;
    white-space: nowrap;
}

.footer-links a,
.copyright {
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--ink);
}

.copyright {
    white-space: nowrap;
}

/* =====================================================
   STANDARDSEITEN
   ===================================================== */

.entry-content,
.page-content,
.site-main > article {
    width: min(calc(100% - 48px), 820px);
    margin-inline: auto;
}

.site-main > article {
    padding: 156px 0 92px;
}

.entry-title {
    margin-bottom: 28px;
    font-size: clamp(2.2rem, 5vw, 4rem);
}

.entry-content p + p {
    margin-top: 1.2em;
}

/* =====================================================
   IMPRESSUM UND DATENSCHUTZ
   ===================================================== */

body.page .site-main > article {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

body.page .entry-header,
body.page .entry-content,
body.page .page-content,
body.page .legal-page {
    width: min(calc(100% - 48px), var(--legal-content)) !important;
    max-width: var(--legal-content) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.page .entry-header {
    display: block !important;
    padding-top: 180px !important;
    margin-bottom: 0 !important;
    border: 0 !important;
}

body.page .entry-header::after,
body.page .entry-title::after {
    display: none !important;
    content: none !important;
}

body.page .entry-title {
    display: block !important;
    margin: 0 0 40px !important;
    font-size: clamp(2.8rem, 6vw, 5rem) !important;
}

body.page .entry-content,
body.page .page-content {
    padding: 0 !important;
}

body.page .legal-page {
    padding: 0 0 100px !important;
}

body.page .legal-content {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
}

.legal-block,
.legal-section {
    width: 100%;
    margin: 0 !important;
    padding: 34px 0 !important;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.legal-block:first-child,
.legal-section:first-child {
    padding-top: 0 !important;
}

.legal-block h2,
.legal-section h2 {
    margin: 0 0 16px !important;
    padding: 0 !important;
    color: var(--ink);
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.legal-block p,
.legal-section p {
    max-width: 760px;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.legal-block p + p,
.legal-section p + p {
    margin-top: 16px !important;
}

.legal-block ul,
.legal-section ul {
    max-width: 760px;
    margin: 16px 0 18px !important;
    padding-left: 22px !important;
    color: var(--muted);
}

.legal-block li,
.legal-section li {
    line-height: 1.65;
}

.legal-block li + li,
.legal-section li + li {
    margin-top: 5px;
}

.legal-block strong,
.legal-section strong {
    color: var(--ink);
    font-weight: 650;
}

.legal-block a,
.legal-section a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

.legal-block a:hover,
.legal-block a:focus-visible,
.legal-section a:hover,
.legal-section a:focus-visible {
    color: var(--accent);
}

.legal-date {
    margin-top: 20px !important;
    font-size: 0.88rem !important;
}

/* =====================================================
   BARRIEREFREIHEIT
   ===================================================== */

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    top: 8px;
    left: 8px;
    z-index: 10000;
    width: auto;
    height: auto;
    padding: 10px 14px;
    clip: auto;
    background: var(--white);
    color: var(--ink);
}

/* =====================================================
   KLEINER DESKTOP
   ===================================================== */

@media (max-width: 1100px) {

    .site-logo img,
    .site-logo .custom-logo,
    .site-logo .custom-logo-link img {
        width: 260px;
        max-height: 68px;
    }

    .statement-grid {
        grid-template-columns:
            minmax(0, 0.88fr)
            minmax(400px, 1.12fr);
        gap: 44px;
    }

    .statement-copy h1 {
        font-size: clamp(2.65rem, 5vw, 4.6rem);
    }
}

/* =====================================================
   KLEINER DESKTOP / GROSSES TABLET
   ===================================================== */

@media (max-width: 1020px) {

    html {
        scroll-padding-top: 112px;
    }

    .header-inner {
        min-height: 112px;
        padding-top: 16px;
        padding-bottom: 16px;
        gap: 24px;
    }

    .site-logo img,
    .site-logo .custom-logo,
    .site-logo .custom-logo-link img {
        width: 225px;
        max-height: 60px;
    }

    .primary-nav {
        gap: 22px;
    }

    .primary-nav a {
        font-size: 0.72rem;
    }

    .statement-grid {
        grid-template-columns:
            minmax(0, 0.9fr)
            minmax(360px, 1.1fr);
        gap: 38px;
    }

    .footer-inner {
        grid-template-columns:
            72px
            minmax(0, 1fr)
            auto;
    }

    .copyright {
        grid-column: 2 / -1;
    }
}

/* =====================================================
   TABLET
   ===================================================== */

@media (max-width: 860px) {

    html {
        scroll-padding-top: 96px;
    }

    .header-inner {
        min-height: 96px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .site-logo img,
    .site-logo .custom-logo,
    .site-logo .custom-logo-link img {
        width: 185px;
        max-height: 52px;
    }

    .menu-toggle {
        display: block;
        margin-left: auto;
    }

    .primary-nav {
        position: fixed;
        inset: 96px 18px auto;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 22px;
        background: var(--paper);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
        white-space: normal;
    }

    .primary-nav.is-open {
        display: flex;
    }

    .statement-first {
        min-height: auto;
        padding-top: 150px !important;
        padding-bottom: 88px !important;
    }

    .statement-grid {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .statement-copy {
        max-width: 730px;
    }

    .statement-copy h1 {
        max-width: 720px;
        font-size: clamp(3rem, 8vw, 5rem);
    }

    .statement-image {
        aspect-ratio: 16 / 9;
    }

    .split-head {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        display: grid;
        grid-template-columns:
            minmax(240px, 0.9fr)
            1.1fr;
        align-items: stretch;
    }

    .project-card > img,
    .project-card > img.project-fallback,
    .project-placeholder {
        height: 100%;
        min-height: 260px;
        aspect-ratio: auto;
    }
}

/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 640px) {

    html {
        scroll-padding-top: 84px;
    }

    .container {
        width: min(calc(100% - 32px), var(--content));
    }

    .header-inner {
        min-height: 84px;
        padding-top: 10px;
        padding-bottom: 10px;
        gap: 14px;
    }

    .site-logo img,
    .site-logo .custom-logo,
    .site-logo .custom-logo-link img {
        width: 150px;
        max-height: 44px;
    }

    .primary-nav {
        inset: 84px 16px auto;
    }

    .site-main section {
        padding: 76px 0;
    }

    /* Arbeitsweise */

    .statement-first {
        padding-top: 134px !important;
        padding-bottom: 72px !important;
    }

    .statement-grid {
        gap: 32px;
    }

    .statement-copy h1 {
        font-size: clamp(2.45rem, 12vw, 4rem);
    }

    .statement-copy p {
        margin-top: 20px;
        font-size: 1rem;
    }

    .statement-image {
        aspect-ratio: 4 / 3;
    }

    .statement-image img {
        object-position: 54% center;
    }

    /* Projekte */

    .projects-section {
        padding-top: 64px !important;
    }

    .split-head {
        gap: 0;
        margin-bottom: 34px;
    }

    .split-head h2 {
        font-size: clamp(2.4rem, 11vw, 3.5rem);
        line-height: 1.02;
    }

    .split-head > p {
        margin-top: 18px;
        font-size: 1rem;
        line-height: 1.65;
    }

    .projects-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .project-card {
        display: flex;
        flex-direction: column;
        border: 1px solid var(--line);
        background: var(--white);
    }

    .project-meta {
        order: 1;
        padding: 22px 20px 20px;
    }

    .project-meta span {
        display: block;
        margin-bottom: 8px;
        font-size: 0.68rem;
    }

    .project-meta h3 {
        margin: 0;
        font-size: 1.55rem;
        line-height: 1.15;
    }

    .project-meta p {
        display: block !important;
        margin-top: 10px;
        font-size: 0.96rem;
        line-height: 1.6;
    }

    .project-card > img,
    .project-card > img.project-fallback,
    .project-placeholder {
        order: 2;
        width: 100%;
        height: 220px;
        min-height: 0;
        aspect-ratio: auto;
        object-fit: cover;
    }

    /* Footer */

    .footer-inner {
        grid-template-columns:
            58px
            minmax(0, 1fr)
            auto;
        align-items: center;
        gap: 14px;
    }

    .footer-icon {
        grid-column: 1;
        grid-row: 1;
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }

    .footer-icon img {
        width: 50px;
        height: 50px;
    }

    .footer-contact {
        grid-column: 2 / 4;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        width: 100%;
    }

    .footer-contact span {
        min-width: 0;
        line-height: 1.45;
    }

    .footer-email-button {
        justify-self: end;
        min-height: 36px;
        padding: 0 13px;
    }

    .footer-links,
    .copyright {
        grid-column: 1 / -1;
    }

    .footer-links {
        margin-top: 8px;
        flex-wrap: wrap;
    }

    .copyright {
        margin-top: -2px;
    }

    /* Impressum und Datenschutz */

    body.page .entry-header,
    body.page .entry-content,
    body.page .page-content,
    body.page .legal-page {
        width: calc(100% - 32px) !important;
    }

    body.page .entry-header {
        padding-top: 126px !important;
    }

    body.page .entry-title {
        margin-bottom: 28px !important;
        font-size: clamp(2.4rem, 11vw, 3.7rem) !important;
    }

    body.page .legal-page {
        padding-bottom: 72px !important;
    }

    .legal-block,
    .legal-section {
        padding: 26px 0 !important;
    }

    .legal-block:first-child,
    .legal-section:first-child {
        padding-top: 0 !important;
    }

    .legal-block h2,
    .legal-section h2 {
        margin-bottom: 12px !important;
        font-size: 1.3rem;
    }

    .legal-block p,
    .legal-section p {
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .legal-block p + p,
    .legal-section p + p {
        margin-top: 13px !important;
    }
}