/* ==========================================================================
   KAYANTARAN – projects.css
   Styles used only by projects.html. Shared components live in site.css.

   .projects-hero     smaller display size for the long page heading
   .filter-bar        All · Completed · Design concepts (shown only with JS)
   .project           one band per project: counter, anchor offset, rhythm
   .project__*        the shared parts: index, title, facts, body, figure, tag
   .project__layout   a different composition for each project:
                      --office    Sixty Seats, No Cubicles (the feature)
                      --concept   Earth & Light
                      --plant     The Plant House
                      --bedrooms  Three Bedrooms
                      --cane      Wood & Cane
                      --mustard   Mustard & Grey
   ========================================================================== */


/* HERO ===================================================================== */

.projects-hero { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.projects-hero .display {
  font-size: clamp(2.625rem, 1.45rem + 5vw, 6.5rem);
  line-height: .98;
}
@media (min-width: 900px) {
  .projects-hero .page-hero__text { grid-column: 1 / span 11; }
}


/* FILTER =================================================================== */

/* <div class="filter-bar" data-filter-bar>
     <div class="filter" role="group" aria-label="Filter projects">
       <button class="filter__btn" type="button" data-filter="all" aria-pressed="true">
         All <span class="filter__count"></span></button> …
     </div>
     <p class="filter-bar__status" role="status" data-filter-status></p>
   </div>
   projects.js fills the counts and the status line. Without JavaScript the
   bar is hidden and every project simply shows. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 2rem;
  padding-block: 1rem;
  border-block: 1px solid var(--hairline);
}
html:not(.js) .filter-bar { display: none; }
.filter { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter__btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.75rem;
  padding: .5rem 1.15rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  color: var(--fg);
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.filter__btn:hover { border-color: var(--fg); }
.filter__btn[aria-pressed="true"] {
  border-color: var(--clay);
  background: var(--clay);
  color: var(--offwhite);
}
.filter__count {
  font-size: .68rem;
  letter-spacing: .04em;
  font-variant-numeric: lining-nums tabular-nums;
  opacity: .72;
}
.filter__count:empty { display: none; }
.filter-bar__status { font-size: var(--fs-small); color: var(--fg-soft); }


/* PROJECT BAND ============================================================= */

/* <article class="section project" id="plant-house" data-status="completed">
   data-status is "completed" or "concept" and drives the filter.
   The bands alternate offwhite and sand; projects.js re-stripes them after
   filtering by toggling .section--sand. The index number is a CSS counter,
   so it stays in sequence when some projects are hidden. */
.projects { counter-reset: project; }

.project {
  --section-y: clamp(4rem, 8.5vw, 8rem);
  counter-increment: project;
  /* The page already keeps anchors clear of the fixed header with
     scroll-padding-top (header height + 1rem, in site.css). This pulls the
     band up by the difference between that and the scrolled header, so a
     link such as projects.html#plant-house lands with the band's top edge
     exactly under the header and no sliver of the previous band above it. */
  scroll-margin-top: -1.75rem;
}

/* After a filter button is pressed, the projects left showing fade in.
   projects.js adds .is-filtering to .projects each time. The site-wide
   reduced-motion rule in site.css cuts this to nothing. */
.projects.is-filtering .project > .container { animation: project-in .55s var(--ease); }
@keyframes project-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.project__layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  row-gap: clamp(1.75rem, 4vw, 3rem);
}
.project__layout > * { grid-column: 1 / -1; min-width: 0; }


/* SHARED PARTS ============================================================= */

.project__index {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(.9rem, 2vw, 1.4rem);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-style: italic;
  line-height: 1.2;
  color: var(--accent-ink);
  font-variant-numeric: lining-nums;
}
.project__index::before { content: counter(project, decimal-leading-zero); }
.project__index::after {
  content: "";
  flex: none;
  width: 2.5rem;
  height: 1px;
  background: var(--hairline-gold);
}

.project__title a { text-decoration: none; transition: color .35s var(--ease); }
.project__title a:hover { color: var(--accent-ink); }
.project--feature .project__title {
  font-size: clamp(3rem, 1.6rem + 5.6vw, 7rem);
  line-height: .96;
  letter-spacing: -.02em;
}

/* <dl class="project__facts"><div><dt>Place</dt><dd>Gurugram</dd></div>…</dl> */
.project__facts {
  max-width: 24rem;
  margin: 0;
  border-bottom: 1px solid var(--hairline);
}
.project__facts > div {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-block: .6rem;
  border-top: 1px solid var(--hairline);
}
.project__facts dt {
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-soft);
}
.project__facts dd { font-size: .95rem; }

.project__body { max-width: 34rem; text-wrap: pretty; }
.project__body > * + * { margin-top: 1.5rem; }

.project__intro > * + *,
.project__aside > * + * { margin-top: clamp(1.25rem, 2.5vw, 2rem); }

/* <figure class="project__figure">
     <div class="project__frame">
       <a class="media reveal reveal--curtain" href="…" data-lightbox="…">…</a>
       <span class="tag tag--sage project__tag reveal">Completed home</span>
     </div>
     <figcaption class="caption">…</figcaption>
   </figure> */
.project__figure { margin: 0; min-width: 0; }
.project__frame { position: relative; }
.project__tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  pointer-events: none;
}
.project__frame--arch .project__tag { top: auto; bottom: 1rem; }


/* 01 SIXTY SEATS, NO CUBICLES ============================================== */

/* Title across the top, the main photograph with the text beside it, then a
   row of three smaller photographs. These photographs are 1280px on their
   long side, so no frame here is wider than about 870px. */
.office__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem) var(--grid-gap);
  align-items: start;
}
.office__gallery > :nth-child(1) { grid-column: 1 / -1; }
.office__gallery > :nth-child(1) .media { --ratio: 5 / 4; }
.office__gallery > :nth-child(2) .media { --ratio: 4 / 5; }
.office__gallery > :nth-child(3) .media { --ratio: 4 / 5; }
.office__main .media { --ratio: 5 / 4; }

@media (min-width: 900px) {
  .project__layout--office > .office__main { grid-column: 1 / span 8; }
  .project__layout--office > .project__aside { grid-column: 9 / -1; align-self: end; padding-bottom: 2.1rem; }
  .office__gallery {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-top: clamp(.5rem, 2vw, 2rem);
  }
  .office__gallery > :nth-child(1) { grid-column: 1 / span 5; }
  .office__gallery > :nth-child(2) { grid-column: 6 / span 3; margin-top: clamp(2rem, 5vw, 5rem); }
  .office__gallery > :nth-child(3) { grid-column: 9 / span 4; }
  .office__gallery > :nth-child(2) .media { --ratio: 3 / 4; }
  .office__gallery > :nth-child(3) .media { --ratio: 5 / 4; }
}


/* 02 EARTH & LIGHT ========================================================= */

/* Text on the left, one wide render on the right. */
.concept__lead .media { --ratio: 16 / 10; }

@media (min-width: 900px) {
  .project__layout--concept {
    grid-template-columns: minmax(16rem, 4fr) minmax(0, 8fr);
    column-gap: clamp(2rem, 5vw, 5rem);
    row-gap: clamp(1.25rem, 2.5vw, 2rem);
  }
  .project__layout--concept > .project__head { grid-column: 1; grid-row: 1; align-self: end; }
  .project__layout--concept > .project__aside { grid-column: 1; grid-row: 2; align-self: start; }
  .project__layout--concept > .concept__lead { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .concept__lead .media { --ratio: 16 / 9; }
}


/* 03 THE PLANT HOUSE ======================================================= */

/* Two staggered columns of photographs, with the text held beside them. */
.plant__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
  align-items: start;
}
.plant__col { display: grid; gap: var(--grid-gap); min-width: 0; }
.plant__col--offset { margin-top: clamp(2.5rem, 7vw, 6rem); }
.plant__gallery > .caption { grid-column: 1 / -1; margin-top: 0; }

@media (min-width: 960px) {
  .project__layout--plant {
    grid-template-columns: minmax(0, 7fr) minmax(17rem, 4fr);
    column-gap: clamp(2.5rem, 7vw, 7rem);
    align-items: start;
  }
  .project__layout--plant > .project__gallery { grid-column: 1; grid-row: 1; }
  .project__layout--plant > .project__intro {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}


/* 04 THREE BEDROOMS ======================================================== */

/* Heading and text side by side, then four renders: one wide, one arch,
   and the lilac room twice. */
.bedrooms__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) var(--grid-gap);
}
.bedrooms__gallery > :nth-child(1) { grid-column: 1 / -1; }
.bedrooms__gallery > :nth-child(2) { grid-column: 1 / -1; width: min(100%, 19rem); justify-self: end; }
.bedrooms__gallery > :nth-child(1) .media { --ratio: 16 / 9; }
.bedrooms__gallery > :nth-child(3) .media,
.bedrooms__gallery > :nth-child(4) .media { --ratio: 1 / 1; }

@media (min-width: 720px) {
  .bedrooms__gallery { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; }
  .bedrooms__gallery > :nth-child(1) { grid-column: 1 / span 8; }
  .bedrooms__gallery > :nth-child(2) { grid-column: 9 / -1; width: auto; justify-self: stretch; }
  .bedrooms__gallery > :nth-child(3) { grid-column: 1 / span 5; align-self: start; }
  .bedrooms__gallery > :nth-child(4) { grid-column: 6 / -1; align-self: start; }
  .bedrooms__gallery > :nth-child(3) .media { --ratio: 4 / 3; }
  .bedrooms__gallery > :nth-child(4) .media { --ratio: 16 / 9; }
}

@media (min-width: 900px) {
  .project__intro--split {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    column-gap: clamp(2rem, 8vw, 8rem);
    align-items: end;
  }
  .project__intro--split > * + * { margin-top: 0; }
}


/* 05 WOOD & CANE =========================================================== */

/* One render, cropped wide to suit a long room, with the text in a row
   underneath. */
.cane__lead .media { --ratio: 16 / 10; }

@media (min-width: 900px) {
  .cane__lead .media { --ratio: 21 / 9; }
  .project__layout--cane > .project__head { grid-column: 1 / span 4; }
  .project__layout--cane > .project__aside {
    grid-column: 6 / -1;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
  }
  .project__layout--cane > .project__aside > * + * { margin-top: 0; }
}


/* 06 MUSTARD & GREY ======================================================== */

/* Two renders, the second overlapping the first. */
.mustard__gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--grid-gap);
}
.mustard__gallery > * { min-width: 0; }
.mustard__gallery > :nth-child(1) { grid-column: 1 / -1; }
.mustard__gallery > :nth-child(2) {
  grid-column: 5 / -1;
  position: relative;
  z-index: 1;
  margin-top: -1.75rem;
}
/* The first render has a thin dark strip along its bottom edge; this frame
   is a touch wider than 16:9 and anchored to the top, so the strip is cut. */
.mustard__gallery > :nth-child(1) .media { --ratio: 20 / 11; }
.mustard__gallery > :nth-child(1) .media img { object-position: 50% 0; }
.mustard__gallery > :nth-child(2) .media { box-shadow: 0 0 0 6px var(--bg); }
.js .mustard__gallery > :nth-child(2) .media:not(.is-visible) { box-shadow: none; }
.mustard__gallery > .caption { grid-column: 1 / -1; }

@media (min-width: 900px) {
  .project__layout--mustard {
    grid-template-columns: minmax(16rem, 4fr) minmax(0, 8fr);
    column-gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
  }
  .project__layout--mustard > * { grid-column: auto; }
  .mustard__gallery > :nth-child(1) { grid-column: 1 / span 10; }
  .mustard__gallery > :nth-child(2) { grid-column: 6 / -1; margin-top: clamp(-6rem, -6vw, -3rem); }
}
