/* ==========================================================================
   Сайт эксперта — Колбиной Марии Сергеевны
   Единая таблица стилей. Без внешних зависимостей и веб-шрифтов ради
   зелёной зоны Core Web Vitals на мобильных.
   ========================================================================== */

:root {
  --ink:        #17252b;   /* основной текст */
  --ink-soft:   #4a5b62;   /* вторичный текст */
  --muted:      #6f8088;   /* подписи, даты */
  --accent:     #0f6e6a;   /* фирменный тёмно-бирюзовый */
  --accent-dk:  #0a544f;   /* ховер */
  --accent-sf:  #e6f1f0;   /* мягкая заливка акцента */
  --line:       #dfe6e6;   /* границы */
  --bg:         #ffffff;   /* фон страницы */
  --bg-alt:     #f5f8f8;   /* фон секций */
  --focus:      #0f6e6a;
  --radius:     10px;
  --wrap:       960px;
  --shadow:     0 1px 2px rgba(23, 37, 43, .05), 0 6px 24px rgba(23, 37, 43, .05);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Служебное --------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* --- Ссылки и типографика ---------------------------------------------- */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dk); text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); margin: 2em 0 .6em; }
h3 { font-size: 1.15rem; margin: 1.6em 0 .4em; }
p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .3em 0; }
strong { font-weight: 700; }

.lead { font-size: 1.15rem; color: var(--ink-soft); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Плейсхолдер — то, что заказчик заполняет по документам */
.ph {
  background: #fff6e2;
  border-bottom: 1px dashed #d9a600;
  color: #6b4f00;
  padding: 0 .25em;
  border-radius: 3px;
  font-style: normal;
}

/* --- Шапка / навигация -------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-right: auto;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .role { font-weight: 400; font-size: .85rem; color: var(--muted); }

.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nav a {
  color: var(--ink-soft);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .97rem;
}
.nav a:hover { background: var(--bg-alt); color: var(--accent-dk); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-sf); color: var(--accent-dk); font-weight: 600; }

/* --- Основной блок ------------------------------------------------------ */
main { display: block; }
.section { padding: 40px 0; }
.section + .section { border-top: 1px solid var(--line); }

/* Хиро главной */
.hero { padding: 48px 0 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
}
.photo {
  width: 200px;
  height: 240px;
  object-fit: cover;
  object-position: center top;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-alt);
  box-shadow: var(--shadow);
}
.hero .role-line { color: var(--accent-dk); font-weight: 600; margin: 0 0 .3em; }
.hero .place { color: var(--muted); margin: 0 0 1.2em; }

/* Карточки / плитки */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 1.2em 0; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* Список публикаций */
.pub-group { margin: 0 0 2em; }
.pub-group h2 { display: flex; align-items: baseline; gap: 10px; }
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 12px;
  background: var(--bg);
  transition: border-color .15s ease;
}
.pub-item:hover { border-color: #c3d3d2; }
.pub-item .pub-title { font-weight: 600; font-size: 1.06rem; }
.pub-item .pub-title a { color: var(--ink); }
.pub-item .pub-title a:hover { color: var(--accent-dk); }
.pub-meta { color: var(--muted); font-size: .92rem; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pub-meta .src { font-weight: 600; color: var(--ink-soft); }

/* Плитка публикаций */
.pub-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 1.2em 0 1em;
}
.pub-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pub-tile:hover {
  border-color: #bcd6d4;
  box-shadow: var(--shadow);
  text-decoration: none;
  transform: translateY(-2px);
}
.pub-tile:focus-visible { text-decoration: none; }
.pub-tile-cat {
  align-self: flex-start;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--accent-dk);
  background: var(--accent-sf);
  padding: 3px 10px;
  border-radius: 999px;
}
.pub-tile-title {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--ink);
  flex: 1;
}
.pub-tile:hover .pub-tile-title { color: var(--accent-dk); }
.pub-tile-date { font-size: .85rem; color: var(--muted); margin-top: auto; }

/* Инфоблок / примечание */
.note {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 1.4em 0;
}
.note p:last-child { margin-bottom: 0; }
.note .note-title { font-weight: 700; margin-bottom: .3em; }

/* Определения (образование, стаж и т.п.) */
.facts { border-top: 1px solid var(--line); margin: 1.2em 0; }
.facts .row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.facts .row dt { color: var(--muted); font-weight: 600; margin: 0; }
.facts .row dd { margin: 0; }

/* Форма контактов */
.form-field { margin: 0 0 16px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.form-field input:focus,
.form-field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-sf); }
.form-field textarea { min-height: 130px; resize: vertical; }
.form-consent { font-size: .88rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.form-consent input { margin-top: 4px; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  border: 0;
  padding: 12px 26px;
  border-radius: 8px;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dk); color: #fff; text-decoration: none; }

.contact-line { font-size: 1.15rem; margin: 1em 0; }
.contact-line a { font-weight: 600; }

/* Блок «последние публикации» на главной */
.latest { list-style: none; padding: 0; margin: 1em 0; }
.latest li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.latest li:first-child { border-top: 1px solid var(--line); }
.latest .t { font-weight: 600; }
.latest .t a { color: var(--ink); }
.latest .m { color: var(--muted); font-size: .9rem; }

.more-link { display: inline-block; margin-top: 8px; font-weight: 600; }

/* --- Подвал ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  margin-top: 48px;
  padding: 32px 0;
  color: var(--muted);
  font-size: .92rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer a { color: var(--ink-soft); }
.site-footer .foot-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* --- Адаптив ------------------------------------------------------------ */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .photo { width: 160px; height: 192px; }
  .cards { grid-template-columns: 1fr; }
  .facts .row { grid-template-columns: 1fr; gap: 2px; padding: 12px 0; }
  .site-header .wrap { gap: 6px 12px; }
  .brand { width: 100%; margin-bottom: 4px; }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  a { color: var(--ink); text-decoration: underline; }
}
