/* Ramka osadzenia v2 (moduł embed): mapa, legenda, podpis, karta, tabela dla czytników ekranu. Motyw: <html data-theme>
   auto | light | dark (parametr ?theme= w adresie ramki). Bez fontów z zewnątrz – czcionki systemowe. */

:root {
  --oe-bg: #ffffff;
  --oe-ink: #141414;
  --oe-ink2: #4b4a47;
  --oe-muted: #6b6964;
  --oe-line: #e3e2dc;
  --oe-link: #1f5fbf;
  --oe-card: #ffffff;
  --oe-shadow: 0 6px 24px rgb(0 0 0 / 0.14);
  --oe-land: #dcdcd6;
  --oe-land-hover: #c6c5bd;
  --oe-border: #ffffff;
  --oe-ocean: #eef0f2;
  --oe-out: #ebebe6;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --oe-bg: #141414;
  --oe-ink: #ececea;
  --oe-ink2: #c4c3be;
  --oe-muted: #9a9993;
  --oe-line: #2e2e2b;
  --oe-link: #8ab4f8;
  --oe-card: #1f1f1d;
  --oe-shadow: 0 6px 24px rgb(0 0 0 / 0.5);
  --oe-land: #3a3a37;
  --oe-land-hover: #4c4c48;
  --oe-border: #141414;
  --oe-ocean: #1b1d20;
  --oe-out: #262624;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --oe-bg: #141414;
    --oe-ink: #ececea;
    --oe-ink2: #c4c3be;
    --oe-muted: #9a9993;
    --oe-line: #2e2e2b;
    --oe-link: #8ab4f8;
    --oe-card: #1f1f1d;
    --oe-shadow: 0 6px 24px rgb(0 0 0 / 0.5);
    --oe-land: #3a3a37;
    --oe-land-hover: #4c4c48;
    --oe-border: #141414;
    --oe-ocean: #1b1d20;
    --oe-out: #262624;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--oe-bg);
  color: var(--oe-ink);
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
}
a { color: var(--oe-link); }

.oe { margin: 0; padding: 12px 14px 10px; }
.oe-head { margin-bottom: 6px; }
.oe-title { font-size: 18px; line-height: 1.25; margin: 0; font-weight: 700; }
.oe-sub { margin: 2px 0 0; color: var(--oe-ink2); font-size: 13px; }

.oe-stage { position: relative; }
.oe-map { width: 100%; min-height: 120px; border-radius: 6px; overflow: hidden; background: var(--oe-ocean); }
/* Kolory mapy z motywu ramki (silniejsze niż .wm[data-wm-theme] z maps.css). */
#oe-map.wm, #oe-map .wm {
  --wm-ocean: var(--oe-ocean); --wm-land: var(--oe-land); --wm-land-hover: var(--oe-land-hover); --wm-land-inactive: var(--oe-land);
  --wm-border: var(--oe-border); --wm-dot: var(--oe-land); --wm-tooltip-bg: var(--oe-card); --wm-tooltip-fg: var(--oe-ink);
}
#oe-map .oe-out { --wm-fill: var(--oe-out); }
.oe-map .wm-marker circle { fill: var(--oe-c, #c8102e); stroke: var(--oe-bg); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.oe-map .wm-marker:focus { outline: none; }
.oe-map .wm-marker:focus circle, .oe-map .wm-marker.oe-active circle { stroke: var(--oe-ink); stroke-width: 2.5px; }

.oe-card {
  position: absolute; left: 8px; bottom: 8px; max-width: min(340px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow: auto;
  background: var(--oe-card); color: var(--oe-ink); border-radius: 8px; box-shadow: var(--oe-shadow); padding: 10px 34px 10px 12px; font-size: 13px;
}
.oe-card h2 { font-size: 15px; margin: 0 0 2px; }
.oe-card p { margin: 4px 0; }
.oe-card .oe-val { font-size: 16px; font-weight: 700; }
.oe-card .oe-close {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent;
  color: var(--oe-muted); font-size: 18px; cursor: pointer;
}
.oe-card .oe-close:hover, .oe-card .oe-close:focus-visible { background: var(--oe-line); color: var(--oe-ink); }
.oe-card img { display: block; max-width: 100%; height: auto; border-radius: 4px; margin-top: 6px; }
.oe-card .oe-photo-btn { margin-top: 6px; font: inherit; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--oe-line); background: transparent; color: var(--oe-ink); cursor: pointer; }
.oe-card small { color: var(--oe-muted); }

.oe-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0 2px; font-size: 12px; color: var(--oe-ink2); }
.oe-legend-title { font-weight: 600; }
.oe-legend ul { display: contents; list-style: none; margin: 0; padding: 0; }
.oe-legend li { display: inline-flex; align-items: center; gap: 5px; }
.oe-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--c); }
:root[data-theme='dark'] .oe-sw { background: var(--cd); }
@media (prefers-color-scheme: dark) { :root[data-theme='auto'] .oe-sw { background: var(--cd); } }

.oe-foot { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--oe-line); font-size: 11.5px; color: var(--oe-muted); }
.oe-links { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; margin-left: auto; }
.oe-foot a { color: var(--oe-muted); }
.oe-foot a:hover, .oe-foot a:focus-visible { color: var(--oe-link); }
.oe-brand { font-weight: 600; }

/* Tabela danych tylko dla czytników ekranu (widoczna po przejściu do niej z klawiatury). Ukryta w <div> – tabela
   nie respektuje wysokości 1px i wydłużałaby dokument (pasek przewijania w ramce). */
.oe-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.oe-sr:focus, .oe-sr:focus-within { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; margin-top: 8px; outline: none; }
.oe-table { border-collapse: collapse; font-size: 12px; width: 100%; }
.oe-table caption { text-align: left; font-weight: 600; padding-bottom: 4px; }
.oe-table th, .oe-table td { text-align: left; padding: 2px 8px 2px 0; border-bottom: 1px solid var(--oe-line); }
.oe-skip { position: absolute; left: 8px; top: 8px; z-index: 10; background: var(--oe-card); color: var(--oe-link); padding: 6px 10px; border-radius: 6px; box-shadow: var(--oe-shadow); transform: translateY(-200%); opacity: 0; }
.oe-skip:focus { transform: none; opacity: 1; }
.oe-fallback { display: block; max-width: 100%; height: auto; }

@media (max-width: 480px) {
  .oe { padding: 10px 10px 8px; }
  .oe-title { font-size: 16px; }
  .oe-links { margin-left: 0; }
}

/* Karta licencji (osobna strona) */
.oe-doc { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; font-size: 15px; line-height: 1.55; }
.oe-doc h1 { font-size: 22px; margin: 0 0 12px; }
.oe-doc h2 { font-size: 15px; margin: 18px 0 4px; }
.oe-doc ul { padding-left: 20px; margin: 4px 0; }
.oe-doc .oe-credit-line { font-weight: 600; padding: 8px 10px; background: var(--oe-line); border-radius: 6px; }
.oe-doc .oe-meta { color: var(--oe-muted); font-size: 13px; margin-top: 24px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
