/* ========================================================== */
/* NAM Funds — Kurschart                                      */
/* Fondsfarben kommen per CSS-Variablen (Inline vom Shortcode)*/
/* --namfc-color = regular, --namfc-bg = dark,                */
/* --namfc-darkest = darkest (Gitter/Achsen)                  */
/* ========================================================== */

.namfc {
    position: relative;
    width: 100%;
    color: #fff;
}

.namfc-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

/* ========================================================== */
/* Range-Buttons als Sprechblase (Rahmen laeuft in den Pfeil) */
/* Technik 1:1 aus der Alt-Seite (.tooltip--with-border):     */
/* ::before = Dreieck in Rahmenfarbe, ::after = Dreieck in    */
/* Seitenhintergrund, 2px hoeher -> bricht die Unterkante auf */
/* ========================================================== */

.namfc-ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.namfc-range {
    position: relative;
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    padding: 2px 8px 4px;
    cursor: pointer;
    background: var(--namfc-bg);
    color: var(--namfc-color);
    border: 1px solid var(--namfc-color);
    border-radius: 0;
}

.namfc-range::before,
.namfc-range::after {
    content: "";
    position: absolute;
    left: 50%;
    pointer-events: none;
    border: 7px solid transparent;
    border-bottom: 0;
    transform: translate(-50%, 100%);
}

.namfc-range::before {
    bottom: 0;
    border-top-color: var(--namfc-color);
}

.namfc-range::after {
    bottom: 2px;
    border-top-color: var(--namfc-bg);
}

.namfc-range.is-active {
    background: #fff;
    border-color: #fff;
    color: var(--namfc-bg);
}

.namfc-range.is-active::before,
.namfc-range.is-active::after {
    border-top-color: #fff;
}

/* Kurzlabel mobil, Langlabel ab 768px (wie Alt-Seite) */
.namfc-range-long {
    display: none;
}

@media (min-width: 768px) {
    .namfc-range {
        width: 80px;
    }

    .namfc-range-short {
        display: none;
    }

    .namfc-range-long {
        display: inline;
    }
}

/* ========================================================== */
/* Info-Box: oben rechts statisch, am Datenpunkt als Tooltip  */
/* Beide identisch aufgebaut (Alt-Seite: eine Komponente)     */
/* ========================================================== */

.namfc-box {
    position: relative;
    z-index: 10;
    background: #fff;
    color: var(--namfc-bg);
    padding: 12px 18px 16px;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
}

.namfc-box::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    pointer-events: none;
    border: 13px solid transparent;
    border-bottom: 0;
    border-top-color: #fff;
    transform: translate(-50%, 100%);
}

.namfc-box p {
    margin: 0;
    padding: 0;
}

.namfc-line {
    margin-top: 4px !important;
    white-space: nowrap;
}

.namfc-value {
    font-size: 36px;
    line-height: 40px;
    font-weight: 700;
}

.namfc-unit {
    margin-right: 8px;
}

.namfc-change {
    color: #00a865;
}

.namfc-change.is-neg {
    color: #d91e4b;
}

.namfc-plot {
    position: relative;
    width: 100%;
}

.namfc-error {
    padding: 24px 0;
    text-align: center;
    font-style: italic;
    color: rgba(255, 255, 255, 0.85);
}

/* ========================================================== */
/* Hover-Tooltip: eigene Box, exakt ueber dem Datenpunkt.     */
/* Liegt bewusst NEBEN dem ApexCharts-Container, weil Apex    */
/* seinen Container beim Neu-Rendern leerraeumt.              */
/* ========================================================== */

.namfc .apexcharts-tooltip {
    display: none !important;
}

.namfc-tt {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    min-width: 150px;
    transform: translate(-50%, calc(-100% - 13px));
}

.namfc-tt[hidden] {
    display: none;
}

@media (max-width: 767px) {
    .namfc-head {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }

    .namfc-price {
        display: none;
    }

    .namfc-value {
        font-size: 28px;
        line-height: 32px;
    }
}
