.cic-atlas {
    --cic-orange: #c63a1e;
    position: relative;
    margin: 24px 0 2rem;
    font-size: 16px;
}
.cic-atlas * {
    box-sizing: border-box;
}
.cic-atlas__intro {
    max-width: none;
    margin: 0 0 16px;
    text-align: left;
    letter-spacing: 0.05rem;
}
.cic-atlas__search-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    align-items: stretch;
}
.cic-atlas__search-row input {
    width: 162px;
    height: 28px;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid #777;
    font: 14px inherit;
}
.cic-atlas__search-row input::placeholder {
    font-style: normal;
}
.cic-button {
    border: 0;
    border-radius: 3px;
    background: #e64626;
    color: #fff;
    padding: 4px 10px;
    font: 14px inherit;
    cursor: pointer;
}
.cic-button--secondary {
    background: #eee;
    color: #141414;
}
.cic-atlas__types {
    border: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 16px 0 8px;
    padding: 0;
}
.cic-type {
    display: flex;
    align-items: stretch;
    border: 0;
    border-radius: 4px;
    background: var(--type-color);
    color: #141414;
    padding: 0;
    font: 14px inherit;
    cursor: pointer;
}
.cic-type__toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px;
}
.cic-type__toggle img {
    width: 24px;
    height: 24px;
}
.cic-type__focus {
    display: grid;
    place-items: center;
    min-width: 32px;
    border-left: 1px solid currentColor;
    font-size: 22px;
}
.cic-type__focus img {
    width: 20px;
    height: 20px;
}
.cic-type.is-active {
    background: var(--type-color);
}
.cic-type:not(.is-active) {
    background: #f1f1f1;
    opacity: 1;
    filter: none;
}
.cic-atlas__hint {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}
.cic-atlas__advanced {
    border: 0;
    margin: 12px auto 0;
    max-width: 806px;
}
.cic-atlas__advanced summary {
    width: max-content;
    margin: auto;
    padding: 4px 8px;
    border-radius: 3px;
    background: #eee;
    color: #141414;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    line-height: 20px;
}
.cic-atlas__advanced summary::-webkit-details-marker {
    display: none;
}
.cic-atlas__advanced summary:after {
    content: " ▼";
}
.cic-atlas__advanced[open] summary:after {
    content: " ▲";
}
.cic-atlas__advanced-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 50px;
    margin-top: 16px;
    padding: 0;
    background: transparent;
}
.cic-atlas__advanced-grid label {
    display: grid;
    grid-template-columns: 110px minmax(0, 202px);
    align-items: center;
    gap: 54px;
}
.cic-atlas__advanced select {
    width: 100%;
    min-height: 110px;
    padding: 6px;
    border: 1px solid #777;
    background: #fff;
    font: inherit;
}
.cic-atlas__date {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 149px minmax(0, 639px);
    align-items: center;
    justify-content: start;
    gap: 18px;
    margin-top: 14px;
}
.cic-atlas__date > span {
    font-weight: 600;
    align-self: center;
}
.cic-atlas__date input {
    padding: 8px;
    border: 1px solid #777;
    font: inherit;
}
.cic-atlas__views {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    border: 0;
    padding: 4px 0;
    margin: 4px 0;
}
.cic-atlas__views label {
    display: flex;
    align-items: center;
    gap: 3px;
}
.cic-atlas__status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.cic-atlas__status.is-error {
    position: static;
    width: auto;
    height: auto;
    margin: 0.5rem 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    color: #a00;
    text-align: right;
}
.cic-atlas__stage {
    position: relative;
    min-height: 650px;
}
.cic-atlas__map,
.cic-atlas__network {
    height: 70vh;
    width: 100%;
    background: #f2f2f2;
}
.cic-atlas .esri-view {
    --esri-view-outline: none;
}
.cic-atlas .esri-view .esri-view-surface:focus::after {
    outline: none;
}
.cic-atlas__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}
.cic-atlas-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: #141414 !important;
    background: #fff;
    box-shadow: 0 2px 9px rgba(0, 0, 0, 0.18);
    text-decoration: none !important;
}
.cic-atlas-card__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 80px;
    padding: 14px;
    background: var(--record-color);
    color: var(--record-foreground);
    font-size: 20px;
}
.cic-atlas-card__heading img {
    width: 36px;
    height: 36px;
}
.cic-atlas-card__image {
    width: 100%;
    height: 210px;
    object-fit: cover;
}
.cic-atlas-card__image--empty {
    display: block;
    background: #e7e7e8;
}
.cic-atlas-card__type {
    padding: 10px 14px;
    font-size: 15px;
}
.cic-atlas__network {
    position: relative;
}
/* CIC artwork is white; keep the generic NodeGraph renderer color-neutral.
   Filter only the transparent icon layer, not the colored nodes or labels. */
.cic-atlas__network canvas.sigma-node-icons,
.cic-atlas__network #legendDiv .legend-row img {
    filter: brightness(0) invert(1);
}
.cic-atlas__network [data-network-canvas] {
    position: absolute;
    inset: 0;
}
.cic-atlas__network-controls {
    position: absolute;
    z-index: 4;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 5px;
}
.cic-atlas__network-controls button {
    width: 42px;
    height: 42px;
    border: 1px solid #aaa;
    background: #fff var(--control-icon) center/22px no-repeat;
    cursor: pointer;
}
.cic-atlas__network [data-network-legend] {
    position: absolute;
    z-index: 4;
    left: 16px;
    top: 16px;
    display: grid;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    padding: 10px;
}
.cic-atlas__network [data-network-legend] span {
    display: flex;
    align-items: center;
    gap: 7px;
}
.cic-atlas__network [data-network-legend] img {
    width: 24px;
    height: 24px;
}
.cic-atlas__network [data-network-popup] {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 70px;
    transform: translateX(-50%);
    max-width: 420px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    padding: 22px;
}
.cic-atlas__network [data-network-popup] a {
    font-size: 20px;
}
.cic-atlas__loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.72);
}
.cic-atlas__loading span:first-child {
    width: 55px;
    height: 55px;
    border: 6px solid #ddd;
    border-top-color: #c63a1e;
    border-radius: 50%;
    animation: cic-spin 0.8s linear infinite;
}
@keyframes cic-spin {
    to {
        transform: rotate(360deg);
    }
}
@media (max-width: 900px) {
    .cic-atlas__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .cic-atlas__advanced-grid {
        grid-template-columns: 1fr;
    }
    .cic-atlas__date {
        grid-column: auto;
        flex-wrap: wrap;
    }
    .cic-atlas__map,
    .cic-atlas__network {
        height: 600px;
    }
}
@media (max-width: 600px) {
    .cic-atlas__search-row {
        align-items: stretch;
        flex-direction: column;
    }
    .cic-atlas__search-row input {
        width: 100%;
        height: 43px;
    }
    .cic-atlas__types {
        display: grid;
    }
    .cic-type {
        justify-content: space-between;
    }
    .cic-atlas__list {
        grid-template-columns: 1fr;
    }
    .cic-atlas__views {
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-content: start;
    }
    .cic-atlas__stage {
        min-height: 500px;
    }
    .cic-atlas__map,
    .cic-atlas__network {
        height: 500px;
    }
}

.cic-atlas__date {
    align-items: center;
    gap: 18px;
    min-height: 45px;
}
.cic-atlas__date > span {
    align-self: auto;
}
.cic-atlas__date-slider {
    width: 100%;
}

/* Native Omeka ATLAS parity and view-state fixes. */
.cic-atlas [hidden] {
    display: none !important;
}
.cic-atlas .cic-button {
    min-height: 28px;
    padding: 4px 10px;
    background: #e64626;
    color: #fff;
    font-size: 14px;
    line-height: 20px;
}
.cic-atlas .cic-button--secondary {
    background: #f1f1f1;
    color: #141414;
}
.cic-atlas .cic-type {
    min-height: 32px;
    padding: 0;
    font-size: 14px;
    line-height: 20px;
}
.cic-atlas .cic-type__toggle {
    padding: 4px 8px;
}
.cic-atlas .cic-type__focus {
    padding: 0;
    line-height: 1;
}
.cic-atlas__map-layout {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 3.5fr) minmax(230px, 1fr);
    height: 70vh;
}
.cic-atlas__map-sidebar {
    height: 70vh;
    overflow-y: auto;
    background: #f1f1f1;
}
.cic-atlas__map-record {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 122px;
    padding: 8px 10px;
    border-bottom: 2px solid #fff;
    background: var(--record-color);
    color: var(--record-foreground) !important;
    text-decoration: none !important;
}
.cic-atlas button.cic-atlas__map-record {
    width: 100%;
    border-top: 0;
    border-right: 0;
    border-left: 0;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.cic-atlas__map-record > img:first-child {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
}
.cic-atlas__map-record-title {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
.cic-atlas__map-record-thumbnail {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    object-fit: cover;
}
.cic-atlas-tile__icon.is-inverted,
.cic-atlas__map-record > img.is-inverted:first-child {
    filter: invert(100%);
}
@media (max-width: 900px) {
    .cic-atlas__map-layout {
        grid-template-columns: 2fr 1fr;
        height: 600px;
    }
    .cic-atlas__map-sidebar {
        height: 600px;
    }
}
@media (max-width: 600px) {
    .cic-atlas__map-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .cic-atlas__map-sidebar {
        height: 300px;
    }
}

/* Match the WordPress ATLAS tile view. */
.cic-atlas .cic-atlas__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}
.cic-atlas-tile {
    display: block;
    min-width: 0;
    color: inherit !important;
    text-decoration: none !important;
}
.cic-atlas-tile__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 130px;
    padding: 15px;
    background: var(--record-color, #f0f0f0);
    color: var(--record-foreground, inherit);
}
.cic-atlas-tile__icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}
.cic-atlas-tile__name {
    flex: 1;
    min-width: 0;
    margin-left: 10px;
    font-size: 16px;
    overflow-wrap: anywhere;
}
.cic-atlas-tile__image {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    object-fit: cover;
}
.cic-atlas-tile__image--empty {
    display: block;
    flex-basis: 0;
    width: 0;
    min-height: 100px;
}

/* Choices.js multiselects used by the original ATLAS advanced search. */
.cic-atlas__advanced .choices {
    width: 100%;
    margin: 0;
    border: 1.5px solid #141414;
    border-radius: 0.25rem;
    background: transparent;
    font-size: inherit;
}
.cic-atlas__advanced .choices__inner {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    height: auto;
    padding: 7.5px 7.5px 3.75px;
    border: 0;
    background: #f9f9f9;
}
.cic-atlas__advanced .choices__inner input.choices__input {
    width: 20px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px 0 4px 2px !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0;
    font-size: inherit !important;
}
.cic-atlas__advanced .choices__list--multiple .choices__item {
    padding: 2px 10px;
    border: 0;
    border-radius: 20px;
    background: #f1eee9;
    color: inherit;
    font-size: inherit;
    font-weight: 600;
}
.cic-atlas__advanced .choices__list--multiple .choices__item[data-deletable] {
    padding-right: 1em;
}
.cic-atlas__advanced .choices[data-type*="select-multiple"] .choices__button {
    min-width: initial;
    height: initial;
    padding: initial;
    border-left: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    filter: invert(1);
}
.cic-atlas__advanced .choices__list--dropdown {
    z-index: 50;
    border-color: #141414;
}
.cic-atlas__advanced .choices__item--choice {
    padding: 8px 12px;
    font-size: 16px;
}
.cic-atlas__advanced .choices__item--choice.is-highlighted {
    background: #f1eee9;
}
.cic-atlas__map-error {
    padding: 30px;
    text-align: center;
}
.cic-atlas__cluster-browse {
    border: 0;
    border-radius: 3px;
    padding: 6px 10px;
    background: #e64626;
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.cic-atlas__cluster-list {
    max-height: 240px;
    margin: 10px 0 0;
    padding-left: 22px;
    overflow: auto;
}
.cic-atlas__cluster-list li + li {
    margin-top: 5px;
}
.cic-atlas__info-bar {
    position: absolute;
    z-index: 210;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    max-height: 100%;
    padding: 20px;
    overflow: auto;
    background: antiquewhite;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.5s ease;
}
.cic-atlas__info-bar.show {
    transform: translateX(0);
}
.cic-atlas__info-bar-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.cic-atlas__info-bar-header h2 {
    margin: 0.25rem 0 1rem;
    font-size: 1.6rem;
    line-height: 1.2;
}
.cic-atlas__info-bar-back {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
.cic-atlas__info-bar > p {
    text-align: justify;
}
.cic-atlas__info-bar > img {
    display: block;
    width: 80%;
    height: auto;
    margin: 1rem auto;
}
.cic-atlas .esri-popup h2.esri-features__heading,
.cic-atlas .esri-popup .esri-widget__heading.esri-features__heading {
    font-size: 16px;
    font-weight: 700;
}
.cic-atlas__network .network-view {
    width: 100% !important;
    height: 70vh !important;
    min-width: 320px;
}
@media (max-width: 900px) {
    .cic-atlas .cic-atlas__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .cic-atlas .cic-atlas__list {
        grid-template-columns: 1fr;
    }
    .cic-atlas-tile__image {
        flex-basis: 80px;
        width: 80px;
        height: 80px;
    }
}
@media (max-width: 700px) {
    .cic-atlas__info-bar {
        width: 85%;
    }
}
