/* Nirav Manubhai — Locked Frame System v1.0.82
   Architecture rule: the frame owns geometry; artwork is only the insert.
   Do not change these dimensions per property. If artwork composes poorly, recompose the artwork. */
:root{
  --frame-room-card-ratio: 16/10;
  --frame-reading-ratio: 16/9;
  --frame-wide-property-ratio: 16/9;
  --frame-poster-ratio: 4/5;
  --frame-book-ratio: 5/7;
  --frame-reading-max: 1120px;
  --frame-property-max: 1120px;
  --frame-book-max: 320px;
}

/* Universal media safety */
img{max-width:100%;}
.frame-media,.room-hero-frame,.axiom-threshold-frame,.courtyard-door-media,.book-cover-frame,.cover-frame{overflow:hidden;position:relative;}
.frame-media>img,.room-hero-frame>img,.axiom-threshold-frame>img,.courtyard-door-media>img,.book-cover-frame>img,.cover-frame>img{display:block;width:100%;height:100%;max-width:none;max-height:none;}

/* A — Courtyard reading-property doors: one landscape frame. */
.courtyard-door-media{
  width:100%!important;aspect-ratio:var(--frame-room-card-ratio)!important;height:auto!important;
  border:1px solid var(--line)!important;background:#e9e2d4!important;
}
.courtyard-door-media>img{object-fit:cover!important;object-position:center center!important;}

/* B — Courtyard room cards retained elsewhere. */
.rooms .room-card .card-thumb{
  width:100%!important;aspect-ratio:var(--frame-room-card-ratio)!important;height:auto!important;
  object-fit:cover!important;display:block!important;margin-bottom:1rem!important;border:1px solid var(--line)!important;
}

/* C — Reading Rooms: every property gets exactly the same 16:9 opening. */
.reading-room .room-hero-frame,.stills-reading-room-inline .room-hero-frame{
  width:min(100%,var(--frame-reading-max))!important;
  aspect-ratio:var(--frame-reading-ratio)!important;
  height:auto!important;min-height:0!important;
  margin:0 auto 2rem!important;padding:0!important;
  overflow:hidden!important;border:1px solid rgba(44,37,25,.14)!important;border-radius:6px!important;
  background:#e9e2d4!important;box-shadow:0 8px 28px rgba(44,37,25,.14)!important;
}
.reading-room .room-hero-frame>img,.stills-reading-room-inline .room-hero-frame>img{
  width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;
  object-fit:cover!important;object-position:center center!important;display:block!important;margin:0!important;
  opacity:1!important;visibility:visible!important;
}
.reading-room .room-intro,.stills-reading-room-inline .room-intro{width:min(100%,760px)!important;margin:0 auto 3rem!important;text-align:center!important;}
.reading-room .shelf-room,.stills-reading-room-inline .shelf-room{width:min(100%,1120px)!important;margin-left:auto!important;margin-right:auto!important;}

/* D — Axiom property threshold: frozen wide visual in a permanent 16:9 frame. */
.axiom-home .axiom-threshold{max-width:var(--frame-property-max)!important;}
.axiom-home .axiom-threshold-grid{display:block!important;}
.axiom-home .axiom-threshold-frame{
  width:100%!important;max-width:var(--frame-property-max)!important;aspect-ratio:var(--frame-wide-property-ratio)!important;
  height:auto!important;margin:0 auto 2.5rem!important;background:#15130f!important;border:1px solid var(--line)!important;
}
.axiom-home .axiom-threshold-frame>img{object-fit:cover!important;object-position:center center!important;}
.axiom-home .axiom-threshold-copy{width:min(100%,760px)!important;margin:0 auto!important;text-align:center!important;}

/* E — Poster-led property thresholds: fixed 4:5 opening. */
.room-shell .hero-poster>img,.quiet-signal-landing .hero-poster>img{
  width:min(100%,500px)!important;aspect-ratio:var(--frame-poster-ratio)!important;height:auto!important;
  object-fit:contain!important;object-position:center center!important;background:#15130f!important;
}

/* F — Books: substantial cover frame; never a skinny column. */
.all-books-page .books-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:2.8rem 2.2rem!important;align-items:start!important;}
.books-grid .book-card{width:100%!important;max-width:360px!important;justify-self:center!important;text-align:center!important;}
.books-grid .book-cover,.book-cover-frame,.cover-frame{
  width:min(100%,var(--frame-book-max))!important;aspect-ratio:var(--frame-book-ratio)!important;height:auto!important;
  max-width:var(--frame-book-max)!important;margin-left:auto!important;margin-right:auto!important;
}
.books-grid .book-cover{object-fit:contain!important;display:block!important;background:transparent!important;}
.cover-frame img,.book-cover-frame img{object-fit:contain!important;object-position:center center!important;}
.take-story-page .book{grid-template-rows:auto 27px auto auto auto auto auto!important;align-content:start!important;}
.take-story-page .cover-button{height:auto!important;min-height:0!important;display:flex!important;justify-content:center!important;align-items:flex-end!important;overflow:hidden!important;}
.take-story-page .cover-wrap{
  width:min(100%,var(--frame-book-max))!important;
  aspect-ratio:var(--frame-book-ratio)!important;
  height:auto!important;
  min-height:0!important;
  margin:0 auto!important;
  display:flex!important;
  align-items:flex-end!important;
  justify-content:center!important;
  overflow:hidden!important;
}
.take-story-page .cover-wrap img{
  width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;
  object-fit:contain!important;object-position:center bottom!important;display:block!important;margin:0!important;
}
.take-story-page .shelf-plank{position:relative!important;z-index:2!important;margin-top:0!important;}
@media(max-width:800px){
  .take-story-page .book{grid-template-rows:auto 27px auto auto auto auto auto!important;}
  .take-story-page .cover-button,.take-story-page .cover-wrap{height:auto!important;}
  .take-story-page .cover-wrap{width:min(78vw,300px)!important;}
}
@media(max-width:380px){
  .take-story-page .book{grid-template-rows:auto 27px auto auto auto auto auto!important;}
  .take-story-page .cover-button,.take-story-page .cover-wrap{height:auto!important;}
  .take-story-page .cover-wrap{width:min(80vw,280px)!important;}
}

/* G — Quiet Signal mobile shelf: release metadata can never squeeze the title column. */
@media(max-width:640px){
  .qs-reading-room .room-hero-frame{aspect-ratio:var(--frame-reading-ratio)!important;}
  .qs-reading-room .spine,.qs-reading-room .spine.next{
    display:grid!important;grid-template-columns:2.25rem minmax(0,1fr)!important;grid-template-rows:auto auto!important;
    column-gap:.85rem!important;row-gap:.35rem!important;align-items:start!important;padding:1.15rem 0!important;
  }
  .qs-reading-room .spine-num{grid-column:1!important;grid-row:1 / span 2!important;min-width:0!important;}
  .qs-reading-room .spine-copy{grid-column:2!important;grid-row:1!important;min-width:0!important;width:100%!important;}
  .qs-reading-room .spine-copy h3{white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;font-size:1.08rem!important;line-height:1.24!important;}
  .qs-reading-room .spine-action,.qs-reading-room .spine.next .spine-action{
    grid-column:2!important;grid-row:2!important;width:100%!important;max-width:none!important;text-align:left!important;
    white-space:normal!important;word-break:normal!important;line-height:1.45!important;padding:0!important;
  }
  .reading-room .room-intro,.stills-reading-room-inline .room-intro{text-align:left!important;}
  .all-books-page .books-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:520px){
  .all-books-page .books-grid{grid-template-columns:1fr!important;}
  .reading-room .room-hero-frame,.stills-reading-room-inline .room-hero-frame{border-radius:4px!important;}
}


/* H — Recurring story artwork families: locked once, inserts change only. */
.quiet-field-note .story-hero{
  width:min(100%,900px)!important;aspect-ratio:3/2!important;height:auto!important;overflow:hidden!important;margin-left:auto!important;margin-right:auto!important;
}
.quiet-field-note .story-hero>img{width:100%!important;height:100%!important;object-fit:cover!important;object-position:center center!important;display:block!important;}
.csja-story .story-hero,.csja-story-page .story-hero{
  width:min(100%,720px)!important;aspect-ratio:4/5!important;height:auto!important;overflow:hidden!important;margin-left:auto!important;margin-right:auto!important;
}
.csja-story .story-hero>img,.csja-story-page .story-hero>img{width:100%!important;height:100%!important;object-fit:contain!important;object-position:center center!important;display:block!important;}
.reader-poster.kabir-poster-frame{width:min(100%,720px)!important;aspect-ratio:4/5!important;height:auto!important;object-fit:contain!important;object-position:center center!important;background:#080604!important;}
.cover-poster{width:min(100%,420px)!important;aspect-ratio:2/3!important;height:auto!important;object-fit:contain!important;object-position:center center!important;}
.viewer .slide img{width:100%!important;height:auto!important;aspect-ratio:2/3!important;object-fit:contain!important;object-position:center center!important;}


/* I — Courtyard Bookshelf room image: locked as a substantial landscape frame.
   The image must never collapse into a shallow/narrow strip on mobile. */
.bookshelf-room-frame{
  width:100%!important;
  aspect-ratio:4/3!important;
  height:auto!important;
  overflow:hidden!important;
  position:relative!important;
  background:#e9e2d4!important;
  line-height:0!important;
}
.bookshelf-room-frame>a{display:block!important;width:100%!important;height:100%!important;line-height:0!important;}
.bookshelf-room-frame img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center center!important;
}
@media(max-width:640px){
  .bookshelf-room-frame{aspect-ratio:5/4!important;}
  .bookshelf-room-frame img{object-position:center center!important;}
}


/* J — v72 courtyard inserts: the frame stays fixed; poster artwork may remain whole. */
.courtyard-door-media.poster-insert>img{
  object-fit:contain!important;
  object-position:center center!important;
  background:#efe4cf!important;
}

/* K — v72 continuous-house imagery: one stable 3:2 frame for Study and Conversation. */
.house-section-media{
  width:100%!important;
  aspect-ratio:3/2!important;
  height:auto!important;
  min-height:0!important;
  overflow:hidden!important;
  border:1px solid var(--line)!important;
  background:#e9e2d4!important;
  border-radius:3px!important;
  box-shadow:0 3px 16px rgba(44,37,25,.12)!important;
}
.house-section-media>img{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:center center!important;
  display:block!important;
}
.study-room-media>img{object-position:center center!important;}
.conversation-room-media>img{object-position:center center!important;}

/* L — v72 Bookshelf: the actual frame owns the 4:3/5:4 geometry permanently. */
.bookshelf-room-frame{
  width:min(100%,1448px)!important;
  aspect-ratio:4/3!important;
  margin:0 auto!important;
}
@media(max-width:640px){.bookshelf-room-frame{aspect-ratio:5/4!important;}}

/* M — v72 All Books: wrapper is the frame; cover is only the insert. */
.all-books-page .book-cover-frame{
  display:block!important;
  width:min(100%,var(--frame-book-max))!important;
  max-width:var(--frame-book-max)!important;
  aspect-ratio:var(--frame-book-ratio)!important;
  height:auto!important;
  margin:0 auto!important;
  overflow:hidden!important;
  background:transparent!important;
  position:relative!important;
}
.all-books-page .book-cover-frame>.book-cover{
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:contain!important;
  object-position:center center!important;
  margin:0!important;
  display:block!important;
}
@media(max-width:640px){
  .house-section-media{aspect-ratio:4/3!important;}
}
