/* ===============================
   ARCHITECTURE GALLERY (non-project pages)
   =============================== */

.arch-gallery {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 0 56px;

  display: flex;
  flex-direction: column;
  gap: 44px;
}

.arch-card {
  width: 100%;
}

.arch-figure {
  width: 66.666%;
  margin: 0 auto;
}

.arch-media {
  overflow: hidden;
}

.arch-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  body:not(.project-page) .arch-figure:hover .arch-media img {
    filter: blur(14px);
  }
}

/* ===============================
   ARCHITECTURE INDEX — LEFT LIST + RIGHT PREVIEW
   =============================== */

.arch-index main {
  padding-left: 0;
  padding-right: 0;
}

.arch-split {
  width: 100%;
  max-width: none;
  margin: 0;

  padding: 8px 0 56px;

  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 40px;
  align-items: start;
}

.arch-list {
  padding: 0;
  margin-top: 110px;
  font-size: 0.75rem;
  line-height: 2.2;
}

.arch-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  margin: 12px 0;
}

.arch-item-text {
  display: inline-block;
  transition: color 160ms ease;
}

.arch-item:hover .arch-item-text,
.arch-item:focus-visible .arch-item-text {
  color: #888888;
}

.arch-item.is-active:not(:hover):not(:focus-visible) .arch-item-text {
  color: inherit;
}

/* Right preview full-bleed */
.arch-preview {
  margin-right: calc(-1 * var(--axis-y));
  width: calc(100% + var(--axis-y));
  overflow: hidden;
  align-self: start;
}

/* Crossfade stack */
.arch-preview-link {
  position: relative;
  display: block;
  width: 100%;
  text-decoration: none;
}

/* Reserve height because imgs are absolute */
.arch-preview-link::before {
  content: "";
  display: block;
  height: clamp(560px, 80vh, 1200px);
}

.arch-preview-img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: clamp(560px, 80vh, 1200px);
  object-fit: cover;
  display: block;

  opacity: 0;

  /* SLOWED fade for more intentional swaps */
  transition: opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1);

  will-change: opacity;
}

.arch-preview-img.is-top {
  opacity: 1;
}

/* ===============================
   MOBILE
   =============================== */

@media (max-width: 860px) {
  .arch-split {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .arch-preview {
    margin-right: 0;
    width: 100%;
  }

  .arch-preview-link::before {
    height: clamp(320px, 50vh, 520px);
  }

  .arch-preview-img {
    height: clamp(320px, 50vh, 520px);
  }

  .arch-index .arch-list {
    display: none;
  }

  /* Make the preview take the full width on mobile */
  .arch-index .arch-split {
    grid-template-columns: 1fr;
  }

  .arch-index .arch-preview {
    margin-right: 0;
    width: 100%;
  }

  /* Optional: remove extra top spacing that was meant for the list */
  .arch-index .arch-split {
    padding-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arch-preview-img {
    transition: none;
  }
}

