/* Golfwerk v0.2.3 — responsive & readability hardening
 * Copyright 2026 berger-support.info | Author m@raxus
 * Applies to existing Gutenberg pages without replacing their saved markup.
 */
html { overflow-x: clip; }
body { min-width: 0; overflow-wrap: break-word; }
.gw-site-content, .gw-block-home, .gw-article, .gw-article-body, .gw-shop-main,
.wp-block-group, .wp-block-column, .wp-block-cover__inner-container { min-width: 0; }
.gw-article-body :is(img, video, iframe, svg),
.gw-block-home :is(img, video, iframe, svg) { max-width: 100%; }
.gw-article-body :is(h1,h2,h3,p,li),
.gw-block-home :is(h1,h2,h3,p,li) { overflow-wrap: break-word; }
.gw-article-body .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gw-article-body .wp-block-table table { width: 100%; }
.gw-article-body .wp-block-buttons, .gw-block-home .wp-block-buttons { gap: 12px; flex-wrap: wrap; }
.gw-article-body .wp-block-button__link, .gw-block-home .wp-block-button__link {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  max-width: 100%; text-align: center; white-space: normal; line-height: 1.35;
}
/* Cover text must stay above the image and overlays, even on iOS Safari. */
body.gw-home .gw-block-home .wp-block-cover.gw-block-hero { isolation: isolate; }
body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__image-background { z-index: 0; }
body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__background { z-index: 1; }
body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__inner-container {
  z-index: 3; color: var(--gw-paper); max-width: var(--gw-container) !important;
}
body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__inner-container :is(h1,h2,h3,p) {
  color: var(--gw-paper);
}
body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__inner-container a.wp-block-button__link {
  color: var(--gw-dark); background: var(--gw-accent);
}
body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__inner-container a.wp-block-button__link:hover {
  color: var(--gw-dark); background: var(--gw-paper);
}
/* Allow responsive typography on fitting, ankauf and regular Gutenberg pages. */
.gw-article-body .wp-block-cover { min-height: 300px; }
.gw-article-body .wp-block-cover__inner-container { width: 100%; }
.gw-article-body .wp-block-cover .wp-block-cover__inner-container :is(h1,h2,h3,p) {
  max-width: 100%; overflow-wrap: anywhere;
}
.gw-article-body .wp-block-cover:not(.is-light) .wp-block-cover__inner-container :is(h1,h2,h3,p):not(.has-text-color) {
  color: #fff;
}
@media (max-width: 1024px) {
  .gw-block-home .gw-block-tiles.wp-block-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .gw-block-home .gw-block-tiles.wp-block-columns > .wp-block-column { flex-basis: auto !important; min-width: 0; margin: 0; }
  .gw-block-home .gw-block-tiles > .wp-block-column { min-height: 195px; }
  .gw-header-inner { gap: 14px; }
}
@media (max-width: 782px) {
  .gw-page-shell { padding: 36px 0 66px; }
  .gw-prose-layout { width: calc(100% - 40px); max-width: 940px; }
  .gw-article-body { font-size: 1rem; line-height: 1.75; }
  .gw-article-body :is(h1,h2,h3,h4) { line-height: 1.18; letter-spacing: -.025em; hyphens: auto; }
  .gw-article-heading h1, .gw-listing-heading h1 { font-size: clamp(2rem, 7vw, 2.85rem); }
  .gw-article-body h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
  .gw-article-body h3 { font-size: clamp(1.25rem, 4vw, 1.65rem); }
  .gw-article-body .wp-block-columns:not(.is-not-stacked-on-mobile) {
    display: flex; flex-direction: column; gap: 24px;
  }
  .gw-article-body .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    flex-basis: auto !important; width: 100%; min-width: 0;
  }
  .gw-article-body .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column > :last-child { margin-bottom: 0; }
  .gw-article-body > .alignwide { width: 100%; max-width: 100%; margin-left: 0; transform: none; left: auto; }
  .gw-article-body > .alignfull {
    position: relative; left: 50%; margin-left: -50vw; width: 100vw;
    max-width: none; transform: none;
  }
  .gw-article-body > .alignfull:not(.wp-block-cover) { padding-inline: 20px; }
  .gw-article-body > .wp-block-cover.alignfull { padding-inline: 20px; }
  .gw-article-body .wp-block-cover:not(.has-custom-content-position) { align-items: center; }
  .gw-article-body .wp-block-cover { min-height: 320px; }
  .gw-article-body .wp-block-cover .wp-block-cover__inner-container :is(h1,h2) {
    font-size: clamp(1.75rem, 6.6vw, 2.8rem) !important;
    line-height: 1.14;
  }
  .gw-article-body .wp-block-cover .wp-block-cover__inner-container p { font-size: 1rem !important; line-height: 1.55; }
  .gw-article-body .wp-block-media-text:not(.has-media-on-the-right) { grid-template-columns: 100% !important; }
  .gw-article-body .wp-block-media-text { display: block; }
  .gw-article-body .wp-block-media-text__content { padding: 22px 0; }
  .gw-article-body .wp-block-media-text__media img { width: 100%; height: auto; }
  .gw-footer-main { gap: 28px; }
  .gw-footer-main :is(h3,p,li) { overflow-wrap: anywhere; }
}
@media (max-width: 767px) {
  /* True touch targets and a logo that cannot push navigation offscreen. */
  .gw-header { min-height: 64px; height: auto; }
  .gw-header-inner { min-height: 68px; gap: 8px; }
  .gw-brand { flex: 1 1 0; max-width: calc(100% - 145px); min-width: 0; }
  .gw-brand :is(.custom-logo-link, .gw-wordmark) { display: block; max-width: 100%; }
  .gw-brand .custom-logo { max-width: 100%; max-height: 52px; object-fit: contain; }
  .gw-wordmark { font-size: clamp(1.12rem, 5vw, 1.55rem); line-height: 1.02; letter-spacing: -.045em; overflow-wrap: anywhere; }
  .gw-header-actions { gap: 2px; flex: none; }
  .gw-icon-button { width: 44px; height: 44px; min-width: 44px; }
  .gw-mobile-menu { width: min(380px, 100vw); padding: max(22px, env(safe-area-inset-top)) 24px max(30px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .gw-mobile-list > li > a { padding: 15px 0; line-height: 1.4; }
  /* Put the claim in the initial viewport, with a reliable dark scrim on top of image. */
  body.gw-home .gw-block-home .wp-block-cover.gw-block-hero {
    min-height: clamp(480px, 76svh, 650px) !important;
    height: auto !important;
    padding: 62px 22px 54px !important;
    justify-content: flex-start; align-items: center;
    overflow: hidden; background-color: var(--gw-dark);
  }
  body.gw-home .gw-block-home .gw-block-hero::after {
    content: ''; position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(90deg,rgba(9,28,19,.86),rgba(9,28,19,.58) 74%,rgba(9,28,19,.38));
    pointer-events: none;
  }
  body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__image-background {
    object-position: 62% center !important;
    -webkit-transform: translateZ(0); transform: translateZ(0);
  }
  body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__inner-container {
    width: 100% !important; max-width: 100% !important;
    margin: 0 !important; padding: 0 !important;
    text-align: left; position: relative; z-index: 3;
  }
  body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__inner-container > * {
    width: auto; min-width: 0; max-width: 100%; margin-left: 0 !important; margin-right: 0 !important;
  }
  body.gw-home .gw-block-home .gw-block-hero h1 {
    font-size: clamp(1.95rem, 7.6vw, 2.85rem) !important;
    letter-spacing: -.027em; line-height: 1.14;
    hyphens: auto; overflow-wrap: normal; word-break: normal;
    margin-bottom: 18px;
  }
  body.gw-home .gw-block-home .gw-block-hero p {
    font-size: 1rem !important; line-height: 1.55; margin-bottom: 18px;
  }
  body.gw-home .gw-block-home .gw-block-hero .has-small-font-size {
    font-size: .8rem !important; line-height: 1.45; letter-spacing: .06em;
  }
  body.gw-home .gw-block-home .gw-block-hero .wp-block-buttons { gap: 12px; }
  body.gw-home .gw-block-home .gw-block-hero .wp-block-button__link {
    min-height: 48px; padding: 12px 19px; font-size: .95rem;
  }
  body.gw-home .gw-block-home > .wp-block-group.gw-block-section {
    padding: 46px 22px;
  }
  body.gw-home .gw-block-home .gw-block-section > :is(h1,h2,h3,p,.wp-block-buttons,.wp-block-columns,.wp-block-shortcode) {
    min-width: 0; width: 100%; max-width: 100%; margin-left: 0 !important; margin-right: 0 !important;
  }
  body.gw-home .gw-block-home .gw-block-section h2 {
    font-size: clamp(1.65rem, 6vw, 2.3rem); line-height: 1.18; letter-spacing: -.025em;
    margin-bottom: 20px;
  }
  body.gw-home .gw-block-home .gw-block-tiles.wp-block-columns:not(.is-not-stacked-on-mobile) {
    display: grid; grid-template-columns: minmax(0,1fr); gap: 12px;
  }
  body.gw-home .gw-block-home .gw-block-tiles > .wp-block-column {
    display: flex; min-height: 0; padding: 21px 20px; gap: 6px;
  }
  body.gw-home .gw-block-home .gw-block-tiles > .wp-block-column :is(h3,p) {
    max-width: 100%; overflow-wrap: anywhere;
  }
  body.gw-home .gw-block-home .gw-block-tiles h3 {
    font-size: 1.45rem; line-height: 1.2; margin: 0 0 5px;
  }
  body.gw-home .gw-block-home .gw-block-tiles p { font-size: .92rem; line-height: 1.55; margin: 0 0 6px; }
  body.gw-home .gw-block-home > .wp-block-group.gw-block-offer {
    padding: 52px 22px !important;
  }
  body.gw-home .gw-block-home .gw-block-offer > h2 {
    font-size: clamp(1.8rem, 6.8vw, 2.6rem); line-height: 1.16; letter-spacing: -.025em;
  }
  body.gw-home .gw-block-home .gw-block-offer > p:not(:first-of-type) {
    font-size: 1rem; line-height: 1.65;
  }
  body.gw-home .gw-block-home .gw-block-offer .wp-block-button__link { font-size: 1rem !important; }
  .gw-benefits-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .gw-benefit strong { font-size: .82rem; }
  .gw-benefit span { font-size: .78rem; }
  .gw-hero { min-height: clamp(490px, 76svh, 660px); }
  .gw-hero-inner { padding-top: 65px; padding-bottom: 60px; }
  .gw-hero h1 { font-size: clamp(2.1rem,8vw,3rem); line-height: 1.12; }
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: .92rem; }
  .woocommerce ul.products li.product .price { font-size: 1rem; }
  .woocommerce ul.products li.product .button { min-height: 44px; font-size: .83rem; padding: 11px 13px; }
  .woocommerce .woocommerce-result-count { float: none; }
  .woocommerce .woocommerce-ordering { float: none; }
  .woocommerce .woocommerce-ordering select { width: 100%; }
  .woocommerce .woocommerce-breadcrumb { font-size: .82rem; line-height: 1.5; }
  .woocommerce div.product .product_title { font-size: clamp(1.95rem, 7vw, 2.65rem); }
  .woocommerce div.product form.cart .button { min-height: 44px; }
  .woocommerce table.shop_table_responsive { max-width: 100%; }
  .woocommerce .wc-block-components-sidebar-layout, .wc-block-components-sidebar-layout { min-width: 0; }
  .woocommerce :is(.woocommerce-tabs,.woocommerce-product-details__short-description,.related.products) { min-width: 0; }
  .gw-shop-sidebar { margin: 0; }
}
@media (max-width: 480px) {
  body.gw-home .gw-block-home .wp-block-cover.gw-block-hero { padding-inline: 20px !important; }
  body.gw-home .gw-block-home > .wp-block-group.gw-block-section,
  body.gw-home .gw-block-home > .wp-block-group.gw-block-offer { padding-inline: 20px !important; }
  .gw-article-body .wp-block-button { max-width: 100%; }
  .gw-article-body .wp-block-buttons .wp-block-button { width: 100%; }
  .gw-article-body .wp-block-buttons .wp-block-button__link { width: 100%; }
  /* A single comfortable product column on compact phones avoids 170px cards. */
  .woocommerce ul.products,
  .gw-home .woocommerce ul.products,
  .gw-shop-layout .woocommerce ul.products { grid-template-columns: minmax(0,1fr) !important; gap: 22px; }
  .woocommerce ul.products li.product a img { aspect-ratio: 1.35; padding: 18px; }
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 1.05rem; }
  .woocommerce ul.products li.product .button { font-size: .9rem; }
  .gw-section-head { gap: 14px; }
}
@media (max-width: 360px) {
  .gw-container { width: calc(100% - 28px); }
  .gw-brand { max-width: calc(100% - 138px); }
  .gw-header-inner { gap: 4px; }
  .gw-icon-button { width: 42px; min-width: 42px; }
  body.gw-home .gw-block-home .gw-block-hero h1 { font-size: 1.85rem !important; }
  body.gw-home .gw-block-home .wp-block-cover.gw-block-hero { padding-inline: 16px !important; }
  body.gw-home .gw-block-home > .wp-block-group.gw-block-section,
  body.gw-home .gw-block-home > .wp-block-group.gw-block-offer { padding-inline: 16px !important; }
}
@media (max-width: 767px) and (orientation: landscape) {
  body.gw-home .gw-block-home .wp-block-cover.gw-block-hero {
    min-height: 380px !important; padding-top: 36px !important; padding-bottom: 36px !important;
  }
  body.gw-home .gw-block-home .gw-block-hero h1 { font-size: 2rem !important; }
}
@media (prefers-reduced-motion: reduce) {
  body.gw-home .gw-block-home .gw-block-hero .wp-block-cover__image-background { transform: none; }
}
/* High-contrast CTAs placed on image covers (e.g. the Fitting landing page). */
.gw-article-body .wp-block-cover .wp-block-button .wp-block-button__link:not(.has-background) {
  background-color: var(--gw-accent);
  color: var(--gw-dark);
  text-decoration: none;
}
.gw-article-body .wp-block-cover .wp-block-button .wp-block-button__link:not(.has-background):hover,
.gw-article-body .wp-block-cover .wp-block-button .wp-block-button__link:not(.has-background):focus-visible {
  background-color: var(--gw-paper);
  color: var(--gw-dark);
}
/* iPhone landscape, compact tablets: don't spend a full screen on the hero. */
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  body.gw-home .gw-block-home .wp-block-cover.gw-block-hero {
    min-height: 420px !important;
    padding-top: 38px !important;
    padding-bottom: 38px !important;
  }
  body.gw-home .gw-block-home .gw-block-hero h1 {
    font-size: clamp(1.9rem, 4.7vw, 2.8rem) !important;
    margin-bottom: 13px;
  }
  body.gw-home .gw-block-home .gw-block-hero p { font-size: .93rem !important; margin-bottom: 13px; }
}
