/* =========================================================================
   Fish It Scripts — components.css
   Кнопки, карточки скриптов, бейджи, фильтр, FAQ, шаги, инжекторы.
   ========================================================================= */

/* ---- Кнопки ------------------------------------------------------------ */
.btn-primary,
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  text-align: center;
  background: var(--accent);
  color: #0A1210;
  border: 1px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 13px 22px;
  cursor: pointer;
  transition: filter var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn-primary:hover,
.btn-download:hover {
  color: #0A1210;
  filter: brightness(1.08);
  box-shadow: 0 6px 20px -6px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-primary:active,
.btn-download:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 13px 22px;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-block { width: 100%; }

/* ---- Флагманский блок -------------------------------------------------- */
.flagship-block .flagship-block__intro {
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 22px;
}

/* ---- Фильтр ------------------------------------------------------------ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 26px;
}
.filter-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.filter-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.filter-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Сетка карточек ---------------------------------------------------- */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

/* ---- Карточка скрипта -------------------------------------------------- */
.script-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  padding: 22px;
  overflow: hidden;
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.script-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.script-card:hover .script-card__cover img { transform: scale(1.04); }
.script-card > h3 { margin: 0 0 12px; font-size: 20px; }

/* Обложка-скриншот (или брендированный плейсхолдер) */
.script-card__cover {
  position: relative;
  margin: -22px -22px 16px;         /* в край карточки поверх паддинга */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #0C1815 0%, #10241D 60%, #0A1210 100%);
}
.script-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.script-card__cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(16, 185, 129, 0.12), transparent 60%);
}
.script-card__cover-mark { font-size: 30px; filter: drop-shadow(0 0 10px var(--accent-glow)); }
.script-card__cover-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
  color: var(--text-primary);
  text-align: center;
  padding: 0 14px;
}

.script-card--flagship {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 34px -16px var(--accent-glow);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(16, 185, 129, 0.08), transparent 60%),
    var(--bg-card);
}
.script-card--flagship::before {
  content: '★ Топовый';
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--bg-base);
  background: var(--accent);
  border-radius: var(--radius-badge);
  padding: 3px 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Бейджи */
.script-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.badge {
  display: inline-block;
  /* Manrope ships a true 700 face; Chivo Mono only ships 500, so the display
     font renders the brief-mandated bold weight without faux-bold synthesis. */
  font-family: var(--font-display);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-badge);
  text-transform: uppercase;
}
.badge--nokey {
  background: transparent;
  color: var(--accent-sand);
  border: 1px solid var(--accent-sand);
}

/* Статус */
.script-card__status {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 10px;
}
.script-card__status.is-idle { color: var(--text-muted); }

.script-card__desc { color: var(--text-primary); margin: 0 0 14px; font-size: 15.5px; }

/* Функции */
.script-card__features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.script-card__features li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  color: var(--text-primary);
}
.script-card__features li::before {
  content: '';
  position: absolute;
  left: 4px; top: 0.62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* Дата проверки — использует песочный акцент как позитивный индикатор */
.script-card__checked {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-sand);
  margin: 0 0 16px;
}

/* Нижняя часть */
.script-card__foot { margin-top: auto; }
.script-card .btn-download { width: 100%; }
.script-card__executors {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 12px 0 0;
  line-height: 1.5;
}

/* ---- Шаги (front / how-to-use) ----------------------------------------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 22px 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps.steps--grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step {
  counter-increment: step;
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  padding: 18px 20px 18px 62px;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 18px; top: 16px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--accent);
  background: var(--bg-base);
  border: 1px solid var(--accent-dim);
  border-radius: 50%;
}
.step__title { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin: 0 0 4px; }
.step p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* ---- FAQ (details/summary) --------------------------------------------- */
.faq { display: grid; gap: 10px; margin: 22px 0; }
.faq__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  overflow: hidden;
}
.faq__item[open] { border-color: var(--accent-dim); }
.faq__q {
  list-style: none;
  cursor: pointer;
  padding: 16px 48px 16px 18px;
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: '+';
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent);
  transition: transform var(--ease);
}
.faq__item[open] .faq__q::after { content: '−'; }
.faq__q:hover { color: var(--accent); }
.faq__a { padding: 0 18px 18px; color: var(--text-muted); }
.faq__a p:last-child { margin-bottom: 0; }

/* ---- Инжекторы (страница /executor/) ----------------------------------- */
.injectors { display: grid; gap: 16px; margin: 22px 0; }
.injector-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  padding: 20px 22px;
  transition: border-color var(--ease);
}
.injector-card:hover { border-color: var(--accent); }
.injector-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.injector-card__name { margin: 0; font-size: 20px; }
.injector-card__translit { color: var(--text-muted); font-weight: 400; font-size: 15px; }
.injector-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.injector-card__meta .badge { text-transform: none; letter-spacing: 0; }
.injector-card p { margin: 0; color: var(--text-muted); }
.injector-card p + p { margin-top: 8px; }

/* ---- Информ-блоки / заметки -------------------------------------------- */
.note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  padding: 16px 20px;
  margin: 22px 0;
  color: var(--text-muted);
}
.note strong { color: var(--text-primary); }

/* ---- Лонгрид: типографика контента ------------------------------------- */
.longread { max-width: 74ch; }
.longread--lead { max-width: 82ch; margin-top: 8px; }
.longread--lead p { font-size: clamp(16px, 2vw, 18px); color: var(--text-primary); }

.final-cta { text-align: center; }
.final-cta .section__intro { margin-inline: auto; }
.final-cta .hero__actions { justify-content: center; }
.longread p { margin: 0 0 1.15em; color: var(--text-primary); }
.longread h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--accent-sand);
  margin: 1.7em 0 0.5em;
  scroll-margin-top: 84px;
}
.longread ul, .longread ol { padding-left: 22px; margin: 0 0 1.2em; }
.longread li { margin-bottom: 0.5em; }
.longread li::marker { color: var(--accent); }
.longread a { color: var(--accent); border-bottom: 1px solid var(--accent-dim); }
.longread a:hover { border-bottom-color: var(--accent); }
.longread strong { color: var(--text-primary); font-weight: 700; }

/* ---- Карточки-типы (виды скриптов) ------------------------------------- */
.type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.type-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  padding: 18px 20px;
  transition: border-color var(--ease);
}
.type-card:hover { border-left-color: var(--accent); }
.type-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text-primary);
}
.type-card h3 .lat { color: var(--accent); }
.type-card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* ---- Таблица сравнения -------------------------------------------------- */
.compare-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.compare-table thead th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-code);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.compare-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
.compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody tr:hover td { background: var(--bg-card); }
.compare-table td:first-child { color: var(--text-primary); font-weight: 700; white-space: nowrap; }
.compare-table .yes { color: var(--accent); font-weight: 700; }
.compare-table .no  { color: var(--text-muted); }

/* ---- Словарь терминов (глоссарий) -------------------------------------- */
.terms { margin: 24px 0; display: grid; gap: 4px; }
.terms dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  margin-top: 14px;
}
.terms dt .lat { color: var(--accent); }
.terms dt .translit { color: var(--text-muted); font-weight: 400; font-size: 14px; }
.terms dd {
  margin: 4px 0 0;
  padding-left: 14px;
  border-left: 2px solid var(--accent-dim);
  color: var(--text-muted);
}

/* ---- Быстрые факты (key facts) ----------------------------------------- */
.keyfacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}
.keyfacts li {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  padding: 16px 18px;
}
.keyfacts .keyfacts__num {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 24px;
  color: var(--accent-sand);
  line-height: 1.1;
  margin-bottom: 4px;
}
.keyfacts .keyfacts__label { color: var(--text-muted); font-size: 13.5px; }

/* ---- Telegram-callout --------------------------------------------------- */
.tg-callout {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: var(--space-section) 0 0;
  padding: 22px 24px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-card);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(16, 185, 129, 0.10), transparent 55%),
    var(--bg-card);
}
.tg-callout__icon {
  font-size: 34px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}
.tg-callout__body { flex: 1; min-width: 0; }
.tg-callout__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.tg-callout__text { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.tg-callout__text a { color: var(--accent); font-weight: 700; }
.tg-callout__btn { flex-shrink: 0; }
@media (max-width: 620px) {
  .tg-callout { flex-direction: column; align-items: flex-start; text-align: left; }
  .tg-callout__btn { width: 100%; }
}

/* ---- Контентная иллюстрация (figure) ----------------------------------- */
.content-figure {
  margin: 26px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-code);
}
.content-figure img { width: 100%; height: auto; display: block; }
.content-figure figcaption {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.content-figure figcaption strong { color: var(--accent-sand); font-weight: 700; }

/* ---- Мета-строка страницы (дата обновления) ---------------------------- */
.page-meta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 18px;
}
.page-meta time { color: var(--accent-sand); }

/* ---- Адаптив ----------------------------------------------------------- */
@media (max-width: 520px) {
  .scripts-grid { grid-template-columns: 1fr; }
  .script-card { padding: 18px; }
}
