/*
Theme Name: Магнат
Theme URI: https://uk-magnat.ru/
Author: НИИ Fat Cat
Description: Сайт УК «Магнат»: общестроительные и монтажные работы, Нижний Новгород и область.
Version: 1.3.0
Requires at least: 6.7
Requires PHP: 8.0
Text Domain: magnat
*/

:root {
  --ink: #1a1612;
  --ink-soft: #4a433c;
  --paper: #f3efe6;
  --paper-2: #e7e0d2;
  --white: #fbf8f2;
  --line: rgba(26, 22, 18, 0.12);
  --gold: #a67c2d;
  --gold-2: #e4c27a;
  --night: #14110e;
  --night-2: #231e18;
  --ribbon: #8d2c32;
  --ok: #1f6b45;
  --shadow: 0 18px 50px rgba(26, 22, 18, 0.12);
  --serif: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --wide: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button, input, textarea { font: inherit; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--gold-2);
  color: var(--night);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--wide), calc(100% - 32px)); margin: 0 auto; }
.eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold);
  margin: 0 0 10px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(40px, 6vw, 76px); margin: 0 0 16px; }
h2 { font-size: clamp(32px, 4vw, 48px); margin: 0 0 14px; }
h3 { font-size: 26px; margin: 0 0 8px; }
.lead { font-size: 19px; color: var(--ink-soft); max-width: 46rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(20, 17, 14, 0.94);
  color: var(--white);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(228, 194, 122, 0.2);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 78px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: white; }
.brand img { width: 54px; height: 68px; object-fit: contain; }
.brand b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.brand small { display: block; color: var(--gold-2); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 18px; margin-left: auto; }
.nav a { text-decoration: none; color: #f4efe6; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-2); }
.header-phones { display: flex; gap: 16px; }
.header-phones a { text-decoration: none; color: var(--gold-2); font-weight: 700; white-space: nowrap; line-height: 1.15; }
.header-phones small { display: block; color: #c8bfb2; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; }
.nav-toggle { display: none; margin-left: auto; background: transparent; color: white; border: 1px solid rgba(255,255,255,.3); min-height: 44px; padding: 8px 12px; }

.hero {
  background-color: var(--night);
  background-size: cover;
  background-position: center;
  color: white;
  padding: 88px 0 78px;
}
.hero-grid { max-width: 46rem; }
.hero p { color: #ddd4c6; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
}
.btn-gold { background: var(--gold-2); color: var(--night); font-weight: 700; }
.btn-ghost { border-color: rgba(255,255,255,.4); color: white; }
.btn-dark { background: var(--night); color: white; }
.crest-card {
  justify-self: end;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(228, 194, 122, 0.3);
  padding: 18px 18px 8px;
  width: min(280px, 100%);
}
.crest-card img { width: 100%; height: auto; }

.section { padding: 72px 0; }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 28px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: -36px; }
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 22px;
  box-shadow: var(--shadow);
}
.stat b { display: block; font-family: var(--serif); font-size: 34px; }
.stat span { color: var(--ink-soft); }

.cards, .project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card, .project-card {
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.card { padding: 22px; }
.card .num { color: var(--gold); font-size: 13px; letter-spacing: 0.12em; }
.project-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--paper-2); }
.project-card.is-feature { grid-column: span 2; }
.project-card.is-feature img { aspect-ratio: 16/8; }
.project-card div { padding: 16px 16px 18px; }
.project-cta { margin-top: 28px; }
.project-card small { color: var(--gold); letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters button {
  border: 1px solid var(--line);
  background: transparent;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--night); color: white; }

.names { display: flex; flex-wrap: wrap; gap: 8px; }
.names span, .chip {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 8px 12px;
  border-radius: 999px;
}
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; }
.panel { background: var(--night); color: #f6f1e7; padding: 28px; }
.panel a { color: var(--gold-2); }
.steps { display: grid; gap: 14px; }
.steps article { border-top: 1px solid var(--line); padding-top: 12px; }

.entry { width: min(760px, 100%); }
.entry .brief-form { margin-top: 28px; }
.entry h1 { font-size: clamp(36px, 5vw, 58px); }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; }
.form input, .form textarea, .form select {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  padding: 12px;
  color: var(--ink);
  min-height: 48px;
}
.brief-form { background: var(--white); border: 1px solid var(--line); padding: 22px; box-shadow: var(--shadow); }
.brief-list { margin: 18px 0 0; padding-left: 18px; display: grid; gap: 10px; }
.form .hp { position: absolute; left: -9999px; }
.notice { padding: 12px 14px; background: #e5f4ec; border: 1px solid #b7dfc8; }
.notice.err { background: #fdecea; border-color: #f0c2bd; }
.reqs { width: 100%; border-collapse: collapse; background: white; }
.reqs th, .reqs td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.reqs th { width: 34%; color: var(--ink-soft); font-weight: 600; }

.site-footer { background: var(--night); color: #ddd4c6; padding: 36px 0 24px; }
.footer-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--gold-2); }
.callbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9;
  grid-template-columns: 1fr 1fr;
  background: var(--night);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  gap: 8px;
}
.callbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  text-decoration: none;
  font-weight: 700;
  background: var(--gold-2);
  color: var(--night);
}
.crumbs { color: var(--ink-soft); font-size: 14px; margin-bottom: 12px; }
.crumbs a { color: var(--ink-soft); }

dialog.lightbox { border: 0; padding: 12px; background: transparent; max-width: min(1100px, 94vw); }
dialog.lightbox button { position: static; margin: 0 0 8px auto; display: block; }
dialog.lightbox::backdrop { background: rgba(0,0,0,.82); }
dialog.lightbox img { max-height: 86vh; margin: 0 auto; }
dialog.lightbox button {
  min-height: 44px;
  padding: 0 12px;
  background: var(--white);
  color: var(--night);
  border: 0;
}

@media (max-width: 1040px) {
  .header-phones { display: none; }
  .callbar { display: grid; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 900px) {
  .cards, .project-grid, .stats, .split, .gallery { grid-template-columns: 1fr 1fr; }
  .nav { display: none; position: absolute; top: 78px; left: 0; right: 0; background: var(--night); padding: 12px 16px 18px; flex-direction: column; }
  .nav.is-open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .header-phones { display: none; }
  .nav a { min-height: 44px; display: flex; align-items: center; }
  .callbar { display: grid; }
  .crest-card { display: none; }
  .project-card.is-feature { grid-column: auto; }
  .project-card.is-feature img { aspect-ratio: 4/3; }
}
@media (max-width: 640px) {
  .cards, .project-grid, .stats, .split, .gallery { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  h1 { font-size: 36px; }
  .reqs, .reqs tbody, .reqs tr, .reqs th, .reqs td { display: block; width: 100%; }
  .reqs th { padding-bottom: 0; }
}
