
/* Media archive filter pills match Publications */
.media-filters .publication-filter-pills{flex:1 1 calc(50% - .5rem);min-width:0;margin:0;padding:.25rem 0;border:0}
.media-filters .publication-filter-pills legend{margin:0 0 .45rem;color:var(--ink);font:600 .76rem/1.35 var(--ui)}
.media-filters .publication-filter-pill-list{display:flex;flex-wrap:wrap;gap:.45rem}
.media-filters .publication-filter-pill{position:relative;display:inline-flex;align-items:center;gap:0;margin:0;padding:.38rem .75rem;border:1px solid #c5d0c4;border-radius:999px;background:var(--white);color:var(--ink);font:600 .78rem/1.3 var(--ui);cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.media-filters .publication-filter-pill input{position:absolute;opacity:0;pointer-events:none}
.media-filters .publication-filter-pill:has(input:checked){border-color:var(--green-dark);background:var(--green-dark);color:#f5f1e8}
.media-filters .publication-filter-pill:focus-within{outline:2px solid var(--green);outline-offset:2px}
.media-filters p{flex:1 1 calc(50% - .5rem);min-width:0}
@media(max-width:700px){
 .media-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:end;gap:.55rem;padding:.7rem}
 .media-filters .publication-filter-pills{grid-column:1/-1;width:100%;min-width:0}
 .media-filters p{width:auto;min-width:0;margin:0}
 .media-filters select{width:100%;min-width:0;min-height:2.45rem;padding:.45rem 2.35rem .45rem .7rem;font-size:.74rem}
 .media-filters .publication-filter-pill-list{gap:.4rem}
 .media-filters .publication-filter-pill{padding:.32rem .62rem;font-size:.72rem}
}

/* Media archive: keep Type and Theme together above Year and Sort. */
.media-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"type theme" "year sort";gap:1rem 1.5rem;align-items:start}
.media-filters fieldset:nth-of-type(1){grid-area:type}
.media-filters fieldset:nth-of-type(2){grid-area:theme}
.media-filters p:nth-of-type(1){grid-area:year}
.media-filters p:nth-of-type(2){grid-area:sort}
.media-filters .publication-filter-pills{width:100%;min-width:0}
.media-filters .publication-filter-pill-list{overflow:visible}
.media-filters p{width:100%;min-width:0;margin:0}
.media-filters select{width:100%;min-width:0}
@media(max-width:700px){
 .media-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"type type" "theme theme" "year sort"}
}
/* Clear, centered archive pagination. */
.media-grid-archive + .pagination,.media-grid-archive ~ .pagination{display:flex;justify-content:center;margin:2.5rem auto 1rem}
.media-grid-archive ~ .pagination .nav-links{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:.5rem}
.media-grid-archive ~ .pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;min-width:2.75rem;min-height:2.75rem;padding:.5rem .8rem;border:1px solid #c5d0c4;border-radius:999px;background:#fff;color:var(--ink);font:600 .9rem/1 var(--ui);text-decoration:none}
.media-grid-archive ~ .pagination .page-numbers.current{background:var(--green-dark);border-color:var(--green-dark);color:#f5f1e8}
.media-grid-archive ~ .pagination a.page-numbers:hover,.media-grid-archive ~ .pagination a.page-numbers:focus-visible{background:var(--green-dark);border-color:var(--green-dark);color:#f5f1e8}

/* Keep media filter pills on one unbroken line; keep the next 30 button easy to find. */
.media-filters .publication-filter-pill-list{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden}
.publication-load-more{display:block;margin:1.5rem auto 0;min-width:8rem;text-align:center}
.media-filters .publication-filter-pill{flex:0 0 auto;white-space:nowrap}

/* Publication batches must stay hidden even though result cards use display:grid. */
.publication-results>.publication-result[hidden]{display:none!important}
.publication-load-more{display:block;margin:1.5rem auto 0;min-width:0;padding:.7rem 1.2rem;border:1px solid #b9c1b8;border-radius:999px;background:var(--white);color:var(--ink);font:500 .82rem/1.25 var(--ui);text-align:center;box-shadow:none;cursor:pointer}
.publication-load-more:hover,.publication-load-more:focus-visible{background:var(--green-dark);border-color:var(--green-dark);color:#f5f1e8}
/* Give Theme two thirds of the media filter row and Type one third. */
.media-filters{grid-template-columns:minmax(0,1fr) minmax(0,2fr)}
@media(max-width:700px){.media-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}

.media-filters fieldset:nth-of-type(1) .publication-filter-pill{padding:.32rem .48rem;font-size:.74rem}

/* Media search icon expands into a full-width query field. */
.media-filters{grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto;grid-template-areas:"type theme theme" "year sort search"}
.media-filters .media-search{grid-area:search;display:flex;align-items:center;gap:.65rem;min-width:0}
.media-search summary{list-style:none;display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:2.75rem;height:2.75rem;border:1px solid #c5d0c4;border-radius:50%;background:var(--white);color:var(--green-dark);cursor:pointer}
.media-search summary::-webkit-details-marker{display:none}
.media-search svg{display:block;width:1.2rem;height:1.2rem}
.media-search input[type=search]{flex:1;min-width:0;height:2.75rem;padding:.6rem .8rem;border:1px solid #c5d0c4;border-radius:999px;background:var(--white);color:var(--ink);font:500 .82rem/1.25 var(--ui)}
.media-search[open]{grid-column:1/-1;grid-row:3;width:100%;justify-self:stretch}
.media-grid-archive>.media-card[hidden]{display:none!important}
@media(max-width:700px){.media-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;grid-template-areas:"type type type" "theme theme theme" "year sort search"}.media-search[open]{grid-row:4}}

/* Keep expanded media search within its Year/Sort row; split the top row 1:2. */
.media-filters{grid-template-columns:repeat(12,minmax(0,1fr));grid-template-areas:"type type type type theme theme theme theme theme theme theme theme" "year year year sort sort sort sort sort sort search search search"}
.media-search[open]{grid-column:10/span3;grid-row:2;width:100%;justify-self:stretch;z-index:2}
/* Keep the filter groups on separate rows on narrow screens. */
@media(max-width:700px){.media-filters{grid-template-columns:repeat(12,minmax(0,1fr));grid-template-areas:"type type type type type type type type type type type type" "theme theme theme theme theme theme theme theme theme theme theme theme" "year year sort sort sort sort search search search search search search"}.media-search[open]{grid-column:7/span6;grid-row:3;width:100%}}
/* Publications filter groups do not need a divider between their rows. */
.publications-page .publication-filter-pills{border-bottom:0}

/* Final placement overrides for expanded media search. */
.media-search[open]{grid-column:10 / span 3;grid-row:2;width:100%;justify-self:stretch;z-index:3}
@media(max-width:700px){.media-search[open]{grid-column:7 / span 6;grid-row:3;width:100%}}

/* Mobile filter fixes: keep expanded searches clear of the other controls. */
@media(max-width:700px){.publications-page .publication-search[open]{grid-column:1/-1;grid-row:4;width:100%;justify-self:stretch;z-index:3}.media-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"type type" "theme theme" "year sort" "search search";column-gap:.65rem;row-gap:.65rem;align-items:stretch}.media-filters p:nth-of-type(1){grid-area:year}.media-filters p:nth-of-type(2){grid-area:sort}.media-filters .media-search{grid-area:search;grid-column:1/-1;grid-row:4;width:100%;justify-self:stretch}.media-filters .media-search[open]{grid-column:1/-1;grid-row:4;width:100%}.media-filters select{font-size:.8rem;padding-right:1.9rem}.media-filters p{min-width:0}.media-filters p label{font-size:.72rem;white-space:nowrap}}
