/* What a minor defect looks like (homepage section 3).
   One large before/after photo with a drag handle, the defect's Problem /
   Our fix / Result lines, and the nine defects as picture tabs. */
.dft{--yellow:#ffd93d;--soft:#cfe0cf;--muted:#aecbae;--line:rgba(255,255,255,.16);padding:clamp(2.75rem,5vw,3.75rem) 0}

/* heading sits at the top of the text column, with a yellow line drawn
   under "minor" once the section comes into view */
.dft-title{font-size:clamp(1.9rem,3vw,2.6rem);margin:0 0 1.3rem;text-align:left;text-wrap:balance}
.dft-title .dft-name{position:relative;display:inline-block;color:var(--yellow);white-space:nowrap}
/* the defect name gets the same yellow line as "minor", redrawn on each switch */
.dft-title .dft-name::after{content:"";position:absolute;left:0;right:0;bottom:-.02em;height:4px;border-radius:2px;background:var(--yellow);
             transform:scaleX(var(--m,1));transform-origin:left;transition:transform .6s cubic-bezier(.2,.7,.3,1) .1s}
.dft-title .dft-name.redraw::after{transform:scaleX(0);transition:none}
.dft-title .mark{position:relative;display:inline-block;color:var(--yellow)}
.dft-title .mark::after{content:"";position:absolute;left:0;right:0;bottom:-.02em;height:4px;border-radius:2px;background:var(--yellow);
             transform:scaleX(var(--m,1));transform-origin:left;transition:transform .7s cubic-bezier(.2,.7,.3,1) .2s}
.dft-title.pre{--m:0}

/* layout */
/* text column pinned to the top of the photo, so heading and text stay put
   now that the defect chips take less height */
.dft-spot{display:grid;grid-template-columns:minmax(0,357px) minmax(0,1fr);gap:clamp(24px,4vw,48px);align-items:start}
.dft-info{padding-top:24px;align-self:stretch;display:flex;flex-direction:column}

/* compare frame */
.dft-cmp{position:relative;aspect-ratio:3/4;border-radius:16px;overflow:hidden;background:#1b2a1b;user-select:none;touch-action:pan-y}
.dft-cmp img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}
/* each defect's pair sits in its own layer; a new layer fades in over the old one */
.dft-cmp .layer{position:absolute;inset:0;transition:opacity .5s ease}
.dft-cmp .layer.in{opacity:0}
/* the three lines and the name fade briefly while they change */
.dft .pf dd,.dft-title .dft-name{transition:opacity .25s ease}
.dft .swap .pf dd,.dft .swap .dft-title .dft-name{opacity:0}
.dft-cmp .after{clip-path:inset(0 0 0 var(--x,50%))}
.dft-cmp .handle{position:absolute;top:0;bottom:0;left:var(--x,50%);width:2px;margin-left:-1px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.15);pointer-events:none}
.dft-cmp .handle::after{content:"";position:absolute;top:50%;left:50%;width:42px;height:42px;margin:-21px 0 0 -21px;border-radius:50%;
  background:var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f2d0f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E") center/22px no-repeat;
  box-shadow:0 2px 10px rgba(0,0,0,.35)}
.dft-cmp input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:ew-resize;margin:0}
/* keyboard: the invisible range input holds the focus, the handle shows it */
.dft-cmp:has(input:focus-visible) .handle::after,.dft-cmp.kbd .handle::after{
  outline:3px solid #fff;outline-offset:3px;box-shadow:0 0 0 9px rgba(15,45,15,.7),0 2px 10px rgba(0,0,0,.35)}
.dft-cmp input:focus-visible{outline:none;box-shadow:none}
.dft-cmp .chip{position:absolute;top:12px;font:600 .72rem 'Barlow Semi Condensed',sans-serif;letter-spacing:1.4px;text-transform:uppercase;
               padding:5px 10px;border-radius:999px;pointer-events:none}
.dft-cmp .chip.b{left:12px;background:rgba(15,45,15,.85);color:#fff}
.dft-cmp .chip.a{right:12px;background:var(--yellow);color:#0f2d0f}
.dft-cmp .illu{position:absolute;bottom:12px;right:12px;font:600 .62rem 'Barlow Semi Condensed',sans-serif;letter-spacing:1.2px;
               text-transform:uppercase;background:#fff7d1;color:#5a4a00;padding:3px 7px;border-radius:4px;pointer-events:none}
.all-green main > section .dft-media .hint{font-size:.85rem;color:var(--muted);margin:.6rem 0 0;text-align:center}

/* info */
.dft .pf{display:grid;gap:10px;margin:0 0 1.2rem}
.dft .pf div{display:grid;grid-template-columns:76px 1fr;gap:12px;align-items:start}
.dft .pf dt{font:600 .75rem 'Barlow Semi Condensed',sans-serif;letter-spacing:1.4px;text-transform:uppercase;color:var(--muted);margin:0;line-height:1.54rem}
.dft .pf dd{margin:0;font-size:1.1rem;line-height:1.4;color:#fff;max-width:46ch}
.dft .pf .fix dd{color:var(--yellow);font-weight:600}
/* the defects as small chips in two rows */
/* chips only as wide as their name, sitting at the foot of the column level with
   the bottom of the photo (the hint line under the photo is the 2rem) */
.dft .tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:auto;padding-top:1.5rem;margin-bottom:2rem}
@media (min-width:761px) and (max-width:1099px){.dft .tabs{display:flex;flex-wrap:wrap}}
.dft .tabs button{display:flex;align-items:center;gap:7px;padding:4px 12px 4px 4px;border-radius:10px;min-width:0;border:1px solid var(--line);
  background:rgba(255,255,255,.04);color:#fff;font:600 .82rem 'Barlow',sans-serif;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;transition:border-color .2s,background .2s}
.dft .tabs button img{width:28px;height:28px;border-radius:7px;object-fit:cover;flex:none}
.dft .tabs button[aria-selected="true"]{border-color:var(--yellow);background:rgba(255,217,61,.1)}
.dft .tabs button:hover{border-color:rgba(255,217,61,.55)}
.dft .tabs .ico{width:28px;height:28px;border-radius:7px;flex:none;display:grid;place-items:center;
  border:1.5px dashed rgba(255,217,61,.6);color:var(--yellow)}
.dft .tabs .ico svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* the Others card stands in for the photo */
.dft-other{aspect-ratio:3/4;border-radius:16px;border:1.5px dashed rgba(255,217,61,.55);background:rgba(255,255,255,.04);
  display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:.6rem;padding:1.5rem}
.dft-other[hidden]{display:none}
.dft-other svg{width:72px;height:72px;fill:none;stroke:var(--yellow);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;margin-bottom:.4rem}
.all-green main > section .dft-other .o-h{font-family:'Bebas Neue',sans-serif;font-size:2rem;line-height:1;color:#fff;margin:0}
.all-green main > section .dft-other .o-t{margin:0 0 .6rem;color:var(--soft);max-width:24ch}
.dft .tabs button:focus-visible{outline:2px solid var(--yellow);outline-offset:2px}

@media (max-width:760px){
  /* the heading moves above the photo: the text column dissolves into the
     stack so its title can be ordered first */
  .dft-spot{display:flex;flex-direction:column;gap:0}
  .dft-info{display:contents;padding-top:0}
  .dft-media{margin-bottom:1.4rem !important}
  .dft-media{max-width:323px;margin:0 auto;width:100%}
  .dft-title{text-align:center;order:-1;margin-bottom:1.2rem}
  .dft .tabs{display:grid;gap:6px;grid-template-columns:repeat(5,minmax(0,1fr));margin:1.2rem 0 0;padding-top:0}
  .dft .tabs button{flex-direction:column;gap:3px;padding:4px;font-size:.66rem;text-align:center}
  .dft .tabs button img,.dft .tabs .ico{width:100%;height:auto;aspect-ratio:1}
}
@media (prefers-reduced-motion:reduce){
  .dft-title .mark::after,.dft-title .dft-name::after{transition:none}
  .dft-cmp .layer,.dft .pf dd,.dft-title .dft-name{transition:none}
}
/* Glue tab: "Watch the video" button on the photo, landscape clip in a dialog */
.dft-cmp .dft-vid{position:absolute;left:12px;bottom:12px;z-index:6;display:inline-flex;align-items:center;gap:.4rem;padding:.5rem .85rem .5rem .7rem;
  border:0;border-radius:999px;background:var(--yellow,#ffd93d);color:#0f2d0f;font:700 .9rem 'Barlow',sans-serif;cursor:pointer;box-shadow:0 4px 14px rgba(0,0,0,.35)}
.dft-cmp .dft-vid svg{width:16px;height:16px;fill:currentColor}
.dft-cmp .dft-vid:hover{filter:brightness(1.06)}
.dft-cmp .dft-vid:focus-visible{outline:3px solid #fff;outline-offset:2px}
.dft-cmp .dft-vid[hidden]{display:none}
.vid-dlg{position:fixed;inset:0;margin:auto;width:min(960px,94vw);max-height:none;padding:0;border:0;border-radius:14px;background:#000;overflow:visible}
.vid-dlg::backdrop{background:rgba(5,20,8,.82)}
.vid-dlg video{display:block;width:100%;height:auto;aspect-ratio:16/9;max-height:84vh;border-radius:14px;background:#000}
.vid-dlg.tall{width:min(400px,92vw,calc(84vh * 400 / 848))}
.vid-dlg.tall video{aspect-ratio:400/848}
.vid-dlg .vid-x{position:absolute;top:-46px;right:0;width:38px;height:38px;border:0;border-radius:50%;background:#fff;color:#0f2d0f;font-size:1.05rem;font-weight:700;cursor:pointer}
.vid-dlg .vid-x:focus-visible{outline:3px solid var(--yellow,#ffd93d);outline-offset:2px}
/* phone: tab labels big enough to read (was .66rem, about 10.5px) */
@media (max-width:700px){ .dft .tabs button{font-size:.76rem;line-height:1.15} }
/* German labels are longer: a little smaller on phones so they fit the tabs */
@media (max-width:700px){ html[lang="de"] .dft .tabs button{font-size:.7rem;letter-spacing:-.3px} }

/* Labels sit above the divider line, and each one fades out while its own
   side is too narrow to hold it (js/site.js sets x-lo / x-hi from the handle
   position), so the line never cuts through a word. */
.dft-cmp .chip{z-index:3;transition:opacity .25s ease}
.dft-cmp.x-lo .chip.b,.dft-cmp.x-hi .chip.a{opacity:0}
/* pause button for the automatic change of defects */
.dft-cmp .mo-dft{position:absolute;right:12px;bottom:12px;z-index:6;background:rgba(15,45,15,.8);border-color:rgba(255,255,255,.55)}
.dft-cmp .illu:not([hidden]){right:54px;bottom:17px}
/* phone: the nine defect tabs are finger-sized (two rows, as before) */
@media (max-width:760px){
  .dft .tabs button{min-height:44px}
}

/* Problem / Our solution / Result: the label column is as wide as its longest
   label in either language, so no label wraps and the three texts line up. */
.dft .pf{grid-template-columns:max-content minmax(0,1fr);column-gap:12px}
.dft .pf div{display:contents}
.dft .pf dt{white-space:nowrap}
