/* =============================================================
   MOCKUP-ONLY: Layout 4 (Spotlight)
   30/70 split: scrollable project list on the left, hero rotator
   with meta panel on the right. Click a list item to pivot the
   hero. "View Project" opens the existing project modal.

   Distinct from 1/2/3: no tile grid, no full-page rows. The list
   is the navigator, the hero is the showcase.
   ============================================================= */

/* Hide the header logo on this layout — it overlaps the full-bleed
   stage. The nav links and other header elements remain visible. */
.page-template-page-work-layout-4 .site-header__brand {
  visibility: hidden;
  pointer-events: none;
}

/* Body lock isn't needed; we just remove the parent header's gap
   underneath this layout so the stage hits the bottom of the
   viewport. The site header is fixed and overlaps the page top. */

.layout4-page {
  background: var(--ink);
  color: var(--bone);
}

.layout4-stage {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(280px, auto) auto;
  /* Hero takes most of the remaining viewport once the fixed nav
     header is accounted for. Falls back to a tall min-height on
     short screens so the meta panel never collapses. */
  min-height: calc(100svh - var(--header-h, 88px));
}

@media (min-width: 980px) {
  .layout4-stage {
    grid-template-columns: minmax(280px, 380px) 1fr;
    grid-template-rows: 1fr;
    height: calc(100svh - var(--header-h, 88px));
    min-height: 640px;
  }
}

/* ============================================================
   Sidebar
   ============================================================ */
.layout4-sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: var(--ink-2, #14141a);
  border-right: 1px solid var(--rule-dark);
  overflow: hidden;
  min-height: 0;
  position: relative;
}

.layout4-sidebar__head {
  padding: clamp(var(--s-5), 4vw, var(--s-6)) clamp(var(--s-4), 3vw, var(--s-5)) var(--s-4);
  border-bottom: 1px solid var(--rule-dark);
}

.layout4-sidebar__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: var(--s-2) 0 var(--s-3);
}

.layout4-sidebar__lede {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--muted-dark);
  margin: 0 0 var(--s-3);
}

/* Search */
.layout4-search {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--rule-dark);
}
.layout4-search__icon {
  position: absolute;
  left: 12px;
  color: var(--muted-dark);
  pointer-events: none;
}
.layout4-search__input {
  flex: 1 1 auto;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 14px 10px 34px;
  outline: none;
  width: 100%;
}
.layout4-search__input::placeholder {
  color: var(--muted-dark);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
}
.layout4-search:focus-within {
  border-color: var(--safety);
  outline: 2px solid var(--safety);
  outline-offset: 2px;
}
.layout4-search__input::-webkit-search-cancel-button,
.layout4-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* List */
.layout4-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-dark) transparent;
}
.layout4-list::-webkit-scrollbar {
  width: 8px;
}
.layout4-list::-webkit-scrollbar-thumb {
  background: var(--rule-dark);
}

.layout4-list-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: var(--s-3);
  padding: 12px var(--s-4);
  border-bottom: 1px solid var(--rule-dark);
  cursor: pointer;
  position: relative;
  transition: background var(--dur-fast) var(--ease-out);
}
.layout4-list-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--dur-fast) var(--ease-out);
}
.layout4-list-item:hover { background: rgba(255,255,255,0.02); }
.layout4-list-item:focus-visible {
  outline: 2px solid var(--safety);
  outline-offset: -3px;
}
.layout4-list-item.is-active {
  background: rgba(255,107,0,0.05);
}
.layout4-list-item.is-active::before {
  background: var(--safety);
}
.layout4-list-item.is-filtered-out {
  display: none;
}

.layout4-list-item__job {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--safety);
  align-self: center;
}
.layout4-list-item__placeholder {
  color: var(--muted-dark);
  opacity: 0.6;
}
.layout4-list-item__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.layout4-list-item__name {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--bone);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.layout4-list-item__sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layout4-list__empty {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-dark);
  padding: var(--s-5) var(--s-4);
  text-align: center;
}

/* ============================================================
   Hero
   ============================================================ */
.layout4-hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
  min-height: 360px;
}

.layout4-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.layout4-hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  filter: grayscale(0.2) contrast(1.05);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 700ms var(--ease-out);
  will-change: opacity, transform;
}

.layout4-hero__slide.is-active {
  opacity: 1;
  animation: layout4-drift 14s ease-in-out forwards;
}

.layout4-hero__slide--no-image {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(107,74,44,0.55) 0%, rgba(107,74,44,0) 60%),
    linear-gradient(160deg, var(--ink-3, #0c0c0e) 0%, var(--ink) 70%, var(--dirt-deep, #3a2510) 100%);
  display: none;
}
.layout4-hero__slide--no-image.is-active {
  display: block;
  opacity: 1;
  animation: none;
  transform: none;
}

@keyframes layout4-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.10) translate3d(-2%, -1.4%, 0); }
}

.layout4-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(11,11,12,0.75) 0%, rgba(11,11,12,0.15) 45%, rgba(11,11,12,0.65) 100%),
    linear-gradient(180deg, rgba(11,11,12,0.05) 0%, rgba(11,11,12,0.85) 100%);
}

/* Counter */
.layout4-hero__counter {
  position: absolute;
  top: clamp(var(--s-4), 4vw, var(--s-5));
  left: clamp(var(--s-4), 4vw, var(--s-5));
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: rgba(11,11,12,0.55);
  border: 1px solid var(--rule-dark);
  padding: 6px 10px;
  color: var(--bone);
}
.layout4-hero__counter [data-layout4-counter-current] { color: var(--safety); margin-right: 4px; }
.layout4-hero__counter-sep { margin: 0 4px; color: var(--muted-dark); }

/* Nav arrows */
.layout4-hero__nav {
  position: absolute;
  top: clamp(var(--s-4), 4vw, var(--s-5));
  z-index: 3;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(11,11,12,0.55);
  color: var(--bone);
  border: 1px solid var(--rule-dark);
  cursor: pointer;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.layout4-hero__nav--prev { right: calc(clamp(var(--s-4), 4vw, var(--s-5)) + 48px); }
.layout4-hero__nav--next { right: clamp(var(--s-4), 4vw, var(--s-5)); }
.layout4-hero__nav:hover {
  background: var(--safety);
  color: var(--ink);
  border-color: var(--safety);
}
.layout4-hero__nav:focus-visible {
  outline: 2px solid var(--safety);
  outline-offset: 2px;
}

/* Meta panel */
.layout4-hero__meta {
  position: absolute;
  left: clamp(var(--s-4), 4vw, var(--s-7));
  right: clamp(var(--s-4), 4vw, var(--s-7));
  bottom: clamp(var(--s-5), 4vw, var(--s-7));
  z-index: 2;
  display: grid;
  gap: var(--s-3);
  max-width: 720px;
}

.layout4-hero__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--safety);
  margin: 0;
}

.layout4-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0;
}

.layout4-hero__detail {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0;
  line-height: 1.5;
}

.layout4-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  margin-top: var(--s-3);
  padding: 12px 22px;
  background: var(--safety);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--safety);
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.layout4-hero__cta:hover,
.layout4-hero__cta:focus-visible {
  background: transparent;
  color: var(--safety);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .layout4-hero__slide,
  .layout4-list-item {
    transition: none !important;
    animation: none !important;
  }
}
