/* GoDigital Media: every media query (loaded after main.css). Width-only breakpoints: desktop from 1025 px, tablet 768–1024 px, phone up to 767 px.
   Order: layout ranges first, then input (hover) and motion preferences. */

/* ========== Desktop: from 1025 px ========== */
@media (min-width:1025px){
  /* The design is drawn at 1440 x 900: 1rem = 16px x min(width/1440, height/900), kept between 70% and 125% */
  html{font-size:clamp(70%,min(100vw / 90,100vh / 56.25),125%); scrollbar-width:none}
  html::-webkit-scrollbar,body::-webkit-scrollbar{display:none}
  :root{--w:.9rem;--rhythm:2.5rem}
  .dots{display:block}
	
  /* Every section fills one window below the header */
  main>section:not(.tension){min-height:calc(100vh - var(--nav-h));min-height:calc(100svh - var(--nav-h));display:flex;flex-direction:column;justify-content:center;scroll-margin-top:var(--nav-h)}
  main>section.tension{padding-top:0}
  /* Services sit in the window middle: the header height as bottom padding */
  [data-section="services"]{padding-top:0;padding-bottom:var(--nav-h)}
  .section-heading{margin-bottom:1rem}
  .guide-left{padding:1.5rem 1rem}
  .guide-right{padding:1.5rem 2.25rem}
  .guide-panel{gap:1.625rem}
  .guide-foot{margin-top:1.25rem}
  .guide-row{padding-top:.8125rem;padding-bottom:.8125rem}
  /* FAQ: an invisible scaffold holds the longest answer, so nothing jumps when another question opens */
  .faq-list{display:grid}
  .faq-rows,.faq-sizer{grid-area:1/1;min-width:0}
  .faq-rows{align-self:start}
  .faq-sizer{display:block;visibility:hidden;pointer-events:none}
  /* Grundsätze and FAQ: the title column with its card stays in view while the list scrolls */
  .split--aside>:first-child,.faq-grid>:first-child{position:sticky;top:calc(var(--nav-h) + 1.5rem);align-self:start}
  .admin-bar .split--aside>:first-child,.admin-bar .faq-grid>:first-child{top:calc(var(--nav-h) + 32px + 1.5rem)}
  /* Stage: statements on the left, the graphic on the right */
  .stage-inner{grid-template-rows:auto minmax(0,1fr) auto;min-height:100%}
  /* Closing line: a wide two-line title with the note beside it, so the row stays short */
  .stage-close{grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,18rem);align-items:end;gap:3rem}
  .stage-close h2{max-width:46rem;font-size:clamp(1.75rem,calc(2.4 * var(--w)),2.25rem)}
  .stage-note{margin-top:0;padding-bottom:.375rem}
  .stage-art{grid-row:2;position:relative;height:31.5rem}
  .situations{display:block}
  .situation{position:absolute;left:0;top:var(--y);width:40%;transform:translateY(-50%)}
  .situation-1{--y:var(--y1)}
  .situation-2{--y:var(--y2)}
  .situation-3{--y:var(--y3)}
  .situation-4{--y:var(--y4)}
  .causes{display:none}
  .mock,.strip,.trace,.dot{display:block}
  .flow1{display:flex}
}

/* ========== Phone and tablet layout: below 1025 px ========== */
@media (max-width:1024.98px){
  :root{--rhythm:clamp(40px,10vw,72px)}
  [data-section="faq"] details[id]{scroll-margin-top:calc(var(--nav-h) + 16px)}
  .hero{padding-top:24px;padding-bottom:var(--rhythm)}
  .hero-grid,.split,.section-heading{grid-template-columns:minmax(0,1fr);gap:40px}
  .hero-grid{gap:32px}
  /* Global type scale and section head below desktop */
  h1{font-size:clamp(34px,11.2vw,72px);line-height:1.05}
  h2,.title-2{font-size:clamp(30px,8vw,44px)}
  .title-3{font-size:clamp(24px,6.4vw,32px)}
  .title-4{font-size:22px}
  .eyebrow{margin-bottom:20px}
  .lead{max-width:none;margin-top:20px;font-size:16px;line-height:1.65}
  .actions{flex-wrap:wrap;gap:8px 24px;margin-top:24px}
  .button:not(.button--small){min-height:48px}
  .text-link{position:relative}
  .text-link::after{content:'';position:absolute;top:-14px;right:-8px;bottom:-14px;left:-8px}
  .stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;padding-top:32px}
  .stats>div{flex-direction:column;align-items:flex-start;gap:2px}
  .stats strong{font-size:clamp(26px,7.4vw,34px);line-height:1.2}
  .hero-media{aspect-ratio:1/1;max-height:70vh;max-height:70svh}
  .hero-media img{object-position:50% 24%}
  /* Situation as a timeline: dot and line = present, dashed chip = missing */
  .stage-inner{gap:40px}
  .situations{gap:36px}
  .situation{position:relative;padding-left:28px}
  .situation::before{content:'';position:absolute;left:0;top:10px;width:9px;height:9px;border-radius:50%;background:var(--ink)}
  .situation:not(:last-child)::after{content:'';position:absolute;left:4px;top:23px;bottom:-32px;width:1px;background:var(--muted)}
  .causes{border-radius:16px;line-height:1.5}
  .process{grid-template-columns:repeat(2,1fr)}
  .faq-grid{grid-template-columns:1fr;gap:32px}
  .faq-list{border-top:0}
  .faq-a{padding-left:68px;padding-right:12px}
  /* Touch targets of at least 44 px; form fields at 16 px so iOS does not zoom */
  .contact input:not([type=submit]):not([type=checkbox]),.contact textarea{min-height:48px;font-size:16px}
  .contact .pills .wpcf7-list-item-label{min-height:44px;padding:0 18px;font-size:14px}
  .contact-info{max-width:none}
  .call-card{max-width:none;margin-top:32px;padding:20px;gap:14px}
  .section-heading{margin-bottom:28px}
  .footer{padding-bottom:max(24px,env(safe-area-inset-bottom))}
  .footer .logo{min-height:44px;margin-right:auto}
  .footer .logo-img{height:28px}
  .footer-legal a{display:inline-flex;align-items:center;min-height:44px;margin-left:-8px;padding:0 8px}
  .legal h1{margin-bottom:28px}
  .legal h2{font-size:clamp(22px,6vw,28px)}
}

/* ========== Tablet: 768 to 1024 px ========== */
@media (min-width:768px) and (max-width:1024.98px){
  .hero-media{aspect-ratio:4/3}
  .impact{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto}
  .impact-lead{grid-column:1/-1;grid-row:auto}
}

/* ========== Header and menu drawer: up to 1024 px ========== */
@media (max-width:1024.98px){
  .nav[data-hidden]{translate:0 -100%}
  .nav-inner{gap:12px}
  .logo{min-height:44px;margin-right:auto}
  .nav .logo-img{height:32px}
  .button--small{min-height:44px;padding:0 18px;font-size:14px}
  .logo,.nav-cta,.menu-button{position:relative;z-index:2}
  .menu-button{display:inline-flex;margin-right:-8px}
  /* Drawer: full width and full height, slides in from the right. The links start below the header;
     --drawer-offset (set by main.js on opening) adds whatever sits above it, e.g. the WP admin bar. */
  .nav nav{position:fixed;top:0;right:0;z-index:1;width:100%;height:100vh;height:100dvh;flex-direction:column;align-items:stretch;gap:0;padding:calc(var(--drawer-offset,0px) + var(--nav-h) + 35px) 16px max(24px,env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;background:var(--linen);counter-reset:menu;display:none}
  /* Closed: out of the layout (an off-screen drawer would widen the page and allow sideways scrolling) */
  .nav[data-open] nav{display:flex}
  .nav nav>a:not(.button){counter-increment:menu;gap:16px;min-height:56px;border-bottom:1px solid var(--line);font-size:20px}
  .nav nav>a:not(.button)::before{content:counter(menu,decimal-leading-zero);width:24px;font-family:var(--mono);font-size:11px;letter-spacing:.05em;color:var(--muted)}
  .nav nav>a.active{border-color:var(--line)}
  .lang{align-self:flex-start;margin:20px 0 24px;padding:4px}
  .lang a{min-width:64px;min-height:44px;font-size:13px}
  .impact-lead{padding:24px}
  .impact-tile{padding:16px}
}

/* ========== Phone: up to 767 px ========== */
@media (max-width:767.98px){
  /* Header: logo and menu button only; the request button moves to the bottom of the drawer */
  .nav .logo-img{height:28px}
  .nav-inner>.nav-cta{display:none}
  .menu-cta{display:flex;margin-top:auto;min-height:52px;font-size:16px}
  .hero-media{display:none}
  .fields,.guide-actions li{grid-template-columns:1fr}
  .guide-actions li{gap:2px}
  .footer-top{flex-wrap:wrap}
  .contact fieldset{min-width:0}
  /* Process steps and impact tiles stack; form pills wrap. Nothing scrolls sideways. */
  .process{grid-template-columns:minmax(0,1fr);gap:24px}
  .impact{display:flex;flex-direction:column;gap:12px}
  .title-4{font-size:20px}
  .impact-text{font-size:14px;line-height:1.6}
  .faq-list summary,.faq-sizerow{grid-template-columns:28px minmax(0,1fr) 14px;gap:0 12px}
  .faq-a{padding:0 12px 20px 52px}
  .faq-a dl>div{grid-template-columns:1fr;gap:2px}
}
/* Narrow phones (under 336 px): Google's reCAPTCHA box is a fixed 304 px, wider than the 288 px form
   column at 320 px, and would make the page scroll sideways. Scaled down, it fits. */
@media (max-width:335.98px){
  .ls-cf7e-recaptcha>div{scale:.94;transform-origin:0 0}
}

/* ========== Fallback for browsers without aspect-ratio ========== */
@supports not (aspect-ratio:1/1){
  @media (max-width:1024.98px){.hero-media{padding-top:100%}}
  @media (min-width:768px) and (max-width:1024.98px){.hero-media{padding-top:75%}}
}

/* ========== Mouse and trackpad ========== */
@media (hover:hover) and (pointer:fine){
  /* Hover effects only for mouse and trackpad, so they do not stick after a tap on touch screens */
  .button:hover{background:var(--brass-hover)}
  .menu-button:hover,.faq-list summary:hover{background:var(--soft)}
  .dots button:hover span{display:block}
  .guide-row:hover{background:var(--soft)}
  .nav nav>a:not(.button):hover{border-bottom-color:var(--ink)}
  .lang a:not([aria-current]):hover{background:var(--selected);color:var(--ink)}
  .text-link:hover{border-bottom-color:var(--brass);color:var(--brass)}
  a.contact-info-row:hover{color:var(--brass)}
  a.contact-info-row:hover .contact-info-icon{border-color:var(--brass);background:var(--brass);color:#fffaf3}
  .contact .pills label:hover>input:not(:checked)+.wpcf7-list-item-label{border-color:var(--brass);background:var(--selected);color:var(--brass-active)}
  .contact .pills label:hover>input:checked+.wpcf7-list-item-label{border-color:var(--brass-hover);background:var(--brass-hover)}
  .contact input:not([type=submit]):hover,.contact textarea:hover{border-bottom-color:var(--ink)}
  .contact input:not([type=submit]):focus,.contact textarea:focus{border-bottom-color:var(--brass)}
  .footer a:hover{text-decoration:underline;text-underline-offset:.25rem;text-decoration-thickness:1px}
  /* Pressed states win over hover */
  .button:active{background:var(--brass-active)}
  .contact .pills label:active>input:not(:checked)+.wpcf7-list-item-label{background:var(--selected)}
}
/* Desktop with mouse: process and impact details appear on hover */
@media (hover:hover) and (pointer:fine) and (min-width:1025px){
  .hint{display:block}
  .reveal{opacity:0;translate:0 .5rem}
  :is(.process article,.impact-tile):is(:hover,:focus-within) .reveal{opacity:1;translate:0 0}
  :is(.process article,.impact-tile):is(:hover,:focus-within) .hint{opacity:0}
  :is(.process article,.impact-tile):focus-visible{outline:2px solid var(--brass);outline-offset:-.125rem}
}

/* ========== Motion allowed ========== */
@media (prefers-reduced-motion:no-preference){
  :root{interpolate-size:allow-keywords}
  .hero-media img{position:absolute;left:0;bottom:0;height:118%;will-change:transform}
  .dots button::before{transition:height 350ms var(--ease),background-color 350ms}
  .faq-icon::after{transition:rotate 250ms var(--ease)}
  .faq-list details::details-content,.guide-item::details-content{block-size:0;overflow:clip;transition:block-size 300ms var(--ease),content-visibility 300ms allow-discrete}
  .faq-list details[open]::details-content,.guide-item[open]::details-content{block-size:auto}
  .to-top{transition:opacity 200ms var(--ease),translate 200ms var(--ease),visibility 0s linear 200ms}
  .to-top[data-visible]{transition-delay:0s}
  .call-card-meta::before{animation:call-pulse 2.4s ease-out infinite}
  @keyframes call-pulse{0%{box-shadow:0 0 0 0 rgba(127,194,138,.55)}70%,100%{box-shadow:0 0 0 .5rem rgba(127,194,138,0)}}
}
@media (prefers-reduced-motion:no-preference) and (max-width:1024.98px){
  .nav{transition:translate 250ms var(--ease),box-shadow .2s var(--ease),border-color .2s var(--ease)}
  .nav[data-open] nav{animation:drawer-in 300ms var(--ease)}
  @keyframes drawer-in{from{translate:100% 0}to{translate:0 0}}
}
@media (prefers-reduced-motion:no-preference) and (max-width:1024.98px){
  html{scroll-behavior:smooth}
}
/* Scroll-driven fade-in on phone and tablet where supported */
@supports (animation-timeline:view()){
  /* Slide only, no fade: text that is mid-fade fails the contrast check (Lighthouse, axe) */
  @keyframes rise{from{translate:0 24px}to{translate:0 0}}
  @media (prefers-reduced-motion:no-preference) and (max-width:1024.98px){
    .situation,.impact-tile{animation:rise linear both;animation-timeline:view();animation-range:entry 5% entry 45%}
  }
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .button svg{transition:translate 200ms var(--ease)}
  .button:hover svg{translate:.1875rem 0}
}

/* Desktop with motion: stage pinned while its states play (data-beat 0 to 5, set by the script) */
@media (prefers-reduced-motion:no-preference) and (min-width:1025px){
  .stage{height:calc(100vh + 500px)}
  .stage-pin{position:sticky;top:0;height:100vh;padding-top:calc(var(--nav-h) + 1rem)}
  .stage-inner{height:100%;padding-bottom:2.5rem}
  /* Pinned: the graphic takes what the title rows leave, up to its drawn height */
  .stage-art{align-self:center;height:100%;max-height:31.5rem}
  .situation,.situation span,.mock,.flow1,.mock-cta,.mock-checkout em,.mock-checkout div,.strip,.stage-close,.dot{transition:opacity 450ms var(--ease),translate 450ms var(--ease)}
  .trace{transition:scale 350ms var(--ease)}
  .situation span,.dot,.trace{transition-delay:120ms}
  .flow1,.mock,.mock-cta,.mock-checkout em,.mock-checkout div,.strip{transition-delay:350ms}
  .stage-close{transition-delay:100ms}
  .stage[data-beat="0"] .situation-1,
  .stage:is([data-beat="0"],[data-beat="1"]) .situation-2,
  .stage:is([data-beat="0"],[data-beat="1"],[data-beat="2"]) .situation-3,
  .stage:is([data-beat="0"],[data-beat="1"],[data-beat="2"],[data-beat="3"]) .situation-4,
  .stage[data-beat]:not([data-beat="5"]) .stage-close{opacity:0;translate:0 1rem;transition-delay:0s}
  .stage[data-beat="0"] :is(.situation-1 span,.dot-1,.flow1),
  .stage:is([data-beat="0"],[data-beat="1"]) :is(.situation-2 span,.dot-2,.mock,.mock-cta),
  .stage:is([data-beat="0"],[data-beat="1"],[data-beat="2"]) :is(.situation-3 span,.dot-3,.mock-checkout em,.mock-checkout div),
  .stage:is([data-beat="0"],[data-beat="1"],[data-beat="2"],[data-beat="3"]) :is(.situation-4 span,.dot-4,.strip){opacity:0;transition-delay:0s}
  .stage[data-beat="0"] .trace-1,
  .stage:is([data-beat="0"],[data-beat="1"]) .trace-2,
  .stage:is([data-beat="0"],[data-beat="1"],[data-beat="2"]) .trace-3,
  .stage:is([data-beat="0"],[data-beat="1"],[data-beat="2"],[data-beat="3"]) .trace-4{scale:0 1;transition-delay:0s}
  /* Process: the steps appear one per scroll impulse (mouse only) */
  [data-section="process"] .process article{transition:opacity 450ms var(--ease),translate 450ms var(--ease)}
}
@media (prefers-reduced-motion:no-preference) and (hover:hover) and (pointer:fine) and (min-width:1025px){
  .site:not([data-input="touch"]) [data-section="process"]:is([data-phase="0"]) .process article,
  .site:not([data-input="touch"]) [data-section="process"][data-phase="1"] .process article:nth-child(n+2),
  .site:not([data-input="touch"]) [data-section="process"][data-phase="2"] .process article:nth-child(n+3),
  .site:not([data-input="touch"]) [data-section="process"][data-phase="3"] .process article:nth-child(n+4){opacity:0;translate:0 16px}
  :is(.reveal,.hint){transition:opacity 350ms var(--ease),translate 350ms var(--ease)}
}

/* ========== Reduced motion ========== */
@media (prefers-reduced-motion:reduce){
  *,::before,::after{animation:none!important;transition-property:color,background-color,border-color,opacity!important;scroll-behavior:auto!important}
}

/* ========== WP: theme additions ========== */
/* Logged-in admin bar above the sticky header */
.admin-bar .nav{top:32px}
@media (max-width:782px){.admin-bar .nav{top:46px}}
@media (max-width:600px){.admin-bar .nav{top:0}}
/* Floating buttons: hover colours and label tooltips with a mouse, phone positions */
@media (hover:hover) and (pointer:fine){
  .fab:hover,.to-top:hover{background:var(--brass);border-color:var(--brass);color:var(--white)}
  .fab:hover .fab__label,.fab:focus-visible .fab__label{visibility:visible;opacity:1;translate:0 -50%}
  .ep-close:hover{background:var(--soft)}
}
@media (max-width:767.98px){
  .fabs{right:16px;bottom:max(16px,env(safe-area-inset-bottom))}
  .to-top{right:16px;bottom:max(16px,env(safe-area-inset-bottom))}
  .fabs~.to-top{bottom:calc(max(16px,env(safe-area-inset-bottom)) + 2 * 52px)}
  .fabs--single~.to-top{bottom:calc(max(16px,env(safe-area-inset-bottom)) + 52px)}
  /* Rail arrows sit at the right edge: keep them out from under the floating buttons */
  .ep-card{padding:28px 20px 24px}
}
@media (prefers-reduced-motion:no-preference){
  .exit-pop{transition:opacity 250ms var(--ease)}
  .ep-card{transition:translate 250ms var(--ease)}
}
