/* Shared resource browser. The full directory uses the theme's sheet and card grid. */
.af-resources { min-width: 0; color: var(--af-text); font: 400 16px/1.5 var(--af-font); }
.af-resources [hidden] { display: none !important; }
.af-resources button, .af-resources input, .af-resources select { font: inherit; }
.af-resources button { cursor: pointer; }
.af-resources__form { margin: 0; }
.af-resources__form label { display: block; margin-bottom: 8px; color: var(--af-primary); font-weight: 600; }
.af-resources__search-row { display: flex; gap: 8px; }
.af-resources__search-row input { flex: 1 1 0; min-width: 0; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--af-field-line); border-radius: var(--af-radius-control); background: #fff; color: var(--af-text); font-size: 16px; }
.af-resources__search-row input::placeholder { color: #666; opacity: 1; }
.af-resources__search-row button { flex: none; min-height: 48px; padding: 10px 18px; border: 1px solid var(--af-primary); border-radius: var(--af-radius-control); background: var(--af-primary); color: #fff; font-weight: 500; }
.af-resources__search-row button:hover { background: var(--af-link); }
.af-resources .af-resources__hint { margin: 8px 0 0; color: var(--af-chrome-text); font-size: 14px; line-height: 1.5; }
.af-resources__groups { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.af-resources__groups button { min-height: 44px; padding: 9px 14px; border: 1px solid var(--af-line); border-radius: var(--af-radius-control); background: #fff; color: var(--af-primary); text-align: left; line-height: 1.4; }
.af-resources__groups button:hover { border-color: var(--af-primary); background: var(--af-tint); }
.af-resources__groups button[aria-pressed="true"] { border-color: var(--af-primary); background: var(--af-primary); color: #fff; }
.af-resources .af-resources__status { margin: 20px 0 0; font-size: 15px; line-height: 1.5; }
.af-resources__status:empty { display: none; }
.af-resources__browse { margin-top: 32px; }
.af-resources__section { min-width: 0; }
.af-resources__section + .af-resources__section { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--af-line); }
.af-resources__section[hidden] + .af-resources__section { margin-top: 0; padding-top: 0; border-top: 0; }
.af-resources__section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 12px; }
.af-resources__section-heading h2 { margin: 0; color: var(--af-primary); font: 600 25px/1.3 var(--af-font-slab); }
.af-resources__directory { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; line-height: 1.4; text-decoration: underline; text-underline-offset: .2em; }
.af-resources .af-resources__section-intro { margin: 0 0 24px; max-width: 720px; color: var(--af-chrome-text); }
.af-sheet .af-resources .af-resources__items { margin: 0; }
.af-sheet .af-resources .af-resources__item { display: grid; grid-template-rows: auto auto 1fr; grid-row: auto; gap: 0; padding: 22px 20px; }
.af-sheet .af-resources .af-resources__icon { margin: 0 0 16px; }
.af-sheet .af-resources .af-resources__icon img { width: 85px; height: 85px; object-fit: contain; }
.af-sheet .af-resources .af-resources__item .wp-block-heading { margin: 0 0 12px; font: 600 21px/1.35 var(--af-font-slab); text-wrap: pretty; }
.af-sheet .af-resources .af-resources__item p { margin: 0; font-size: 16px; line-height: 1.6; }
.af-resources--page { margin-top: 28px; }
.af-resources--page .af-resources__form { padding: 24px; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: var(--af-tan-pale); }
.af-resources--page .af-resources__form label { font: 600 22px/1.35 var(--af-font-slab); margin-bottom: 12px; }
.af-resources--page .af-resources__search-row input { min-height: 52px; }
.af-resources--page .af-resources__groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.af-resources--page .af-resources__groups button { min-height: 52px; padding: 12px 16px; border: 2px solid var(--af-primary); background: var(--af-tan-pale); font-size: 17px; font-weight: 600; text-align: center; }
.af-resources--page .af-resources__groups button:hover { background: var(--af-tint); }
.af-resources--page .af-resources__groups button[aria-pressed="true"] { background: var(--af-primary); color: #fff; }

/* Search results and filters are filled by the shared public PDF-text search. */
.af-resources__results { margin-top: 24px; min-width: 0; }
.af-resource-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 20px; }
.af-resource-filters label { display: grid; flex: 1 1 200px; min-width: 0; gap: 6px; color: var(--af-primary); font-size: 15px; font-weight: 500; }
.af-resource-filters__field { flex: 1 1 200px; min-width: 0; }
.af-resource-filters select { min-width: 0; width: 100%; min-height: 44px; padding: 8px 30px 8px 10px; border: 1px solid var(--af-field-line); border-radius: var(--af-radius-control); background: #fff; color: var(--af-text); font-size: 16px; }
.af-resource-results__list { margin: 0; padding: 0; list-style: none; }
.af-resource-result { position: relative; min-width: 0; padding: 20px 0; border-top: 1px solid var(--af-line); }
.af-resource-result:first-child { padding-top: 0; border-top: 0; }
.af-resource-result__meta { margin: 0 0 6px; color: var(--af-chrome-text); font-size: 14px; line-height: 1.5; }
.af-resource-result__note { margin: 8px 0 0; color: var(--af-chrome-text); font-size: 14px; line-height: 1.5; }
.af-resource-results__note, .af-resource-results__empty { margin: 16px 0 0; color: var(--af-chrome-text); font-size: 16px; line-height: 1.5; }
.af-resource-fallback { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: .2em; }
.af-resource-result__title { margin: 0 0 8px; font: 600 22px/1.35 var(--af-font-slab); overflow-wrap: anywhere; }
.af-resource-result__title a { text-decoration: underline; text-underline-offset: .15em; }
.af-resource-result__snippet { margin: 0 0 12px; color: var(--af-text); font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.af-resource-result__snippet mark { padding: 0 2px; background: #f4dfb6; color: inherit; }
.af-resource-result__links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; }
.af-resource-result__links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; text-decoration: underline; text-underline-offset: .2em; }
.af-resources__more { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 16px; padding: 10px 16px; border: 1px solid var(--af-primary); border-radius: var(--af-radius-control); font-weight: 500; text-align: center; }
.af-resources__more:hover { background: var(--af-tint); }
.af-resource-pagination { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; }
.af-resource-pagination button { min-height: 44px; min-width: 44px; padding: 8px 14px; border: 1px solid var(--af-line); border-radius: var(--af-radius-control); background: #fff; color: var(--af-primary); }
.af-resource-pagination button[aria-current="page"] { border-color: var(--af-primary); background: var(--af-primary); color: #fff; }
.af-resource-pagination button:disabled { cursor: default; opacity: .55; }

@media (max-width: 767px) {
	.af-resources--page .af-resources__form { padding: 18px 16px; }
	.af-resources--page .af-resources__form label { font-size: 20px; }
	.af-resources--page .af-resources__groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.af-resources--page .af-resources__groups button { padding: 12px 10px; font-size: 16px; }
	.af-resources__section-heading h2 { font-size: 23px; }
	.af-resources__section + .af-resources__section { margin-top: 36px; padding-top: 32px; }
	.af-sheet .af-resources .af-resources__item { grid-template: auto auto / 64px minmax(0, 1fr); gap: 12px 16px; align-items: center; padding: 20px 16px; }
	.af-sheet .af-resources .af-resources__icon { grid-area: 1 / 1; margin: 0; }
	.af-sheet .af-resources .af-resources__icon img { width: 64px; height: 64px; }
	.af-sheet .af-resources .af-resources__item .wp-block-heading { grid-area: 1 / 2; margin: 0; }
	.af-sheet .af-resources .af-resources__item p { grid-area: 2 / 1 / auto / -1; }
	.af-resource-result__title { font-size: 20px; }
}
@media (max-width: 420px) {
	.af-resources__search-row { gap: 6px; }
	.af-resources__search-row button { padding-inline: 10px; }
	.af-resources__groups { gap: 6px; }
	.af-resources__groups button { flex: 1 1 calc(50% - 6px); padding-inline: 10px; }
	.af-resource-filters label { flex-basis: 100%; }
	.af-resource-filters__field { flex-basis: 100%; }
}
@media print {
	.af-resources__form, .af-resources__groups, .af-resources__more, .af-resource-filters, .af-resource-pagination { display: none; }
	.af-resources__item { break-inside: avoid; }
}
