/* ==========================================================================
   Listing pages (notices, downloads) — reuses the home page design tokens.
   ========================================================================== */

.kiu-listing .kiu-section {
    background: var(--kiu-surface);
}

/* The hero supplies these pages' clearance under the fixed navbar; it must sit
   flush against the content below rather than adding a second gap. */
.kiu-listing .kiu-page-hero + .kiu-section {
    margin-top: 0;
}

/* Filters ---------------------------------------------------------------- */

.kiu-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}

.kiu-filter {
    padding: 10px 20px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-pill);
    background: var(--kiu-white);
    font-size: 14px;
    font-weight: 550;
    color: var(--kiu-body);
    transition: background-color var(--kiu-dur) var(--kiu-ease-out), color var(--kiu-dur) var(--kiu-ease-out), border-color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-filter:hover {
    border-color: var(--kiu-navy);
    color: var(--kiu-navy);
}

.kiu-filter.is-active {
    background: var(--kiu-navy);
    border-color: var(--kiu-navy);
    color: var(--kiu-white);
}

/* Scope switch (Current / Archive) — a segmented control: one white pill
   holding both options, the active one filled blue. Lives inside the search
   bar, pushed right so it sits level with the field. */

.kiu-filters--scope {
    margin-bottom: 0;
    margin-left: auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    padding: 5px;
    border-radius: var(--kiu-radius-pill);
    background: var(--kiu-white);
    box-shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 6px 16px rgba(20, 33, 61, .07);
}

/* Reset the standalone chip styling — inside the segment the options carry no
   border of their own; the container supplies the frame. */
.kiu-filters--scope .kiu-filter {
    padding: 9px 22px;
    border: 0;
    border-radius: var(--kiu-radius-pill);
    background: transparent;
    font-weight: 600;
    color: var(--kiu-muted);
}

.kiu-filters--scope .kiu-filter:hover {
    color: var(--kiu-navy);
}

.kiu-filters--scope .kiu-filter.is-active {
    background: var(--kiu-navy);
    color: var(--kiu-white);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(27, 58, 107, .28);
}

@media (max-width: 575px) {
    .kiu-filters--scope {
        margin-left: 0;
        width: 100%;
    }

    .kiu-filters--scope .kiu-filter {
        flex: 1 1 0;
        text-align: center;
    }
}

/* Notice title link. The whole row is clickable, but it cannot simply be
   wrapped in an <a> — it already contains the View and Download links, and
   nested anchors are invalid HTML. So the title link is stretched over the row
   with an ::after overlay instead; the action buttons are lifted back above it
   below, which keeps them separate click targets. */

.kiu-notice-list--full .kiu-notice-row__text {
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.kiu-notice-list--full .kiu-notice-row__text::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.kiu-notice-list--full .kiu-notice-row__title i {
    font-size: 14px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--kiu-dur-fast) var(--kiu-ease-out), transform var(--kiu-dur-fast) var(--kiu-ease-out);
    display: inline-block;
    vertical-align: -1px;
}

.kiu-notice-list--full .kiu-notice-row:hover .kiu-notice-row__title i {
    opacity: 1;
    transform: translateX(0);
}

/* Notice rows ------------------------------------------------------------ */

.kiu-notice-list--full .kiu-notice-row {
    /* Containing block for the stretched title link above. */
    position: relative;
    cursor: pointer;
}

/* Raised above the stretched link so View/Download stay reachable. The two
   selectors are the main listing (__actions, icon pair) and the departmental
   listing (__download, single labelled button). */
.kiu-notice-list--full .kiu-notice-row__actions,
.kiu-notice-list--full .kiu-notice-row__download {
    position: relative;
    z-index: 1;
}

/* The listing keeps the home page's hover exactly — scale plus shadow, no
   recolouring. This rule used to cancel the transform outright, back when the
   hover was a sideways nudge that fought the stretched title link. */
.kiu-notice-list--full .kiu-notice-row:hover {
    transform: scale(var(--kiu-scale-hover-sm));
}

.kiu-notice-row__download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    padding: 10px 18px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-pill);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--kiu-navy);
    transition: background-color var(--kiu-dur) var(--kiu-ease-out), color var(--kiu-dur) var(--kiu-ease-out), border-color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-notice-row__download:hover {
    background: var(--kiu-navy);
    border-color: var(--kiu-navy);
    color: var(--kiu-white);
}

.kiu-empty {
    padding: 60px 0;
    text-align: center;
    font-size: 16px;
    color: var(--kiu-muted);
}

@media (max-width: 767px) {
    .kiu-notice-row__download span {
        display: none;
    }

    .kiu-notice-row__download {
        padding: 10px 12px;
    }
}

/* Search + advanced filters (notices) ------------------------------------- */

.kiu-search {
    margin-bottom: 32px;
}

.kiu-search__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.kiu-search__field {
    position: relative;
    flex: 1 1 260px;
    min-width: 0;
}

.kiu-search__field input {
    width: 100%;
    height: 46px;
    /* Right padding clears the submit button sitting inside the field. */
    padding: 0 56px 0 20px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-pill);
    background: var(--kiu-white);
    font-size: 14px;
    color: var(--kiu-ink);
    transition: border-color var(--kiu-dur) var(--kiu-ease-out), box-shadow var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-search__field input::placeholder {
    color: var(--kiu-muted);
}

.kiu-search__field input:focus {
    outline: none;
    border-color: var(--kiu-navy);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, .10);
}

.kiu-search__toggle {
    height: 46px;
    padding: 0 22px;
    border-radius: var(--kiu-radius-pill);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color var(--kiu-dur) var(--kiu-ease-out), color var(--kiu-dur) var(--kiu-ease-out), border-color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-search__toggle {
    border: 1px solid var(--kiu-border);
    background: var(--kiu-white);
    color: var(--kiu-body);
}

.kiu-search__toggle:hover,
.kiu-search__toggle.is-active {
    border-color: var(--kiu-navy);
    color: var(--kiu-navy);
}

.kiu-search__chevron {
    font-size: 16px;
    transition: transform var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-search__toggle.is-active .kiu-search__chevron {
    transform: rotate(180deg);
}

/* Icon-only, circular, primary blue — sits INSIDE the field at its right
   edge, vertically centred, rather than as a separate button beside it. */
.kiu-search__submit {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kiu-navy);
    color: var(--kiu-white);
    cursor: pointer;
    transition: background-color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-search__submit:hover {
    background: var(--kiu-navy-deep, #12294D);
}

.kiu-search__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 58, 107, .25);
}


/* Panel: closed by default, opened by the Filters button (or on load when a
   date/department filter is already active). */
.kiu-search__panel {
    display: none;
    margin-top: 14px;
    padding: 20px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius, 14px);
    background: var(--kiu-white);
}

.kiu-search__panel.is-open {
    display: block;
}

/* Two controls now (category + date) — the From/To range was removed. */
.kiu-search__row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 575px) {
    .kiu-search__row {
        grid-template-columns: 1fr;
    }
}

.kiu-search__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.kiu-search__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--kiu-muted);
}

.kiu-search__group input[type="date"] {
    cursor: pointer;
}

.kiu-search__group input,
.kiu-search__group select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-sm);
    background: var(--kiu-white);
    font-size: 13.5px;
    color: var(--kiu-ink);
    font-family: inherit;
}

.kiu-search__group input:focus,
.kiu-search__group select:focus {
    outline: none;
    border-color: var(--kiu-navy);
    box-shadow: 0 0 0 3px rgba(27, 58, 107, .10);
}

.kiu-search__hint {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--kiu-muted);
}

.kiu-search__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

.kiu-search__apply {
    height: 42px;
    padding: 0 24px;
    border: 1px solid var(--kiu-navy);
    border-radius: var(--kiu-radius-pill);
    background: var(--kiu-navy);
    color: var(--kiu-white);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-search__apply:hover {
    background: var(--kiu-navy-deep, #12294D);
}

.kiu-search__clear {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--kiu-muted);
    text-decoration: underline;
}

.kiu-search__clear:hover {
    color: var(--kiu-navy);
}

.kiu-search__summary {
    margin: 0 0 20px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--kiu-body);
}

/* Notice row — View + Download icons */
.kiu-notice-row__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.kiu-notice-row__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--kiu-radius-xs);
    font-size: 16px;
    background: var(--kiu-surface, #F5F7FB);
    color: var(--kiu-navy, #1B3A6B);
    border: 1px solid var(--kiu-border, #E1E7F0);
    transition: background var(--kiu-dur-fast) var(--kiu-ease-out), color var(--kiu-dur-fast) var(--kiu-ease-out);
}

.kiu-notice-row__action:hover {
    background: var(--kiu-navy, #1B3A6B);
    color: var(--kiu-white, #FFFFFF);
}

@media (max-width: 575px) {
    .kiu-notice-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .kiu-notice-row__text {
        flex: 1 1 calc(100% - 75px);
        min-width: 0;
    }

    .kiu-notice-row__actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 6px;
        border-top: 1px dashed var(--kiu-border);
    }
}
