/* «Карта української мови» (mu-plugins/zno-langmap.php). Lines take their colour from --c. */

/* the map page is full width: no sidebar */
.zno-langmap-page #secondary { display: none; }
body.zno-langmap-page .content-area,
body.zno-langmap-page .site-main { float: none; width: auto; max-width: none; }

.zlm { --ink: #222; --muted: #666; --line: 6px; --dot: 22px; margin: 1.2em 0 2em; color: var(--ink); line-height: 1.4; -webkit-hyphens: manual; hyphens: manual; }
.zlm ol, .zlm ul { margin: 0; padding: 0; list-style: none; }
.zlm li, .entry-content .zlm li { margin: 0; }
.zlm a, .entry-content .zlm a, .entry-content .zlm a:hover, .entry-content .zlm a:focus { color: #0067ac; text-decoration: none; box-shadow: none; border: 0; }
.entry-content .zlm a:hover { text-decoration: underline; }
.zlm h2 { margin: 0; padding: 0; border: 0; }

/* the theme paints every button:hover/:focus dark blue with white text — reset for map buttons */
.zlm button { width: auto; margin: 0; padding: 0; border: 0; background: none; color: inherit;
  font: inherit; line-height: inherit; outline: none; box-shadow: none; transition: none; -webkit-appearance: none; appearance: none; }
/* only colours on hover/focus — box metrics must not change, or the station label rewraps and the row jumps */
.zlm .zlm-st__btn:hover, .zlm .zlm-st__btn:focus { border: 0; background: none; color: inherit; outline: none; box-shadow: none; }
.zlm button:focus-visible { outline: 2px solid #0067ac; outline-offset: 2px; border-radius: 6px; }

.zlm .zlm__stats { margin: 0 0 1em; color: var(--muted); }
.zlm__stats b { color: var(--ink); }

/* ---------- overview: the whole map in a dozen rows ---------- */
.zlm-ov ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5em, 1fr)); gap: .45em .9em; }
.zlm-ov a { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; gap: .15em .55em;
  padding: .4em .55em; border-radius: 8px; color: var(--ink); }
.entry-content .zlm-ov a { color: var(--ink); }
.entry-content .zlm-ov a:hover { background: #f3f6f9; text-decoration: none; }
.zlm-ov .zlm-badge { grid-row: span 2; }
.zlm-ov__name { font-size: .92em; font-weight: 600; line-height: 1.25; }
.zlm-ov__n { grid-column: 3; grid-row: 1 / span 2; font-size: .8em; color: var(--muted); white-space: nowrap; }
.zlm-ov__bar { grid-column: 2; height: 5px; border-radius: 3px; background: #e7ecf1; overflow: hidden; }
.zlm-ov__bar span { display: block; height: 100%; background: var(--c); }

.zlm-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2em; height: 2em; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 700; font-size: .95em; }

/* ---------- filter + legend ---------- */
.zlm__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5em 1.5em;
  margin: 1.4em 0 .6em; padding: .55em .2em; border-bottom: 1px solid #e6e6e6; }
.zlm__filter { display: flex; flex-wrap: wrap; align-items: center; gap: .3em; }
.zlm__filter span { margin-right: .2em; color: var(--muted); font-size: .92em; }
.zlm .zlm__filter button { padding: .2em .7em; border: 1px solid #c9d6e2; border-radius: 999px; background: #fff; color: #004d80; font-size: .92em; cursor: pointer; }
.zlm .zlm__filter button:hover { border-color: #e0a800; background: #fff3bf; color: #222; }
.zlm .zlm__filter button[aria-pressed="true"] { border-color: #0067ac; background: #0067ac; color: #fff; }
.zlm__legend { display: flex; flex-wrap: wrap; gap: .3em 1.1em; font-size: .85em; color: var(--muted); }
.zlm__legend li { display: inline-flex; align-items: center; gap: .4em; }
.zlm-key { display: inline-block; width: 14px; height: 14px; border: 4px solid #555; border-radius: 50%; background: #fff; box-sizing: border-box; }
.zlm-key--test { background: #555; box-shadow: inset 0 0 0 2px #fff; }
.zlm-key--empty { border: 2px dashed #9aa5ae; }
.zlm-key--x { display: inline-flex; gap: 2px; width: auto; height: auto; border: 0; }
.zlm-key--x i, .zlm-st__x i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #c2185b); }
.zlm-key--x i + i { background: #0067ac; }

/* ---------- lines ---------- */
.zlm-line { margin: 0; padding: 1.1em 0 .4em; border-top: 1px solid #eef1f4; scroll-margin-top: 110px; }
.zlm-line:first-child { border-top: 0; }
.zlm-line__head { display: flex; flex-wrap: wrap; align-items: center; gap: .2em .6em; margin: 0 0 .8em; }
.zlm-line__name { font-size: 1.12em; font-weight: 700; color: var(--ink); }
.entry-content .zlm-line__name { margin: 0; font-size: 1.12em; }
.zlm .zlm-line__level { flex-basis: 100%; margin: 0 0 0 calc(2em * .95 + .6em); font-size: .88em; color: var(--muted); }

.zlm-line__track { display: flex; flex-wrap: wrap; row-gap: 1.1em; }
.zlm-st { position: relative; flex: 0 0 calc(100% / min(var(--cols, 8), 11)); min-width: 0; }
@media (max-width: 1180px) { .zlm-st { flex-basis: calc(100% / min(var(--cols, 8), 8)); } }
@media (max-width: 900px) { .zlm-st { flex-basis: calc(100% / min(var(--cols, 8), 6)); } }
/* the line itself: two half-segments per station, so wrapped rows stay continuous */
.zlm-st::before { content: ""; position: absolute; top: calc(var(--dot) / 2 - var(--line) / 2); left: 0; right: 0; height: var(--line); background: var(--c); }
.zlm-st:first-child::before { left: 50%; }
.zlm-st:last-child::before { right: 50%; }
.zlm-st:only-child::before { display: none; }

.zlm .zlm-st__btn { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; padding: 0 .15em; text-align: center; cursor: pointer; }
.zlm-st__dot { box-sizing: border-box; width: var(--dot); height: var(--dot); border: 5px solid var(--c); border-radius: 50%; background: #fff; transition: transform .15s; }
.zlm-st--test .zlm-st__dot { background: var(--c); box-shadow: inset 0 0 0 3px #fff; }
.zlm-st--hub .zlm-st__dot { transform: scale(1.25); }
.zlm-st--empty .zlm-st__dot { border: 3px dashed #9aa5ae; }
.zlm-st__name { margin-top: .45em; font-size: .84em; font-weight: 600; line-height: 1.22; overflow-wrap: break-word; }
.zlm-st--hub .zlm-st__name { font-size: .95em; }
.zlm-st--empty .zlm-st__name { color: #8a949c; font-weight: 500; }
.zlm-st__n { margin-top: .15em; font-size: .75em; color: var(--muted); white-space: nowrap; }
.zlm-st__x { display: inline-flex; gap: 2px; vertical-align: 1px; }
.zlm .zlm-st__btn:hover .zlm-st__dot, .zlm .zlm-st.is-open .zlm-st__dot { transform: scale(1.3); }
.zlm .zlm-st__btn:hover .zlm-st__name { color: #0067ac; }
.zlm-st.is-open .zlm-st__name { color: var(--c); }
.zlm-st.is-hl .zlm-st__dot { animation: zlm-hl 1.2s ease-in-out 3; }
@keyframes zlm-hl { 50% { transform: scale(1.7); box-shadow: 0 0 0 8px rgba(255, 213, 79, .7); } }
.zlm-st.is-dim { opacity: .2; }
.zlm-line.is-off { padding-bottom: .2em; opacity: .45; }
.zlm-line.is-off .zlm-line__track { display: none; }
.zlm-ov a.is-off { opacity: .35; }
.zlm-st.is-dim .zlm-st__btn { cursor: default; }

/* station pop-up */
.zlm-st__panel { margin: .5em .3em 0; font-size: .9em; }
.zlm--js .zlm-st__panel { display: none; }
.zlm--js .zlm-st.is-open .zlm-st__panel { display: block; position: absolute; z-index: 5; top: calc(100% + .4em); left: 50%; width: 21em;
  margin: 0; padding: .7em .9em .8em; transform: translateX(calc(-50% + var(--shift, 0px))); border: 1px solid #d6e3ee; border-top: 4px solid var(--c);
  border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(0, 40, 80, .16); text-align: left; }
.zlm .zlm-st__meta { margin: 0 0 .45em; font-size: .88em; color: var(--muted); }
.zlm-st__list li { margin: 0; padding: .28em 0; border-top: 1px solid #eef1f4; line-height: 1.3; }
.zlm-st__list li:first-child { border-top: 0; }
.zlm-st__list .zlm-more a { font-weight: 600; }
.zlm .zlm-st__soon { margin: 0; color: var(--muted); font-style: italic; }
.zlm-tag { display: inline-block; padding: 0 .45em; border-radius: 999px; background: #e7f4ea; color: #1f6b30; font-size: .8em; font-weight: 600; white-space: nowrap; }

/* ---------- check yourself ---------- */
.zlm-train { margin-top: 2em; padding-top: 1.2em; border-top: 1px solid #e6e6e6; }
.entry-content .zlm-train h2 { margin: 0 0 .7em; font-size: 1.25em; }
.zlm-train ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: .7em; }
.zlm-train a { display: flex; flex-direction: column; gap: .2em; height: 100%; padding: .8em 1em; border: 1px solid #d6e3ee; border-radius: 10px; background: #f6f9fc; box-sizing: border-box; }
.entry-content .zlm-train a { border: 1px solid #d6e3ee; }
.entry-content .zlm-train a:hover { border-color: #0067ac; text-decoration: none; }
.zlm-train span { font-size: .88em; color: var(--muted); }

/* ---------- phones: lines run downwards ---------- */
@media (max-width: 700px) {
  .zlm { --dot: 20px; }
  .zlm-ov ol { grid-template-columns: 1fr; gap: .1em; }
  .zlm-line__track { flex-direction: column; flex-wrap: nowrap; row-gap: 0; }
  .zlm-st { flex: none; min-width: 0; padding: 0 0 .55em; }
  .zlm-st::before { top: 0; bottom: 0; left: calc(var(--dot) / 2 - var(--line) / 2); right: auto; width: var(--line); height: auto; }
  .zlm-st:first-child::before { left: calc(var(--dot) / 2 - var(--line) / 2); top: calc(var(--dot) / 2); }
  .zlm-st:last-child::before { right: auto; bottom: auto; height: calc(var(--dot) / 2); }
  .zlm-st:first-child:last-child::before { display: none; }
  .zlm .zlm-st__btn { flex-direction: row; align-items: flex-start; gap: .7em; padding: 0; text-align: left; }
  .zlm-st__dot { flex: none; }
  .zlm-st__name { flex: 1; margin-top: .05em; font-size: .95em; }
  .zlm-st--hub .zlm-st__name { font-size: 1em; }
  .zlm-st__n { margin-top: .2em; }
  .zlm--js .zlm-st.is-open .zlm-st__panel { position: static; width: auto; margin: .5em 0 .3em calc(var(--dot) + .7em); transform: none; box-shadow: none; }
  .zlm-st__panel { margin-left: calc(var(--dot) + .7em); }
  .zlm .zlm-line__level { margin-left: 0; }
}
