/* Кнопка «На сайт Mezzotint» — общая для всех этюдов (разметку собирает js/etude-flag.js).
   Место по умолчанию — внизу по центру. Если там элементы этюда, этюд переставляет кнопку в своём CSS
   свойствами left / right / top / bottom / transform. */
.etude-flag {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 1000;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px); box-sizing: border-box;
  padding: 11px 16px 11px 13px; border-radius: 22px;
  background: rgba(10, 10, 9, .88); /* без backdrop-filter: под кнопкой часто живой WebGL-холст */
  box-shadow: inset 0 0 0 1px rgba(233, 227, 213, .16), 0 12px 30px -14px rgba(0, 0, 0, .8);
  color: #e9e3d5; text-decoration: none; text-align: left; text-transform: none; text-shadow: none;
  font: 500 13px/18px 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; letter-spacing: .01em;
  transition: background-color .3s, box-shadow .3s, opacity .4s;
}
.etude-flag:not(.ef) { opacity: 0; pointer-events: none; } /* до скрипта виден был бы голый текст */
.etude-flag:hover, .etude-flag:focus-visible {
  background: rgba(10, 10, 9, .92); color: #e9e3d5;
  box-shadow: inset 0 0 0 1px rgba(95, 184, 140, .55), 0 12px 30px -14px rgba(0, 0, 0, .8);
}
.etude-flag:focus-visible { outline: 2px solid #5fb88c; outline-offset: 3px; }

.ef__mark { flex: none; display: block; width: 22px; height: 18px; overflow: visible; }
.ef__mark path { fill: none; stroke: currentColor; stroke-width: 12; }
.ef__mark polygon { fill: #5fb88c; stroke: none; }
.ef__text { display: flex; align-items: center; min-width: 0; }
.ef__go { white-space: nowrap; }
.ef__arrow { display: inline-block; color: #5fb88c; transition: transform .3s; }
.etude-flag:hover .ef__arrow { transform: translateX(-3px); }

/* пояснение: на широком экране выезжает вбок, высота кнопки не меняется; на телефоне — второй строкой */
.ef__note {
  display: grid; grid-template-columns: 0fr; overflow: hidden; opacity: 0;
  color: #bcb5a6; font-size: 12px; font-weight: 400; line-height: 17px;
  transition: grid-template-columns .5s cubic-bezier(.2, .7, .2, 1), opacity .35s;
}
.ef__note > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ef__note > span::before { content: ''; display: inline-block; width: 1px; height: 14px; margin: 0 12px; vertical-align: -2px; background: rgba(233, 227, 213, .25); }
.etude-flag.is-open .ef__note, .etude-flag:hover .ef__note, .etude-flag:focus-visible .ef__note { grid-template-columns: 1fr; opacity: 1; }
@media (max-width: 760px) {
  .ef__text { flex-direction: column; align-items: flex-start; }
  .ef__note { grid-template-columns: none; grid-template-rows: 0fr; max-width: 0; transition: grid-template-rows .5s cubic-bezier(.2, .7, .2, 1), max-width .5s cubic-bezier(.2, .7, .2, 1), opacity .35s; }
  .ef__note > span { width: min(290px, calc(100vw - 100px)); min-height: 0; padding-top: 3px; white-space: normal; }
  .ef__note > span::before { display: none; }
  .etude-flag.is-open .ef__note, .etude-flag:hover .ef__note, .etude-flag:focus-visible .ef__note { grid-template-rows: 1fr; max-width: min(290px, calc(100vw - 100px)); }
}
@media (prefers-reduced-motion: reduce) { .etude-flag, .etude-flag * { transition: none !important; } }
.in-frame .etude-flag { display: none; }
@media print { .etude-flag { display: none !important; } }
