﻿/* ==========================================================================
   Design C — Upright 3-Column Architectural Service Trio
   --------------------------------------------------------------------------
   - All three frames sit flat at matrix(1, 0, 0, 1, 0, 0) — zero rotate(45deg)
   - Bespoke architectural SVG artwork + subtle depth gradients per card
   - Editorial corner index numerals (01 / 02 / 03) + cursor radial spotlight
   - CSS Grid rows align kicker, title, description & bottom-pinned CTA
   - One-way staggered entrance via IntersectionObserver (`--b-card-delay`)
   - Asymmetric hover/focus transitions (220ms in / 380ms out) + arrow glide
   - Full `prefers-reduced-motion: reduce` collapse
   ========================================================================== */

.b-collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(18px, 2.2vw, 28px);
  width: min(90vw, 1280px);
  margin: clamp(40px, 5vw, 68px) auto 0;
  padding-block: 12px clamp(36px, 4vw, 56px);
}

.b-collage__tile {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 348px;
  margin: 0;
  border-radius: 20px;
  border: 1px solid rgba(15, 16, 20, 0.09);
  border-top: 3px solid var(--p-focus);
  background: linear-gradient(155deg, var(--p-paper) 0%, var(--p-pale) 100%);
  color: var(--p-ink);
  box-shadow:
    0 6px 24px rgba(15, 16, 20, 0.06),
    0 1px 2px rgba(15, 16, 20, 0.04);
  overflow: hidden;
  isolation: isolate;
  transform: translateY(0);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.38s ease,
    background 0.38s ease,
    box-shadow 0.38s ease,
    opacity 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.b-collage__tile--left,
.b-collage__tile--centre,
.b-collage__tile--right {
  margin-top: 0;
  margin-inline: 0;
  --b-tile-size: 100%;
}

.b-collage__tile--centre {
  background: linear-gradient(155deg, var(--p-dark-raised) 0%, var(--p-dark) 100%);
  border-color: var(--p-line-dark);
  border-top: 3px solid var(--p-accent-on-dark);
  color: var(--p-on-dark);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 14px 36px rgba(15, 16, 20, 0.24);
}

/* Editorial corner index numerals (01 / 02 / 03) */
.b-collage__tile::before {
  position: absolute;
  top: 22px;
  right: 26px;
  z-index: 2;
  font-family: var(--b-font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: rgba(15, 16, 20, 0.14);
  pointer-events: none;
  transition:
    color 0.38s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.b-collage__tile--left::before {
  content: "01";
}

.b-collage__tile--centre::before {
  content: "02";
  color: rgba(255, 255, 255, 0.16);
}

.b-collage__tile--right::before {
  content: "03";
}

/* Interactive cursor-following radial spotlight */
.b-collage__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(220, 53, 19, 0.08),
    transparent 65%
  );
  transition: opacity 0.28s ease;
}

.b-collage__tile--centre::after {
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 50%),
    rgba(220, 53, 19, 0.16),
    transparent 65%
  );
}

.b-collage__tile:is(:hover, :focus-within)::after {
  opacity: 1;
}

.b-collage__tile:is(:hover, :focus-within)::before {
  color: var(--p-focus);
  transform: translateY(-2px);
  transition-duration: 0.22s;
}

.b-collage__tile--centre:is(:hover, :focus-within)::before {
  color: var(--p-accent-on-dark);
}

/* One-way staggered entrance on scroll */
.has-js .b-collage[data-b-collage-reveal="waiting"] .b-collage__tile {
  opacity: 0;
  transform: translateY(24px);
}

.has-js .b-collage[data-b-collage-reveal="shown"] .b-collage__tile {
  opacity: 1;
  transform: translateY(0);
  transition-delay: var(--b-card-delay, 0ms), 0ms, 0ms, 0ms, var(--b-card-delay, 0ms);
}

.b-collage__tile:is(:hover, :focus-within),
.has-js .b-collage[data-b-collage-reveal="shown"] .b-collage__tile:is(:hover, :focus-within) {
  transform: translateY(-8px);
  box-shadow:
    0 20px 44px rgba(15, 16, 20, 0.14),
    0 4px 12px rgba(220, 53, 19, 0.08);
  transition-duration: 0.22s;
  transition-delay: 0ms;
}

.b-collage__tile--left:is(:hover, :focus-within),
.b-collage__tile--right:is(:hover, :focus-within) {
  border-color: var(--p-focus);
}

.b-collage__tile--centre:is(:hover, :focus-within),
.has-js .b-collage[data-b-collage-reveal="shown"] .b-collage__tile--centre:is(:hover, :focus-within) {
  border-color: var(--p-accent-on-dark);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 24px 52px rgba(15, 16, 20, 0.34),
    0 6px 18px rgba(220, 53, 19, 0.14);
}

/* Flat upright architectural backdrop frame: matrix(1, 0, 0, 1, 0, 0) */
.b-collage__tile .b-collage__frame,
.b-collage__tile--centre .b-collage__frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  opacity: 0.85;
  transform: none;
  pointer-events: none;
  transition:
    opacity 0.38s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.b-collage__tile--centre .b-collage__frame {
  opacity: 0.90;
}

.b-collage__tile:is(:hover, :focus-within) .b-collage__frame,
.b-collage__tile--centre:is(:hover, :focus-within) .b-collage__frame {
  opacity: 1;
  transform: scale(1.04);
  transition-duration: 0.22s;
}

.b-collage__frame::after {
  content: none;
}

.b-collage__tile .b-collage__frame img,
.b-collage__tile--centre .b-collage__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: none;
  transition: none;
  filter: none;
}

.b-collage__link {
  position: absolute;
  z-index: 4;
  inset: 0;
  border-radius: 20px;
  transform: none;
  text-decoration: none;
}

.b-collage__link:focus-visible {
  outline: 3px solid var(--p-focus);
  outline-offset: 4px;
}

.b-collage__tile--centre .b-collage__link:focus-visible {
  outline-color: var(--p-accent-on-dark);
}

/* Aligned Grid Layout inside each card: kicker | title | 1fr description | bottom-pinned CTA */
.b-collage__label {
  position: relative;
  z-index: 2;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  display: grid;
  flex: 1 1 auto;
  width: 100%;
  grid-template-rows: auto auto 1fr auto;
  align-items: start;
  justify-items: start;
  gap: 10px;
  padding: clamp(24px, 2.6vw, 34px);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transform: none;
  pointer-events: none;
}

.b-collage__label-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--p-focus);
  font-family: var(--b-font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.b-collage__label-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--p-focus);
  flex: 0 0 6px;
}

.b-collage__tile--centre .b-collage__label-kicker {
  color: var(--p-accent-on-dark);
}

.b-collage__tile--centre .b-collage__label-kicker::before {
  background: var(--p-accent-on-dark);
}

.b-collage__label-title {
  display: block;
  max-width: calc(100% - 48px);
  margin: 0;
  color: inherit;
  font-family: var(--b-font-display);
  font-size: clamp(1.55rem, 2.05vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.b-collage__description {
  display: block;
  max-width: 24ch;
  margin: 4px 0 0;
  color: var(--p-on-pale-muted);
  font-family: var(--b-font-body);
  font-size: clamp(0.96rem, 1.05vw, 1.04rem);
  font-weight: 400;
  line-height: 1.55;
}

.b-collage__tile--centre .b-collage__description {
  color: var(--p-on-dark-muted);
}

.b-collage__cta {
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--p-dark);
  color: var(--p-on-dark);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  transition: background-color 0.22s ease, transform 0.22s ease;
}

.b-collage__cta > span {
  display: inline-block;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.b-collage__tile:is(:hover, :focus-within) .b-collage__cta > span {
  transform: translate(3px, -3px);
  transition-duration: 0.22s;
}

.b-collage__tile--centre .b-collage__cta {
  background: var(--p-accent);
  color: var(--p-accent-ink);
}

.b-collage__tile:is(:hover, :focus-within) .b-collage__cta {
  background: var(--p-accent);
  color: var(--p-accent-ink);
}

.b-collage__tile--centre:is(:hover, :focus-within) .b-collage__cta {
  background: var(--p-accent-strong);
  color: var(--p-accent-ink);
}

@media (max-width: 960px) {
  .b-collage {
    grid-template-columns: minmax(0, 1fr);
    width: min(92vw, 560px);
    row-gap: 18px;
  }

  .b-collage__tile {
    min-height: 256px;
  }

  .b-collage__tile--centre {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .has-js .b-collage[data-b-collage-reveal] .b-collage__tile,
  .b-collage__tile,
  .b-collage__tile::before,
  .b-collage__tile::after,
  .b-collage__frame,
  .b-collage__cta,
  .b-collage__cta > span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    transition-delay: 0s !important;
  }

  .b-collage__tile::after {
    display: none !important;
  }

  .b-collage__tile:is(:hover, :focus-within),
  .b-collage__tile:is(:hover, :focus-within)::before,
  .b-collage__tile:is(:hover, :focus-within) .b-collage__frame,
  .b-collage__tile:is(:hover, :focus-within) .b-collage__cta > span {
    transform: none !important;
  }
}
