/* ============================================================
   T1 Filterable List
   /modules/t1_filterable_list/style.css
   ============================================================ */

.t1-fl {
    margin: 2rem 0;
}

/* The HTML `hidden` attribute must always hide. Author rules like
   `display: grid` on .t1-fl__item would otherwise win on equal-specificity
   selectors against the UA `[hidden]` rule. Use a class+attr selector
   (specificity 0,2,0) so it beats any single-class rule below. */
.t1-fl [hidden],
.t1-fl[hidden] {
    display: none;
}

.t1-fl--error {
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--gold, #c9a14a);
    background: var(--pearl, #f4f1e8);
    color: var(--ink, #1a1a1a);
    font-size: 0.9375rem;
}

/* ---- Header ---- */
.t1-fl__header {
    margin-bottom: 1.5rem;
}
.t1-fl__heading {
    margin: 0 0 0.5rem;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
    color: var(--ink, #1a1a1a);
}
.t1-fl--dark .t1-fl__heading {
    color: var(--cream, #faf7ef);
}
.t1-fl__intro {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--charcoal, #3a3a3a);
    max-width: 65ch;
}
.t1-fl--dark .t1-fl__intro {
    color: var(--pearl, #d8d4c8);
}

/* ---- Filter panel ---- */
.t1-fl__filters {
    margin: 0 0 1.25rem;
    border: 1px solid var(--stone, #c8c4b8);
    border-radius: var(--radius, 6px);
    background: var(--cream, #faf7ef);
}
.t1-fl--dark .t1-fl__filters {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}
.t1-fl__filters-summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--jade-dark, #1c4a3a);
    user-select: none;
}
.t1-fl--dark .t1-fl__filters-summary {
    color: var(--cream, #faf7ef);
}
.t1-fl__filters-summary::-webkit-details-marker { display: none; }
.t1-fl__filters-summary::marker { display: none; content: ''; }
.t1-fl__filters-summary::before {
    content: '+';
    display: inline-block;
    width: 1em;
    margin-right: 0.25em;
    font-weight: 700;
    transition: transform 150ms ease;
}
.t1-fl__filters[open] .t1-fl__filters-summary::before {
    content: '−';
}

.t1-fl__filters-form {
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--stone, #c8c4b8);
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.t1-fl--dark .t1-fl__filters-form {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.t1-fl__filter {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.t1-fl__filter-legend {
    padding: 0;
    margin: 0 0 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink, #1a1a1a);
}
.t1-fl--dark .t1-fl__filter-legend {
    color: var(--cream, #faf7ef);
}
.t1-fl__filter-legend--child {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--charcoal, #3a3a3a);
}
.t1-fl--dark .t1-fl__filter-legend--child {
    color: var(--pearl, #d8d4c8);
}

.t1-fl__filter--yesno {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
}
.t1-fl__filter--yesno .t1-fl__filter-legend {
    flex-basis: 100%;
}

.t1-fl__filter--text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.t1-fl__filter--group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius, 6px);
}
.t1-fl--dark .t1-fl__filter--group {
    background: rgba(255, 255, 255, 0.04);
}
.t1-fl__filter--child {
    padding: 0.4rem 0.6rem;
    background: var(--cream, #faf7ef);
    border-radius: var(--radius, 6px);
}
.t1-fl--dark .t1-fl__filter--child {
    background: rgba(0, 0, 0, 0.25);
}

.t1-fl__filter-option {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--charcoal, #3a3a3a);
}
.t1-fl--dark .t1-fl__filter-option {
    color: var(--pearl, #d8d4c8);
}
.t1-fl__filter-option input {
    margin: 0;
    flex-shrink: 0;
}
.t1-fl__filter-count {
    color: var(--charcoal, #6a6a6a);
    font-size: 0.8em;
}
.t1-fl--dark .t1-fl__filter-count {
    color: rgba(255, 255, 255, 0.5);
}

.t1-fl__filter-actions {
    margin: 0.5rem 0 0;
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.t1-fl__apply {
    appearance: none;
    background: var(--jade, #2e6b54);
    color: var(--cream, #faf7ef);
    border: 1px solid var(--jade, #2e6b54);
    border-radius: var(--radius, 6px);
    padding: 0.5rem 1.25rem;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, transform 100ms ease;
}
.t1-fl__apply:hover,
.t1-fl__apply:focus-visible {
    background: var(--jade-dark, #1c4a3a);
    border-color: var(--jade-dark, #1c4a3a);
}
.t1-fl__apply:active {
    transform: translateY(1px);
}
.t1-fl__clear {
    appearance: none;
    background: transparent;
    border: 1px solid var(--stone, #c8c4b8);
    border-radius: var(--radius, 6px);
    padding: 0.4rem 0.85rem;
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--jade-dark, #1c4a3a);
    transition: background 150ms ease, border-color 150ms ease;
}
.t1-fl__clear:hover,
.t1-fl__clear:focus-visible {
    background: var(--jade-light, #e3eee9);
    border-color: var(--jade, #2e6b54);
}
.t1-fl--dark .t1-fl__clear {
    color: var(--cream, #faf7ef);
    border-color: rgba(255, 255, 255, 0.2);
}
.t1-fl--dark .t1-fl__clear:hover,
.t1-fl--dark .t1-fl__clear:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ---- Status counter ---- */
.t1-fl__status {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--charcoal, #6a6a6a);
}
.t1-fl--dark .t1-fl__status {
    color: var(--pearl, #d8d4c8);
}

/* ---- Items list ---- */
.t1-fl__items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.t1-fl__item {
    padding: 1.25rem;
    background: var(--cream, #faf7ef);
    border: 1px solid var(--stone, #c8c4b8);
    border-radius: var(--radius, 6px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
.t1-fl--dark .t1-fl__item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ---- Image column (position set by admin: t1-fl--img-right / t1-fl--img-left) ----
   Explicit grid placement, so the DOM order (image first) doesn't matter.
   --t1-fl-img-w is the image column width (64px mobile, 120px from 640px). */
.t1-fl {
    --t1-fl-img-w: 64px;
}
.t1-fl__item--has-image {
    column-gap: 1rem;
}
.t1-fl__name    { grid-row: 1; }
.t1-fl__details { grid-row: 2; }
.t1-fl__image-link,
.t1-fl__item > .t1-fl__image {
    grid-row: 1 / span 2;
    align-self: start;
}

/* Right (default) */
.t1-fl--img-right .t1-fl__item--has-image {
    grid-template-columns: 1fr var(--t1-fl-img-w);
}
.t1-fl--img-right .t1-fl__name,
.t1-fl--img-right .t1-fl__details {
    grid-column: 1;
}
.t1-fl--img-right .t1-fl__image-link,
.t1-fl--img-right .t1-fl__item > .t1-fl__image {
    grid-column: 2;
    justify-self: end;
}

/* Left */
.t1-fl--img-left .t1-fl__item--has-image {
    grid-template-columns: var(--t1-fl-img-w) 1fr;
}
.t1-fl--img-left .t1-fl__item--has-image .t1-fl__name,
.t1-fl--img-left .t1-fl__item--has-image .t1-fl__details {
    grid-column: 2;
}
.t1-fl--img-left .t1-fl__image-link,
.t1-fl--img-left .t1-fl__item > .t1-fl__image {
    grid-column: 1;
    justify-self: start;
}
.t1-fl__image-link {
    display: block;
    line-height: 0;
}
.t1-fl__image {
    width: 100%;
    height: auto;
    max-height: 64px;
    object-fit: contain;   /* never crop a logo */
    display: block;
}

.t1-fl__name {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.3;
    color: var(--ink, #1a1a1a);
}
.t1-fl--dark .t1-fl__name {
    color: var(--cream, #faf7ef);
}
.t1-fl__name a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;   /* visible so it reads as a link */
    transition: border-color 150ms ease, opacity 150ms ease;
}
.t1-fl__name a:hover,
.t1-fl__name a:focus-visible {
    opacity: 0.75;
}
.t1-fl__name a:hover,
.t1-fl__name a:focus-visible {
    border-bottom-color: currentColor;
}

/* ---- Detail rows (dl as grid) ---- */
.t1-fl__details {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1rem;
    row-gap: 0.4rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.t1-fl__detail-label {
    margin: 0;
    font-weight: 600;
    color: var(--charcoal, #3a3a3a);
}
.t1-fl--dark .t1-fl__detail-label {
    color: var(--pearl, #d8d4c8);
}
.t1-fl__detail-value {
    margin: 0;
    color: var(--ink, #1a1a1a);
    min-width: 0;
}
.t1-fl--dark .t1-fl__detail-value {
    color: var(--cream, #faf7ef);
}

.t1-fl__subitems {
    margin: 0;
    padding-left: 1.1em;
    list-style: disc;
}
.t1-fl__subitems li {
    margin: 0.1em 0;
}

/* ---- Empty state ---- */
.t1-fl__empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--charcoal, #6a6a6a);
    background: var(--pearl, #f4f1e8);
    border-radius: var(--radius, 6px);
}
.t1-fl--dark .t1-fl__empty {
    color: var(--pearl, #d8d4c8);
    background: rgba(255, 255, 255, 0.04);
}

/* ---- Show more ---- */
.t1-fl__more {
    margin: 1.25rem 0 0;
    text-align: center;
}
.t1-fl__more-btn {
    appearance: none;
    background: var(--jade, #2e6b54);
    color: var(--cream, #faf7ef);
    border: 0;
    border-radius: var(--radius, 6px);
    padding: 0.6rem 1.4rem;
    font: inherit;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 150ms ease;
}
.t1-fl__more-btn:hover,
.t1-fl__more-btn:focus-visible {
    background: var(--jade-dark, #1c4a3a);
}

/* ---- Responsive: filters in columns + items in grid ---- */
@media (min-width: 640px) {
    .t1-fl__filters-form {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        align-items: start;
    }
    .t1-fl__item {
        align-items: start;
    }
    .t1-fl {
        --t1-fl-img-w: 120px;
    }
    .t1-fl__image {
        max-height: 120px;
    }
}

@media (min-width: 1024px) {
    .t1-fl__items {
        grid-template-columns: 1fr;
    }
}

/* ---- Active filter chips ---- */
.t1-fl__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}
.t1-fl__chip {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
    border: 1px solid var(--jade, #2e6b54);
    border-radius: 999px;
    background: var(--jade-light, #e3eee9);
    color: var(--jade-dark, #1c4a3a);
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.2;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.t1-fl__chip:hover,
.t1-fl__chip:focus-visible {
    background: var(--jade, #2e6b54);
    color: var(--cream, #faf7ef);
    border-color: var(--jade-dark, #1c4a3a);
}
.t1-fl__chip-text {
    white-space: nowrap;
}
.t1-fl__chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.12);
    font-size: 0.95em;
    line-height: 1;
    font-weight: 600;
}
.t1-fl__chip:hover .t1-fl__chip-x,
.t1-fl__chip:focus-visible .t1-fl__chip-x {
    background: rgba(255, 255, 255, 0.25);
}
.t1-fl--dark .t1-fl__chip {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    color: var(--cream, #faf7ef);
}
.t1-fl--dark .t1-fl__chip:hover,
.t1-fl--dark .t1-fl__chip:focus-visible {
    background: var(--jade, #2e6b54);
    border-color: var(--jade, #2e6b54);
}
.t1-fl--dark .t1-fl__chip-x {
    background: rgba(255, 255, 255, 0.18);
}

/* ---- Active-filter count badge on the panel summary ---- */
.t1-fl__active-count {
    display: inline-block;
    margin-left: 0.5em;
    padding: 0.1em 0.55em;
    border-radius: 999px;
    background: var(--jade, #2e6b54);
    color: var(--cream, #faf7ef);
    font-size: 0.78em;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
}
.t1-fl--dark .t1-fl__active-count {
    background: var(--jade-light, #e3eee9);
    color: var(--jade-dark, #1c4a3a);
}

/* ---- Live status mirror inside the summary ---- */
.t1-fl__summary-status {
    display: inline-block;
    margin-left: 0.6em;
    font-size: 0.85em;
    font-weight: 400;
    color: var(--charcoal, #6a6a6a);
    transition: color 250ms ease;
}
.t1-fl--dark .t1-fl__summary-status {
    color: var(--pearl, #d8d4c8);
}
.t1-fl__summary-status[data-fl-just-updated="1"] {
    color: var(--jade-dark, #1c4a3a);
    font-weight: 600;
}
.t1-fl--dark .t1-fl__summary-status[data-fl-just-updated="1"] {
    color: var(--cream, #faf7ef);
}

/* ---- Status counter highlight on change ---- */
.t1-fl__status {
    transition: color 250ms ease;
}
.t1-fl__status[data-fl-just-updated="1"] {
    color: var(--jade-dark, #1c4a3a);
    font-weight: 600;
}
.t1-fl--dark .t1-fl__status[data-fl-just-updated="1"] {
    color: var(--cream, #faf7ef);
}
