/* ═══ Portfolio-only components ══════════════════════════════════════════
   base.css, layout.css and components.css are byte-identical copies of the
   ones on spbt.pp.ua, so anything only this site needs lives here, the same
   way spbt-site keeps its own additions in spbt.css.                       */

/* ─── Three sites on one project panel ───────────────────────────────────
   One lead preview and two smaller ones, not three equal tiles: the company
   site is the one a visitor can actually use, so it carries the weight. The
   grid has a fixed 2:1 frame because the panel lives in a sticky stage with
   overflow:clip; a taller visual pushes the buttons below the reveal line at
   760x700, which is the band that hides real breakage.                      */
.trio{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);
  grid-template-rows:repeat(2,minmax(0,1fr));
  gap:calc(var(--space)*2);
  aspect-ratio:3/2;
}
.trio__item{
  display:flex;
  flex-direction:column;
  gap:calc(var(--space)*1);
  min-width:0;
  min-height:0;
  color:inherit;
}
.trio__item--lead{grid-row:1 / span 2;}
.trio__frame{
  flex:1;
  min-height:0;
  overflow:hidden;
  border-radius:var(--radius-sm);
  border:1px solid var(--border);
  transition:border-color .25s ease;
}
.pj__visual .trio__frame img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:left top;
  border:0;
  border-radius:0;
  transition:transform .5s var(--ease);
}
.trio__name{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:0 calc(var(--space)*1);
  font-size:.86rem;
  line-height:1.3;
  color:var(--text);
}
.trio__name small{font-size:.78rem;color:var(--muted);}
a.trio__item:active .trio__frame{transform:scale(.985);}
@media (hover:hover) and (pointer:fine){
  a.trio__item:hover .trio__frame{border-color:var(--green-line);}
  a.trio__item:hover .trio__frame img{transform:scale(1.03);}
}
a.trio__item:focus-visible{outline:2px solid var(--green);outline-offset:4px;border-radius:var(--radius-sm);}

/* The previews are the content of this panel, so they get the wide column. */
@media (min-width:901px){
  #sites .pj__inner{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);}
}

@media (max-width:759px){
  .trio{aspect-ratio:auto;grid-template-rows:auto;}
  .trio__item--lead{grid-column:1 / -1;grid-row:auto;}
  .trio{grid-template-columns:repeat(2,minmax(0,1fr));}
  .trio__frame{flex:none;aspect-ratio:16/10;}
}

/* ─── Before and after ───────────────────────────────────────────────────
   The two screenshots share one frame and one viewport size, so the same menu
   sits in the same place on both. The range input is the control: it brings
   keyboard, touch and a screen-reader value for free, and it is stretched over
   the frame with opacity 0, so the visible line is only a picture of it. The
   frame stays at 50% with JavaScript off, which still shows both sites.      */
.compare{
  --pos:50%;
  position:relative;
  aspect-ratio:8/5;
  overflow:hidden;
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--bg-soft);
}
.compare img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:left top;
  user-select:none;
  -webkit-user-drag:none;
}
.compare__before{clip-path:inset(0 calc(100% - var(--pos)) 0 0);}
.compare__line{
  position:absolute;
  top:0;
  bottom:0;
  left:var(--pos);
  width:2px;
  margin-left:-1px;
  background:var(--green);
  pointer-events:none;
}
.compare__grip{
  position:absolute;
  top:50%;
  left:50%;
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  margin:-24px 0 0 -24px;
  border-radius:50%;
  color:var(--bg);
  background:var(--green);
  box-shadow:0 6px 18px rgba(5,8,7,.45);
  transition:transform .16s ease-out;
}
.compare__grip svg{width:22px;height:22px;}
.compare input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  opacity:0;
  cursor:ew-resize;
}
.compare input:active ~ .compare__line .compare__grip{transform:scale(.94);}
.compare input:focus-visible ~ .compare__line .compare__grip{outline:2px solid var(--text);outline-offset:3px;}
.compare-legend{
  display:flex;
  justify-content:space-between;
  gap:calc(var(--space)*2);
  margin-top:calc(var(--space)*1.5);
  color:var(--muted);
  font-size:.9rem;
}
.compare-legend b{color:var(--text);font-weight:700;}

/* ─── The same two sites on a phone ──────────────────────────────────────
   Side by side at every width: the point is the comparison, and stacking them
   would put one phone a whole screen away from the other.                    */
.phones{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,300px));
  justify-content:center;
  gap:calc(var(--space)*5);
  margin:0;
}
.phones figure{margin:0;}
.phones img{
  width:100%;
  height:auto;
  border-radius:var(--radius);
  border:1px solid var(--border);
}
.phones figcaption{margin-top:calc(var(--space)*1.5);color:var(--muted);font-size:.9rem;}
.phones figcaption b{display:block;color:var(--text);font-weight:700;}
@media (max-width:560px){
  .phones{gap:calc(var(--space)*2);}
}
