/*
Nilpar Gallery — layout skeleton (Gate 3.1)

Layout constants (from knowledge base):
- Reading width rhythm: max-width: 820px; margin: 0 auto;
- Home hero height: ~70vh

Implementation note:
- We keep these as commented anchors until Gate 5+.
*/
:root {
  /* --ng-reading-width: 820px; */
  /* --ng-hero-vh: 70vh; */
}



/* Phase 3.3 helpers */
.ng-container {
  max-width: var(--ng-page-max);
  margin: 0 auto;
  padding-left: var(--ng-gutter-x);
  padding-right: var(--ng-gutter-x);
}
.ng-main { padding: 0 0 var(--ng-space-8); }

.ng-logo__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(10rem, 40vw);
  max-height: clamp(2.6rem, 4.25vw, 3.1rem);
}

/* ---------- Page (canonical) ---------- */
/* ---------- Grid (Intrinsic, breakpoint-free) ---------- */

.ng-grid{
  display: grid;
  gap: var(--ng-space-7);
  /* Each column is at least 320px wide; browser fills as many as fit */
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}

/* Legacy modifiers map to intrinsic grid (kept for template compatibility) */
.ng-grid--2,
.ng-grid--3,
.ng-grid--4{
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}

/* Collection canon: never exceed 2 columns (enforced via max-width) */
.ng-grid--collection{
  grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 42%, 560px), 1fr));
  max-width: calc(1120px + var(--ng-space-7));
  margin-left: auto;
  margin-right: auto;
}


/* Card media container */
.ng-card__media {
  aspect-ratio: 4 / 5;
  background: rgba(20,20,20,.03);
  border-radius: var(--ng-card-radius);
  margin-bottom: var(--ng-space-4);
  overflow: hidden;
}

.ng-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Card composition rhythm */
.ng-card__footer {
  margin-top: auto;
  padding-top: var(--ng-space-4);
}

.ng-reading { max-width: var(--ng-reading-width); margin-left:auto; margin-right:auto; }


/* ---------- Sections / Stacks (Phase 5.7) ---------- */
.ng-section {
  padding-top: var(--ng-section-y);
  padding-bottom: var(--ng-section-y);
}
.ng-section--tight {
  padding-top: var(--ng-section-y-tight);
  padding-bottom: var(--ng-section-y-tight);
}
.ng-stack > * + * { margin-top: var(--ng-stack-gap); }
.ng-stack--tight > * + * { margin-top: var(--ng-stack-gap-tight); }


/* Homepage hero */
.ng-hero{
  /* Mobile-safe viewport chain: old browsers get vh, modern get dvh/svh. */
  min-height: 68vh;
  min-height: 68dvh;
  min-height: var(--ng-hero-min-height);

  display: flex;
  align-items: flex-start;
  justify-content: center;

  /* Controlled upper-third placement (stable viewport units) */
  padding-top: clamp(var(--ng-space-8), 24vh, var(--ng-space-9));
  padding-left: var(--ng-space-5);
  padding-right: var(--ng-space-5);
  padding-bottom: clamp(2rem, 5svh, 3.5rem);
}

.ng-hero__inner{
  width: 100%;
  max-width: var(--ng-page-max);
}

.ng-hero__title{
  font-family: var(--ng-font-serif);
  font-size: var(--ng-hero-title-size);
  line-height: 1.05;
  letter-spacing: var(--ng-hero-title-tracking);
  margin: 0;
  font-weight: 600;
}

.ng-hero__sub{
  letter-spacing: var(--ng-hero-sub-tracking);
  font-family: var(--ng-font-serif);
  font-size: var(--ng-hero-sub-size);
  line-height: 1.25;
  margin: var(--ng-space-4) 0 0;
  font-weight: 400;
  color: var(--ng-color-ink-muted);
  max-width: 28ch;
}

.ng-divider{
  height: 1px;
  background: var(--ng-color-hairline);
  margin: var(--ng-space-5) 0;
}


/* ---------------------------------------------
   Phase 3 — Canon compliance utilities
---------------------------------------------- */

.ng-divider--mt7{
  margin-top: var(--ng-space-7);
}

.ng-artwork-body--reading{
  max-width: var(--ng-reading-width-narrative);
  margin-left: auto;
  margin-right: auto;
}

/* Homepage inline-style migrations */
.ng-home__lead{
  margin: 0;
  max-width: var(--ng-reading-width);
  color: var(--ng-color-ink-muted);
  line-height: var(--ng-line-body);
}


.ng-home-block--mt6{ margin-top: var(--ng-space-6); }

.ng-home__h2{
  font-family: var(--ng-font-serif);
  font-size: 1.15rem;
  letter-spacing: .01em;
  margin: 0 0 var(--ng-space-2);
}

.ng-home__muted{
  max-width: var(--ng-reading-width);
  color: var(--ng-color-ink-muted);
  margin: 0;
}

.ng-home-routes{
  margin-top: var(--ng-space-7);
  display: flex;
  gap: var(--ng-space-4);
  flex-wrap: wrap;
}

/* Homepage authority refinements (Phase 4.0) */
.ng-home__curator{
  max-width: var(--ng-reading-width);
  color: var(--ng-color-ink-faint);
  font-size: var(--ng-text-small);
  margin: var(--ng-space-3) 0 0;
}

.ng-home__secondary-link{
  color: var(--ng-color-ink-muted);
  font-size: var(--ng-text-small);
  text-decoration: none;
  border-bottom: 1px solid var(--ng-color-hairline);
  padding-bottom: 2px;
}

.ng-home__secondary-link:hover{
  border-bottom-color: var(--ng-color-border);
}

/* Footer inline-style migrations */
.ng-footer__small--meta{
  margin-top: var(--ng-space-4);
  opacity: .7;
  font-size: var(--ng-text-small);
}

/* Metadata inline component */
.ng-meta-inline{
  margin-top: var(--ng-space-3);
  color: var(--ng-color-ink-muted);
  font-size: var(--ng-text-small);
  line-height: 1.35;
}

.ng-meta-inline__bottom{
  margin-top: .25rem;
}

@media (min-width: 860px){
  .ng-meta-inline{
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
  }
  .ng-meta-inline__top,
  .ng-meta-inline__bottom{
    margin-top: 0;
  }
  .ng-meta-inline__bottom::before{
    content: "|";
    margin-right: .6rem;
    opacity: .55;
  }
}

/* Generic page surface */
.ng-page {
  min-height: 60vh;
  padding: var(--ng-space-7) var(--ng-space-5);
}

.ng-page__header {
  margin-bottom: var(--ng-space-5);
}

.ng-page__title {
  font-family: var(--ng-font-serif);
  font-weight: 600;
  letter-spacing: .01em;
  font-size: clamp(2rem, 3.2vw, 3.25rem);
  line-height: 1.12;
  margin: 0;
}


.ng-artwork-body--narrative{
  max-width: var(--ng-reading-width-narrative);
  margin-left: auto;
  margin-right: auto;
}
