/* 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;}
}

/* ═══════════════════════════════════════════════════════════════════
   HOUSE READING ROOM SHELF THUMBNAIL CONTRACT — v1.0.102
   Artwork on a shelf is a threshold, never a card or hero.
   One immutable geometry across CSJA, STILLS, Kabir, Quiet Signal,
   Axiom and any future story-series Reading Room.
   ═══════════════════════════════════════════════════════════════════ */
.reading-room .room-intro,
.stills-reading-room-inline .room-intro{
  text-align:center!important;
}

/* Desktop/tablet shelf row: compact artwork → number → copy → action. */
.reading-room .shelf-spine-with-thumb{
  display:grid!important;
  grid-template-columns:52px 2.4rem minmax(0,1fr) auto!important;
  gap:.75rem .9rem!important;
  align-items:center!important;
}

/* The House thumbnail itself has a hard ceiling. */
.reading-room .shelf-thumb-frame,
.stills-reading-room .stills-thumb-frame{
  inline-size:48px!important;
  width:48px!important;
  min-width:48px!important;
  max-width:48px!important;
  max-height:72px!important;
  display:block!important;
  overflow:hidden!important;
  border-radius:3px!important;
  background:#eee8de!important;
  box-shadow:0 2px 7px rgba(43,38,32,.08)!important;
  justify-self:start!important;
  flex:0 0 48px!important;
}
.reading-room .shelf-thumb-frame.portrait-45{aspect-ratio:4/5!important;}
.reading-room .shelf-thumb-frame.portrait-23,
.stills-reading-room .stills-thumb-frame{aspect-ratio:2/3!important;}
.reading-room .shelf-thumb-frame.landscape-32{aspect-ratio:3/2!important;}

.reading-room .shelf-thumb-img,
.stills-reading-room .stills-thumb{
  display:block!important;
  inline-size:100%!important;
  width:100%!important;
  block-size:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
}

/* No shelf image may inherit hero/card geometry. */
.reading-room .shelf-items .shelf-thumb-frame img,
.reading-room .shelf-items .stills-thumb-frame img{
  margin:0!important;
  padding:0!important;
  border-radius:0!important;
  box-shadow:none!important;
}

/* Intro alignment remains part of the shared Reading Room frame. */
@media(max-width:720px){
  .reading-room .room-intro,
  .stills-reading-room-inline .room-intro{
    text-align:center!important;
  }
}

/* Mobile: smaller threshold, same hierarchy. */
@media(max-width:640px){
  .reading-room .shelf-spine-with-thumb,
  .stills-reading-room .stills-spine{
    grid-template-columns:44px 1.85rem minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    gap:.6rem .7rem!important;
    align-items:start!important;
  }
  .reading-room .shelf-spine-with-thumb .shelf-thumb-frame,
  .stills-reading-room .stills-thumb-frame{
    inline-size:40px!important;
    width:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    max-height:60px!important;
    flex-basis:40px!important;
    grid-column:1!important;
    grid-row:1 / span 2!important;
  }
  .reading-room .shelf-spine-with-thumb .spine-num,
  .stills-reading-room .stills-spine .spine-num{
    grid-column:2!important;
    grid-row:1!important;
  }
  .reading-room .shelf-spine-with-thumb .spine-copy,
  .stills-reading-room .stills-spine .spine-copy{
    grid-column:3!important;
    grid-row:1!important;
  }
  .reading-room .shelf-spine-with-thumb .spine-action,
  .stills-reading-room .stills-spine .spine-action{
    grid-column:3!important;
    grid-row:2!important;
    justify-self:start!important;
    text-align:left!important;
    white-space:normal!important;
    margin-top:.15rem!important;
  }
}

/* Kabir carries historical grid-area declarations; only placement is reset.
   Thumbnail dimensions still come exclusively from the House contract above. */
@media(max-width:640px){
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb{
    display:grid!important;
    grid-template-columns:44px 1.85rem minmax(0,1fr)!important;
    grid-template-areas:none!important;
    grid-template-rows:auto auto!important;
    column-gap:.7rem!important;
    row-gap:.4rem!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .spine-num{
    grid-area:auto!important;
    grid-column:2!important;
    grid-row:1!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy{
    grid-area:auto!important;
    grid-column:3!important;
    grid-row:1!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .spine-action{
    grid-area:auto!important;
    grid-column:3!important;
    grid-row:2!important;
  }
}


/* ═══════════════════════════════════════════════════════════════════
   HOUSE READING ROOM TITLE-ANCHOR CONTRACT — v1.0.103
   Titles may wrap, descriptions may wrap, artwork ratios may vary;
   the title origin must never drift. Every shelf row begins from one
   common top anchor rather than vertically centering mixed-height cells.
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width:641px){
  .reading-room .shelf-items > .spine,
  .reading-room .shelf-items > .shelf-spine-with-thumb,
  .stills-reading-room .shelf-items > .spine,
  .stills-reading-room .shelf-items > .stills-spine{
    align-items:start!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .shelf-thumb-frame,
  .stills-reading-room .shelf-items > .stills-spine .stills-thumb-frame,
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-num,
  .stills-reading-room .shelf-items > .stills-spine .spine-num,
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy,
  .stills-reading-room .shelf-items > .stills-spine .spine-copy,
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-action,
  .stills-reading-room .shelf-items > .stills-spine .spine-action{
    align-self:start!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-num,
  .stills-reading-room .shelf-items > .stills-spine .spine-num{
    padding-top:.12rem!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy h3,
  .stills-reading-room .shelf-items > .stills-spine .spine-copy h3{
    margin-top:0!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-action,
  .stills-reading-room .shelf-items > .stills-spine .spine-action{
    padding-top:.12rem!important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   KABIR READING ROOM — SHARED SHELF GEOMETRY REJOIN v1.0.101
   Kabir had legacy grid-area rules in series-common.css. On desktop,
   explicitly place thumbnail → number → copy → action in the shared
   Reading Room row so the title cannot drift away from its thumbnail.
   Mobile continues to use the compact v97 thumbnail row contract.
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width:641px){
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb{
    display:grid!important;
    grid-template-columns:52px 2.4rem minmax(0,1fr) auto!important;
    grid-template-areas:none!important;
    grid-template-rows:auto!important;
    column-gap:1rem!important;
    row-gap:0!important;
    align-items:start!important;
    width:100%!important;
    margin-left:0!important;
    padding:1rem 0!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .shelf-thumb-frame{
    grid-area:auto!important;
    grid-column:1!important;
    grid-row:1!important;
    justify-self:start!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .spine-num{
    grid-area:auto!important;
    grid-column:2!important;
    grid-row:1!important;
    align-self:start!important;
    padding-top:.12rem!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy{
    grid-area:auto!important;
    grid-column:3!important;
    grid-row:1!important;
    min-width:0!important;
    width:auto!important;
    align-self:start!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy h3{
    margin:0 0 .22rem!important;
  }
  .kabir-reading-room .shelf-items > .shelf-spine-with-thumb .spine-action{
    grid-area:auto!important;
    grid-column:4!important;
    grid-row:1!important;
    justify-self:end!important;
    align-self:start!important;
    width:auto!important;
    margin:0!important;
    text-align:right!important;
    white-space:nowrap!important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   CACHE-PROOF READING ROOM GEOMETRY LOCK — v1.0.104
   This versioned stylesheet is intentionally a new URL. It prevents
   an older cached House frame from surviving a deployment.
   ═══════════════════════════════════════════════════════════════════ */

/* One row grammar for every story-series shelf. */
.reading-room .shelf-items > .shelf-spine-with-thumb,
.stills-reading-room .shelf-items > .stills-spine{
  display:grid!important;
  grid-template-columns:52px 2.4rem minmax(0,1fr) auto!important;
  grid-template-rows:auto!important;
  grid-template-areas:none!important;
  column-gap:.9rem!important;
  row-gap:0!important;
  align-items:start!important;
  width:100%!important;
}

/* Hard image ceiling — desktop/tablet. */
.reading-room .shelf-items > .shelf-spine-with-thumb .shelf-thumb-frame,
.stills-reading-room .shelf-items > .stills-spine .stills-thumb-frame{
  width:48px!important;
  inline-size:48px!important;
  min-width:48px!important;
  max-width:48px!important;
  max-height:72px!important;
  justify-self:start!important;
  align-self:start!important;
  grid-column:1!important;
  grid-row:1!important;
}
.reading-room .shelf-items > .shelf-spine-with-thumb .spine-num,
.stills-reading-room .shelf-items > .stills-spine .spine-num{
  grid-column:2!important;
  grid-row:1!important;
  align-self:start!important;
}
.reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy,
.stills-reading-room .shelf-items > .stills-spine .spine-copy{
  grid-column:3!important;
  grid-row:1!important;
  align-self:start!important;
  min-width:0!important;
}
.reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy h3,
.stills-reading-room .shelf-items > .stills-spine .spine-copy h3{
  margin-top:0!important;
}
.reading-room .shelf-items > .shelf-spine-with-thumb .spine-action,
.stills-reading-room .shelf-items > .stills-spine .spine-action{
  grid-column:4!important;
  grid-row:1!important;
  align-self:start!important;
  justify-self:end!important;
  white-space:nowrap!important;
}

/* Mobile: compact image + fixed title origin. Description may wrap; title may not drift. */
@media(max-width:640px){
  .reading-room .shelf-items > .shelf-spine-with-thumb,
  .stills-reading-room .shelf-items > .stills-spine{
    grid-template-columns:44px 1.85rem minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    grid-template-areas:none!important;
    column-gap:.7rem!important;
    row-gap:.4rem!important;
    align-items:start!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .shelf-thumb-frame,
  .stills-reading-room .shelf-items > .stills-spine .stills-thumb-frame{
    width:40px!important;
    inline-size:40px!important;
    min-width:40px!important;
    max-width:40px!important;
    max-height:60px!important;
    grid-column:1!important;
    grid-row:1 / span 2!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-num,
  .stills-reading-room .shelf-items > .stills-spine .spine-num{
    grid-column:2!important;
    grid-row:1!important;
    padding-top:0!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-copy,
  .stills-reading-room .shelf-items > .stills-spine .spine-copy{
    grid-column:3!important;
    grid-row:1!important;
  }
  .reading-room .shelf-items > .shelf-spine-with-thumb .spine-action,
  .stills-reading-room .shelf-items > .stills-spine .spine-action{
    grid-column:3!important;
    grid-row:2!important;
    justify-self:start!important;
    text-align:left!important;
    white-space:normal!important;
    margin-top:.15rem!important;
  }
}

