/* ==========================================================================
   Practice Cards block — tilted newspaper cards with parallax + hover grow.
   Each card is a link containing a tiled background pattern + one SVG that
   holds the entire newspaper composition.
   ========================================================================== */

.practice-cards {
  margin: 10px auto;
  position: relative;
  width: 100%;
  max-width: 1920px;
  height: 1203px;
  overflow: hidden;
  background: linear-gradient(180deg, #d8d8d8 -13.47%, #b0b0b0 71.4%);
  isolation: isolate;
}

/* Optional full-width background image. */
.practice-cards__bg-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.practice-cards__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ------------------------------ Eyebrow pill --------------------------- */

.practice-cards__pill {
  position: absolute;
  left: 50%;
  top: 72px;
  transform: translateX(-50%);
  z-index: 4;
  padding: 10px 30px;
  border-radius: 50px;
  background: rgba(109, 16, 22, 0.7);
  font-family: 'Quattrocento Sans', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-transform: uppercase;
  color: #f3f2ed;
  white-space: nowrap;
}

/* ------------------------------ Nav + list ----------------------------- */

.practice-cards__nav {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.practice-cards__list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  height: 100%;
}

/* ------------------------------ Card slot ------------------------------ */

.practice-cards__item {
  position: absolute;
  width: 571px;
  height: 610px;
  will-change: transform;
  --drift-y: 0px;
  transform: translate3d(0, var(--drift-y), 0);
}

/* Centered via calc(50% + X) + negative margin-left of half card width, so
   the cascade auto-centers at any width ≥1440. At 1920px this reproduces the
   original 53/453/841/1234 layout; on narrower desktops both sides spill
   symmetrically instead of clipping only the right. */
.practice-cards__item {
  margin-left: -285.5px; /* half of 571px card width */
}
.practice-cards__item--1 {
  left: calc(50% - 621.5px);
  top: 25px;
}
.practice-cards__item--2 {
  left: calc(50% - 221.5px);
  top: 204px;
}
.practice-cards__item--3 {
  left: calc(50% + 166.5px);
  top: 384px;
}
.practice-cards__item--4 {
  left: calc(50% + 559.5px);
  top: 563px;
}

/* ------------------------------ Card ---------------------------------- */

.practice-cards__card {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  transform-origin: 50% 50%;
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 420ms ease;
  will-change: transform;
  filter: drop-shadow(-10px 10px 18px rgba(0, 0, 0, 0.24));
}

.practice-cards__card:hover,
.practice-cards__card:focus-visible {
  transform: scale(1.05);
  filter: drop-shadow(-16px 18px 32px rgba(0, 0, 0, 0.34));
  outline: none;
}

/* Tilted paper — matrix mimics the design's slight skew. */
.practice-cards__paper {
  position: absolute;
  left: 0;
  top: 164px;
  width: 594px;
  height: 446px;
  overflow: hidden;
  background: #efede6;
  transform: matrix(0.961, -0.276, 0, 1, 0, 0);
  transform-origin: 0 0;
}

/* Tiled background pattern (~20×20 seamless tile). */
.practice-cards__pattern {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  background-size: 20px 20px;
  pointer-events: none;
}

/* The newspaper composition — an upright SVG centered on the card,
   sitting on top of the tilted paper background. */
.practice-cards__art {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 540px;
  height: auto;
  display: block;
  z-index: 2;
  pointer-events: none;
}

/* ------------------------------ Reduced motion ------------------------- */

@media (prefers-reduced-motion: reduce) {
  .practice-cards__item {
    transform: none !important;
  }
  .practice-cards__card:hover,
  .practice-cards__card:focus-visible {
    transform: none;
  }
}

/* ------------------------------ Responsive ----------------------------- */

/* Desktop below 1920: scale every dimension proportionally with the viewport
   (1920 = 100%). Everything — section height, card size, offsets, paper —
   uses `calc(N / 1920 * 100vw)` so the whole cascade shrinks smoothly and
   always fits without clipping. */
@media (min-width: 1440px) and (max-width: 1919.98px) {
  .practice-cards {
    height: calc(1203 / 1920 * 100vw);
  }
  .practice-cards__item,
  .practice-cards__item--1,
  .practice-cards__item--2,
  .practice-cards__item--3,
  .practice-cards__item--4 {
    width: calc(571 / 1920 * 100vw);
    height: calc(610 / 1920 * 100vw);
    margin-left: calc(-285.5 / 1920 * 100vw);
  }
  .practice-cards__item--1 {
    left: calc(50% - (621.5 / 1920 * 100vw));
    top: calc(25 / 1920 * 100vw);
  }
  .practice-cards__item--2 {
    left: calc(50% - (221.5 / 1920 * 100vw));
    top: calc(204 / 1920 * 100vw);
  }
  .practice-cards__item--3 {
    left: calc(50% + (166.5 / 1920 * 100vw));
    top: calc(384 / 1920 * 100vw);
  }
  .practice-cards__item--4 {
    left: calc(50% + (559.5 / 1920 * 100vw));
    top: calc(563 / 1920 * 100vw);
  }

  .practice-cards__paper {
    top: calc(164 / 1920 * 100vw);
    width: calc(594 / 1920 * 100vw);
    height: calc(446 / 1920 * 100vw);
  }
}

/* Tablets & mobile use the same cascading pattern as desktop, just smaller
   and horizontally centered inside the viewport. Each card is positioned
   with `left: calc(50% + Xpx)` + a negative left-margin equal to half the
   card width, so the cascade auto-centers at any viewport width and only
   the first/last cards clip on tight screens. */

@media (max-width: 1439px) {
  .practice-cards {
    height: 940px;
    padding: 0;
    overflow: hidden;
  }

  .practice-cards__nav {
    position: absolute;
    inset: 0;
    margin-top: 0;
  }

  .practice-cards__list {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    grid-template-columns: none;
    gap: 0;
  }

  .practice-cards__item,
  .practice-cards__item--1,
  .practice-cards__item--2,
  .practice-cards__item--3,
  .practice-cards__item--4 {
    position: absolute;
    width: 350px;
    height: 380px;
    margin-left: -175px; /* half of card width — centers the calc(50% + X) anchor */
    transform: translate3d(0, var(--drift-y), 0);
  }

  .practice-cards__item--1 {
    left: calc(50% - 195px);
    top: 30px;
  }
  .practice-cards__item--2 {
    left: calc(50% - 65px);
    top: 180px;
  }
  .practice-cards__item--3 {
    left: calc(50% + 65px);
    top: 330px;
  }
  .practice-cards__item--4 {
    left: calc(50% + 195px);
    top: 480px;
  }

  .practice-cards__paper {
    top: 100px;
    width: 100%;
    height: 280px;
    transform: matrix(0.961, -0.276, 0, 1, 0, 0);
  }

  .practice-cards__art {
    width: 92%;
    max-width: 320px;
  }
}

@media (max-width: 767px) {
  .practice-cards {
    height: 830px;
  }

  .practice-cards__pill {
    top: 30px;
    padding: 8px 24px;
    font-size: 13px;
    letter-spacing: 0.22em;
  }

  .practice-cards__item,
  .practice-cards__item--1,
  .practice-cards__item--2,
  .practice-cards__item--3,
  .practice-cards__item--4 {
    width: 280px;
    height: 300px;
    margin-left: -140px;
  }

  .practice-cards__item--1 {
    left: calc(50% - 85px);
    top: 30px;
  }
  .practice-cards__item--2 {
    left: calc(50% - 15px);
    top: 200px;
  }
  .practice-cards__item--3 {
    left: calc(50% + 35px);
    top: 380px;
  }
  .practice-cards__item--4 {
    left: calc(50% + 85px);
    top: 560px;
  }

  .practice-cards__paper {
    top: 80px;
    height: 220px;
  }

  .practice-cards__art {
    max-width: 260px;
  }
}

/* ------------------------------ Editor preview ------------------------- */

.practice-cards--is-preview {
  zoom: 0.55;
}

.practice-cards--is-preview .practice-cards__item {
  transform: none;
}
