/*
Theme Name: GI Bagger
Description: Deutschsprachiger Baggerkatalog mit Kontaktbereich.
Version: 1.1.5
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: gi-bagger
*/
@font-face {
  font-family:"GX Instrument Sans";
  src:url("../../uploads/gx-brand/instrument-sans.woff2") format("woff2");
  font-weight:400 700; font-style:normal; font-display:swap;
}
:root{--gx-width:min(1240px,calc(100% - 80px));--ink:#171b1b;--paper:#f4f2ec;--accent:#effc00;--gx-button-hover:#dbe600;--gx-night:#2b2c30;--gx-radius-small:6px;--gx-radius-medium:10px;--gx-radius-large:14px;--muted:#53545a;--gx-panel:#26272b;--gx-deep:#222327;--gx-gap:16px;--gx-gap-small:8px;--gx-gap-large:32px;--line:#dadbd2}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;color:var(--ink);background:var(--paper);font:16px/1.6 "GX Instrument Sans",system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
a{color:inherit}
a:focus-visible{outline:3px solid var(--ink);outline-offset:4px}
[hidden]{display:none!important}
img{max-width:100%;height:auto}
.wrap{width:min(1232px,calc(100% - 64px));margin:auto}
.site-head{background:var(--gx-night);color:white}
.top{display:flex;align-items:center;justify-content:space-between;gap:24px;min-height:84px}
.brand{display:flex;align-items:center;gap:12px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;text-decoration:none}
.brand img{display:block;max-width:175px;max-height:55px;width:auto}
nav{display:flex;align-items:center;gap:30px}
nav a,.button{text-decoration:none;font-weight:700}
.button{display:inline-flex;justify-content:center;align-items:center;gap:15px;padding:13px 20px;background:var(--accent);color:var(--ink);min-height:48px}
@media (hover:hover) and (pointer:fine){.button:hover{background:var(--gx-button-hover)}}
.hero{position:relative;isolation:isolate;color:white;background:var(--gx-night);display:grid;align-items:center}
.hero .wrap{padding:76px 0 84px}
.eyebrow{margin:0 0 14px;font-size:.84rem;letter-spacing:.16em;text-transform:uppercase;font-weight:900}
h1,h2,h3,p{margin-top:0}
h1,h2,h3{line-height:1.04;letter-spacing:-.045em}
h1{font-size:clamp(3.3rem,7.7vw,7.15rem);max-width:850px;margin-bottom:24px}
h2{font-size:clamp(2.35rem,5vw,4.7rem);margin-bottom:16px}
h3{font-size:1.5rem;margin-bottom:12px}
.hero p:not(.eyebrow){color:#f4f3ed;font-size:1.14rem;max-width:420px;margin-bottom:29px}
.section{padding:90px 0}
.section-head{border-bottom:1px solid var(--line);padding-bottom:24px;margin-bottom:28px}
.section-head p:last-child{margin-bottom:0;color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.card,.empty{background:#fff;border:1px solid var(--line)}
.card img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.card-body,.empty{padding:26px}
.card p,.empty p{color:var(--muted)}
.card a,.empty a{font-weight:800}
.contact-grid{display:grid;grid-template-columns:1.2fr 1fr;align-items:center;gap:32px}
.contact h2,.contact p:last-child{margin-bottom:0}
.contact-details{display:grid;gap:8px;font-size:1.15rem;overflow-wrap:anywhere}
.contact-details a{font-weight:800}
.site-footer{background:var(--gx-night);color:#fff;padding:28px 0}
.foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:14px}
.foot a{margin-right:16px}
.article{max-width:800px;padding:65px 0}
.article h1{font-size:clamp(2.4rem,8vw,5rem)}
@media(max-width:760px){.wrap{width:calc(100% - 36px)}.top{min-height:68px;gap:12px}nav{gap:12px;font-size:.88rem}nav .button{padding:8px 12px;min-height:44px}.section{padding:58px 0}.grid{grid-template-columns:1fr}.contact-grid{grid-template-columns:1fr}.brand{font-size:.83rem;letter-spacing:.04em}}
@media(max-width:350px){.brand img{max-width:112px}nav{gap:8px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

.hero .hero-layout{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:clamp(24px,5vw,72px);padding:52px 0}
.hero .hero-photo{display:block;width:100%;height:auto}
.brand .gx-logo{height:54px;width:auto;max-width:none;max-height:none}
.machine-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:32px}
.machine-gallery a,.machine-gallery img{display:block}
.machine-gallery img{width:100%;height:auto;aspect-ratio:4/3;object-fit:cover}
@media(max-width:760px){.hero .hero-layout{grid-template-columns:1fr;gap:26px;padding:38px 0}.hero .hero-photo{max-width:540px}.brand .gx-logo{height:43px}.machine-gallery{gap:10px}}

/* Keyboard navigation and narrow screens */
.gx-skip {
    position: absolute;
    z-index: 10000;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    background: var(--accent);
    color: #171b1b;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
}
.admin-bar .gx-skip { top: 54px; }
.gx-skip:focus { opacity: 1; pointer-events: auto; }
#gx-main:focus { outline: none; }
.article h1, .article h2 { overflow-wrap: anywhere; }
@media (max-width: 380px) {
    .article h2.wp-block-heading { font-size: 1.25rem !important; }
}

/* GX Bagger – Startseite */
.home {
  --gx-text:#f5f5ef;
  --gx-border:#ffffff2b;
  background:var(--paper);
}
.home .site-head { background:var(--gx-night); border-bottom:1px solid var(--gx-border); }
.site-head .top { width:var(--gx-width); min-height:84px; }
.home .hero {
  color:var(--gx-text);
  background:radial-gradient(ellipse at 78% 4%,#45474e 0%,#35363c 34%,transparent 67%),var(--gx-night);
  border-bottom:0;
}
.home .hero .hero-layout {
  width:var(--gx-width);
  grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);
  gap:clamp(30px,6vw,86px);
  padding:clamp(50px,5vw,79px) 0;
}
.home .hero h1 {
  font-size:clamp(3.6rem,6.2vw,6.9rem); line-height:.94;
  letter-spacing:-.045em; text-wrap:balance; margin:0 0 23px;
}
.home .hero p:not(.eyebrow) { max-width:34ch; color:#d8d8db; font-size:clamp(1rem,1.3vw,1.16rem); line-height:1.58; margin-bottom:30px; }
.home .hero .hero-photo {
  display:block; width:100%; aspect-ratio:1.1; object-fit:cover; object-position:center 56%;
  border:1px solid #ffffff47; border-radius:var(--gx-radius-large);
  box-shadow:0 24px 65px #08090c82;
}
.button {
  border:1px solid #1d1e211c; border-radius:var(--gx-radius-small); font-weight:800;
  transition:background-color 150ms ease,transform 150ms ease;
}
.home .hero .button { padding:13px 19px; }
.home #bagger { padding:clamp(52px,7.5vw,106px) 0 clamp(40px,6.1vw,88px); }
.home #bagger > .wrap { width:var(--gx-width); }
.home #bagger .section-head { border-bottom:0; margin-bottom:16px; padding-bottom:0; }
.home #bagger h2 { font-size:clamp(2.3rem,4.3vw,3.9rem); letter-spacing:-.045em; margin-bottom:0; }
.home #bagger > .wrap > p { color:var(--muted); margin-bottom:0; max-width:57ch; }
.home .machine-gallery {
  margin-top:32px;
}
.home .machine-gallery a {
  overflow:hidden; position:relative; min-height:0; background:var(--gx-panel);
  border:1px solid #20212638; border-radius:var(--gx-radius-medium);
  box-shadow:0 7px 21px #18191d18;
}
.home .machine-gallery img {
  display:block; width:100%; height:100%; aspect-ratio:auto; object-fit:cover;
  transition:transform 320ms cubic-bezier(.2,.7,.25,1);
}
.home #kontakt.contact { padding:0 0 clamp(34px,5vw,68px); background:transparent; color:var(--gx-text); }
.home #kontakt .contact-grid {
  width:var(--gx-width); padding:clamp(19px,3vw,31px) clamp(19px,3.3vw,41px);
  background:var(--gx-deep); border:1px solid #33343a; border-left:4px solid var(--accent);
  border-radius:var(--gx-radius-medium); box-shadow:0 12px 25px #20212516;
}
.home #kontakt .eyebrow { color:var(--accent); margin-bottom:8px; }
.home #kontakt h2 { font-size:clamp(1.45rem,2.45vw,2.05rem); }
 .home #kontakt .contact-details .button {
  display:inline-flex; align-items:center; justify-content:center;
  min-height:44px; padding:8px 15px; border:1px solid var(--accent); border-radius:var(--gx-radius-small);
  color:var(--accent); text-decoration:none; white-space:nowrap;
  transition:color 180ms ease,background-color 180ms ease;
}
.home .site-footer { background:var(--gx-night); }
.home .site-footer .foot { width:var(--gx-width); }
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  .button:hover { transform:translateY(-2px); }
  .home .machine-gallery a:hover .gx-zoom { background:var(--accent); color:var(--ink); }
}
@media (prefers-reduced-motion:no-preference) {
  .home .hero-copy { animation:gx-intro 360ms cubic-bezier(.2,.7,.25,1); }
  .home .hero-photo { animation:gx-photo-enter 360ms cubic-bezier(.2,.7,.25,1); }
  @keyframes gx-photo-enter { from { transform:translateY(8px); } to { transform:none; } }
  @keyframes gx-intro { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
}
@media (prefers-reduced-motion:reduce) {
  .button,.home .machine-gallery a,
  .home .machine-gallery img, .home #kontakt .contact-details .button { transition:none; }
}
@media (max-width:760px) {
  :root { --gx-width:calc(100% - 36px); }
  .site-head .top { min-height:67px; }
  .home .hero .hero-layout { grid-template-columns:1fr; gap:28px; padding:38px 0 34px; }
  .home .hero h1 { font-size:clamp(2.8rem,10.7vw,4.8rem); margin-bottom:14px; }
  .home .hero p:not(.eyebrow) { margin-bottom:20px; }
  .home .hero .hero-photo { aspect-ratio:1.08; border-radius:var(--gx-radius-medium); }
  .home .machine-gallery { margin-top:24px; }
  .home .machine-gallery a { border-radius:var(--gx-radius-small); }
  .home #kontakt .contact-grid { grid-template-columns:1fr; gap:12px; }
   .home #kontakt .contact-details .button { justify-self:start; }
}


/* GX Bagger – Logo, Bildansicht und Impressum */
.site-head .brand img { border-radius:var(--gx-radius-medium); }
.site-footer .foot { align-items:center; }
.site-footer .gx-footer-links { display:flex; align-items:center; flex-wrap:wrap; gap:9px 18px; }
.site-footer .gx-footer-links a { margin:0; text-underline-offset:.24em; }
html:has(.gx-dialog[open]) { overflow:hidden; }
.gx-dialog {
  box-sizing:border-box; width:min(720px,calc(100% - 32px)); max-width:none;
  max-height:min(88dvh,850px); padding:0;
  color:var(--ink); background:var(--paper); border:1px solid #ffffff4d; border-radius:var(--gx-radius-large);
  box-shadow:0 28px 85px #0008;
}
.gx-dialog::backdrop { background:#15161abb; }
.gx-dialog[open] { display:flex; flex-direction:column; }
.gx-dialog-toolbar {
  flex:none; display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding:15px 24px; background:var(--gx-night); color:#fff;
  border-bottom:2px solid var(--accent);
}
.gx-dialog-toolbar h2 { margin:0; font-size:clamp(1.35rem,3vw,1.8rem); letter-spacing:-.035em; }
.gx-dialog button {
  min-width:44px; min-height:44px; padding:7px 11px; border:1px solid #ffffff45;
  border-radius:var(--gx-radius-small); background:var(--gx-night); color:#fff; font:inherit; cursor:pointer;
}
.gx-dialog-close { flex:none; font-size:1.42rem!important; line-height:1; }
.gx-dialog-body { min-height:0; overflow:auto; padding:23px 24px; overscroll-behavior:contain; }
.gx-dialog-body h2 { margin:22px 0 10px; font-size:1.35rem; overflow-wrap:anywhere; }
.gx-dialog-body p { margin-bottom:14px; overflow-wrap:anywhere; }
.gx-dialog-body p:last-child { margin-bottom:0; }
.gx-dialog-gallery { width:min(1050px,calc(100% - 32px)); color:white; background:var(--gx-panel); }
/* Keep gallery controls in place when changing images. */
.gx-gallery-stage {
  flex:0 1 min(66dvh,680px);
  min-height:0;
  display:grid; place-items:center;
  padding:14px; text-align:center; touch-action:pan-y pinch-zoom;
}
.gx-gallery-stage img {
  display:block; width:100%; height:100%; max-width:100%; max-height:none; min-height:0;
  margin:0 auto; object-fit:contain;
}
.gx-gallery-controls {
  display:flex; flex:none; justify-content:space-between; align-items:center;
  padding:8px 18px 15px; gap:12px;
}
.gx-gallery-count { color:#e6e6e9; font-variant-numeric:tabular-nums; }
.home .machine-gallery a { cursor:zoom-in; }
@media (max-width:540px) {
  .gx-dialog { width:calc(100% - 20px); max-height:92dvh; border-radius:var(--gx-radius-medium); }
  .gx-dialog-toolbar,.gx-dialog-body { padding:12px 14px; }
  .gx-gallery-controls { padding-inline:12px; }
}

/* GX Bagger – Impressum-Fenster */
html:has(.gx-dialog) { scrollbar-gutter:stable; }
@media (prefers-reduced-motion:no-preference) {
  .gx-dialog[open] { animation:gx-dialog-enter 280ms cubic-bezier(.22,1,.36,1) both; }
  @keyframes gx-dialog-enter {
    from { opacity:0; transform:translateY(12px) scale(.985); }
    to { opacity:1; transform:none; }
  }
  @supports (transition-behavior:allow-discrete) and (overlay:auto) {
    .gx-dialog {
      opacity:0; transform:translateY(4px);
      transition:opacity 200ms cubic-bezier(.3,.1,.45,1), transform 200ms cubic-bezier(.3,.1,.45,1), display 220ms allow-discrete, overlay 220ms allow-discrete;
    }
    .gx-dialog[open] {
      opacity:1; transform:none; animation:none;
      transition:opacity 230ms ease-out, transform 280ms cubic-bezier(.22,1,.36,1), display 280ms allow-discrete, overlay 280ms allow-discrete;
    }
    .gx-dialog::backdrop {
      opacity:0;
      transition:opacity 220ms cubic-bezier(.3,.1,.45,1), display 220ms allow-discrete, overlay 220ms allow-discrete;
    }
    .gx-dialog[open]::backdrop {
      opacity:1;
      transition:opacity 230ms ease-out, display 230ms allow-discrete, overlay 230ms allow-discrete;
    }
    @starting-style {
      .gx-dialog[open] { opacity:0; transform:translateY(12px) scale(.985); }
      .gx-dialog[open]::backdrop { opacity:0; }
    }
  }
}

/* GX Bagger – Kontakt */
#gx-contact-dialog { max-width:460px; }
#gx-contact-dialog .gx-contact-list { display:grid; gap:18px; margin:0; }
#gx-contact-dialog dt { margin-bottom:4px; color:var(--muted); font-size:.9rem; font-weight:650; }
#gx-contact-dialog dd { margin:0; }
#gx-contact-dialog dd a { color:inherit; font-size:clamp(1.05rem,4vw,1.28rem); font-weight:750; overflow-wrap:anywhere; text-underline-offset:.2em; }

.site-head .top nav > a.button[href$="#kontakt"] {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-block-size:44px;
  padding:7px clamp(17px,2.4vw,30px);
  font-size:clamp(.86rem,1.2vw,.94rem);
  white-space:nowrap;
}

/* GX Bagger – Schaltflächen */
.home #kontakt .contact-details .button {
  background:var(--accent); border-color:var(--accent); color:var(--ink);
}
.home .hero .button:focus-visible, .home .top .button:focus-visible,
.home #kontakt .contact-details .button:focus-visible, .gx-dialog button:focus-visible {
  outline:2px solid var(--accent); outline-offset:3px;
}
@media (hover:hover) and (pointer:fine) {
  .home #kontakt .contact-details .button:hover {
    background:var(--gx-button-hover); border-color:var(--gx-button-hover); color:var(--ink);
  }
  .gx-dialog button:hover { background:var(--gx-button-hover); color:var(--ink); }
}
.gx-dialog button:active { background:var(--accent); color:var(--ink); }

/* GX Bagger – Rückmeldung beim Drücken */
@media (prefers-reduced-motion:no-preference) {
   .home #kontakt .contact-details .button {
    transition:color 180ms ease, background-color 180ms ease, transform 150ms ease;
  }
  .gx-dialog button { transition:transform 150ms ease; }
  .button:active,
  .home #kontakt .contact-details .button:active, .gx-dialog button:active {
    transform:scale(.98);
  }
}

/* Shared links and controls */
.site-head a:focus-visible, .site-footer a:focus-visible { outline-color:var(--accent); }
.home .machine-gallery a:focus-visible { outline:3px solid var(--gx-night); outline-offset:3px; }
.site-head .top nav > a.button { min-height:44px; }
.hero-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px 18px; }
.home .hero .hero-copy .gx-hero-location {
  margin:0 0 14px; color:var(--accent); font-size:.87rem;
  font-weight:750; letter-spacing:.08em;
}
.gx-not-found { min-height:50vh; }
.article .button { border:2px solid var(--ink); border-radius:var(--gx-radius-small); }
.gx-not-found .button { margin-top:8px; }


/* Rows retain the editor order. Each pair shares a height at native aspect ratios. */
.home .machine-gallery { display:grid; grid-template-columns:minmax(0,1fr); grid-auto-rows:auto; gap:var(--gx-gap); }
.gx-gallery-row { display:flex; align-items:flex-start; gap:var(--gx-gap); min-width:0; }
.home .machine-gallery .gx-gallery-row > a {
  position:relative; flex:var(--gx-photo-ratio) 1 0%; min-width:0;
  aspect-ratio:var(--gx-photo-shape); border:0; isolation:isolate;
}
.home .machine-gallery .gx-gallery-row > a:only-child { max-width:50%; }
.home .machine-gallery .gx-gallery-row > a > img {
  position:absolute; inset:0; width:100%; height:100%; object-fit:contain;
}
.gx-zoom {
  position:absolute; right:var(--gx-gap-small); bottom:var(--gx-gap-small);
  display:grid; place-items:center; width:32px; height:32px;
  color:#fff; background:var(--gx-deep); border:1px solid #ffffff9c;
  border-radius:var(--gx-radius-small); font-size:1.25rem; line-height:1;
  pointer-events:none;
}
.gx-dialog-gallery .gx-gallery-controls button {
  min-width:48px; min-height:48px; border-color:#ffffffa8;
  font-size:1.45rem; font-weight:700; line-height:1;
}
.gx-gallery-caption {
  flex:none; margin:0; padding:0 var(--gx-gap) var(--gx-gap-small);
  color:#f5f5ef; text-align:center; font-size:.88rem; line-height:1.35;
}
.gx-gallery-caption:empty { display:none; }
.gx-gallery-controls { padding-top:var(--gx-gap-small); }
.gx-section-label { color:var(--ink); }
.gx-section-label::after { content:""; display:block; width:28px; height:3px; margin-top:var(--gx-gap-small); background:var(--accent); }
.gx-benefits { padding-top:var(--gx-gap); color:var(--gx-text); background:var(--gx-night); }
.gx-benefits ul {
  width:var(--gx-width); margin:0 auto; padding:var(--gx-gap) var(--gx-gap-large);
  list-style:none; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:var(--gx-gap);
  background:var(--gx-deep); border:1px solid var(--gx-border);
  border-radius:var(--gx-radius-medium) var(--gx-radius-medium) 0 0;
}
.gx-benefits li { display:flex; align-items:center; gap:var(--gx-gap-small); font-weight:650; }
.gx-benefits li span { color:var(--accent); }
.site-footer .foot { width:var(--gx-width); display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:var(--gx-gap-large); }
.gx-footer-company img { width:82px; height:auto; margin-bottom:var(--gx-gap-small); border-radius:var(--gx-radius-small); }
.gx-footer-company p { margin:var(--gx-gap-small) 0 0; color:#dadbe0; }
.site-footer .gx-footer-links { justify-content:flex-end; }
.home .hero p, .home #bagger p, .article p { hyphens:auto; text-wrap:pretty; }

@media (max-width:760px) {
  .home .machine-gallery, .gx-gallery-row { gap:var(--gx-gap-small); }
  .gx-benefits ul { padding:var(--gx-gap); gap:var(--gx-gap-small); font-size:.92rem; }
  .site-footer .foot { grid-template-columns:1fr; gap:var(--gx-gap); }
  .site-footer .gx-footer-links { justify-content:flex-start; }
}
@media (max-width:380px) {
  .gx-gallery-row { display:grid; }
  .home .machine-gallery .gx-gallery-row > a:only-child { max-width:none; }
  .gx-benefits ul { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:no-preference) {
  .gx-gallery-motion .gx-gallery-row { opacity:0; transform:translateY(12px); transition:opacity 340ms ease,transform 340ms ease; }
  .gx-gallery-motion .gx-gallery-row.is-visible, .gx-gallery-motion .gx-gallery-row:focus-within { opacity:1; transform:none; }
}
@media print {
  .site-head nav, .hero-actions, .gx-dialog, .gx-zoom, #wpadminbar { display:none; }
  .home .hero, .home #kontakt .contact-grid, .site-footer, .gx-benefits, .gx-benefits ul { color:#111; background:#fff; box-shadow:none; }
  .gx-footer-company p,.gx-benefits li span { color:#111; }
  .gx-gallery-motion .gx-gallery-row { opacity:1; transform:none; }
  .home .hero p:not(.eyebrow),
  .home .hero .hero-copy .gx-hero-location,
  .home #kontakt .eyebrow,  .home #kontakt .contact-details .button { color:#111; }
   .home #kontakt .contact-details .button { background:#fff; border-color:#111; }
  .home .hero .hero-photo, .home .machine-gallery a { box-shadow:none; break-inside:avoid; }
}
