/* Rooms: a typographic directory (Direction A, #192; builds on #196's fewer, lighter boxes). One solid band holds
   a toolbar row and a hairline-divided list of rooms, so the page reads as one index rather than box after box.
   The intro stays the one framed, lit object. Each rule here is scoped to Rooms; the shared .pc-card is untouched.
   Existing tokens only. Delete this file and its <link> to undo the lot. */

/* Joined rooms stays available at every width. Below the desktop grid it is a collapsible section above the
   directory; on desktop a stable track leaves enough room for the label, search and ordinary room names. */
.room-directory-layout > .room-navigation{display:block;width:100%;max-block-size:none;overflow:visible}
.room-directory-layout .room-navigation details[open]{width:100%}
.room-directory-layout .room-navigation-toggle{width:100%;white-space:nowrap}
.room-directory-layout .room-navigation-toggle:focus-visible{outline:2px solid var(--color-fg);outline-offset:2px}
/* The label may take a second line when large text leaves no room, so it never runs under the count. */
.room-directory-layout .room-navigation-toggle-label{flex:1 1 auto;min-inline-size:0;white-space:normal;overflow-wrap:anywhere}
.room-directory-layout .room-navigation-toggle .menu-count{flex:0 0 auto;margin-inline-start:auto}
.room-directory-layout .room-navigation-toggle::before{flex:0 0 auto;inline-size:.75rem;transform-origin:center}
.room-directory-layout .room-navigation-body{max-block-size:none;overflow:visible}
.room-directory-layout .room-list-navigation{
  max-block-size:min(24rem,50svh);
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-gutter:stable;
  scroll-padding-block:.5rem;
}
@media (min-width:80rem){
  .room-directory-layout{grid-template-columns:16rem minmax(0,1fr)}
}

/* The band: one solid surface, one hairline, no vignette, glow or shadow. Its bg-surface class also exempts it
   from page-craft's loose-text backing, which had wrapped each category heading in a dark pill. */
.directory-band{
  --band-pad:var(--space-3);
  display:flex;
  flex-direction:column;
  gap:var(--space-3);
  min-inline-size:0;
  padding:0 var(--band-pad) var(--band-pad);
  border:1px solid var(--pc-hair);
  border-radius:6px;
  background:var(--color-surface);
}

/* The toolbar row: search, name sort and count side by side. It is the phone's sticky row (.room-chips), so it
   carries the band's own ground across the band's full width. */
.discovery-toolbar{display:flex;flex-direction:column;gap:var(--space-2);min-inline-size:0}
.directory-band .discovery-toolbar-row{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:.5rem .75rem;
  margin-inline:calc(-1 * var(--band-pad));
  padding:var(--band-pad) var(--band-pad) var(--space-2);
  border-block-end:1px solid var(--pc-hair);
  border-start-start-radius:6px;
  border-start-end-radius:6px;
  background:var(--color-surface);
  scroll-snap-type:none;
}
.discovery-toolbar-row > *{flex:none}
.discovery-toolbar-row > .discovery-search{flex:1 1 14rem;min-inline-size:0}
/* A 44px wrapper aligns the compact count badge with the field and sort button without stretching the badge. */
.discovery-count{display:flex;align-items:center;justify-content:center;min-block-size:44px}
.discovery-toolbar-row .menu-count{margin:0;font-variant-numeric:tabular-nums}
.discovery-search > label{color:var(--color-muted)}
.discovery-sort{white-space:nowrap}
.discovery-search input,.discovery-sort{padding-block:0;font-family:var(--font-sans);font-size:1rem}

/* Categories use their natural label widths and wrap only when the row is full. Labels are not assigned to tall,
   evenly spaced grid cells; each control keeps a 44px target and the selected category has a gilt outline. */
.discovery-chips{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:0 .25rem;
  min-inline-size:0;
  margin-inline:0;
  padding-block:.125rem;
  border-block-end:1px solid var(--pc-hair);
}
.discovery-chip{flex:0 0 auto;white-space:normal;overflow-wrap:normal}
.discovery-chip,
.directory-band .town-filter > [role="group"] button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-block-size:44px;
  min-inline-size:44px;
  max-inline-size:100%;
  padding:0 .375rem;
  border:0;
  border-radius:0;
  background:none;
  color:var(--color-muted);
  font-size:.9375rem;
  font-weight:400;
  text-align:start;
  overflow-wrap:anywhere;
  cursor:pointer;
}
.discovery-chip{border:1px solid transparent;border-radius:4px;text-align:center}
.discovery-chip:hover,
.directory-band .town-filter > [role="group"] button:hover{color:var(--color-fg)}
.discovery-chip.is-selected,
.directory-band .town-filter > [role="group"] button[aria-pressed="true"]{
  color:var(--color-fg);
  text-decoration:underline;
  text-decoration-color:var(--pc-gilt);
  text-decoration-thickness:2px;
  text-underline-offset:.3em;
}
.discovery-chip.is-selected{border-color:var(--pc-gilt);background:var(--color-raised)}
.discovery-chip:focus-visible{outline:2px solid var(--color-fg);outline-offset:1px}
.directory-band .town-filter :is(button,summary):focus-visible{outline:2px solid var(--color-fg);outline-offset:2px}

@media (max-width:47.99em){.discovery-toolbar-row>.discovery-search{flex-basis:100%;width:100%}}
@media (min-width:48em){.directory-band .discovery-toolbar-row{flex-wrap:nowrap}}

/* Towns are a separate compact wrapping row. "Search all … towns" remains a prominent summary and opens the full
   searchable list; only that open search needs a boxed field. */
.discovery-filter-row{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.5rem;min-inline-size:0}
.directory-band .town-filter{display:grid;grid-template-columns:minmax(0,1fr) auto;flex:1 1 100%;align-items:center;gap:0 .5rem;padding-block-start:.125rem}
.directory-band .town-filter > [role="group"]{min-inline-size:0;gap:0 .25rem}
.directory-band .town-filter > details:not([open]){margin-inline-start:auto;padding:0;border:0;background:none}
.directory-band .town-filter > details[open]{grid-column:1/-1;margin-inline-start:0}
.directory-band .town-filter > details > summary{
  padding-inline:.25rem;
  font-weight:600;
  text-decoration:underline;
  text-decoration-color:var(--pc-gilt);
  text-underline-offset:.3em;
}
@media (max-width:47.99em){
  .directory-band .town-filter{display:flex;flex-direction:row;flex-wrap:wrap}
  .directory-band .town-filter > [role="group"]{
    flex:1 1 auto;
    flex-wrap:nowrap;
    max-inline-size:100%;
    padding-block:2px;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    scrollbar-width:thin;
  }
  .directory-band .town-filter > [role="group"] > :is(span,button){flex:0 0 auto;white-space:nowrap}
  .directory-band .town-filter > details:not([open]){margin-inline-start:0}
}
/* With large text on a narrow phone the label alone fills the strip and pushes All out of view; there the towns
   wrap under the label instead of scrolling. em follows the text size, so 100% text keeps the scrolling strip. */
@container town-filter (inline-size < 12em){
  .directory-band .town-filter > [role="group"]{flex-wrap:wrap;overflow-x:visible}
  .directory-band .town-filter > [role="group"] > span{flex:1 1 100%;white-space:normal}
}

/* Your rooms keeps its section head. Add a place is a compact ordinary action beside its plus, not a gold
   heading with an empty ornament row. The form sits under Your rooms, divided by a hairline. */
#your-rooms > .rooms-yours-head{margin:0}
.directory-band .pc-card:has(> .add-place-summary){
  padding:0;
  border:0;
  border-block-start:1px solid var(--pc-hair);
  border-radius:0;
  background:none;
  box-shadow:none;
}
.directory-band .pc-card:has(> .add-place-summary)::before{content:none}
/* The whole summary is the 44px target. Its 14px plus is an icon inside that target, not a second control. */
.directory-band .add-place-summary{gap:.5rem;list-style:none}
.directory-band .add-place-summary::-webkit-details-marker{display:none}
.directory-band .add-place-summary::after{content:none}
.add-place-toggle{
  flex:none;
  inline-size:1rem;
  block-size:1rem;
  margin-inline:0;
  background:
    linear-gradient(var(--pc-gilt),var(--pc-gilt)) center/14px 1.5px no-repeat,
    linear-gradient(var(--pc-gilt),var(--pc-gilt)) center/1.5px 14px no-repeat;
}
details[open] > .add-place-summary > .add-place-toggle{background-size:14px 1.5px,0 0}
/* The list: one column of entries, a hairline between rows, no card around each room. */
.directory-band .room-grid{display:flex;flex-direction:column;gap:0}
.directory-band .community-card--entry{
  padding:var(--space-2) 0;
  border:0;
  border-radius:0;
  background:none;
}
/* The closed form keeps only its action row; opening it restores the column's normal rhythm below. */
.directory-band .pc-card:has(> .add-place-summary):not([open]){margin-block-end:calc(-1 * var(--space-3))}
.directory-band .pc-card:has(> .add-place-summary)[open]{padding:var(--space-2);margin-block-end:0}

/* The divider is drawn inside the text edge (::after), so it lines up with the heads; the row's hover area runs
   wider, into the band's padding. */
.directory-band .community-card--entry + .community-card--entry::after{
  content:"";
  position:absolute;
  inset-block-start:0;
  inset-inline:var(--space-2);
  block-size:1px;
  background:var(--pc-hair);
}
.directory-band .community-card--entry .community-card-title{min-block-size:44px}
.directory-band .category-section{border-block-start-color:var(--pc-hair)}
/* One left edge for every row, and the band's own rhythm between sections (the column's 2rem left Add a place
   floating). */
.directory-band .room-column{gap:var(--space-3)}
.directory-band .category-section-body{padding-inline:0}

/* ---- The engraved-book craft (Josh, Nov 20, 2:20 PM: Direction A was "too plain"). The structure above stays;
   this adds character back as type, ornament and one light, never as layered card effects. ---- */

/* One light (the reel's chiaroscuro): the intro is the page's focal object. A static warm lift falls on the
   heading and darkens toward the card's edges. Solid ground, one gilt hairline, no ring, shadow or grain. */
.plate.pc-head.room-directory-heading{
  border-color:color-mix(in srgb,var(--pc-gilt) 45%,var(--line));
  background-color:var(--pc-t2);
  background-image:
    radial-gradient(55% 75% at 26% 16%,color-mix(in srgb,var(--pc-gilt) 16%,transparent),transparent 72%),
    radial-gradient(130% 115% at 35% 15%,transparent 48%,color-mix(in srgb,var(--pc-solid) 70%,transparent) 100%);
  box-shadow:none;
}
.plate.pc-head.room-directory-heading::before{content:none}
.room-directory-heading > h1{font-size:clamp(2.4rem,1.7rem + 2.8vw,3.75rem);line-height:1.05;letter-spacing:-.01em;text-shadow:0 1px 0 rgba(0,0,0,.45)}
/* The rule under the title: a gilt diamond and a double hairline, as on a title page. */
.room-directory-heading > h1 + p::before{
  content:"";
  display:block;
  inline-size:min(16rem,70%);
  block-size:7px;
  margin-block:.15rem .9rem;
  background:var(--orn-ink);
  -webkit-mask:var(--orn-rule);
  mask:var(--orn-rule);
}

/* The band darkens toward its edges, so the eye stays on the list. */
.directory-band{
  background:radial-gradient(140% 90% at 50% 0,var(--color-surface) 55%,color-mix(in srgb,var(--color-surface) 55%,var(--color-bg)) 100%);
}

/* Search and sort are sibling controls: the shared 44px height, 6px radius, hairline and solid surface.
   The count stays a badge, centred on their baseline. Category and town words below keep the book's small caps. */
.directory-band .town-filter > [role="group"] > span{
  font-family:var(--font-display);
  font-size:1rem;
  font-variant-caps:all-small-caps;
  letter-spacing:.1em;
  color:color-mix(in srgb,var(--pc-gilt) 70%,var(--color-muted));
}
.discovery-search input{
  border:1px solid var(--color-line);
  border-radius:var(--radius-md);
  background:var(--color-surface);
}
.discovery-search input:focus-visible{border-color:var(--color-fg);box-shadow:none}
.discovery-chip,
.directory-band .town-filter > [role="group"] button,
.directory-band .town-filter > details > summary{
  font-family:var(--font-display);
  font-size:1rem;
  font-variant-caps:all-small-caps;
  letter-spacing:.04em;
}
/* The joined-rooms toggle, where it shows (64em and up), in the same small caps as the rest of the page. */
.room-directory-layout > .room-navigation .room-navigation-toggle{
  font-family:var(--font-display);
  font-size:1.125rem;
  font-weight:500;
  font-variant-caps:all-small-caps;
  letter-spacing:.08em;
}

/* Section heads at a real display size, closed by the diamond and double hairline. */
.directory-band .pc-h{font-size:1.4rem;letter-spacing:.14em}
.directory-band .pc-h::after{
  height:7px;
  background:var(--orn-ink);
  -webkit-mask:var(--orn-rule);
  mask:var(--orn-rule);
}
/* The title can shrink and wrap so a long name and its count stay in the band at
   320px with a 32px root. The shell clips overflow, so page scrollWidth stays 0.
   The ornament only takes leftover space, and keeps a 2rem stub even when the
   title wraps. */
.directory-band .category-section-summary{
  display:flex;
  align-items:center;
  min-inline-size:0;
  gap:.6rem;
}
.directory-band .category-title{
  flex:0 1 auto;
  min-inline-size:0;
  overflow-wrap:break-word;
  hyphens:auto;
  color:var(--pc-gilt);
  font-size:clamp(1.375rem,1.2rem + .7vw,1.75rem);
  font-weight:600;
  font-variant-caps:all-small-caps;
  letter-spacing:min(.12em,2.64px);
}
.directory-band .category-section-summary .menu-count{
  flex:0 0 auto;
  border:0;
  background:none;
  padding:0;
  color:var(--color-muted);
  font-family:var(--font-display);
  font-size:1.0625rem;
}
.directory-band .category-section-summary::after{
  content:"";
  flex:1 1 2rem;
  min-inline-size:0;
  height:7px;
  background:var(--orn-ink);
  -webkit-mask:var(--orn-rule);
  mask:var(--orn-rule);
}
/* A category's line of description reads as the catalogue's italic note under its head. */
.directory-band .category-section-body > p{font-family:var(--font-display);font-size:1.125rem;font-style:italic}

/* Each room is a catalogue entry: the title in display type with the page's red initial, a small-caps meta line,
   and a hairline with a diamond between entries. Hover and keyboard focus lift the row a warm tone and draw a
   gilt rule at its left edge. Targets stay 44px. */
.directory-band .community-card--entry{
  position:relative;
  margin-inline:calc(-1 * var(--space-2));
  padding-inline:var(--space-2);
  transition:background-color .2s ease,box-shadow .2s ease;
}
.directory-band .community-card--entry .community-card-title{
  font-family:var(--font-display);
  font-size:clamp(1.4rem,1.25rem + .6vw,1.8rem);
  font-weight:500;
  line-height:1.15;
}
.entry-title{display:block}
.entry-title::first-letter{color:var(--pc-rubric);font-size:1.18em;font-weight:600}
.entry-meta{
  margin:0;
  color:var(--color-muted);
  font-family:var(--font-display);
  font-size:1.0625rem;
  font-variant-caps:all-small-caps;
  letter-spacing:.07em;
}
.directory-band .community-card--entry + .community-card--entry::before{
  content:"";
  position:absolute;
  inset-block-start:-4px;
  inset-inline-start:50%;
  inline-size:7px;
  block-size:7px;
  margin-inline-start:-3.5px;
  background:var(--pc-gilt);
  -webkit-mask:var(--orn-diamond) center/7px 7px no-repeat;
  mask:var(--orn-diamond) center/7px 7px no-repeat;
}
.directory-band .community-card--entry:is(:hover,:focus-within){
  background-color:color-mix(in srgb,var(--pc-gilt) 7%,transparent);
  box-shadow:inset 2px 0 0 var(--pc-gilt);
}
.directory-band .community-card--entry .community-card-title:hover{text-decoration:underline;text-decoration-color:var(--pc-gilt);text-decoration-thickness:1px;text-underline-offset:.2em}
@media (prefers-reduced-motion:reduce){.directory-band .community-card--entry{transition:none}}

/* The phone tab bar's current tab: a 2px gilt mark inset inside the tab, as wide as its label, in place of the
   full-width top border that sat on the bar's own edge and read as a stray line. */
@media (max-width:47.99em){
  .tabbar button[aria-current="page"]{
    border-top-color:transparent;
  }
  .tabbar .tab-face{
    position:relative;
    flex:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    min-inline-size:0;
  }
  /* The face starts below the 2px top border and 6px padding; the mark sits 4px down from the tab's top. */
  .tabbar button[aria-current="page"] .tab-face::before{
    content:"";
    position:absolute;
    inset-inline:0;
    top:-4px;
    height:2px;
    border-radius:1px;
    background:var(--gold);
  }
}
