﻿/* =============================================================================
   ECLIPSE Practices
   Stylesheet for the [eclipse_practices] shortcode. Scoped to .ecl-practices.
   ============================================================================= */

.ecl-practices {
    /* Brand — swap these to match the ECLIPSE site palette */
    --ecl-brand:        #281ab2;   /* ECLIPSE blue */
    --ecl-brand-dark:   #540fb7;   /* ECLIPSE purple */
    --ecl-accent:       #f0047f;   /* ECLIPSE pink */
    --ecl-green:        #75cb6e;   /* ECLIPSE green */
    --ecl-navy:         #12114a;   /* dark page background, used for card borders */
    --ecl-brand-soft:   rgba(40, 26, 178, .08);

    --ecl-fg:           #1f2937;
    --ecl-fg-soft:      #4b5563;
    --ecl-muted:        #6b7280;
    --ecl-border:       #d9dee5;
    --ecl-bg-soft:      #f6f8fa;

    --ecl-good:         #1d6b1a;
    --ecl-good-bg:      #e0f4df;   /* green #75cb6e tint */
    --ecl-promising:    #00638a;
    --ecl-promising-bg: #d9f1fb;   /* cyan #00b2e6 tint */
    --ecl-interesting:  #6b5f00;
    --ecl-interesting-bg: #faf4c2; /* yellow #e2cd00 tint */

    --ecl-radius:       5px;

    /* White card, like the content boxes on the ECLIPSE site (page background is dark) */
    background: #fff;
    border-radius: 18px;

    font: inherit;     /* typography (family, size, weight, line-height) comes from the theme */
    color: var(--ecl-fg);
}
.ecl-practices *, .ecl-practices *::before, .ecl-practices *::after { box-sizing: border-box; }
.ecl-practices [x-cloak] { display: none !important; }

.ecl-practices__status { padding: 2rem; text-align: center; color: var(--ecl-muted); }

/* ─── Filters ─────────────────────────────────────────────────────────────── */
/* Light grey hairlines around the filters; they collapse together with the panel. */
.ecl-collapse {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows .3s ease;
}
.ecl-collapse.is-closed { grid-template-rows: 0fr; }
.ecl-collapse__inner { min-height: 0; overflow: hidden; }
.ecl-collapse__inner.is-settled { overflow: visible; }
.ecl-practices__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--ecl-border);
    border-bottom: 1px solid var(--ecl-border);
}
.ecl-field { display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 180px; min-width: 0; }
.ecl-field--search { flex: 1 1 100%; }
.ecl-field > label {
    color: var(--ecl-brand);
}
.ecl-field input[type=search],
.ecl-field select {
    width: 100%;
    height: 42px;
    padding: 0 0.75rem;
    font: inherit;
    color: inherit;
    font-size: inherit;
    background: #fff;
    border: 1px solid var(--ecl-border);
    border-radius: var(--ecl-radius);
    transition: border-color .15s, box-shadow .15s;
}
.ecl-field select { cursor: pointer; }
.ecl-field input[type=search]:focus,
.ecl-field select:focus {
    outline: 0;
    border-color: var(--ecl-brand);
    box-shadow: 0 0 0 3px rgba(40, 26, 178, .18);
}
.ecl-practices__link {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--ecl-brand);
    cursor: pointer;
}
.ecl-practices__link:hover { color: var(--ecl-accent); }
.ecl-practices__chev { width: 16px; height: 16px; transition: transform .2s; }
.ecl-practices__chev.is-up { transform: rotate(180deg); }

/* Results bar: count on the left, filter actions on the right */
.ecl-practices__bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.75rem 0 1rem;
}
.ecl-practices__count { margin: 0; color: var(--ecl-fg-soft); }
.ecl-practices__count strong { color: var(--ecl-fg); }
.ecl-practices__actions { display: flex; align-items: baseline; gap: 1.25rem; }

/* ─── List / accordion ────────────────────────────────────────────────────── */
.ecl-practices__list { display: flex; flex-direction: column; gap: 0.75rem; }

.ecl-item {
    background: #fff;
    border: 1px solid rgba(18, 17, 74, .35);
    border-radius: 8px;
    
}

.ecl-item__head {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.6rem 2rem;
}
.ecl-item__head:focus-within { outline: 2px solid var(--ecl-brand); outline-offset: -2px; border-radius: 8px; }
.ecl-item__headmain { display: flex; flex-direction: column; gap: 0.8rem; min-width: 0; }
/* Title is a real heading (h3): size/weight/colour come from the theme */
.ecl-item__title { margin: 0; }
.ecl-item__toggle {
    appearance: none; background: none; border: 0; padding: 0; margin: 0;
    font: inherit; color: inherit; text-align: left; cursor: pointer; transition: color .15s;
}
.ecl-item__toggle:focus { outline: 0; }
/* Stretch the click target over the whole header row */
.ecl-item__toggle::after { content: ""; position: absolute; inset: 0; }
.ecl-item__head:hover .ecl-item__toggle { color: var(--ecl-accent); }
.ecl-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    color: var(--ecl-fg-soft);
}
.ecl-item__label { color: var(--ecl-muted); }
.ecl-item__chevron {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 0.15rem;
    color: var(--ecl-fg-soft);
    transition: transform .2s;
}
.ecl-item.is-open .ecl-item__chevron { transform: rotate(180deg); }

/* Pills */
.ecl-pill {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.88em;
    line-height: 1.4;
    background: #eceff3;
    color: var(--ecl-fg-soft);
    white-space: nowrap;
}
/* Classification colours as in the Excel inventory */
.ecl-pill--good-practice        { background: #92d050; color: #111; }
.ecl-pill--promising-practice   { background: #00b0f0; color: #111; }
.ecl-pill--interesting-practice { background: #e59bdc; color: #111; }
/* Practice categories: neutral, so the classification colour stays the only accent */
.ecl-pill--cat { background: #eef0f4; color: var(--ecl-fg-soft); }

/* Expanded body */
.ecl-item__body { padding: 0 2rem 2.25rem; border-top: 1px solid var(--ecl-border); }
.ecl-item__desc { margin: 1.75rem 0 2.25rem; color: var(--ecl-fg-soft); }

.ecl-item__cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 2.5rem;
}
@media (max-width: 860px) { .ecl-item__cols { grid-template-columns: 1fr; gap: 0; } }
.ecl-item__col dl { margin: 0 0 1.75rem; }
.ecl-item__col dt { color: var(--ecl-fg); }
.ecl-item__col dd { margin: 0.35em 0 0; color: var(--ecl-fg-soft); overflow-wrap: anywhere; }

.ecl-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.ecl-links a { color: var(--ecl-brand); text-decoration: underline; }
.ecl-links a:hover { color: var(--ecl-brand-dark); }

/* Criteria checklist */
.ecl-criteria {
    margin-top: 1rem;
    padding: 1.75rem 0 0;
    border-top: 1px solid var(--ecl-border);
}
.ecl-criteria__head { color: var(--ecl-fg-soft); margin-bottom: 1.25rem; }
.ecl-criteria__head strong { color: var(--ecl-fg); }

@media (max-width: 560px) {
    .ecl-item__head { padding: 1.25rem; }
    .ecl-item__body { padding: 0 1.25rem 1.5rem; }
}

/* --- Multi-select dropdowns ---------------------------------------------- */
.ecl-multi { position: relative; }
.ecl-multi__btn {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    width: 100%; height: 42px; padding: 0 0.75rem;
    font: inherit; color: inherit; text-align: left;
    background: #fff; border: 1px solid var(--ecl-border); border-radius: var(--ecl-radius);
    cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.ecl-multi__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecl-multi__btn svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--ecl-muted); transition: transform .2s; }
.ecl-multi__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.ecl-multi__btn:focus-visible,
.ecl-multi__btn[aria-expanded="true"] { outline: 0; border-color: var(--ecl-brand); box-shadow: 0 0 0 3px rgba(40, 26, 178, .18); }
.ecl-multi__panel {
    position: absolute; z-index: 20; top: calc(100% + 4px); left: 0;
    min-width: 100%; width: max-content; max-width: min(360px, 90vw);
    display: flex; flex-direction: column; gap: 0.1rem;
    padding: 0.4rem; background: #fff;
    border: 1px solid var(--ecl-border); border-radius: var(--ecl-radius);
    box-shadow: 0 8px 24px rgba(17, 24, 39, .14);
}
.ecl-check { display: flex; align-items: baseline; gap: 0.5em; padding: 0.4rem 0.5rem; border-radius: 4px; cursor: pointer; }
.ecl-check:hover { background: var(--ecl-bg-soft); }
.ecl-check input { accent-color: var(--ecl-brand); margin: 0; flex-shrink: 0; }

/* --- Criteria icons in the expanded card (icon-box style, blue + pink) --- */
.ecl-icons {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 2rem 1.25rem;
}
.ecl-icons li { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.ecl-ico { width: 64px; height: 64px; }
.ecl-fb { fill: #281ab2; }
.ecl-fp { fill: #f0047f; }
