/* style.css */
/*
Theme Name: GeneratePress Child – Dach Gugg
Description: Child theme for GeneratePress for Dach Gugg.
Author: devgertschi
Template: generatepress
Version: 1.0.1
Text Domain: generatepress-gugg
*/

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* Brand tokens */
:root {
    --brand-yellow: #f3d707;
    --brand-yellow-dark: #d6bd06;
    --brand-dark: #221d24;
    --brand-white: #ffffff;
    --brand-light: #fffef4;
    --border-grey: #e6e6e6;
    --brand-green: #6f9a4a;
}

/* Base */
body {
    background: var(--brand-white);
    color: var(--brand-dark);
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

a {
    color: var(--brand-dark);
    text-decoration: underline;
}
a:hover,
a:focus {
    color: var(--brand-yellow);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--brand-dark);
}

h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
    color: inherit;
    text-decoration: none;
}

hr,
.wp-block-separator {
    border: 0;
    border-top: 2px solid var(--brand-yellow);
    color: var(--brand-yellow);
    margin: 2.5em 6%;
}

.wp-block-media-text + .wp-block-heading {
    margin-top: clamp(16px, 2.5vw, 28px);
}
.wp-block-media-text + .wp-block-media-text {
    margin-top: clamp(12px, 2vw, 20px);
}

/* Footer widget spacing */
.footer-widgets .inside-footer-widgets .widget {
    margin-bottom: 0.4em;
}

/* Dashicons in headings */
.wp-block-heading .dashicons {
    font-size: 1.2em;
    width: 1em;
    height: 1em;
    line-height: 1;
    margin-right: 0.2em;
    vertical-align: -0.08em;
}

/* Group blocks with background */
.entry-content .wp-block-group.has-background {
    margin: clamp(16px, 2.5vw, 28px) 0;
    padding: clamp(16px, 2.5vw, 28px);
    border: 1px solid var(--border-grey);
    box-shadow: 0 10px 20px rgba(34, 29, 36, 0.06);
}
.entry-content .wp-block-group.has-background > :first-child {
    margin-top: 0;
}
.entry-content .wp-block-group.has-background > :last-child {
    margin-bottom: 0;
}

.entry-content ul,
.entry-content ol {
    margin: 12px 0 16px;
    padding-left: 0;
    display: grid;
    gap: 8px;
}
.entry-content ul {
    list-style: none;
}
.entry-content ul > li {
    position: relative;
    padding-left: 28px;
}
.entry-content ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35em;
    width: 14px;
    height: 14px;
    background: url("assets/dach.svg") center / contain no-repeat;
}
.entry-content ol {
    list-style: none;
    counter-reset: dg-list;
}
.entry-content ol > li {
    position: relative;
    padding-left: 32px;
    counter-increment: dg-list;
}
.entry-content ol > li::before {
    content: counter(dg-list) ".";
    position: absolute;
    left: 0;
    top: 0.1em;
    font-weight: 700;
    color: var(--brand-dark);
}

@media (max-width: 768px) {
    .entry-content .wp-block-group.has-background {
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding-left: 30px;
        padding-right: 30px;
        border-left: 0;
        border-right: 0;
    }
}

/* Full-width image spacing */
.wp-block-image.alignfull,
figure.wp-block-image.alignfull,
img.alignfull,
.wp-block-image.aligncenter,
figure.wp-block-image.aligncenter,
img.aligncenter,
.wp-block-image.alignwide,
figure.wp-block-image.alignwide,
img.alignwide {
    margin-bottom: clamp(18px, 2.5vw, 32px);
}

.wp-block-gallery {
    margin-bottom: clamp(18px, 2.5vw, 32px);
    margin-left: -1em;
    margin-right: -1em;
}
.wp-block-gallery .wp-lightbox-container {
    outline: 2px solid transparent;
    outline-offset: 1px;
    transition: outline-color 900ms ease;
}
.wp-block-gallery .wp-lightbox-container:hover {
    outline: 2px solid var(--brand-yellow);
    transition: outline-color 300ms ease;
}

/* Top bar */
.dg-topbar {
    background: var(--brand-dark);
    color: var(--brand-white);
    font-size: 14px;
}
.dg-topbar .inside-top-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
}
.dg-topbar a {
    color: var(--brand-yellow);
    text-decoration: none;
}
.dg-topbar a:hover {
    color: var(--brand-yellow-dark);
    text-decoration: underline;
}
.dg-topbar .dg-topbar-left,
.dg-topbar .dg-topbar-right {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

/* Header banner (optional) */
.dg-header-banner {
    background: var(--brand-light);
    border-bottom: 1px solid var(--border-grey);
}
.dg-header-banner .dg-header-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.dg-header-banner .dg-header-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.dg-header-banner .dg-header-logo {
    height: 64px;
    width: auto;
    display: block;
}
.dg-header-banner .dg-header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
    min-width: 0;
}
.dg-header-banner .dg-header-title strong {
    font-size: 20px;
    letter-spacing: 0.4px;
}
.dg-header-banner .dg-header-title span {
    font-size: 13px;
    opacity: 0.85;
}
.dg-header-banner .dg-header-cta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.dg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--brand-yellow);
    background: var(--brand-yellow);
    color: var(--brand-dark) !important;
    text-decoration: none !important;
    font-weight: 700;
    line-height: 1;
}
.dg-btn:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: var(--brand-white) !important;
}
.dg-btn.dg-btn-outline {
    background: transparent;
    border-color: var(--border-grey);
    color: var(--brand-dark) !important;
}
.dg-btn.dg-btn-outline:hover {
    border-color: var(--brand-dark);
}

/* Main navigation */
.main-navigation .main-nav ul li a {
    color: var(--brand-dark);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 10px 12px;
    transition:
        color 200ms ease,
        text-decoration-color 200ms ease;
}
.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li a:focus-visible {
    color: var(--brand-yellow);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    text-decoration-color: var(--brand-yellow);
}
.main-navigation .main-nav ul li[class*="current-"] > a {
    color: var(--brand-dark);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    text-decoration-color: var(--brand-yellow);
}
.main-navigation .main-nav ul li.dg-home-menu-item > a .dashicons {
    font-size: 20px;
    height: 1em;
    line-height: 1;
    position: relative;
    transform: translateY(2px);
    vertical-align: baseline;
    width: 1em;
}
.main-navigation .main-nav ul li.dg-home-menu-item > a:hover,
.main-navigation .main-nav ul li.dg-home-menu-item > a:focus-visible,
.main-navigation
    .main-nav
    ul
    li.dg-home-menu-item[class*="current-"]
    > a {
    text-decoration: none;
}
.main-navigation .main-nav ul li.dg-home-menu-item > a:hover .dashicons::after,
.main-navigation
    .main-nav
    ul
    li.dg-home-menu-item
    > a:focus-visible
    .dashicons::after,
.main-navigation
    .main-nav
    ul
    li.dg-home-menu-item[class*="current-"]
    > a
    .dashicons::after {
    background: var(--brand-yellow);
    bottom: -4px;
    content: "";
    height: 2px;
    left: 0;
    position: absolute;
    right: 0;
}

@media (max-width: 768px) {
    .main-navigation
        .main-nav
        ul
        li.dg-home-menu-item
        > a
        .screen-reader-text {
        clip: auto;
        clip-path: none;
        height: auto;
        margin: 0 0 0 8px;
        overflow: visible;
        position: static !important;
        width: auto;
    }
    .dg-header-banner .dg-header-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .dg-header-banner .dg-header-cta {
        justify-content: flex-start;
    }
    .dg-header-banner .dg-header-logo {
        height: 56px;
    }
}

/* Buttons & forms */
button,
input[type="button"],
input[type="reset"],
input[type="submit"],
a.button,
.wp-block-button__link:not(.has-background) {
    background: var(--brand-yellow);
    color: var(--brand-dark);
}
button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
a.button:hover,
.wp-block-button__link:not(.has-background):hover {
    background: var(--brand-dark);
    color: var(--brand-white);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select {
    background: var(--brand-white);
    color: var(--brand-dark);
    border-color: var(--border-grey);
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-yellow);
}

/* Contact Form 7 (wpcf7) */
.wpcf7 .wpcf7-form-control {
    font: inherit;
    color: var(--brand-dark);
}
.wpcf7 input.wpcf7-form-control,
.wpcf7 textarea.wpcf7-form-control,
.wpcf7 select.wpcf7-form-control {
    background: var(--brand-white);
    border: 1px solid var(--border-grey);
}
.wpcf7 input.wpcf7-form-control:focus,
.wpcf7 textarea.wpcf7-form-control:focus,
.wpcf7 select.wpcf7-form-control:focus {
    border-color: var(--brand-yellow);
}
.wpcf7 input.wpcf7-submit {
    background: var(--brand-yellow);
    color: var(--brand-dark);
    border: 1px solid var(--brand-yellow);
    font-weight: 700;
}
.wpcf7 input.wpcf7-submit:hover,
.wpcf7 input.wpcf7-submit:focus {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: var(--brand-white);
}
.wpcf7 .wpcf7-not-valid-tip {
    color: #b00020;
}
.wpcf7 .wpcf7-response-output {
    border-color: var(--border-grey);
    color: var(--brand-dark);
}
.wpcf7 .wpcf7-spinner {
    background-color: var(--brand-yellow);
}

.wpcf7 .wpcf7-form:has(.half) {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
.wpcf7 .wpcf7-form:has(.half) p {
    flex: 1 1 100%;
    margin: 0;
}
.wpcf7 .wpcf7-form:has(.half) p.half,
.wpcf7 .wpcf7-form:has(.half) p:has(> label.half) {
    flex: 1 1 calc(50% - 12px);
}
.wpcf7 .wpcf7-form p.half .wpcf7-form-control-wrap,
.wpcf7 .wpcf7-form p:has(> label.half) .wpcf7-form-control-wrap,
.wpcf7 .wpcf7-form p.half input,
.wpcf7 .wpcf7-form p:has(> label.half) input {
    width: 100%;
}
@media (max-width: 768px) {
    .wpcf7 .wpcf7-form:has(.half) p.half,
    .wpcf7 .wpcf7-form:has(.half) p:has(> label.half) {
        flex-basis: 100%;
    }
}

.wpcf7 .yellow input.wpcf7-form-control:not(.wpcf7-submit),
.wpcf7 .yellow textarea.wpcf7-form-control,
.wpcf7 .yellow select.wpcf7-form-control {
    background: var(--brand-light);
    border-color: var(--brand-yellow);
}
.wpcf7 .yellow .wpcf7-form-control:focus {
    border-color: var(--brand-yellow-dark);
}

div:has(> .wpcf7) {
    margin-bottom: 1.5em;
}

/* Sidebar/footer tweaks */
.sidebar .widget {
    background: var(--brand-light);
    color: var(--brand-dark);
}
.footer-widgets,
.site-info {
    background: var(--brand-dark);
    color: var(--brand-white);
}
.footer-widgets a,
.site-info a {
    color: var(--brand-yellow);
}
.footer-widgets a:hover,
.site-info a:hover {
    color: var(--brand-yellow-dark);
}

/* Front page hero slider */
.dg-hero-slider {
    --dg-hero-max-width: min(100%, var(--content-width, 1200px));
    position: relative;
    width: 100%;
    max-width: var(--dg-hero-max-width);
    aspect-ratio: 21 / 9;
    height: auto;
    max-height: clamp(280px, 45vw, 520px);
    margin: 0 auto;
    overflow: visible;
    background: var(--brand-dark);
}
.dg-hero-slider.alignfull {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.dg-hero-slide::before,
.dg-hero-slide::after,
.wp-block-image.dg-hero-image::before,
.wp-block-image.dg-hero-image::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(24px, 6vw, 120px);
    pointer-events: none;
    z-index: 2;
    background-image: var(--dg-hero-bg);
    background-size: cover;
    background-position: center;
    filter: blur(10px);
    opacity: 0.7;
}
.dg-hero-slide::before,
.wp-block-image.dg-hero-image::before {
    left: 0;
    transform: translateX(-100%);
    background-position: left center;
    mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.75), transparent);
    -webkit-mask-image: linear-gradient(
        to left,
        rgba(0, 0, 0, 0.75),
        transparent
    );
}
.dg-hero-slide::after,
.wp-block-image.dg-hero-image::after {
    right: 0;
    transform: translateX(100%);
    background-position: right center;
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.75), transparent);
    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.75),
        transparent
    );
}
.wp-block-image.dg-hero-image {
    position: relative;
    overflow: visible;
    isolation: isolate;
}
.wp-block-image.dg-hero-image img {
    display: block;
    position: relative;
    z-index: 1;
}
.dg-hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 600ms ease;
    overflow: visible;
    background-image: var(--dg-hero-bg);
    background-size: cover;
    background-position: center;
    z-index: 0;
    isolation: isolate;
}
.dg-hero-slide.is-active {
    opacity: 1;
    z-index: 1;
}

/* Lift the right sidebar when it starts with the callback CTA after the hero */
@media (min-width: 992px) {
    .dg-hero-slider
        + #page
        #right-sidebar:has(aside > .cta-callback:first-child) {
        position: relative;
        z-index: 2;
        /* margin-top: -10em; */
    }
}

/* Callback CTA card (start page) */
.sidebar .widget:has(> .cta-callback) {
    border: 1px solid var(--brand-yellow);
    border-left-width: 10px;
    padding-left: 30px;
}
.sidebar .widget .cta-callback p {
    margin-bottom: 0.65em;
}
.sidebar .widget .cta-callback textarea {
    height: 100px;
    resize: vertical;
}
.sidebar .widget .cta-callback input[type="submit"] {
    background: var(--brand-yellow);
    color: var(--brand-dark);
    border: none;
    padding: 10px 20px;
    font-weight: 700;
}
.sidebar .widget .cta-callback input[type="submit"]:hover {
    background: var(--brand-dark);
    color: var(--brand-white);
}
.sidebar .widget .cta-callback input::placeholder,
.sidebar .widget .cta-callback textarea::placeholder {
    color: var(--brand-dark);
    opacity: 0.4;
    font-size: 0.9em;
}
