@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600&family=Lato:wght@300;400;700&display=swap');

:root {
  --white:      #ffffff;
  --bg:         #fafafa;
  --bg2:        #f4f4f2;
  --border:     #e8e4de;
  --text:       #1a1a1a;
  --text-muted: #888880;
  --accent:     #1a6fc4;
  --accent2:    #c9a84c;
  --nav-border: #e0dbd2;
  --header-h:   64px;
  --font-head:  'Cormorant Garamond', Georgia, serif;
  --font-body:  'Lato', sans-serif;
  --max-w:      1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ШАПКА */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--nav-border);
  position: sticky; top: 0; z-index: 500;
}
.header-inner {
  display: flex; align-items: center;
  height: var(--header-h);
  padding: 0 2.5rem;
  max-width: var(--max-w);
  margin: 0 auto; gap: 2rem;
}
.site-logo {
  font-family: var(--font-head);
  font-size: 1.7rem; font-style: italic; font-weight: 600;
  color: var(--text); white-space: nowrap;
  letter-spacing: .02em; flex-shrink: 0; text-decoration: none;
}
.site-logo:hover { color: var(--accent); text-decoration: none; }

/* НАВИГАЦИЯ */
.main-nav { display: flex; flex: 1; height: var(--header-h); align-items: stretch; }
.nav-item { position: relative; display: flex; align-items: stretch; }
.nav-link {
  display: flex; align-items: center; gap: .3rem;
  padding: 0 .9rem;
  font-family: var(--font-body); font-size: .73rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-link:hover { color: var(--accent); text-decoration: none; }
.nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-link .arrow { font-size: .5rem; opacity: .5; margin-top: 1px; }

.dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--white); border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  min-width: 210px; z-index: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  list-style: none; padding: .5rem 0;
}
.nav-item.has-sub:hover .dropdown { display: block; }
.dropdown-link {
  display: block; padding: .6rem 1.3rem;
  font-size: .73rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text);
  border-bottom: 1px solid var(--bg2); white-space: nowrap;
  transition: background .15s, color .15s;
}
.dropdown-link:last-child { border-bottom: none; }
.dropdown-link:hover, .dropdown-link.active {
  background: var(--bg); color: var(--accent); text-decoration: none;
}

.header-admin-btn {
  margin-left: auto; flex-shrink: 0;
  padding: .35rem .9rem; font-size: .68rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 2px;
  color: var(--text-muted); transition: all .2s; white-space: nowrap;
}
.header-admin-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ТЕЛО */
.site-wrapper { max-width: var(--max-w); margin: 0 auto; width: 100%; padding: 0 2.5rem; flex: 1; }
.site-body { display: flex; gap: 3.5rem; padding: 3rem 0 4rem; align-items: flex-start; }

/* БОКОВАЯ ПАНЕЛЬ */
.sidebar { width: 190px; flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 2rem); }
.sidebar-box { margin-bottom: 2rem; }
.sidebar-heading {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted); padding-bottom: .6rem;
  border-bottom: 1px solid var(--border); margin-bottom: .6rem;
}
.sidebar-list { list-style: none; }
.sidebar-list li a {
  display: block; padding: .45rem 0; font-size: .85rem; color: var(--text);
  border-bottom: 1px solid var(--bg2);
  transition: color .15s, padding-left .15s;
}
.sidebar-list li:last-child a { border-bottom: none; }
.sidebar-list li a:hover { color: var(--accent); padding-left: .4rem; text-decoration: none; }
.sidebar-list li a.active { color: var(--accent); font-weight: 700; padding-left: .4rem; }

/* КОНТЕНТ */
.content-area { flex: 1; min-width: 0; }

.section-heading {
  font-family: var(--font-head); font-size: 2rem; font-weight: 600;
  font-style: italic; color: var(--text);
  margin-bottom: 2rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border); line-height: 1.2;
}

.article-block { margin-bottom: 3.5rem; }
.article-block + .article-block { border-top: 1px solid var(--border); padding-top: 3.5rem; }

.article-title {
  font-family: var(--font-head); font-size: 2rem; font-weight: 600;
  font-style: italic; color: var(--text); margin-bottom: .4rem; line-height: 1.2;
}
.article-title a { color: inherit; }
.article-title a:hover { color: var(--accent); text-decoration: none; }

.article-meta {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 1.5rem;
}

/* ТЕЛО СТАТЬИ */
.article-body { font-size: 1rem; line-height: 1.85; color: var(--text); }
.article-body p { margin-bottom: .9em; margin-top: 0; }
.article-body p:last-child { margin-bottom: 0; }

.article-body img { max-width: 100%; height: auto; margin: 1.2em 0; display: block; }
.article-body img[style*="float: left"],
.article-body img[style*="float:left"] {
  display: inline; float: left !important;
  max-width: 42% !important; margin: .2em 2rem 1rem 0 !important;
}
.article-body img[style*="float: right"],
.article-body img[style*="float:right"] {
  display: inline; float: right !important;
  max-width: 42% !important; margin: .2em 0 1rem 2rem !important;
}
.article-body p { overflow: visible; }
.article-body::after { content: ''; display: table; clear: both; }

.article-body h1, .article-body h2, .article-body h3 {
  font-family: var(--font-head); font-style: italic; color: var(--text);
  margin: 1.8em 0 .6em; font-weight: 600; line-height: 1.2;
}
.article-body h1 { font-size: 1.7rem; }
.article-body h2 { font-size: 1.4rem; }
.article-body h3 { font-size: 1.2rem; }

.article-body blockquote {
  border-left: 2px solid var(--accent2); padding: .8rem 1.5rem;
  color: var(--text-muted); font-style: italic;
  font-family: var(--font-head); font-size: 1.15rem;
  margin: 1.8em 0; background: var(--bg);
}
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1em; }
.article-body li { margin-bottom: .3em; }
.article-body a { color: var(--accent); }
.article-body strong { font-weight: 700; }
.article-body em { font-style: italic; }

.empty-notice {
  padding: 3rem 0; color: var(--text-muted);
  font-style: italic; font-family: var(--font-head); font-size: 1.1rem;
}
.article-clearfix::after { content: ''; display: table; clear: both; }

/* ПОДВАЛ */
.site-footer {
  background: #f0f0f0;
  border-top: 1px solid #e0e0e0;
  padding: 2rem 2.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; flex-direction: column;
  align-items: center; gap: 1rem;
  text-align: center;
}
.footer-copy {
  font-size: .78rem; color: #888;
  letter-spacing: .04em;
}
.footer-social { display: flex; gap: .8rem; align-items: center; justify-content: center; }
.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: #ddd;
  color: #555;
  transition: background .2s, transform .2s, color .2s;
}
.social-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  text-decoration: none;
}

/* АДАПТИВ */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .header-inner, .site-wrapper { padding: 0 1.2rem; }
  .site-body { padding: 2rem 0 3rem; }
}
@media (max-width: 700px) {
  .main-nav { overflow-x: auto; }
  .nav-link { padding: 0 .55rem; font-size: .65rem; }
  .site-logo { font-size: 1.3rem; }
  .article-title { font-size: 1.5rem; }
  .header-admin-btn { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ===== СПИСОК СТАТЕЙ ===== */
.articles-list { list-style: none; padding: 0; }
.articles-list-item {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: .9rem 0; border-bottom: 1px solid var(--border); gap: 1rem;
}
.articles-list-item:last-child { border-bottom: none; }
.articles-list-link {
  font-family: var(--font-head); font-size: 1.2rem;
  font-style: italic; color: var(--text);
  transition: color .2s;
}
.articles-list-link:hover { color: var(--accent); text-decoration: none; }
.articles-list-date {
  font-size: .72rem; color: var(--text-muted);
  font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
}

/* ===== КНОПКА НАЗАД ===== */
.back-link {
  display: inline-block; margin-bottom: 1.5rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  transition: color .2s;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* ===== ГАМБУРГЕР МЕНЮ ===== */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  margin-left: auto; flex-shrink: 0;
}
.burger span {
  display: block; width: 100%; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
/* Анимация → крестик */
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .burger { display: flex; }

  .main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 2px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    z-index: 400;
    padding: .5rem 0;
    height: auto;
  }
  .main-nav.open { display: flex; }

  .nav-item { flex-direction: column; }
  .nav-link {
    padding: .75rem 1.5rem;
    font-size: .8rem;
    border-bottom: 1px solid var(--bg2);
    border-left: none;
    height: auto; line-height: 1.4;
    justify-content: space-between;
  }
  .nav-link.active { border-bottom-color: var(--bg2); border-left: 3px solid var(--accent); }

  /* Подменю на мобильных — всегда открыто */
  .dropdown {
    display: block !important;
    position: static;
    box-shadow: none;
    border: none;
    border-top: none;
    background: var(--bg);
    padding: 0;
  }
  .dropdown-link {
    padding: .6rem 2rem;
    font-size: .75rem;
  }
}

