/* ============================================================
   Diagpro — WordPress shim (аддитивно к styles.css)
   Заменяет поведение <image-slot> на нативные изображения WP
   и стилизует Contact Form 7 под дизайн.
   ============================================================ */

/* --- Изображения: класс .diag-img повторяет геометрию <image-slot> --- */
.diag-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero__photo .diag-img { width: 100%; height: 100%; }
.split__media .diag-img { width: 100%; height: 460px; border: 1px solid var(--line); }
.art-card__media .diag-img { width: 100%; height: 100%; }
.svc-big__media .diag-img { width: 100%; height: 100%; }
.prose .figure .diag-img { width: 100%; height: 380px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.article-cover .diag-img { width: 100%; height: clamp(280px, 42vw, 520px); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.team-card .diag-img { width: 100%; aspect-ratio: 1; }
@media (max-width: 720px) { .split__media .diag-img { height: 300px; } }

/* Плейсхолдер, когда изображение не задано (повторяет вид image-slot) */
.diag-img--placeholder {
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  color: var(--muted, #8b8f98);
  background:
    linear-gradient(135deg, rgba(255,255,255,.02), rgba(255,255,255,0)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 10px, transparent 10px 20px),
    var(--surface-2, #15171c);
  font: 500 14px/1.4 var(--font-body, system-ui, sans-serif);
}
.hero__photo .diag-img--placeholder { width: 100%; height: 100%; }

/* --- Contact Form 7 под дизайн Diagpro --- */
.cta-form .wpcf7, .request-form .wpcf7 { width: 100%; }
.wpcf7 .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .wpcf7 .row { grid-template-columns: 1fr; } }
.wpcf7 .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.wpcf7 label { font-size: 14px; font-weight: 600; color: var(--ink, #e8e9ec); }
.wpcf7 input.input,
.wpcf7 input[type="text"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%; padding: 14px 16px;
  background: var(--surface-2, #15171c);
  border: 1px solid var(--line, #2a2d35);
  border-radius: var(--radius, 10px);
  color: var(--ink, #e8e9ec);
  font: 400 15px var(--font-body, system-ui, sans-serif);
  transition: border-color .15s ease;
}
.wpcf7 input:focus, .wpcf7 textarea:focus {
  outline: none; border-color: var(--accent, #ff7a00);
  box-shadow: 0 0 0 3px rgba(255,122,0,.15);
}
.wpcf7 .wpcf7-submit { width: 100%; justify-content: center; }

/* Согласие на обработку ПД */
.wpcf7-acceptance .wpcf7-list-item { margin: 0 0 14px; }
.wpcf7-acceptance label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.wpcf7-acceptance input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0;
  background: var(--surface-2, #15171c); border: 1px solid var(--line, #2a2d35);
  border-radius: 4px; cursor: pointer; position: relative; transition: .15s;
}
.wpcf7-acceptance input[type="checkbox"]:checked { background: var(--accent, #ff7a00); border-color: var(--accent, #ff7a00); }
.wpcf7-acceptance input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #1a0e00; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.wpcf7-acceptance input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent-2, #ffb300); outline-offset: 2px; }
.wpcf7-acceptance .wpcf7-list-item-label { font-size: 13px; line-height: 1.5; color: var(--muted, #9aa0aa); }
.wpcf7-acceptance a { color: var(--accent, #ff7a00); text-decoration: underline; }
.wpcf7-acceptance a:hover { color: var(--accent-2, #ffb300); }
/* Неактивная кнопка, пока согласие не отмечено */
.wpcf7-submit:disabled, .wpcf7 .wpcf7-submit[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }
.wpcf7-response-output {
  margin: 8px 0 0 !important; padding: 12px 16px !important;
  border-radius: var(--radius, 10px); border: 1px solid var(--line, #2a2d35);
  font-size: 14px;
}
.wpcf7-not-valid-tip { color: #ff6b6b; font-size: 12.5px; }
.wpcf7 .wpcf7-not-valid { border-color: #ff6b6b !important; }
.wpcf7 form.sent .wpcf7-response-output { border-color: #3fb950; color: #3fb950; }

/* Карта (Яндекс embed) заполняет блок .map-stub */
.map-stub iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* Попап заявки */
.diag-modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.diag-modal.open { display: flex; }
.diag-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.diag-modal__dialog { position: relative; z-index: 1; width: 100%; max-width: 560px; background: var(--bg-1, #15171C); border: 1px solid var(--line, #2a2d35); border-radius: var(--radius-lg, 10px); padding: 34px; max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.diag-modal__close { position: absolute; top: 8px; right: 12px; width: 40px; height: 40px; background: none; border: 0; color: var(--text-dim, #8a909a); font-size: 30px; line-height: 1; cursor: pointer; }
.diag-modal__close:hover { color: var(--accent, #ff7a00); }
@media (max-width: 520px) { .diag-modal__dialog { padding: 24px; } }

/* Логотип Diagpro (SVG) в шапке и подвале */
.brand__img { display: block; height: 38px; width: auto; }
.site-header .brand__img { height: 36px; }
.site-footer .brand__img { height: 40px; margin-bottom: 4px; }
@media (max-width: 1040px) { .site-header .brand__img { height: 30px; } }

/* На мобиле скрываем CTA-кнопку в шапке (она дублируется в мобильном меню),
   оставляем только бургер — иначе ломается раскладка header-cta. */
@media (max-width: 1040px) {
  .site-header .header-cta .btn { display: none; }
}

/* --- WP-специфика --- */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
/* пагинация WP в стиле ссылок-стрелок */
.diag-pagination { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 48px; }
.diag-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 12px;
  border: 1px solid var(--line, #2a2d35); border-radius: var(--radius, 10px);
  color: var(--ink, #e8e9ec); text-decoration: none; font-weight: 600;
}
.diag-pagination .page-numbers.current,
.diag-pagination .page-numbers:hover { border-color: var(--accent, #ff7a00); color: var(--accent, #ff7a00); }
