/* ==========================================================================
   Subject areas list view (controlledvocabulary/subjectAreas.jsp)
   Loaded only inside the #subList iframe of controlledvocabulary/search.jsp.
   Overrides the legacy .cvItem / .cvExpandIcon rules from styles.css.
   ========================================================================== */

body {
    background: transparent;
    margin: 0;
    padding: 12px;
    box-sizing: border-box;
}

ul.controlledvocabulary {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.controlledvocabulary li {
    margin: 0;
}

/* Each category row: a chevron button (.cvToggle) that opens/closes the
   subcategories and a button (.cvSelect) over the rest of the row that
   selects/deselects the category. */
.cvItem {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 0 0 8px;
    border-radius: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    transition: background 0.2s, border-color 0.2s;
}

.cvItem:hover {
    background: rgba(229, 137, 53, 0.35);
    border-color: rgba(229, 137, 53, 0.7);
}

.cvItem.selected {
    background: rgba(229, 137, 53, 0.55);
    border-color: rgba(229, 137, 53, 0.9);
    box-shadow: -3px 3px 6px rgba(0, 0, 0, 0.4);
}

.cvToggle,
.cvSelect {
    margin: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.cvToggle:focus-visible,
.cvSelect:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
    border-radius: 8px;
}

/* Chevron: points down when the subcategories are open */
.cvToggle,
.cvDot {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cvToggle::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f054";
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s, transform 0.2s;
}

.cvToggle[aria-expanded="true"]::before {
    transform: rotate(90deg);
}

.cvToggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cvToggle:hover::before {
    color: rgba(229, 137, 53, 1);
}

/* Last level: a dot instead of the chevron */
.cvDot::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f111";
    font-size: 6px;
    color: rgba(255, 255, 255, 0.5);
}

.cvItem.selected .cvToggle::before,
.cvItem.selected .cvDot::before {
    color: #ffffff;
}

.cvSelect {
    flex: 1;
    min-width: 0;
    padding: 12px 16px 12px 6px;
    text-align: left;
}

.cvItem .value {
    height: auto;   /* styles.css gives it 20px */
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Subcategories: indented under their parent, a bit smaller */
#list ul.cvSub {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0 0 24px;
    padding: 0;
}

.cvItem.cvLevel2 .cvSelect,
.cvItem.cvLevel3 .cvSelect {
    padding-top: 9px;
    padding-bottom: 9px;
}

.cvItem.cvLevel2 .value {
    font-size: clamp(12px, 1.1vw, 15px);
}

.cvItem.cvLevel3 .value {
    font-size: clamp(12px, 1vw, 14px);
}

@media (max-width: 600px) {
    #list ul.cvSub {
        margin-left: 14px;
    }
}
