/*
 * EnergyID help center: platform switch (website / app).
 * Deploy as /css/energyid/platform-switch.css, linked from the helpItem template.
 * Behaviour: platform-switch.js. Markup: blocks with class pf-web / pf-app.
 */
:root {
  --pf-web: #1f6fd1;
  --pf-app: #0f8a6b;
}

/* ---- Fallback without JavaScript (and print): everything visible, platform marked in neutral grey ----
   The label only goes on the first block of a run, so a series of marked paragraphs reads as one section. */
html:not(.pf-enhanced) .pf-web,
html:not(.pf-enhanced) .pf-app { border-left: 2px solid #d5dbe3; padding-left: 1rem; }
html:not(.pf-enhanced) .pf-web:not(.pf-web + .pf-web)::before,
html:not(.pf-enhanced) .pf-app:not(.pf-app + .pf-app)::before {
  display: block; font-size: .75rem; font-weight: 300; color: #7b8794; margin-bottom: .25rem;
}
html:not(.pf-enhanced) .pf-web:not(.pf-web + .pf-web)::before { content: "Op de website"; }
html:not(.pf-enhanced) .pf-app:not(.pf-app + .pf-app)::before { content: "In de app"; }
/* needs <html lang="..."> (see README, step 4); without it the Dutch labels above apply */
html[lang^="en"]:not(.pf-enhanced) .pf-web:not(.pf-web + .pf-web)::before { content: "On the website"; }
html[lang^="en"]:not(.pf-enhanced) .pf-app:not(.pf-app + .pf-app)::before { content: "In the app"; }
html[lang^="fr"]:not(.pf-enhanced) .pf-web:not(.pf-web + .pf-web)::before { content: "Sur le site web"; }
html[lang^="fr"]:not(.pf-enhanced) .pf-app:not(.pf-app + .pf-app)::before { content: "Dans l\2019 application"; }

/* ---- Enhanced: the box is an invisible wrapper (no background, no icon, no indent); only the switch hides/shows it ---- */
.pf-box[hidden] { display: none !important; }
.pf-box img { max-width: 100%; height: auto; }

/* ---- The one sticky switch ---- */
.pf-fab {
  position: fixed; z-index: 1030; /* below Bootstrap modals (1050), e.g. the cookie banner */
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: flex-end; gap: .5rem;
}
.pf-toggle { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: #fff; border: 1px solid #dbe2ea; box-shadow: 0 2px 6px rgba(20, 35, 55, .2), 0 10px 28px rgba(20, 35, 55, .18); }
.pf-toggle button { display: inline-flex; align-items: center; gap: .45rem; background: transparent; border: 0; border-radius: 999px; padding: .5rem 1rem .5rem .8rem; font-weight: 600; font-size: .92rem; color: #5b6878; cursor: pointer; }
.pf-toggle button svg { width: 1.15rem; height: 1.15rem; flex: none; }
.pf-toggle button:not([aria-checked="true"]):hover { color: #1d2733; background: #eef2f7; }
.pf-toggle button[aria-checked="true"] { color: #fff; box-shadow: 0 1px 4px rgba(20, 35, 55, .3); }
.pf-toggle button[aria-checked="true"]::after { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; margin-left: .1rem; flex: none; }
.pf-toggle button[data-platform="web"][aria-checked="true"] { background: var(--pf-web); }
.pf-toggle button[data-platform="app"][aria-checked="true"] { background: var(--pf-app); }
.pf-toggle button:focus-visible { outline: 3px solid #1f6fd1; outline-offset: 2px; }
.pf-hint { margin: 0; max-width: 260px; background: #fff; border: 1px solid #dbe2ea; border-radius: .75rem; padding: .55rem .75rem; box-shadow: 0 2px 6px rgba(20, 35, 55, .15); font-size: .82rem; color: #1d2733; }
.pf-hint button { background: none; border: 0; padding: 0; text-decoration: underline; color: #1f6fd1; font-size: inherit; cursor: pointer; }

/* keep the last lines of an article clear of the pill */
html.pf-enhanced .article-content, html.pf-enhanced .help-article { padding-bottom: 4.5rem; }

@media print { .pf-fab { display: none; } }
@media (prefers-reduced-motion: reduce) { .pf-toggle button { transition: none; } }
