/*
Theme Name: Wylerblatter
Theme URI: 
Author: Armin Oppliger
Author URI: https://useit.ch/
Description: 
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 5.7
Version: 
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wylerblatter
Tags: 
*/

/* @import url('responsive.css'); */


/* Site header — fixed, hide on scroll down */
header.wp-block-template-part,
header.site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    transition: transform 0.3s;
    opacity: 0.9;
}

body.header-nav-hidden header.wp-block-template-part,
body.header-nav-hidden header.site-header {
    transform: translateY(-100%);
}

/* Global */
a {
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}
a:focus,
input:focus,
button:focus {
    outline: none;
}

main {
    margin: 80px 0 0;
}
main a {
    text-decoration: underline;
}
main .back-btn a {
    text-decoration: none;
}

.wp-social-link a {
	padding:0;
}

/* Header navigation — animated underline hover (rush.ch style) */
header nav .wp-block-navigation-item__content {
    /* color: #666 !important; */
}

header nav .wp-block-navigation-item__label {
    display: inline;
    background-image: linear-gradient(transparent, transparent), linear-gradient(#000, #000);
    background-position: 100% 100%, 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 2px, 0 2px;
    padding-bottom: 2px;
    transition: background-size 0.4s ease, color 0.4s ease;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

header nav .wp-block-navigation-item__content:hover {
    color: #666 !important;
}
header nav .wp-block-navigation-item__content:focus-visible,
header nav .current-menu-item .wp-block-navigation-item__content,
header nav .wp-block-navigation-item__content[aria-current="page"] {
    color: #000 !important;
}

header nav .wp-block-navigation-item__content:hover .wp-block-navigation-item__label,
header nav .wp-block-navigation-item__content:focus-visible .wp-block-navigation-item__label,
header nav .current-menu-item .wp-block-navigation-item__label,
header nav .wp-block-navigation-item__content[aria-current="page"] .wp-block-navigation-item__label,
.single-projekte header nav .projekte-item .wp-block-navigation-item__label {
    background-size: 0 2px, 100% 2px;
}

.single-projekte header nav .projekte-item .wp-block-navigation-item__content {
    color: #000 !important;
}

.white-bg img {
    filter: brightness( 110% ) contrast( 100% ) saturate( 74% ) blur( 0px ) hue-rotate( 0deg );
}

/* All Projects shortcode */
.single-pro-gal {
    max-width: 1200px;
}
.all-projects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 3em;
    box-sizing: border-box;
}

.all-projects__item {
    display: block;
    color: inherit;
    text-decoration: none;
}

.all-projects__item:hover,
.all-projects__item:focus {
    text-decoration: none;
}

.all-projects__card {
    position: relative;
    display: block;
    overflow: hidden;
    background-color: #fff;
    aspect-ratio: 4 / 3;
}

.all-projects__card,
.all-projects__card *,
.all-projects__card::before {
    box-sizing: border-box;
    transition: all 0.5s ease;
}

.all-projects__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.all-projects__caption {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: absolute;
    inset: 0;
    margin: auto;
    padding: 30px;
    color: #333;
    background-color: #fff;
    opacity: 0;
    z-index: 2;
    text-align: center;
}

.all-projects__item:hover .all-projects__caption,
.all-projects__item:focus-visible .all-projects__caption {
    opacity: 0.8;
}

.all-projects__title-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.all-projects__title {
    margin: 0;
    padding: 0;
}

.all-projects__ort {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    line-height: 1.4;
    color: #333;
}

@media (max-width: 767px) {
    .all-projects {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
}

/* Project Info shortcode */
body.single-projekte main > .wp-block-cover:not(.alignfull) {
    max-width: 1200px;
    width: 100%;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}

body.single-projekte main > .wp-block-cover:not(.alignfull) .wp-block-cover__inner-container {
    text-align: left;
}

/* Project Info shortcode */
.project-info {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-top: 1px solid #000;
}

.project-info__item {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0;
    padding: 0.35em 0;
    border-bottom: 1px solid #000;
    text-align: left;
}

.project-info__item:last-child {
    margin-bottom: 0;
}

.project-info__label {
    grid-column: 1;
    font-weight: 600;
}

.project-info__value {
    grid-column: 2;
    text-align: left;
}

@media (max-width: 800px) {
    .project-info__item {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Aktuelles shortcode */
.aktuell-posts__image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 900px;
    aspect-ratio: auto;
    object-fit: contain;
}

.aktuell-posts__body p {
    margin: 0 0 1em;
    text-align: center;
}

.aktuell-posts__body p:last-child {
    margin-bottom: 0;
}

.aktuell-posts__cover {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.aktuell-posts__cover .wp-block-cover__inner-container {
    /* height: 100%; */
    height: 80%;
    overflow: hidden;
}

.aktuell-posts__cover .wp-block-group {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aktuell-posts__media {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.aktuell-posts__media .wp-block-image {
    height: 100%;
    margin: 0;
}

.aktuell-posts__cover .wp-block-columns {
    flex: 0 0 auto;
    max-height: 45%;
    overflow-y: auto;
}

/* Kontakt page — grayscale Google Maps embed */
body.kontakt iframe[src*="google.com/maps"] {
    filter: grayscale(100%);
    -webkit-filter: grayscale(100%);
}

/* Büro cards grid */
.buro-cards {
    gap: 20px;
}

.buro-cards > .wp-block-group {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    margin: 0;
    padding: 0;
}

.buro-cards > .wp-block-group,
.buro-cards > .wp-block-group > a,
.buro-cards > .wp-block-group .wp-block-image,
.buro-cards > .wp-block-group .wp-block-image img {
    box-sizing: border-box;
}

.buro-cards > .wp-block-group .wp-block-image {
    position: absolute;
    inset: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}

.buro-cards > .wp-block-group .wp-block-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.buro-cards > .wp-block-group > a {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #333;
    background-color: #fff;
    opacity: 0;
    transform: translateY(15%);
    transition: all 0.5s ease;
    text-decoration: none;
}

.buro-cards > .wp-block-group:hover > a,
.buro-cards > .wp-block-group:focus-within > a {
    opacity: 1;
    transform: translateY(0);
}

.buro-cards > .wp-block-group > a h2 {
    margin: 0 0 10px;
    padding: 0;
    font-weight: 700;
    color: #333;
}

.buro-cards > .wp-block-group > a p {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    line-height: 1.4;
    color: #333;
}

@media (max-width: 767px) {
    .buro-cards {
        grid-template-columns: 1fr !important;
    }
}

/* Homepage slideshow */
.homepage-slideshow {
    margin-top: 80px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
}

.homepage-slideshow__swiper {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px);
    max-height: 900px;
}

.homepage-slideshow__slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

.homepage-slideshow__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.homepage-slideshow__pagination {
    bottom: 24px !important;
    z-index: 3;
}

.homepage-slideshow__pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    margin: 0 5px !important;
    background-color: #333;
    opacity: 0.35;
    transition: opacity 0.3s ease;
}

.homepage-slideshow__pagination .swiper-pagination-bullet-active {
    background-color: #000;
    opacity: 1;
}

body.has-homepage-slideshow main {
    margin-top: 0;
}

body.has-homepage-slideshow {
    overflow-x: clip;
}

/* Homepage intro overlay */
.homepage-intro {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--homepage-intro-bg, #fff);
    opacity: 1;
    transition: opacity 1s ease;
}

.homepage-intro__content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--homepage-intro-text, #000);
}

.homepage-intro__link {
    display: inline-block;
    color: var(--homepage-intro-text, #000);
    text-decoration: none;
    cursor: pointer;
}

.homepage-intro__text {
    opacity: 0;
    font-size: clamp(1rem, 5vw, var(--homepage-intro-text-size, 40px));
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    padding: 0 24px;
    transition: opacity 1.5s ease;
}

.homepage-intro.is-text-visible .homepage-intro__text {
    opacity: 1;
}

.homepage-intro.is-exiting {
    opacity: 0;
    pointer-events: none;
}

body.homepage-intro-active {
    overflow: hidden;
}

body.homepage-intro-pending::before {
    pointer-events: none;
}

/* Page Burogemeinschaft */
.hover-effect .wp-block-group {
	position: absolute;
  	top: 10%;
  	height: 100%;
  	width: 100%;
	transition: all 0.5s ease;
	opacity:0;
}
.hover-effect .wp-block-group a {
	position: absolute;
  	top: 0;
	left:0;
  	height: 90%;
  	width: 90%;
	padding:5%;
	text-decoration:none;
}
.hover-effect:hover .wp-block-group {
	top:0;
	opacity:1;
	cursor:pointer;
}

@media (prefers-reduced-motion: reduce) {
    .homepage-intro,
    .homepage-intro__text {
        transition: none;
    }
}

/* Cover blocks — scroll snap (single projekte + aktuell) */
@media (prefers-reduced-motion: no-preference) {
    html:has(body.single-projekte),
    html:has(body.aktuell) {
        height: 100%;
        margin: 0;
        overflow: hidden;
    }

    html:has(body.single-projekte) {
        scroll-behavior: smooth;
    }

    html:has(body.aktuell) {
        scroll-behavior: auto;
    }

    body.single-projekte,
    body.aktuell {
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.single-projekte .wp-site-blocks,
    body.aktuell .wp-site-blocks {
        padding-top: 0;
        padding-bottom: 0;
    }

    body.single-projekte .wp-site-blocks > *,
    body.aktuell .wp-site-blocks > * {
        margin-block-start: 0;
    }

    body.single-projekte main,
    body.aktuell main {
        margin-top: 0;
    }

    body.single-projekte header.wp-block-template-part,
    body.single-projekte footer.wp-block-template-part,
    body.single-projekte .wp-block-cover,
    body.aktuell .aktuell-posts__cover {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    body.aktuell header.wp-block-template-part,
    body.aktuell footer.wp-block-template-part {
        scroll-snap-align: none;
    }

    body.single-projekte .wp-block-cover,
    body.aktuell .aktuell-posts__cover {
        align-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }
}

/* Mobile header navigation (≤860px) */
.mobile-nav {
    display: none;
    position: relative;
    z-index: 1004;
}

.mobile-nav__toggle {
    position: relative;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.mobile-nav__bar {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 2px;
    margin-left: -14px;
    background-color: #000;
    transition: all 400ms cubic-bezier(0.84, 0.06, 0.52, 1.8);
}

.mobile-nav__bar--1 {
    transform: translateY(-7px);
}

.mobile-nav__bar--3 {
    transform: translateY(7px);
}

.mobile-nav.is-open .mobile-nav__bar--1 {
    transform: rotate(40deg);
}

.mobile-nav.is-open .mobile-nav__bar--3 {
    transform: rotate(-40deg);
}

.mobile-nav.is-open .mobile-nav__bar--2 {
    opacity: 0;
}

.mobile-nav__layer,
.mobile-nav__panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.mobile-nav__layer--1 {
    z-index: 1001;
    background: #f3f3f3;
    transition: all 500ms cubic-bezier(0.62, 0.04, 0.3, 1.56);
    transition-delay: 50ms;
}

.mobile-nav__layer--2 {
    z-index: 1002;
    background: #fff;
    transition: all 600ms cubic-bezier(0.62, 0.04, 0.3, 1.56);
    transition-delay: 100ms;
}

.mobile-nav__panel {
    z-index: 1003;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    transition: all 600ms cubic-bezier(0.62, 0.04, 0.3, 1.56);
    transition-delay: 100ms;
}

.mobile-nav.is-open .mobile-nav__layer,
.mobile-nav.is-open .mobile-nav__panel {
    width: 70%;
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav__list {
    list-style: none;
    margin: 0;
    padding: 80px 20px 40px;
    text-align: left;
}

.mobile-nav__item {
    margin: 0 0 1.2em;
    padding: 0;
}

.mobile-nav__item:last-child {
    margin-bottom: 0;
}

.mobile-nav__link {
    display: inline-block;
    color: #666;
    text-decoration: none;
    text-transform: uppercase;
    /* font-size: 1.12rem; */
    letter-spacing: 0.04em;
}

.mobile-nav__label {
    display: inline;
    background-image: linear-gradient(transparent, transparent), linear-gradient(#000, #000);
    background-position: 100% 100%, 0 100%;
    background-repeat: no-repeat;
    background-size: 100% 2px, 0 2px;
    padding-bottom: 2px;
    transition: background-size 0.4s ease, color 0.4s ease;
}

.mobile-nav__link:hover,
.mobile-nav__link:focus-visible,
.mobile-nav__item.current-menu-item .mobile-nav__link {
    color: #000;
}

.mobile-nav__link:hover .mobile-nav__label,
.mobile-nav__link:focus-visible .mobile-nav__label,
.mobile-nav__item.current-menu-item .mobile-nav__label {
    background-size: 0 2px, 100% 2px;
}

html.mobile-nav-open {
    overflow: hidden;
}

html.mobile-nav-open body {
    overflow: hidden;
}

@media (max-width: 860px) {
    header nav.wp-block-navigation {
        display: none !important;
    }

    .mobile-nav {
        display: block;
        flex: 0 0 auto;
        top:5px;
    }

    header .is-content-justification-space-between {
        align-items: center;
    }
}

@media (min-width: 861px) {
    .mobile-nav {
        display: none !important;
    }
}


@media (max-width: 400px) {
    .header-logo a {
        font-size: 70%;
    }
}