/* ============================================================
   Страница «А что делать?» — порядок выполнения курсовой
   Стиль: чертёжный лист 3D-страницы
   ============================================================ */

.guide-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  border-left: 6px solid var(--acc, #e04a17);
  background: linear-gradient(135deg, rgba(44, 93, 158, .10), var(--card, #faf8f2) 70%);
}

.guide-hero__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border: 1.5px solid var(--ink, #1b232e);
  border-radius: 5px;
  background: var(--paper, #f2f0e9);
  font-size: 26px;
}

.guide-hero h2 {
  padding-bottom: 0;
  margin-bottom: 6px;
  border-bottom: 0;
}

.guide-hero p {
  max-width: 760px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink2, #5b6572);
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 5px;
  font-family: var(--disp, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.btn-primary {
  background: var(--ink, #1b232e);
  border: 1.5px solid var(--ink, #1b232e);
  color: var(--paper, #f2f0e9);
}

.btn-primary:hover {
  background: var(--acc, #e04a17);
  border-color: var(--acc, #e04a17);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--card, #faf8f2);
  border: 1.5px solid var(--ink, #1b232e);
  color: var(--ink, #1b232e);
}

.btn-ghost:hover {
  border-color: var(--acc, #e04a17);
  color: var(--acc, #e04a17);
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 26px;
  color: var(--ink2, #5b6572);
  font-size: 14px;
  line-height: 1.5;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  background: var(--acc, #e04a17);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.guide-section-title {
  margin: 34px 0 14px;
  font-family: var(--disp, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink, #1b232e);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 0;
  padding: 18px 20px;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--ink, #1b232e);
  color: var(--paper, #f2f0e9);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 13px;
  font-weight: 600;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body h3 {
  margin: 0 0 5px;
  font-family: var(--disp, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink, #1b232e);
}

.step-body p {
  margin: 0;
  color: var(--ink2, #5b6572);
  font-size: 14px;
  line-height: 1.6;
}

.step-meta {
  margin-top: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line, #c8c2b2);
  border-radius: 3px;
  background: var(--paper2, #eae7dd);
  color: var(--ink2, #5b6572);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 10.5px;
  line-height: 1.5;
}

.step-meta span {
  color: var(--ink, #1b232e);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.step-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--blue, #2c5d9e);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
}

.step-link:hover {
  color: var(--acc, #e04a17);
  text-decoration: underline;
}

.guide-tip {
  margin-top: 20px;
}

.guide-tip ol,
.guide-tip ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--ink2, #5b6572);
  font-size: 14px;
  line-height: 1.7;
}

.guide-tip li + li {
  margin-top: 5px;
}

.guide-tip strong {
  color: var(--ink, #1b232e);
}

.guide-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 22px 24px;
  border: 2px solid var(--ink, #1b232e);
  border-top: 6px solid var(--acc, #e04a17);
  border-radius: 6px;
  background: var(--ink, #1b232e);
  color: var(--paper, #f2f0e9);
}

.guide-cta h2 {
  margin: 0 0 4px;
  font-family: var(--disp, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--paper, #f2f0e9);
}

.guide-cta p {
  margin: 0;
  color: var(--paper2, #eae7dd);
  font-size: 13.5px;
}

.guide-cta .btn-primary {
  flex-shrink: 0;
  background: var(--paper, #f2f0e9);
  border-color: var(--paper, #f2f0e9);
  color: var(--ink, #1b232e);
}

.guide-cta .btn-primary:hover {
  background: var(--acc, #e04a17);
  border-color: var(--acc, #e04a17);
  color: #fff;
}

/* ============================================================
   КОМПОНЕНТЫ ДЛЯ ПЕРЕРАБОТКИ СТРАНИЦЫ
   ============================================================ */

/* ---- 1. Иллюстрация с подписью (PNG / GIF) ---- */
.guide-figure {
  margin: 18px 0 0;
}

.guide-figure__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1.5px solid var(--ink, #1b232e);
  border-radius: 5px;
  background-color: var(--paper2, #eae7dd);
  background-image:
    linear-gradient(rgba(44, 93, 158, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 93, 158, .05) 1px, transparent 1px);
  background-size: 12px 12px;
  overflow: hidden;
}

.guide-figure__media img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line, #c8c2b2);
  border-radius: 3px;
  background: #fff;
}

.guide-figure__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--ink, #1b232e);
  color: var(--paper, #f2f0e9);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.4;
  text-transform: uppercase;
  pointer-events: none;
}

.guide-figure--gif .guide-figure__badge {
  background: var(--acc, #e04a17);
  color: #fff;
}

.guide-figure--gif .guide-figure__badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: guide-pulse 1.4s ease-in-out infinite;
}

@keyframes guide-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

.guide-figure__caption {
  margin-top: 8px;
  color: var(--ink2, #5b6572);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 10.5px;
  line-height: 1.5;
}

.guide-figure__label {
  margin-right: 6px;
  color: var(--acc, #e04a17);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Ряд из двух и более иллюстраций */
.guide-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.guide-figure-grid .guide-figure {
  margin-top: 0;
}

/* ---- 2. Блок формулы ---- */
.guide-formula {
  margin-top: 16px;
  padding: 14px 18px 16px;
  border: 1.5px solid var(--ink, #1b232e);
  border-left: 5px solid var(--blue, #2c5d9e);
  border-radius: 5px;
  background: var(--card, #faf8f2);
}

.guide-formula__label {
  margin-bottom: 4px;
  color: var(--blue, #2c5d9e);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.guide-formula__body {
  color: var(--ink, #1b232e);
  text-align: center;
}

.guide-formula__body .katex-display {
  margin: 4px 0;
  padding: 2px 0;
}

.guide-formula__body .katex-display:first-child {
  margin-top: 0;
}

.guide-formula__note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #c8c2b2);
  color: var(--ink2, #5b6572);
  font-size: 12.5px;
  line-height: 1.55;
}

/* Вариант для итоговой / главной формулы */
.guide-formula--result {
  border-left-color: var(--acc, #e04a17);
}

.guide-formula--result .guide-formula__label {
  color: var(--acc, #e04a17);
}

.guide-formula--result .katex-display .katex {
  font-size: 1.18em !important;
}

/* ---- 3. Сворачивающийся блок ---- */
.guide-collapse {
  margin-top: 14px;
  border: 1.5px solid var(--ink, #1b232e);
  border-radius: 5px;
  background: var(--card, #faf8f2);
  overflow: hidden;
}

.guide-collapse__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--ink, #1b232e);
  cursor: pointer;
  font-family: var(--disp, 'Oswald', 'Arial Narrow', sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  list-style: none;
  text-transform: uppercase;
  transition: background .15s ease, color .15s ease;
}

.guide-collapse__summary::-webkit-details-marker {
  display: none;
}

.guide-collapse__summary:hover {
  background: var(--paper2, #eae7dd);
  color: var(--acc, #e04a17);
}

.guide-collapse__summary:focus-visible {
  outline: 2px solid var(--acc, #e04a17);
  outline-offset: -2px;
}

.guide-collapse__summary::after {
  content: "+";
  margin-left: auto;
  color: var(--acc, #e04a17);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  transition: transform .2s ease;
}

.guide-collapse[open] > .guide-collapse__summary {
  border-bottom: 1px solid var(--line, #c8c2b2);
  background: var(--paper2, #eae7dd);
}

.guide-collapse[open] > .guide-collapse__summary::after {
  transform: rotate(45deg);
}

.guide-collapse__hint {
  margin-left: auto;
  color: var(--ink2, #5b6572);
  font-family: var(--mono, 'IBM Plex Mono', Consolas, monospace);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: none;
}

.guide-collapse__body {
  padding: 14px 16px 16px;
  color: var(--ink2, #5b6572);
  font-size: 14px;
  line-height: 1.65;
}

.guide-collapse__body > :first-child {
  margin-top: 0;
}

.guide-collapse__body > :last-child {
  margin-bottom: 0;
}

.guide-collapse__body .guide-figure {
  margin-top: 12px;
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  .guide-figure--gif .guide-figure__badge::before,
  .guide-collapse__summary::after {
    animation: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .guide-hero {
    flex-direction: column;
    gap: 12px;
  }

  .step {
    gap: 12px;
    padding: 16px;
  }

  .step-num {
    width: 34px;
    height: 34px;
    font-size: 11px;
  }

  .guide-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .guide-figure-grid {
    grid-template-columns: 1fr;
  }

  .guide-formula {
    padding: 12px 14px 14px;
  }

  .guide-collapse__hint {
    display: none;
  }

  .guide-collapse__summary {
    padding: 10px 13px;
    font-size: 12px;
  }

  .guide-collapse__body {
    padding: 12px 13px 14px;
  }
}
