/* =========================================================
   Odessa News Currency
   ========================================================= */

.onc-currency {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 14px;
    padding-right: 14px;
}

.onc-currency::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 30px;
    background: rgba(0, 0, 0, 0.14);
    transform: translateY(-50%);
}

.onc-currency__trigger {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    min-width: 88px;
    min-height: 54px;
    gap: 3px;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #444;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.onc-currency__trigger:hover,
.onc-currency__trigger:focus-visible,
.onc-currency__trigger[aria-expanded="true"] {
    background: rgba(0, 0, 0, 0.06);
    color: #444;
}

.onc-currency__trigger:focus-visible {
    outline: 2px solid #ff6048;
    outline-offset: 3px;
}

.onc-currency__item {
    display: grid;
    grid-template-columns: 12px 42px auto;
    align-items: center;
    width: 100%;
    gap: 3px;
    line-height: 1.2;
    white-space: nowrap;
}

.onc-currency__symbol {
    width: 12px;
    text-align: center;
    font-weight: 600;
}

.onc-currency__value {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.onc-currency__trend {
    margin-left: 2px;
    font-size: 0.72em;
    line-height: 1;
}

/* Popup */

.onc-currency__popup {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 10px);
    left: 0;
    width: 340px;
    padding: 16px;
    background: #fff;
    color: #222;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.onc-currency__popup-title {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: #222;
    text-align: left;
}

.onc-currency__table {
    display: grid;
    gap: 0;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fbfbfb;
    overflow: hidden;
}

.onc-currency__row {
    display: grid;
    grid-template-columns: 58px 1fr 1fr;
    gap: 10px;
    align-items: center;
    font-variant-numeric: tabular-nums;
}

.onc-currency__table--nbu .onc-currency__row {
    grid-template-columns: 58px 1fr;
}

.onc-currency__row--head {
    font-size: 12px;
    opacity: 0.65;
}

.onc-currency__code {
    font-weight: 600;
}

.onc-currency__sell {
    white-space: nowrap;
}

.onc-currency__meta {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.75;
}

.onc-currency__stale {
    margin-top: 4px;
    font-weight: 600;
}

/* Popup presentation */

.onc-currency__row {
    min-height: 42px;
    padding: 9px 12px;
}

.onc-currency__row + .onc-currency__row {
    border-top: 1px solid #ededed;
}

.onc-currency__row--head {
    min-height: auto;
    padding-top: 7px;
    padding-bottom: 7px;
    background: #f7f7f7;
    color: #777;
    font-size: 11px;
    font-weight: 500;
    opacity: 1;
}

.onc-currency__row > *:nth-child(2),
.onc-currency__row > *:nth-child(3) {
    text-align: right;
}

.onc-currency__code {
    color: #444;
}

.onc-currency__buy,
.onc-currency__sell {
    color: #333;
    white-space: nowrap;
}

.onc-currency__meta {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eeeeee;
    font-size: 11px;
    line-height: 1.55;
    color: #888;
    opacity: 1;
}

.onc-currency__stale {
    margin-top: 5px;
    color: #a66a00;
    font-size: 11px;
    font-weight: 600;
}

.onc-currency__popup[hidden] {
    display: none !important;
}

/* NewsPlus header integration */

#header .brand {
    margin-bottom: 0;
}

#header .hwa-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 54px;
}

#header .header-widget-area .widget_block {
    margin-bottom: 0;
}

#header .header-widget-area .widget_block > * {
    margin-top: 0;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    #header > .wrap.full-width {
        display: flex;
        align-items: center;
    }

    #header > .wrap.full-width > .brand {
        float: none;
        flex: 0 0 auto;
        margin-top: 0;
        margin-bottom: 0;
    }

    #header > .wrap.full-width > .header-widget-area {
        float: none;
        margin-left: auto;
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    .onc-currency {
        margin-right: 8px;
        padding-right: 8px;
    }

    .onc-currency::after {
        height: 26px;
    }

    .onc-currency__trigger {
        min-width: 64px;
        min-height: 46px;
        gap: 2px;
        padding: 6px 7px;
    }

    .onc-currency__item {
        grid-template-columns: 9px 37px auto;
        gap: 2px;
        font-size: 12px;
    }

    .onc-currency__symbol {
        width: 9px;
    }

    .onc-currency__popup {
        left: 50%;
        width: min(290px, calc(100vw - 24px));
        transform: translateX(-50%);
    }
}
