/*
 * Page shell + base reset for the standalone dashboard.
 *
 * Inside the portal, the LED components sit on top of Bootstrap, so they were
 * authored assuming Bootstrap's Reboot is already in effect — above all
 * `box-sizing: border-box` on every element. Standing alone there is no
 * Bootstrap, and without that rule any element with an explicit width *plus*
 * padding renders wider than designed: `.led-sidebar` (width 230px, padding
 * 1.1rem) came out 266px and pushed itself into the data panel.
 *
 * So this file reproduces the parts of Reboot the LED markup actually depends
 * on, and nothing else — pulling in all of Bootstrap for a handful of rules
 * would be far more likely to change the look than to preserve it. Everything
 * visual lives in led.css, lifted verbatim from the Vue components.
 */

/* ---- Reboot subset (Bootstrap 4) --------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
}

/* Reboot zeroes the top margin and normalises the bottom one. Browser defaults
   (`margin: 1em 0`) would add stray space above every <p> the LED CSS does not
   explicitly reset — which is most of the card labels. */
p {
    margin-top: 0;
    margin-bottom: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

table {
    border-collapse: collapse;
}

th {
    text-align: inherit;
}

/* Form controls do not inherit typography on their own. */
button,
input,
optgroup,
select,
textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="submit"] {
    -webkit-appearance: button;
}

button:not(:disabled) {
    cursor: pointer;
}

/* The gauge and the sidebar/brand icons are inline SVG. */
svg {
    overflow: hidden;
    vertical-align: middle;
}

/* The IEA methodology sections on the Benchmark tab are native <details>. */
summary {
    display: list-item;
    cursor: pointer;
}

/* ---- Typography: FIA Digital Design System 1.0 ------------------------- */

/* The dashboard uses Manrope only, in three weights: 400 (text), 600
   (navigation, buttons, card titles) and 800 (headings, key figures).
   The files are vendored so the page still needs no network; the latin-ext
   subset carries the Bosnian/Croatian diacritics (c, c, s, z, dj).
   Manrope is (c) The Manrope Project Authors, SIL Open Font License 1.1
   (vendor/fonts/Manrope-OFL.txt). */
@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../vendor/fonts/manrope-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../vendor/fonts/manrope-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../vendor/fonts/manrope-latin-600-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../vendor/fonts/manrope-latin-ext-600-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../vendor/fonts/manrope-latin-800-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../vendor/fonts/manrope-latin-ext-800-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* The portal's App.vue still declares `div` and `h1-h6` as PT Sans Narrow,
   weight 400. The weight half is reproduced here because the LED styles
   rely on it; the font half is overridden for LED below, exactly as the
   portal's LocalEconomicOverview.vue does. */
div,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
    font-style: normal;
}

/* An element rule beats an inherited value, so Manrope is set on every
   element; the methodology formulas stay monospace. The modal renders into
   #led-modal, outside .led-page, so it is listed too. */
.led-page *:not(.led-iea-comp-formula):not(.expl-mono),
#led-modal *:not(.led-iea-comp-formula):not(.expl-mono) {
    font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
}

/* Visible focus: 3 px FIA Blue outline with a white gap. */
.led-page :focus-visible,
#led-modal :focus-visible {
    outline: 3px solid #204990;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #FFFFFF;
}

/* ---- Page shell -------------------------------------------------------- */

/* In the portal the dashboard renders inside `.content`, which is tinted
   `--light-color`. That tint is what makes the white sidebar read as part of
   the rounded shell rather than merging into the page. */
body {
    background: #f3f6fc;
    color: #142D47;
    -webkit-font-smoothing: antialiased;
}

/* Leaflet sets its own z-index stack; keep it under the methodology modal
   (.led-modal-backdrop is z-index 1050 in led.css). */
.leaflet-pane,
.leaflet-top,
.leaflet-bottom {
    z-index: 400;
}
