/* assets/css/author.css — Modern v2.7 (ровные отступы, единая строка заголовка с иконками) */

/* Базовые переменные */
.author-page {
  --ap-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  --ap-text-color: #0f172a;    /* основной текст */
  --ap-muted-color: #64748b;   /* подписи */
  --ap-link: #2563eb;
  --ap-link-hover: #1d4ed8;
  --ap-border: #e5e7eb;
  --ap-bg: #ffffff;
  --ap-surface: #ffffff;
  --ap-surface-2: #f9fafb;
  --ap-radius: 14px;
  --ap-shadow: 0 10px 28px rgba(2, 8, 23, .06);

  --ap-base-font-size: 15px;
  --ap-line-height: 1.7;
  --ap-title-letterspace: -0.01em;

  /* Равномерные отступы у шапки (внутри .author-header) */
  --ah-pad: 14px; /* одинаковый паддинг сверху и снизу у строки заголовка+иконок */
}

/* Страница */
.author-page {
  padding: 24px 0 40px;
  background: var(--ap-bg);
  font-family: var(--ap-font-family);
  font-size: var(--ap-base-font-size);
  line-height: var(--ap-line-height);
  color: var(--ap-text-color);
}

/* Единая строка: имя автора слева, иконки справа, равномерные отступы */
.author-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: var(--ah-pad) 0;             /* одинаковый сверху/снизу */
  border-bottom: 2px solid #f0f0f0;     /* разделитель строго под строкой */
  margin-bottom: 20px;                  /* расстояние до следующего блока */
}

/* Имя автора — без внешних отступов, чтобы паддинги .author-header были симметричны */
.author-page .author-title {
  font-weight: 700;
  margin: 0;
  letter-spacing: var(--ap-title-letterspace);
  color: #0b1220;
  font-size: clamp(26px, 2.2vw + 12px, 34px);
  line-height: 1.2;
}

/* Иконки действий: круг, прозрачный фон, тонкая обводка круга и пиктограммы */
.author-actions { display: flex; gap: 10px; }
.author-actions .action-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;  /* прозрачные */
  color: #000;

  /* ТОЛЩИНА ОБВОДКИ КРУГА: меняйте тут (по умолчанию 0.4px) */
  border: 0.4px solid rgba(0,0,0,.9);

  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(2,8,23,.06);
  cursor: pointer; user-select: none;
  transition: transform .1s ease, filter .15s ease, border-color .2s ease, color .2s ease;
}
@supports not (border: 0.4px solid black) {
  .author-actions .action-btn {
    border-width: 1px;               /* фолбэк — визуально тоньше за счёт полупрозрачности */
    border-color: rgba(0,0,0,.35);
  }
}
.author-actions .action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

/* Обводка контуром самой иконки (stroke); если не поддерживается — будет чёрный цвет */
.author-actions .action-btn i {
  font-size: 18px; line-height: 1;
  color: transparent;                   /* без заливки */
  -webkit-text-stroke: 0.7px #000;      /* ТОЛЩИНА ОБВОДКИ ПИКТОГРАММЫ */
  text-stroke: 0.7px #000;
}
@supports not (-webkit-text-stroke: 1px black) {
  .author-actions .action-btn i { color: rgba(0,0,0,.9); }
}

/* Временный зелёный отклик для «копировать» */
.author-actions .action-btn.ok {
  border-color: #16a34a !important;
  color: #16a34a !important;
}
.author-actions .action-btn.ok i {
  -webkit-text-stroke: 0.7px #16a34a;
  text-stroke: 0.7px #16a34a;
}

/* Основная сетка: шире контент слева, уже sticky справа */
.author-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

/* Левая внутренняя сетка */
.ap-main {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-auto-rows: min-content;
  gap: 24px;
  align-items: start;
}

/* Галерея */
.ap-gallery .ap-main-photo {
  width: 260px;
  height: 355px;
  border-radius: var(--ap-radius);
  overflow: hidden;
  background: #f3f4f6;
  box-shadow: var(--ap-shadow);
}
.ap-gallery .ap-main-photo img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .35s ease;
}
.ap-gallery .ap-main-photo:hover img { transform: scale(1.03); }

.ap-gallery .ap-thumbs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, 85px);
  gap: 6px;
}
.ap-gallery .ap-thumb {
  width: 85px; height: 85px;
  border-radius: 10px; overflow: hidden;
  background: #f3f4f6; border: 1px solid var(--ap-border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ap-gallery .ap-thumb:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.ap-gallery .ap-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Правая часть левой колонки */
.ap-info { width: 100%; }

/* ЕДИНАЯ карточка ap-info: превью + характеристики */
.ap-info .ap-card {
  position: relative;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius);
  box-shadow: var(--ap-shadow);
  overflow: hidden;
  padding: 0;
}

/* Превью — не обрезается */
.ap-info .ap-card .ap-preview {
  padding: 18px;
  color: #334155;
  line-height: 1.75;
  background: linear-gradient(180deg, rgba(249,250,251,.6) 0%, rgba(255,255,255,1) 100%);
}

/* Характеристики ниже превью */
.ap-info .ap-card .ap-char {
  border-top: 1px solid #eef2f7;
  background: transparent;
  border: 0; border-radius: 0;
  overflow: visible; box-shadow: none;
}
.ap-info .ap-char ul { list-style: none; padding: 0; margin: 0; }

.ap-info .ap-char-row {
  display: grid;
  grid-template-columns: 170px 1fr; /* шире зона значения */
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f7;
  transition: background-color .15s ease;
}
.ap-info .ap-char-row:last-child { border-bottom: none; }
.ap-info .ap-char-row:hover { background: rgba(2,8,23,.02); }

.ap-info .ap-char-item span {
  color: var(--ap-muted-color);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
}
.ap-info .ap-char-val { color: var(--ap-text-color); position: relative; }

/* Сворачиваемый текст */
.ap-info .ap-char-text { white-space: normal; }
.ap-info .ap-char-text.ap-collapsed {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, #000 80%, transparent 100%);
          mask-image: linear-gradient(to right, #000 80%, transparent 100%);
}

/* Тоггл Развернуть/Свернуть — «пилюля» */
.ap-info .ap-char-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ap-link); cursor: pointer; font-size: 13.5px;
  margin-top: 8px; user-select: none; padding: 4px 10px; border-radius: 9999px;
  background: rgba(37,99,235,.08);
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.ap-info .ap-char-toggle:hover { background: rgba(37,99,235,.12); color: var(--ap-link-hover); }
.ap-info .ap-char-toggle.is-hidden { display: none !important; }
.ap-info .ap-char-toggle::after { content: "▾"; font-size: 12px; transform-origin: center; transition: transform .2s ease; }
.ap-info .ap-char-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* Ссылки внутри значений */
.ap-info .ap-char-val a { color: var(--ap-link); text-decoration: none; }
.ap-info .ap-char-val a:hover { text-decoration: underline; }

/* Sticky CTA — «glass»-карточка */
.ap-sidebar { align-self: stretch; position: relative; }
.ap-sidebar .ap-sticky-cta {
  position: sticky;
  top: var(--ap-sticky-top, 90px);
  width: 100%;

  /* убираем фиксированный минимум, даём блоку сжиматься по контенту */
  min-height: auto;

  padding: 18px 18px;

  background:
    linear-gradient(180deg, rgba(255,255,255,.78) 0%, rgba(249,250,251,.78) 100%),
    var(--ap-surface-2);
  border: 1px solid rgba(148,163,184,.35);
  border-radius: var(--ap-radius);
  backdrop-filter: saturate(130%) blur(6px);
  box-shadow: var(--ap-shadow);

  display: grid;
  row-gap: 10px;

  /* контент прижимается к верху, не центрируется по вертикали */
  align-content: start;
  justify-content: stretch;
  justify-items: start;
  text-align: left;

  max-height: calc(100vh - var(--ap-sticky-top, 90px) - 24px);
  overflow: auto;
}

.ap-sidebar .ap-sticky-cta .ap-cta-title {
  font-size: clamp(calc(var(--cta-title-size) * 0.98), 1.1vw, calc(var(--cta-title-size) * 1.08));
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--cta-title-color);
  letter-spacing: -0.01em;
}
.ap-sidebar .ap-sticky-cta .ap-cta-text {
  font-size: var(--cta-text-size);
  color: var(--cta-text-color);
  margin-bottom: 4px;
  line-height: 1.65;
}
.ap-sidebar .ap-sticky-cta .ap-cta-button {
  display: inline-block;
  text-align: center;
  padding: 10px 14px;
  font-size: var(--cta-btn-size);
  background: var(--cta-btn-bg);
  color: var(--cta-btn-color);
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(37,99,235,.18);
  transition: transform .08s ease, box-shadow .2s ease, filter .15s ease;
}
.ap-sidebar .ap-sticky-cta .ap-cta-button:hover { filter: brightness(0.96); box-shadow: 0 10px 20px rgba(37,99,235,.22); }
.ap-sidebar .ap-sticky-cta .ap-cta-button:active { transform: translateY(1px); }

/* Подробнее */
.ap-detail { grid-column: 1 / 3; margin-top: 28px; background: var(--ap-bg); }
.ap-detail h2 { font-size: clamp(20px, 1.2vw + 12px, 24px); margin: 0 0 12px; letter-spacing: -0.01em; }
.ap-detail__content p { margin: 10px 0; line-height: 1.8; color: #334155; }

/* Списки в «Подробнее» */
.ap-detail__content ul { list-style:none; padding-left:0; }
.ap-detail__content ul li { position:relative; padding-left:28px; margin:8px 0; }
.ap-detail__content ul li:before { content:""; position:absolute; left:0; top:4px; width:18px; height:18px; border-radius:50%; background:#10b981; }
.ap-detail__content ul li:after { content:""; position:absolute; left:6px; top:9px; width:6px; height:3px; border-left:2px solid #fff; border-bottom:2px solid #fff; transform:rotate(-45deg); }

.ap-detail__content ol { list-style: none; counter-reset: ap-ol; padding-left: 0; margin: 10px 0; }
.ap-detail__content ol li { position: relative; counter-increment: ap-ol; padding-left: 34px; margin: 8px 0; min-height: 24px; color: #334155; }
.ap-detail__content ol li::before {
  content: counter(ap-ol);
  position: absolute; left: 0; top: 2px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #10b981; color: #fff; font-weight: 700; font-size: 13px; line-height: 24px; text-align: center;
}

/* Курсы автора */
.author-courses { margin-top: 36px; background: #fff !important; }

/* Адаптив */
@media (max-width: 1280px) { .author-top { grid-template-columns: 1fr 320px; } }
@media (max-width: 1100px) { .author-top { grid-template-columns: 1fr 300px; } }
@media (max-width: 900px)  {
  .author-top { grid-template-columns: 1fr; }
  .ap-main { grid-template-columns: 1fr; }
  .ap-detail { grid-column: 1 / 2; }
  .ap-sidebar .ap-sticky-cta { position: static; width: 100%; max-height: none; overflow: visible; }
}
