Module:InfoboxNew/styles.css

.infobox {
    margin-bottom: 1rem;
    width: 100%;
    max-width: 300px;
    background-color: #333;
    font-size: 0.875rem;
    line-height: 1.375;
    box-sizing: content-box;
    border-radius: 0 0 0 0 !important;
    padding: 0 !important;
}

.infobox[open] {
    background-color: #5c5c5c;
}

.infobox__content {
    position: relative;
}

.infobox__image {
    position: relative;
}

.infobox__image::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 50%;
}

.infobox__image,
.infobox__image::after,
.infobox__indicators {
    transition-timing-function: cubic-bezier( 0.44, 0.21, 0, 1 );
    transition-duration: 250ms;
}

.infobox__image {
    transition-property: margin-bottom;
}

.infobox__image::after {
    transition-property: opacity, transform;
}

.infobox__image:hover {
    margin-bottom: 0;
}

.infobox__image:hover::after {
    opacity: 0;
    transform: translateY(2rem);
}

.infobox__image:hover ~ .infobox__indicators {
    opacity: 0;
    transform: translateY(-2rem);
}

.infobox__image img {
    /* Prevent overflow */
    max-width: 100%;
    height: auto;
}

/* Provide background color for transparent SVGs */
.infobox__image img[src$='.svg'] {
    background: #eaecf0;
}

.infobox__image-upload {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    z-index: 1;
}

.infobox__image-upload > a {
    display: flex;
    margin: 1rem;
    padding: calc( 0.5 * 1rem ) calc( 0.875 * 1rem );
    border-radius: 1px;
    background: #f00;
    color: #ffffff;
    font-weight: 500;
    text-decoration: none;
    justify-content: center;
    align-items: center;
}

.infobox__image-upload > a .citizen-ui-icon {
    width: 1rem;
    height: 1rem;
}

.infobox__image-upload > a:hover {
    background: #f00;
}

.infobox__image-upload > a:active {
    background: #f00;
}

.infobox__header {
    /* Needed to stay on top of image fade */
    position: relative;
}

.infobox__snippet,
.infobox__header,
.infobox__sectionHeader,
.infobox__sectionContent {
    padding-left: 1rem;
    padding-right: 1rem;
}

.infobox__snippet {
    position: relative;
    z-index: 1;
    padding-top: calc( 0.875 * 1rem );
    padding-bottom: calc( 0.875 * 1rem );
    display: flex;
    gap: calc( 0.5 * 1rem );
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    /* So that clicking the infobox summary won't highlight the text */
    user-select: none;
}

.infobox__snippet:hover {
    background-color: rgba( 0, 24, 73, 0.027 );
}

/* Might as well steal from skin */
.infobox__snippet .mw-ui-icon-wikimedia-collapse {
    width: 0.875rem;
    height: 0.875rem;
    transition: 100ms cubic-bezier( 0.44, 0.21, 0, 1 );
    transition-property: transform;
}

.infobox[open] .infobox__snippet .mw-ui-icon-wikimedia-collapse {
    transform: none;
}

.infobox__snippet .infobox__desc {
    max-width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 0.875rem;
}

.infobox__indicators {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    justify-content: flex-end;
    padding: calc( 0.5 * 1rem );
    transition-property: opacity, transform;
}

.infobox__indicator {
    padding: calc( 0.25 * 1rem ) calc( 0.5 * 1rem );
    background: #333333;
    color: #ffffff;
    border-radius: 1px;
    line-height: 1.25;
}

.infobox__indicator .infobox__data {
    font-size: 0.75rem;
    font-weight: 500;
}

.infobox__indicator.infobox__indicator--red {
    background-color: #9a0000;
    color: #ffffff;
}

.infobox__indicator.infobox__indicator--yellow {
    background-color: #dada43;
    color: #000000;
}

.infobox__indicator.infobox__indicator--green {
    background-color: #009100;
    color: #ffffff;
}

.infobox__header,
.infobox__sectionHeader {
    line-height: 1.25;
}

.infobox__header {
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-bottom: calc( 1.25 * 1rem );
    background: #595959;
    display: flex;
    gap: calc( 0.875 * 1rem );
}

.infobox__section,
.infobox__sectionHeader,
.infobox__sectionContent {
    margin-top: 1rem;
}

.infobox__title,
.infobox__sectionTitle {
    color: #ffffff;
    font-weight: 500;
}

.infobox__title {
    font-size: 1.25rem;
}

.infobox__sectionSubtitle {
    margin-top: 2px;
}

.infobox__section + .infobox__section {
    margin-top: calc( 1.5 * 1rem );
}

/* Use padding to prevent margin collapse when there is no footer */
.infobox__content > .infobox__section:last-child {
    margin-bottom: 0;
    padding-bottom: 1rem;
}

.infobox__sectionTitle {
    font-size:  0.875rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.infobox__sectionTitle:after {
    content: '';
    height: 1px;
    flex-grow: 1;
    background: #595959;
}

.infobox__sectionSubtitle {
    color: #AAAAAA;
}

.infobox__sectionContent {
    --t-infoboxneue-grid-template-columns: repeat(var(--infobox-grid-cols), minmax(0, 1fr));
    display: grid;
    gap: calc(0.875*1rem);
    grid-template-columns: var(--t-infoboxneue-grid-template-columns);
}

.infobox__sectionContent--has-cells {
    gap: calc( 0.25 * 1rem );
}

.infobox__item {
    display: grid;
    gap: 2px calc( 0.5 * 1rem );
    grid-auto-rows: max-content;
}

.infobox__item--is-cell {
    display: grid;
    padding: calc( 0.5 * 1rem );
    border: 1px solid #000;
    border-radius: 1px;
}

.infobox__item--is-cell.infobox__item--has-tooltip:hover {
    background-color: rgba( 0, 24, 73, 0.027 );
}

.infobox__item--is-cell.infobox__item--positive {
    background-color: #007800;
    color: #ffffff;
}

.infobox__item--is-cell.infobox__item--negative {
    background-color: #871f1f;
    color: #ffffff;
}

.infobox__item--is-cell.infobox__item--null {
    border-color: #FFFFFF0D;
    color: #ffffff;
}

.infobox__item--is-range {
    justify-content: space-between;
    grid-template-areas:
		'label data'
		'bar   bar ';
    gap: calc( 0.5 * 1rem );
    grid-column: -1 / 1;
}

.infobox__item--is-range .infobox__label {
    grid-area: label;
}

.infobox__item--is-range .infobox__data {
    grid-area: data;
}

.infobox__item--is-range .infobox__bar {
    grid-area: bar;
}

.infobox__item--hasIcon {
    display: flex;
    align-items: center;
    column-gap: calc( 0.875 * 1rem );
}

.infobox__bar {
    height: 4px;
    border-radius: 9999px;
    background-color: #5c5c5c;
}

.infobox__bar-item {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(to right, transparent, #5c5c5c);
    clip-path: polygon(
            0 0,
            0 0,
            0 100%,
            0 100%
    );
}

/* Should not be here, but it's a quick fix */
.infobox__item--is-range--temperature .infobox__bar-item {
    background: linear-gradient(
            to right,
            #5c5c5c,
            #5c5c5c
    );
}

.infobox__badge {
    place-content: center;
    text-align: center;
    box-shadow: inset 0 0 0 1px #000;
    border-radius: calc( 1px * 2 );
    padding: calc( 0.5 * 1rem ) calc( 0.875 * 1rem );
    font-weight: 500;
    background-color: #5c5c5c;
}

.infobox__desc,
.infobox__label {
    color: #AAAAAA;
    font-size: 0.75rem;
}

.infobox__label {
    font-weight: 500;
}

.infobox__grid--row .infobox__label,
.infobox__grid--row .infobox__desc {
    font-size: 0.875rem;
}

.infobox__data {
    font-weight: 500;
}

.infobox__icon img {
    filter: none;
    opacity: 0.6;
}

.infobox__itemButton {
    position: relative;
    padding: calc( 0.875 * 1rem ) 1rem;
    line-height: 1.375;
    gap: 0;
}

.infobox__itemButton:hover {
    background-color: rgba( 0, 24, 73, 0.027 );
}

.infobox__itemButton:hover .infobox__itemButtonArrow {
    transform: rotate(90deg) translateY(-4px);
}

.infobox__itemButton:active {
    background-color: rgba( 0, 24, 73, 0.082 );
}

.infobox__itemButton .infobox__text {
    flex-grow: 1;
}

.infobox__itemButton .infobox__data {
    color: #ffffff;
}

.infobox__itemButtonLink a {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.infobox__itemButton .infobox__icon {
    margin-right: calc( 0.875 * 1rem );
}

.infobox__itemButton .infobox__icon img {
    width: 1.25rem;
    height: 1.25rem;
}

.infobox__itemButtonArrow {
    width: 1rem;
    height: 1rem;
    transition: 100ms cubic-bezier( 0.44, 0.21, 0, 1 );
    transform: rotate(90deg);
}

.infobox__footer {
    margin-top: calc( 1.25 * 1rem );
    border-top: 1px solid #000;
    background-color: #5c5c5c;
    border-bottom-left-radius: calc( 1px * 2 );
    border-bottom-right-radius: calc( 1px * 2 );
}

.infobox__footer > .infobox__section {
    margin: 0;
    padding: 1rem;
    display: grid;
    gap: calc( 0.25 * 1rem );
}

.infobox__button {
    position: relative;
    border-bottom-left-radius: calc( 1px * 2 );
    border-bottom-right-radius: calc( 1px * 2 );
    padding: calc( 0.875 * 1rem ) 1rem;
    background-color: #5c5c5c;
    cursor: pointer;
}

.infobox__button:hover {
    background-color: #5c5c5c;
}

.infobox__buttonLabel {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: calc( 0.5 * 1rem );
    color: #fff;
    font-weight: 500;
}

/* Fake button with link element */
.infobox__buttonLink {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}

.infobox__buttonLink a {
    display: block;
    height: 100%;
    font-size: 0;
}

.infobox__buttonCard {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: -1;
    border: 1px solid #000;
    background-color: #5c5c5c;
    border-radius: calc( 1px * 2 );
    box-shadow: 0 0.5px 0.6px #f0f, 0 2.8px 3.1px -0.4px #f0f, 0 5.3px 6px -0.7px #f0f, 0 8.7px 9.8px -1.1px #f0f, 0 13.9px 15.6px -1.4px #f0f, 0 21.8px 24.5px -1.8px #f0f;
    opacity: 0;
    transition: 250ms cubic-bezier( 0.215, 0.61, 0.355, 1 );
    transition-property: opacity, transform;
    visibility: hidden;
    transform: translateY(-20px);
}

.infobox__button:hover > .infobox__buttonCard {
    z-index: 10;
    opacity: 1;
    visibility: visible;
    transform: none;
    cursor: auto;
}

.infobox__linkButton a {
    padding: calc( 0.25 * 1rem ) calc( 0.5 * 1rem );
    display: block;
    border-radius: 1px;
    text-decoration: none !important;
}

/* Hide external URL icon */
.infobox__linkButton a:after {
    content: none;
}

.infobox__linkButton a:hover {
    background-color: rgba( 0, 24, 73, 0.027 );
}

.infobox__linkButton a:active {
    background-color: rgba( 0, 24, 73, 0.082 );
}

.infobox__section--linkButtons > .infobox__sectionContent {
    margin-bottom: 1rem;
}

.infobox__section--linkButtons .infobox__data {
    margin-top: calc( 0.25 * 1rem );
    margin-left: -8px; /* negative space-xs */
    margin-right: -8px; /* negative space-xs */
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.infobox__buttonLabel img[src$='.svg'] {
    filter: invert(1);
}

@media only screen and (max-width: 639px) {
    .infobox {
        margin-right: auto;
        margin-left: auto;
    }
}

.infobox__section--actions .infobox__sectionContent {
    padding-left: 0;
    padding-right: 0;
}

/* TODO: Remove when footer is removed */
.infobox__section--hasBackground + .infobox__section--hasBackground,
.infobox__section--hasBackground + .infobox__footer {
    margin-top: 0;
}

.infobox__section--hasBackground .infobox__sectionContent {
    margin: 0;
}

.infobox__section--metadata .infobox__sectionContent {
    padding: 1rem;
    background: #ffffff;
    line-height: 1.25;
    gap: calc( 0.25 * 1rem );
}

.infobox__section--metadata .infobox__label,
.infobox__section--metadata .infobox__data {
    font-size: 0.75rem;
}

.infobox__section--metadata .infobox__data {
    word-break: break-word;
    font-family: 'Menlo', 'Consolas', 'Liberation Mono', 'Fira Code', 'Courier New', monospace;
}

/* CSS grid utility classes */
.infobox__grid--row {
    --infobox-grid-cols: 1;
    grid-auto-flow: column;
}

.infobox__grid--cols-2 {
    --infobox-grid-cols: 2;
}

.infobox__grid--cols-3 {
    --infobox-grid-cols: 3;
}

.infobox__grid--cols-4 {
    --infobox-grid-cols: 4;
}

.infobox__grid--cols-5 {
    --infobox-grid-cols: 5;
}

.infobox__grid--cols-6 {
    --infobox-grid-cols: 6;
}

.infobox__grid--col-span-2 {
    grid-column: span 2;
}

.infobox__grid--col-span-3 {
    grid-column: span 3;
}

.infobox__grid--col-span-4 {
    grid-column: span 4;
}

.infobox__grid--col-span-5 {
    grid-column: span 5;
}

.infobox__grid--col-span-6 {
    grid-column: span 6;
}

.infobox__grid--space-between {
    justify-content: space-between;
}

/* Tabber styles */
.infobox__section--tabber > .infobox__sectionHeader {
    margin-bottom: calc( 0.25 * 1rem );
}

.infobox__section--tabber > .infobox__sectionContent {
    padding-left: 0;
    padding-right: 0;
}

/* Spacing is handled by tabber */
.infobox__section--tabber .infobox__sectionContent {
    margin-top: 0;
    margin-bottom: 0;
}

.infobox__section--tabber .tabber .infobox__section {
    margin-top: calc( 0.875 * 1rem );
    margin-bottom: 0;
}

/* Increase top margin for nested tabber section */
.infobox__section--tabber .infobox__section.infobox__section--tabber {
    margin-top: calc( 1.5 * 1rem );
}

.infobox__section--tabber .tabber__header {
    margin-left: calc( 0.5 * 1rem );
    margin-right: calc( 0.5 * 1rem );
    box-shadow: none;
}

/* Match padding in the rest of the infobox */
.infobox__section--tabber .tabber__tab {
    margin-left: calc( 0.5 * 1rem );
    margin-right: calc( 0.5 * 1rem );
    padding-left: 0;
    padding-right: 0;
}