/*
 * The generic page (WP-13, index.php): О компании, Вакансии, the privacy policy, the sitemap, the consent page and any
 * other singular. Boards OKompanii (1440) and OKompanii-mobile (390); the pages without a board take the same frame:
 * breadcrumbs, the H1, the stored text at a 760 px measure. Scoped under .k-type-generic; tokens of css/base.css,
 * stored-content type of css/components.css (.page-text). Breakpoints max-width 1023px, 767px and 359px.
 */

/* ---------- Frame: H1 and text ---------- */

/* A short page (a singular with no text, a search with no results) still puts the footer at the bottom of the window. */
body.k-type-generic {
  display: flex;
  flex-direction: column;
}

body.k-type-generic > .k-main {
  flex: 1 0 auto;
}

.k-type-generic .k-generic__main {
  padding: 0 0 72px;
  background: var(--k-white);
}

.k-type-generic .k-generic__title {
  margin: 20px 0 0;
  overflow-wrap: break-word;
  /* 768–1199 has no board: two-line titles split evenly. Phones keep OKompanii-mobile's breaks. */
  text-wrap: balance;
}

.k-type-generic .k-generic__text {
  margin-top: 28px;
}

.k-type-generic .k-generic:not(.k-generic--about) .k-generic__text {
  max-width: 760px;
}

/* ---------- О компании: text, photos two by two (588 × 441, 4:3), then «Наши преимущества» on the band ---------- */

.k-type-generic .k-generic--about .k-generic__main .page-text > p:not([class*="k-"]) {
  max-width: 760px;
  margin: 32px 0 0;
}

.k-type-generic .k-generic--about .k-generic__main .page-text > p:first-child {
  margin-top: 0;
}

/* The stored photos: two <img> in one paragraph, a <br> between them. */
.k-type-generic .k-generic--about .k-generic__main .page-text > p:not([class*="k-"]):has(> img) {
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.k-type-generic .k-generic--about .k-generic__main .page-text > p:has(> img) > br {
  display: none;
}

.k-type-generic .k-generic--about .k-generic__main .page-text > p:has(> img) > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--k-radius-card);
}

.k-type-generic .k-generic__band {
  padding: 72px 0;
  background: var(--k-band);
}

.k-type-generic .k-generic__band .k-generic__text {
  margin-top: 0;
}

.k-type-generic .k-generic__band .page-text > h2:not([class*="k-"]) {
  margin: 0;
}

/* The advantages list as three cards, each with its board icon (compressors, delivery, the price known in advance:
   the icons of the builder pages' «Наши преимущества»). index.php gives the list role="list" (no bullets). */
.k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) {
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) > li {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-card);
  background: var(--k-white);
}

.k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) > li::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 20px;
  background: var(--k-blue);
  -webkit-mask: var(--k-generic-icon) center / contain no-repeat;
  mask: var(--k-generic-icon) center / contain no-repeat;
}

.k-type-generic .k-generic__band .page-text > ul > li:nth-child(3n+1) {
  --k-generic-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='13' height='9' rx='4.5'/%3E%3Cpath d='M16 10.5h3.5V7.5'/%3E%3Cpath d='M18 7.5h3'/%3E%3Cpath d='M6.5 15v1.7M12.5 15v1.7'/%3E%3Ccircle cx='6.5' cy='18.5' r='1.8'/%3E%3Ccircle cx='12.5' cy='18.5' r='1.8'/%3E%3C/svg%3E");
}

.k-type-generic .k-generic__band .page-text > ul > li:nth-child(3n+2) {
  --k-generic-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.5h11v9h-11z'/%3E%3Cpath d='M13.5 9.5h4l3 3.5v2.5h-7'/%3E%3Ccircle cx='6.5' cy='17.5' r='1.8'/%3E%3Ccircle cx='17' cy='17.5' r='1.8'/%3E%3C/svg%3E");
}

.k-type-generic .k-generic__band .page-text > ul > li:nth-child(3n) {
  --k-generic-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-3-2-3 2-3-2-3 2z'/%3E%3Cpath d='M9 8h6'/%3E%3Cpath d='M9 11.5h6'/%3E%3Cpath d='M9 15h3.5'/%3E%3C/svg%3E");
}

.k-type-generic .k-generic__band .page-text > p:not([class*="k-"]) {
  max-width: 760px;
  margin: 32px 0 0;
}

/* ---------- Вакансии: the vacancies form (Contact Form 7 «vacancy») as a page-form card ---------- */

.k-type-generic .k-generic__text > .wpcf7 {
  max-width: 672px;
  margin: 32px 0 0;
  padding: 32px;
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-card);
  background: var(--k-white);
}

/* ---------- The privacy policy and the consent page ---------- */

.k-type-generic .k-generic--legal .page-text h2:not([class*="k-"]) {
  margin: 40px 0 12px;
  font-size: 24px;
  line-height: 30px;
  letter-spacing: normal;
}

.k-type-generic .k-generic--legal .page-text > h2:first-child {
  margin-top: 0;
}

/* The operator block (lines with <br>) keeps the body line height. */
.k-type-generic .k-generic--legal .page-text p:not([class*="k-"]):has(> br) {
  line-height: inherit;
}

.k-type-generic .k-generic__nowrap {
  white-space: nowrap;
}

/* The policy: <div class="row mb-4"><div class="col"> sections (css/legacy-content.css), the h4 title, the h5
   section headings, .descr lead-ins and .ol > .li points. */
.k-type-generic .k-generic--legal .page-text .col > :first-child {
  margin-top: 0;
}

.k-type-generic .k-generic--legal .page-text h4:not([class*="k-"]) {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 30px;
}

.k-type-generic .k-generic--legal .page-text :is(h5, h6):not([class*="k-"]) {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 26px;
}

.k-type-generic .k-generic--legal .page-text .row.mb-4 {
  margin-bottom: 32px !important;
}

.k-type-generic .k-generic--legal .page-text .row.mb-4:last-child {
  margin-bottom: 0 !important;
}

.k-type-generic .k-generic--legal .page-text .descr {
  margin: 0 0 12px;
}

.k-type-generic .k-generic--legal .page-text .ol > .li {
  margin: 0 0 10px;
}

.k-type-generic .k-generic--legal .page-text .ol > .li:last-child {
  margin-bottom: 0;
}

.k-type-generic .k-generic--legal .page-text .ol > .li.mb-4:not(:last-child) {
  margin-bottom: 16px !important;
}

/* The purpose tables (section 6): label column on the panel colour, as the requisites table. */
.k-type-generic .page-text .purpose-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-card);
  background: var(--k-white);
  font-size: 15px;
  line-height: 22px;
}

.k-type-generic .page-text .purpose-table :is(th, td) {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
}

.k-type-generic .page-text .purpose-table th {
  width: 200px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--k-muted);
  background: var(--k-panel);
}

.k-type-generic .page-text .purpose-table td {
  color: var(--k-ink);
  overflow-wrap: break-word;
}

.k-type-generic .page-text .purpose-table tr + tr > * {
  border-top: 1px solid var(--k-hairline);
}

.k-type-generic .page-text .purpose-table tr:first-child > :first-child {
  border-top-left-radius: 11px;
}

.k-type-generic .page-text .purpose-table tr:first-child > :last-child {
  border-top-right-radius: 11px;
}

.k-type-generic .page-text .purpose-table tr:last-child > :first-child {
  border-bottom-left-radius: 11px;
}

.k-type-generic .page-text .purpose-table tr:last-child > :last-child {
  border-bottom-right-radius: 11px;
}

.k-type-generic .page-text .purpose-table td :is(ul, ol):not([class*="k-"]):not([role]) {
  margin: 0;
  padding-left: 18px;
}

.k-type-generic .page-text .purpose-table td :is(ul, ol):not([class*="k-"]):not([role]) > li {
  margin: 0 0 4px;
}

.k-type-generic .page-text .purpose-table td :is(ul, ol):not([class*="k-"]):not([role]) > li:last-child {
  margin-bottom: 0;
}

/* ---------- Карта сайта: Simple Sitemap's list ---------- */

.k-type-generic .page-text .simple-sitemap-wrap > h3:not([class*="k-"]) {
  margin: 0 0 16px;
}

.k-type-generic .page-text ul.simple-sitemap-page {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 48px;
}

.k-type-generic .page-text ul.simple-sitemap-page li {
  margin: 0;
  padding: 0 0 10px;
  break-inside: avoid;
}

.k-type-generic .page-text ul.simple-sitemap-page ul.children {
  margin: 10px 0 0;
  padding: 0 0 0 16px;
  border-left: 1px solid var(--k-hairline);
  list-style: none;
}

.k-type-generic .page-text ul.simple-sitemap-page ul.children > li:last-child {
  padding-bottom: 0;
}

.k-type-generic .page-text ul.simple-sitemap-page a {
  text-decoration: none;
}

.k-type-generic .page-text ul.simple-sitemap-page a:hover {
  text-decoration: underline;
}

/* The plugin's clearing <br> after the list. */
.k-type-generic .page-text .simple-sitemap-container + br {
  display: none;
}

/* ---------- Search and archive results: links to the other result pages (paginate_links) ---------- */

.k-type-generic .k-generic__pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.k-type-generic .k-generic__pager .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--k-hairline);
  border-radius: var(--k-radius-control);
  background: var(--k-white);
  color: var(--k-ink);
  font-size: 16px;
  line-height: 20px;
  text-decoration: none;
}

.k-type-generic .k-generic__pager a.page-numbers:hover {
  border-color: var(--k-blue);
  color: var(--k-blue);
}

.k-type-generic .k-generic__pager .page-numbers.current {
  border-color: var(--k-blue);
  background: var(--k-blue);
  color: var(--k-white);
}

.k-type-generic .k-generic__pager .page-numbers.dots {
  min-width: 0;
  padding: 0 4px;
  border-color: transparent;
  background: none;
}

/* ---------- 768–1023: the cards one under another ---------- */

@media (max-width: 1023px) {
  .k-type-generic .k-generic__main {
    padding-bottom: 56px;
  }

  .k-type-generic .k-generic__band {
    padding: 56px 0;
  }

  .k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) > li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
  }

  .k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) > li::before {
    flex: none;
    margin: 0;
  }
}

/* ---------- Phones (OKompanii-mobile) ---------- */

@media (max-width: 767px) {
  .k-type-generic .k-generic__main {
    padding-bottom: 28px;
  }

  .k-type-generic .k-generic__title {
    margin-top: 14px;
    text-wrap: wrap;
  }

  .k-type-generic .k-generic__title--long {
    font-size: 30px;
    line-height: 34px;
  }

  .k-type-generic .k-generic__text {
    margin-top: 16px;
  }

  .k-type-generic .k-generic--about .k-generic__main .page-text > p:not([class*="k-"]) {
    margin-top: 20px;
  }

  .k-type-generic .k-generic--about .k-generic__main .page-text > p:first-child {
    margin-top: 0;
  }

  .k-type-generic .k-generic--about .k-generic__main .page-text > p:not([class*="k-"]):has(> img) {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    container-type: inline-size;
  }

  /* OKompanii-mobile draws each photo 269 px tall in its 358 px column: 4:3 rounded up to whole pixels (268.5 → 269),
     as css/page-portfolio.css rounds the portfolio tiles. */
  @supports (height: round(up, 75cqw, 1px)) {
    .k-type-generic .k-generic--about .k-generic__main .page-text > p:not([class*="k-"]):has(> img) > img {
      aspect-ratio: auto;
      height: round(up, 75cqw, 1px);
    }
  }

  .k-type-generic .k-generic__band {
    padding: 24px 0 28px;
  }

  .k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) {
    margin-top: 16px;
    gap: 8px;
  }

  .k-type-generic .k-generic__band .page-text > ul:not([class*="k-"]) > li {
    gap: 14px;
    padding: 14px 16px;
  }

  .k-type-generic .k-generic__band .page-text > p:not([class*="k-"]) {
    margin-top: 16px;
  }

  .k-type-generic .k-generic__text > .wpcf7 {
    margin-top: 20px;
    padding: 16px;
  }

  .k-type-generic .k-generic--legal .page-text h2:not([class*="k-"]) {
    margin: 32px 0 10px;
    font-size: 20px;
    line-height: 26px;
  }

  .k-type-generic .k-generic--legal .page-text > h2:first-child {
    margin-top: 0;
  }

  .k-type-generic .k-generic--legal .page-text h4:not([class*="k-"]) {
    font-size: 20px;
    line-height: 26px;
  }

  .k-type-generic .k-generic--legal .page-text :is(h5, h6):not([class*="k-"]) {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 24px;
  }

  .k-type-generic .k-generic--legal .page-text .row.mb-4 {
    margin-bottom: 24px !important;
  }

  .k-type-generic .k-generic--legal .page-text .row.mb-4:last-child {
    margin-bottom: 0 !important;
  }

  /* The purpose tables: each label above its value, so no table is wider than the screen. */
  .k-type-generic .page-text .purpose-table,
  .k-type-generic .page-text .purpose-table :is(tbody, tr, th, td) {
    display: block;
    width: auto;
  }

  .k-type-generic .page-text .purpose-table :is(th, td) {
    padding: 10px 12px;
  }

  .k-type-generic .page-text .purpose-table td {
    padding-bottom: 12px;
  }

  .k-type-generic .page-text .purpose-table tr + tr > * {
    border-top: 0;
  }

  .k-type-generic .page-text .purpose-table tr + tr > th {
    border-top: 1px solid var(--k-hairline);
  }

  .k-type-generic .page-text .purpose-table tr:first-child > :first-child {
    border-top-right-radius: 11px;
  }

  .k-type-generic .page-text .purpose-table tr:first-child > :last-child {
    border-top-right-radius: 0;
  }

  .k-type-generic .page-text .purpose-table tr:last-child > :first-child {
    border-bottom-left-radius: 0;
  }

  .k-type-generic .page-text .purpose-table tr:last-child > :last-child {
    border-bottom-left-radius: 11px;
  }

  /* The sitemap: one column of 44 px rows, each link a full-width target. */
  .k-type-generic .page-text ul.simple-sitemap-page {
    columns: 1;
  }

  .k-type-generic .page-text ul.simple-sitemap-page li {
    padding: 0;
  }

  .k-type-generic .page-text ul.simple-sitemap-page ul.children {
    margin: 0;
  }

  .k-type-generic .page-text ul.simple-sitemap-page a {
    display: block;
    padding: 10px 0;
  }

  /* The search results: the same 44 px rows. */
  .k-type-generic .page-text.k-generic__found > ul:not([class*="k-"]) > li {
    margin: 0;
  }

  .k-type-generic .page-text.k-generic__found > ul:not([class*="k-"]) > li > a {
    display: block;
    padding: 10px 0;
  }
}

/* ---------- Narrow phones (320–359) ---------- */

@media (max-width: 359px) {
  .k-type-generic .k-generic__title--long {
    font-size: 28px;
    line-height: 32px;
  }
}
