/* ==========================================================
   polzaivred.ru — single responsive CSS
   Replaces old Artisteer CSS + responsive CSS + layout JS.
   Keeps existing class names in HTML: art-*
   ========================================================== */

:root {
  --page-bg: #f4f7f2;
  --surface: #ffffff;
  --surface-soft: #f8fbf6;
  --text: #1e2a1e;
  --muted: #5f6f5f;
  --brand: #159447;
  --brand-dark: #0b6f31;
  --brand-light: #e9f7ee;
  --accent: #e4572e;
  --border: #dbe7d8;
  --shadow: 0 10px 30px rgba(24, 62, 32, .08);
  --radius: 16px;
  --content-width: 1180px;
  --content-padding: clamp(14px, 2vw, 28px);
  --font-main: Arial, "Arial Unicode MS", Helvetica, sans-serif;
  --font-head: "Trebuchet MS", Arial, Helvetica, sans-serif;
}

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

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 0;
  min-height: 100%;
  margin: 0;
  padding: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(21, 148, 71, .10), transparent 34rem),
    linear-gradient(180deg, #eef5ea 0, var(--page-bg) 260px, #ffffff 100%);
  font: 16px/1.65 var(--font-main);
}

img,
video,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:visited {
  color: #7b3fb0;
}

a:hover,
a:focus {
  color: var(--accent);
}

p,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
}

ul,
ol {
  padding-left: 1.45em;
}

li {
  margin: .35em 0;
}

/* Main page wrapper */
#art-main {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Top navigation */
.art-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  margin: 0;
  padding: 10px var(--content-padding);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .06);
  backdrop-filter: blur(8px);
}

ul.art-hmenu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  font: 600 15px/1.25 var(--font-main);
}

ul.art-hmenu li {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.art-hmenu a,
ul.art-hmenu a:link,
ul.art-hmenu a:visited {
  display: block;
  min-height: 38px;
  padding: 10px 14px;
  color: var(--brand-dark);
  background: var(--brand-light);
  border: 1px solid rgba(21, 148, 71, .16);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

ul.art-hmenu a:hover,
ul.art-hmenu a:focus,
ul.art-hmenu a.active,
ul.art-hmenu a.active:link,
ul.art-hmenu a.active:visited {
  color: #ffffff;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  border-color: var(--brand-dark);
  transform: translateY(-1px);
}

/* Dropdown submenus, if they exist in other pages */
ul.art-hmenu ul {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 100;
  display: none;
  min-width: 220px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

ul.art-hmenu li:hover > ul,
ul.art-hmenu li:focus-within > ul {
  display: block;
}

ul.art-hmenu ul li {
  width: 100%;
}

ul.art-hmenu ul a,
ul.art-hmenu ul a:link,
ul.art-hmenu ul a:visited {
  min-height: 0;
  padding: 9px 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  white-space: normal;
}

ul.art-hmenu ul a:hover,
ul.art-hmenu ul a:focus,
ul.art-hmenu ul a.active {
  color: #ffffff;
  background: var(--brand);
}

/* Sheet and layout */
.art-sheet {
  width: min(calc(100% - 2 * var(--content-padding)), var(--content-width));
  margin: clamp(14px, 2vw, 28px) auto;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.art-layout-wrapper,
.art-content-layout,
.art-content-layout-row {
  width: 100%;
}

.art-content-layout {
  display: table;
  table-layout: fixed;
  border-collapse: collapse;
}

.art-content-layout-row {
  display: table-row;
}

.art-layout-cell {
  display: table-cell;
  vertical-align: top;
}

.art-content {
  width: 100%;
}

.art-post,
.art-article {
  margin: 0;
  padding: 0;
}

.art-postcontent {
  padding: clamp(18px, 3vw, 42px);
  font: 16px/1.7 var(--font-main);
  color: var(--text);
}

.art-postcontent::after,
.clearfix::after,
.art-sheet::after,
.art-nav::after,
.art-footer::after {
  content: "";
  display: table;
  clear: both;
}

.art-postcontent > img:first-child {
  display: block;
  width: min(100%, 780px);
  margin: 0 auto 24px;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
}

.art-postcontent img {
  border: 0;
  border-radius: 12px;
}

.art-postcontent p {
  margin: 12px 0;
}

.art-postcontent h1,
.art-postcontent h2,
.art-postcontent h3,
.art-postcontent h4,
.art-postcontent h5,
.art-postcontent h6 {
  font-family: var(--font-head);
  line-height: 1.25;
  color: var(--text);
}

.art-postcontent h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4vw, 42px);
  color: var(--brand-dark);
}

.art-postcontent h2 {
  margin: 30px 0 12px;
  font-size: clamp(23px, 3vw, 32px);
  color: var(--brand);
}

.art-postcontent h3 {
  margin: 24px 0 10px;
  font-size: clamp(20px, 2.3vw, 26px);
  color: var(--accent);
}

.art-postcontent h4 {
  margin: 20px 0 10px;
  font-size: 19px;
  color: var(--brand-dark);
}

.art-postcontent h5 {
  margin: 18px 0 8px;
  font-size: 17px;
  color: var(--brand-dark);
}

.art-postcontent h6 {
  margin: 16px 0 8px;
  font-size: 15px;
  color: var(--muted);
}

.art-postcontent ul,
.art-postcontent ol {
  margin: 12px 0 18px;
}

.art-postcontent ul {
  list-style: disc;
}

.art-postcontent ol {
  list-style: decimal;
}

.art-postcontent li::marker {
  color: var(--brand);
}

.art-postcontent strong,
.art-postcontent b {
  color: #173617;
}

.art-postcontent hr {
  height: 1px;
  margin: 28px 0;
  border: 0;
  background: var(--border);
}

/* Category blocks on index/category pages */
.art-postcontent .art-content-layout {
  margin: 18px 0;
}

.art-postcontent .art-content-layout-row {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.art-postcontent .art-layout-cell {
  padding: clamp(12px, 2vw, 22px);
}

.art-postcontent .art-content-layout img {
  display: block;
  width: 100%;
  margin: 0;
  object-fit: cover;
}

/* Old inline item classes preserved */
.art-content .art-postcontent-0 .layout-item-old-0 {
  margin-bottom: 5px;
}

.art-content .art-postcontent-0 .layout-item-old-1 {
  border-spacing: 10px 0;
  border-collapse: separate;
}

.art-content .art-postcontent-0 .layout-item-old-2 {
  border: 1px solid #bbc5c9;
  padding-right: 10px;
  padding-left: 10px;
}

.art-content .art-postcontent-0 .layout-item-old-3 {
  border: 1px solid #80dbff;
  padding-right: 10px;
  padding-left: 10px;
}

/* Buttons */
.art-button,
.art-button:link,
.art-button:visited,
.art-postcontent .art-button,
.art-postcontent .art-button:link,
.art-postcontent .art-button:visited {
  display: inline-block;
  min-height: 38px;
  margin: 6px 0;
  padding: 9px 18px;
  color: #ffffff;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  border: 1px solid var(--brand-dark);
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(11, 111, 49, .20);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.art-button:hover,
.art-button:focus,
.art-postcontent .art-button:hover,
.art-postcontent .art-button:focus {
  color: #ffffff;
  background: linear-gradient(180deg, #1aa954, #075b28);
}

/* Tables and code */
.art-postcontent table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow-wrap: anywhere;
}

.art-postcontent th,
.art-postcontent td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}

.art-postcontent th {
  background: var(--brand-light);
  color: var(--brand-dark);
  text-align: left;
}

code {
  padding: 2px 5px;
  color: #9c1d4d;
  background: #fff4f7;
  border: 1px solid #f0c9d4;
  border-radius: 5px;
  font-family: "Courier New", Courier, monospace;
  font-size: .92em;
}

pre {
  max-width: 100%;
  margin: 18px 0;
  padding: 16px;
  overflow-x: auto;
  color: #182018;
  background: #f4f6f4;
  border: 1px solid var(--border);
  border-radius: 12px;
}

pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
}

/* Footer */
.art-footer {
  width: 100%;
  margin: 0;
  padding: 0 var(--content-padding) 28px;
}

.art-footer-inner {
  width: min(calc(100% - 2 * var(--content-padding)), var(--content-width));
  margin: 0 auto;
  padding: 18px var(--content-padding);
  color: #dff4df;
  background: linear-gradient(180deg, #12743a, #0a4e27);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.art-footer p {
  margin: 0;
}

.art-footer a,
.art-footer a:link,
.art-footer a:visited {
  color: #ffffff;
}

.art-footer .layout-item-0,
.art-footer .layout-item-1 {
  padding: 5px;
}

/* Responsive behavior without Artisteer JS */
@media (max-width: 900px) {
  .art-content-layout,
  .art-content-layout-row,
  .art-layout-cell {
    display: block;
    width: 100% !important;
    height: auto !important;
  }

  .art-postcontent .art-content-layout-row {
    display: block;
  }

  .art-footer .art-content-layout,
  .art-footer .art-content-layout-row,
  .art-footer .art-layout-cell {
    display: block;
    width: 100% !important;
  }
}

@media (max-width: 700px) {
  :root {
    --content-padding: 12px;
  }

  body {
    font-size: 16px;
    line-height: 1.62;
  }

  .art-nav {
    position: static;
    padding: 8px 10px;
  }

  ul.art-hmenu {
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  ul.art-hmenu li {
    flex: 0 0 auto;
  }

  ul.art-hmenu a,
  ul.art-hmenu a:link,
  ul.art-hmenu a:visited {
    min-height: 36px;
    padding: 9px 12px;
    white-space: nowrap;
    font-size: 14px;
  }

  ul.art-hmenu ul {
    position: static;
    display: none;
    min-width: 0;
    margin-top: 4px;
    box-shadow: none;
  }

  ul.art-hmenu li:hover > ul,
  ul.art-hmenu li:focus-within > ul {
    display: block;
  }

  .art-sheet,
  .art-footer-inner {
    width: calc(100% - 20px);
    border-radius: 12px;
  }

  .art-postcontent {
    padding: 18px 14px;
  }

  .art-postcontent h1 {
    font-size: 28px;
  }

  .art-postcontent h2 {
    font-size: 23px;
  }

  .art-postcontent .art-content-layout {
    margin: 14px 0;
  }

  .art-postcontent .art-layout-cell {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .art-sheet,
  .art-footer-inner {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .art-footer {
    padding-left: 0;
    padding-right: 0;
  }

  .art-postcontent {
    padding: 16px 12px;
  }
}

/* Print */
@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .art-nav,
  .art-footer {
    display: none;
  }

  .art-sheet {
    width: 100%;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .art-postcontent {
    padding: 0;
  }

  a {
    color: #000000;
  }
}
