/*
Theme Name: Совпадаем
Description: Фирменная тема блога «Совпадаем» — тёплая редакционная ризография: три краски на небелёной бумаге, жёсткие тени, 2px обводки. Повторяет дизайн-систему основного сайта.
Version: 1.0
Author: Совпадаем
Text Domain: sovpadaem
*/

:root {
  --paper:      #F7F4EF;
  --paper-deep: #EFEAE0;
  --paper-line: #E3DCCF;
  --ink:        #2B2430;
  --muted:      #837A72;
  --blue:       #2C4FD6;
  --blue-soft:  #E4E9FB;
  --red:        #E03E4E;
  --red-soft:   #FBE5E4;
  --purple:     #6B2A78;
  --purple-soft:#F0E4F3;
  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-ui: "Golos Text", -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow-card: 5px 5px 0 rgba(43, 36, 48, .16);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.18rem; }

p { margin: 0 0 1em; }
a { color: var(--purple); text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 740px; margin: 0 auto; padding: 0 20px; }

/* ── Шапка ── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 18px 0 14px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
}
.logo b { color: var(--red); }
.logo-group { display: flex; align-items: center; gap: 8px; }
.blog-tag {
  font-family: var(--font-ui); font-weight: 600; font-size: .78rem;
  color: var(--purple); background: var(--purple-soft);
  border-radius: 999px; padding: 3px 10px;
  text-decoration: none;
}
.blog-tag:hover { background: var(--purple); color: #fff; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .97rem; }
.site-nav a:hover { color: var(--purple); }

.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 600; font-size: 1rem;
  text-decoration: none; text-align: center; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 999px;
  background: #FDFCF9; color: var(--ink);
  padding: 11px 24px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary, .site-nav a.btn-primary { background: var(--ink); color: var(--paper); }
.btn-big { padding: 16px 34px; font-size: 1.1rem; }

/* ── Лента статей ── */
.blog-head { margin: 34px 0 10px; }
.blog-head p { max-width: 40em; color: var(--muted); }
.post-grid { display: grid; gap: 20px; margin: 30px 0 10px; }
@media (min-width: 800px) { .post-grid { grid-template-columns: 1fr 1fr; } }

.post-card {
  background: #FDFCF9;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 8px;
}
.post-card .pc-meta { color: var(--muted); font-size: .84rem; }
.post-card h2 { font-size: 1.35rem; margin: 0; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--purple); }
.post-card .pc-excerpt { color: var(--ink); margin: 0; font-size: .97rem; }
.post-card .pc-more { color: var(--red); font-weight: 600; font-size: .93rem; text-decoration: none; margin-top: auto; }
.post-card .pc-thumb { margin: -8px -10px 8px; }
.post-card .pc-thumb img { border-radius: 10px; display: block; width: 100%; }

.blog-empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  border: 2px dashed var(--paper-line); border-radius: var(--radius);
  margin: 40px 0;
}

/* ── Статья ── */
.entry-head { margin: 36px 0 8px; }
.entry-meta { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.crumb { font-size: .9rem; margin-top: 22px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--purple); }

.entry { font-size: 1.05rem; }
.entry h2 { margin-top: 1.6em; }
.entry h3 { margin-top: 1.4em; }
.entry img {
  border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.entry blockquote {
  margin: 1.4em 0; padding: 4px 22px;
  border-left: 4px solid var(--red);
  background: var(--red-soft); border-radius: 0 10px 10px 0;
  font-family: var(--font-display); font-style: italic;
}
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: .4em; }
.entry .wp-caption { max-width: 100%; }
.entry .wp-caption-text { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 6px; }
.entry table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
.entry td, .entry th { border: 1.5px solid var(--paper-line); padding: 8px 12px; text-align: left; }
.entry th { background: var(--paper-deep); }
.entry hr { border: none; border-top: 2px solid var(--paper-line); margin: 2em 0; }

/* ── CTA после статьи ── */
.post-cta {
  background: #FDFCF9;
  border: 2px solid var(--purple);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--purple-soft);
  padding: 30px 30px 34px;
  margin: 48px 0 20px;
  text-align: center;
}
.post-cta h3 { font-size: 1.45rem; margin-bottom: 8px; }
.post-cta p { color: var(--muted); max-width: 34em; margin: 0 auto 20px; }

/* ── «Читайте также» ── */
.related { margin: 44px 0 10px; }
.related-h { font-size: 1.4rem; margin-bottom: 16px; }
.related-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .related-grid { grid-template-columns: 1fr 1fr 1fr; align-items: stretch; } }
.related-card {
  display: flex; flex-direction: column; gap: 8px;
  background: #FDFCF9; border: 2px solid var(--ink);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 16px 18px; text-decoration: none; color: var(--ink);
  transition: transform .12s;
}
.related-card:hover { transform: translate(-1px, -1px); }
.related-card b { font-family: var(--font-display); font-size: 1rem; line-height: 1.3; }
.related-card .rc-thumb { margin: -4px -6px 2px; }
.related-card .rc-thumb img { border-radius: 8px; display: block; width: 100%; height: 110px; object-fit: contain; }
.related-card .rc-more { margin-top: auto; color: var(--red); font-weight: 600; font-size: .88rem; }

/* ── Пагинация ── */
.pager { display: flex; gap: 10px; justify-content: center; margin: 36px 0; flex-wrap: wrap; }
.pager .page-numbers {
  display: inline-block; min-width: 42px; padding: 9px 14px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: #FDFCF9; color: var(--ink);
  text-decoration: none; font-weight: 600; text-align: center;
}
.pager .page-numbers.current { background: var(--ink); color: var(--paper); }
.pager .page-numbers:hover:not(.current) { box-shadow: 3px 3px 0 var(--ink); }

/* ── Футер ── */
.site-footer {
  margin-top: 80px; padding: 26px 0 34px;
  border-top: 2px solid var(--paper-line);
  color: var(--muted); font-size: .9rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--purple); }
.site-footer .fgrid { display: grid; gap: 26px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .site-footer .fgrid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; }
}
.site-footer .fcol { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.site-footer .fcol b {
  font-family: var(--font-display); color: var(--ink);
  font-size: .95rem; margin-bottom: 2px;
}
.site-footer .fabout { max-width: 30em; gap: 10px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { gap: 8px; }
  .site-nav { gap: 10px; }
  .site-nav a:not(.btn) { display: none; }
  .site-nav a.btn {
    white-space: nowrap;
    padding: 9px 14px; font-size: .9rem;
  }
  .logo { font-size: 1.1rem; gap: 7px; }
  .logo svg { width: 32px; height: 24px; }
  .logo-group { gap: 6px; }
  .blog-tag { padding: 3px 8px; font-size: .72rem; }
  .post-card { padding: 20px 18px; }
  .post-cta { padding: 24px 18px 26px; }
  .site-footer { margin-top: 56px; }
}

/* ── Блоки внимания: заметки на полях уютной книги ── */
.co {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px 20px 6px;
  margin: 1.6em 0;
  background: #FDFCF9;
  font-size: .97rem;
}
.co > b {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: .74rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 12px;
  margin: -28px 0 8px; position: relative; top: -2px;
}
.co p:last-child { margin-bottom: 10px; }
.co-tip  { border-color: var(--purple); box-shadow: 5px 5px 0 var(--purple-soft); }
.co-tip > b  { background: var(--purple); color: #fff; }
.co-warn { border-color: var(--red); box-shadow: 5px 5px 0 var(--red-soft); }
.co-warn > b { background: var(--red); color: #fff; }
.co-try  { border-color: var(--ink); box-shadow: 5px 5px 0 var(--paper-line); background: var(--paper-deep); }
.co-try > b  { background: var(--ink); color: var(--paper); }

/* ── Маскоты: Маша и Дима комментируют статью ── */
.mascot-say {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 1.6em 0;
}
.mascot-say img {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--ink); background: #FDFCF9;
  flex: 0 0 auto; box-shadow: none;
}
.mascot-say > div {
  background: #FDFCF9;
  border: 2px solid var(--ink);
  border-radius: 14px; border-top-left-radius: 4px;
  padding: 12px 18px 2px;
  font-size: .97rem;
}
.mascot-say > div > b {
  font-family: var(--font-ui); font-size: .78rem;
  letter-spacing: .06em; text-transform: uppercase;
}
.mascot-say > div p { margin: 4px 0 12px; }
.mascot-say.her img { border-color: var(--red); }
.mascot-say.her > div { border-color: var(--red); box-shadow: 4px 4px 0 var(--red-soft); }
.mascot-say.her b { color: var(--red); }
/* Дима отвечает справа — как в переписке */
.mascot-say.him { flex-direction: row-reverse; }
.mascot-say.him img { border-color: var(--blue); }
.mascot-say.him > div {
  border-color: var(--blue);
  border-radius: 14px; border-top-right-radius: 4px;
  box-shadow: -4px 4px 0 var(--blue-soft);
}
.mascot-say.him b { color: var(--blue); }
@media (max-width: 640px) {
  .mascot-say { gap: 10px; }
  .mascot-say img { width: 42px; height: 42px; }
}

/* Сцены-иллюстрации внутри статьи — без рамки */
.entry img.scene {
  border: none; box-shadow: none;
  display: block; margin: 1.5em auto;
  max-width: min(420px, 100%);
}
