:root {
  --bg: #fafafa;
  --text: #222;
  --muted: #555;
  --accent: #1a1a1a;
  --border: #ddd;
  --header-h: 56px;
  --maxw: 960px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.logo:hover {
  text-decoration: underline;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--accent);
}

.nav-toggle::before {
  top: 14px;
  box-shadow: 0 6px 0 var(--accent);
}

.nav-toggle::after {
  bottom: 14px;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-left: auto;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
  text-decoration: underline;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-img {
  max-width: min(96vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  z-index: 301;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.85;
}

.lightbox-close:hover {
  opacity: 1;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 1.25rem;
  line-height: 1.25;
}

.page-content {
  font-size: 1rem;
}

/* Список на странице «Проекты»: переносы \r\n из WordPress не схлопывать в пробел */
article.page[data-slug="all-projects"] .page-content {
  white-space: pre-line;
  line-height: 1.9;
}

article.page[data-slug="contacts"] .contact-page-static p {
  margin: 0 0 0.85rem;
}

article.page[data-slug="contacts"] .contact-muted {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 1.25rem;
  line-height: 1.5;
}

.page-content a {
  color: #0b4d8c;
}

.page-content a:hover {
  text-decoration: none;
}

.page-content img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.page-content .alignleft {
  float: left;
  margin: 0 1rem 1rem 0;
}

.page-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-content .wp-caption {
  margin: 1rem 0;
  max-width: 100%;
}

.page-content::after {
  content: "";
  display: table;
  clear: both;
}

.page-content h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.75rem;
  font-weight: 600;
}

.page-content ol,
.page-content ul {
  padding-left: 1.25rem;
}

.page-content li {
  margin-bottom: 0.5rem;
}

.ngg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.ngg-cell {
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  padding: 0.5rem;
}

.ngg-cell img {
  width: 100%;
  display: block;
}

.ngg-cell figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.35;
}

.singlepic {
  display: inline-block;
  vertical-align: top;
  text-align: center;
  margin: 0.35rem;
}

.singlepic img {
  display: block;
}

.gallery-missing,
.empty,
.loading,
.error {
  color: var(--muted);
}

.error code {
  font-size: 0.85em;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    gap: 0;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 0.6rem 0;
    border-bottom: 1px solid #eee;
  }

  .header-inner {
    position: relative;
  }
}
