/* Native teaching library (/teachings/), design direction A "refined sidebar". Plain BEM (Matt, 27 October 2026),
 * ACSS variables throughout: spacing and type snap to the nearest ACSS step; steps below --space-xs are
 * calc(var(--space-xs) * n); fixed dimensions (control heights, the sidebar column) stay in rem.
 * Blocks: teaching-library (the shell's content wrapper and the page), filter-group. Cards are the teaching-card
 * Bricks component (styles in Bricks global classes). The page no longer borrows the homepage's si-home rules. */

/* ---------- teaching-library ---------- */
.teaching-library{display:block;font-family:var(--samye-t-body);font-size:var(--text-m);line-height:1.7;color:var(--neutral-dark);background:var(--white)}
/* Page-wide element rules weigh one class (beating the legacy baseline reset) and skip teaching-card components. */
.teaching-library :where(:is(h1,h2,h3):not(.teaching-card *)){font-family:var(--samye-t-heading);font-weight:400;color:var(--neutral);margin:0;line-height:1.3}
.teaching-library :where(p:not(.teaching-card *)){margin:0}
.teaching-library__head,.teaching-library__body{display:flex;align-items:center;scroll-margin-top:10rem}
/* The page-header standard (stone band, as on Practice Guides, Articles and the course overviews; Matt, 29 Oct 2026). */
.teaching-library__head{background:var(--base-ultra-light);padding:var(--space-m) var(--gutter);border-bottom:var(--border-size) solid var(--base-light)}
.teaching-library__body{padding:var(--space-m) var(--gutter) var(--section-space-s)}
.teaching-library__container{width:100%;max-width:var(--samye-content-max,120rem);margin:0 auto;display:flex;flex-direction:column;gap:var(--space-m)}
.teaching-library__container--head{gap:calc(var(--space-xs) * .6)}
.teaching-library__head .teaching-library__title{font:400 var(--h1)/1.25 var(--samye-t-heading);color:var(--neutral)}
.teaching-library__lead p{margin:calc(var(--space-xs) * .6) 0 0;max-width:60ch;font:300 var(--text-m)/1.6 var(--samye-t-body);color:var(--neutral-dark);text-wrap:balance}
.teaching-library__search{width:100%;max-width:64rem;margin-top:var(--space-xs)}
.teaching-library__search input[type=search]{width:100%;min-height:4.4rem;padding:0 var(--space-xs) 0 4.4rem;border:var(--border);border-radius:var(--radius);background:var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6E6E' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") var(--space-xs) center/1.8rem no-repeat;font:var(--text-m) var(--samye-t-body)}

/* Free to watch (signed-out visitors only, by a Bricks condition): a one-option content-status checkbox drawn as a
   switch. Bricks hides the input and paints .brx-input-indicator; three classes beat its .brxe-filter-checkbox rules. */
.teaching-library__free-filter{display:block;margin:0;padding:0;border:0;min-width:0}
.teaching-library__free-filter .brx-filter-legend{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.teaching-library__free .teaching-library__free-filter :is(ul,li){margin:0;padding:0;list-style:none}
.teaching-library__free-filter label{display:inline-flex;align-items:center;gap:calc(var(--space-xs) * .6);min-height:4rem;cursor:pointer;font-size:var(--text-s);line-height:1.3;color:var(--neutral-dark)}
.teaching-library__free-filter .brx-option-text{display:inline-flex;align-items:baseline;gap:calc(var(--space-xs) * .5)}
.teaching-library__free-filter .brx-option-count{color:var(--neutral-semi-dark)}
.teaching-library__free .teaching-library__free-filter .brx-input-indicator{position:relative;flex:none;width:3.6rem;height:2rem;border:0;border-radius:var(--radius-circle);background:var(--neutral-light);transition:background-color .15s}
.teaching-library__free .teaching-library__free-filter .brx-input-indicator::after{position:absolute;top:.2rem;left:.2rem;width:1.6rem;height:1.6rem;border:0;border-radius:50%;background:var(--white);opacity:1;transform:none;transition:transform .15s}
.teaching-library__free .teaching-library__free-filter input:checked + .brx-input-indicator{background:var(--primary)}
.teaching-library__free .teaching-library__free-filter input:checked + .brx-input-indicator::after{transform:translateX(1.6rem)}
.teaching-library__free .teaching-library__free-filter input:focus-visible + .brx-input-indicator{outline:calc(var(--border-size) * 3) solid var(--secondary);outline-offset:calc(var(--border-size) * 2)}

/* Layout and sidebar */
.teaching-library__layout{display:grid;grid-template-columns:25rem minmax(0,1fr);gap:var(--space-l);align-items:start;width:100%}
.teaching-library__sidebar{display:flex;flex-direction:column;gap:var(--space-s);min-width:0;font-size:var(--text-s)}
.teaching-library__sidebar-head{flex-direction:row;align-items:baseline;justify-content:space-between;width:100%}
.teaching-library__sidebar-title{margin:0;font-size:var(--h5);font-weight:400;color:var(--neutral)}
.teaching-library__clear{background:none;border:0;padding:0;min-height:0;color:var(--primary);font:var(--text-s) var(--samye-t-body);text-transform:none;letter-spacing:0;cursor:pointer;text-decoration:underline;text-underline-offset:calc(var(--border-size) * 3)}

/* Results toolbar */
.teaching-library__results{display:flex;flex-direction:column;gap:var(--space-s);min-width:0;width:100%}
.teaching-library__toolbar{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-xs);width:100%}
.teaching-library__status{display:flex;width:auto;flex:1 1 auto;flex-direction:row;flex-wrap:wrap;align-items:center;gap:calc(var(--space-xs) * .6)}
.teaching-library__count{font-weight:600;color:var(--neutral)}
.teaching-library__active-filters{display:flex;flex-wrap:wrap;gap:calc(var(--space-xs) * .6);margin:0;padding:0;list-style:none;font-size:var(--text-s)}
.teaching-library__active-filters li{margin:0}
.teaching-library__active-filters :is(button,a,.bricks-button){text-transform:none;letter-spacing:0;display:inline-flex;align-items:center;gap:calc(var(--space-xs) * .5);min-height:3.2rem;padding:0 var(--space-xs);border:var(--border);border-radius:var(--radius-circle);background:var(--base-ultra-light);color:var(--neutral-dark);font:var(--text-s) var(--samye-t-body);cursor:pointer}
/* display set explicitly: the legacy baseline reset (label{display:inline-block}) still loads on this route. */
.teaching-library__sort{display:flex;width:auto;flex:0 0 auto;flex-direction:row;line-height:1.4;align-items:center;gap:calc(var(--space-xs) * .6);font-size:var(--text-s)}
.teaching-library__sort select{width:auto;min-width:17rem;min-height:4rem;padding:0 calc(var(--space-xs) * .75);border:var(--border);border-radius:var(--radius);background:var(--white);color:var(--neutral);font:var(--text-s) var(--samye-t-body)}

/* Grid: each loop item holds one teaching-card component instance, which fills it. */
.teaching-library__grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-s);width:100%;align-items:stretch}
.teaching-library__grid-item{display:flex;min-width:0;height:100%}
.teaching-library__grid-item > *{flex:1}
.teaching-library__more{align-self:center;text-transform:none;letter-spacing:0}

.teaching-library__filters-toggle{display:none}

/* ---------- filter-group (one filter in the sidebar) ---------- */
.filter-group{display:flex;flex-direction:column;gap:calc(var(--space-xs) * .5);width:100%}
.filter-group + .filter-group{border-top:var(--border);padding-top:var(--space-s)}
/* A filter with no options left under the current selection (Topic under Path of Dignity) hides with its heading;
   Bricks redraws the options on every change, so the group returns when it has some again. */
.teaching-library__sidebar .filter-group:not(:has(.brx-filter-options li)){display:none}
.filter-group__label{font:600 var(--text-s)/1.4 var(--samye-t-body);letter-spacing:.05em;text-transform:uppercase;color:var(--neutral-semi-dark);margin-bottom:calc(var(--space-xs) * .3)}
.filter-group__help{margin:0 0 calc(var(--space-xs) * .3);font-size:var(--text-s);line-height:1.5;color:var(--neutral-semi-dark)}
.filter-group__options{width:100%;margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:calc(var(--space-xs) * .5)}
.filter-group__options label{display:flex;align-items:center;gap:calc(var(--space-xs) * .75);cursor:pointer;line-height:1.4}
.filter-group__options .brx-option-text{flex:1}
.filter-group__options .brx-option-count{margin-left:auto;color:var(--neutral-semi-dark);font-size:var(--text-s)}
.filter-group__options input:is([type=checkbox],[type=radio]){accent-color:var(--primary);width:1.6rem;height:1.6rem;flex:none}
/* Pathway: a list-mode radio, which Bricks wraps in a fieldset with a visible legend. */
.filter-group__options--radio{border:0;margin:0;padding:0;min-width:0;--brx-indicator-border-color-checked:var(--primary);--brx-indicator-check-color-checked:var(--primary)}
.filter-group__options--radio .brx-filter-legend{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.filter-group__options--radio .brx-option-text{display:flex;align-items:baseline;gap:calc(var(--space-xs) * .5)}
.filter-group__options label:has(input:focus-visible){outline:calc(var(--border-size) * 3) solid var(--secondary);outline-offset:calc(var(--border-size) * 2)}
.filter-group__options .brx-show-more-less-wrapper{margin:calc(var(--space-xs) * .15) 0 0}
.filter-group__options :is(.brx-show-more-less-button,.brx-show-more-less-button.bricks-button){align-self:flex-start;min-height:0;background:none;border:0;padding:calc(var(--space-xs) * .3) 0;color:var(--primary);font:500 var(--text-s)/1.4 var(--samye-t-body);text-transform:none;letter-spacing:0;cursor:pointer}
.filter-group__options .brx-show-more-less-button:hover{text-decoration:underline;background:none}
.filter-group__options .brx-filter-options{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:calc(var(--space-xs) * .5)}
.filter-group__options li[data-depth="1"]{padding-left:var(--space-xs)}
.filter-group__options li[data-depth="2"]{padding-left:var(--space-s)}
/* Format: a button-mode radio drawn as a quiet segmented control; the selected option takes the sidebar's crimson
   accent (as the Pathway radios), not a solid fill, so it doesn't outrank the other filters. */
.filter-group__toggle{border:0;margin:0;padding:0;min-width:0;width:100%}
.filter-group__toggle .brx-filter-legend{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.filter-group__toggle .brx-filter-options{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:0;margin:0;padding:0;list-style:none;border:var(--border);border-radius:var(--radius);overflow:hidden}
.filter-group__toggle li{margin:0}
.filter-group__toggle label{display:block}
.filter-group__toggle .bricks-button{display:flex;align-items:center;justify-content:center;width:100%;min-height:3.6rem;padding:0 calc(var(--space-xs) * .6);border:0;border-left:var(--border);border-radius:0;background:var(--white);color:var(--neutral-semi-dark);font:400 var(--text-s)/1 var(--samye-t-body);text-transform:none;letter-spacing:0;cursor:pointer;outline:0}
.filter-group__toggle li:first-child .bricks-button{border-left:0}
.filter-group__toggle .bricks-button:hover{background:var(--white);color:var(--neutral)}
.filter-group__toggle .bricks-button.brx-option-active{background:color-mix(in oklch, var(--primary) 8%, var(--white));color:var(--primary);font-weight:500}
.filter-group__toggle label:has(input:focus-visible) .bricks-button{outline:calc(var(--border-size) * 3) solid var(--secondary);outline-offset:calc(var(--border-size) * 2)}
/* Teaching venue: a details element that folds the long list. */
.filter-group--collapsible{display:block}
.filter-group__summary{display:flex;align-items:center;justify-content:space-between;cursor:pointer;list-style:none;margin:0}
.filter-group__summary::-webkit-details-marker{display:none}
.filter-group__summary::after{content:'+';font:400 var(--text-m)/1 var(--samye-t-body);color:var(--neutral-semi-dark)}
.filter-group--collapsible[open] .filter-group__summary::after{content:'–'}
.filter-group--collapsible[open] .filter-group__summary{margin-bottom:calc(var(--space-xs) * .6)}

@media(max-width:1100px){.teaching-library__grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){
  .teaching-library__layout{grid-template-columns:1fr;gap:var(--space-s)}
  /* The Filters button sits in the results toolbar; flattening the results column lets the panel open directly under
     it (toolbar, panel, grid), and while the panel is open the toolbar sticks to the top so closing is one tap away. */
  .teaching-library__results{display:contents}
  .teaching-library__toolbar{order:1}
  .teaching-library__grid{order:3}
  .teaching-library__more{order:4;justify-self:center}
  .teaching-library__layout:has(.teaching-library__sidebar--open) .teaching-library__toolbar{position:sticky;top:0;z-index:5;background:var(--white);padding-block:calc(var(--space-xs) * .6);box-shadow:0 1px 0 rgb(0 0 0 / .08)}
  .teaching-library__sidebar{display:none;order:2;border:var(--border);border-radius:var(--radius);padding:var(--space-s)}
  .teaching-library__sidebar--open{display:flex}
  .teaching-library__filters-toggle{display:inline-flex;align-items:center;gap:calc(var(--space-xs) * .6);min-height:4.4rem;padding:0 var(--space-xs);border:var(--border-size) solid var(--neutral);border-radius:var(--radius);background:var(--white);color:var(--neutral);font:500 var(--text-s) var(--samye-t-body);text-transform:none;letter-spacing:0;cursor:pointer}
  .teaching-library__filters-toggle::before{content:'';width:1.6rem;height:1.6rem;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2'%3E%3Cpath d='M4 6h16M7 12h10M10 18h4'/%3E%3C/svg%3E") center/contain no-repeat}
  .teaching-library__filters-toggle--open{background:var(--neutral);color:var(--white)}
  .teaching-library__filters-toggle--open::before{filter:invert(1)}
  .teaching-library__filters-toggle--open::after{content:'✕';font-size:var(--text-s);line-height:1}
}
@media(max-width:600px){
  .teaching-library__body{padding:var(--space-s) var(--gutter) var(--section-space-xs)}
  .teaching-library__grid{grid-template-columns:1fr}
  /* Toolbar on one row: Filters, count, Sort. Active-filter chips take their own row below when there are any. */
  .teaching-library__toolbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:calc(var(--space-xs) * .75);row-gap:calc(var(--space-xs) * .6)}
  .teaching-library__status{display:contents}
  .teaching-library__count{grid-column:2;grid-row:1;font-size:var(--text-s);line-height:1.3}
  .teaching-library__active-filters{grid-column:1/-1;grid-row:2}
  .teaching-library__active-filters:empty{display:none}
  .teaching-library__sort{grid-column:3;grid-row:1}
  .teaching-library__sort-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .teaching-library__sort select{min-width:0;min-height:4.4rem}
}
