/* Additions to the 3dkonstruktiv theme: submenu, request form states. */

/* ---------- Headings: one font on every page ---------- */
/* The theme set Inter only on home/portfolio headings; contacts and articles fell back to the body font (Onest). */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--fontFamily_2);
}

/* ---------- Submenu "Расчёты онлайн" ---------- */
.menu__item--parent {
  position: relative;
}

/* the toggle is a <button>: reset it to look like the other menu links */
.menu__link--parent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-family: var(--fontFamily_2);
  font-size: .875rem;
  line-height: var(--lineHeight_130);
  color: #4b4b4b;
}

.menu__chevron {
  flex: 0 0 auto;
  transition: transform .2s ease;
}

.menu__item--open .menu__chevron {
  transform: rotate(180deg);
}

.menu__submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu__submenu li::before {
  display: none;
}

.menu__sublink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #1f2933;
  transition: background-color .15s ease;
}

.menu__sublink:hover,
.menu__sublink:focus-visible {
  background-color: var(--accent-soft, #eaf0f5);
  outline: none;
}

.menu__sublink._active {
  background-color: var(--accent-soft, #eaf0f5);
}

.menu__subicon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.menu__subbody {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.menu__subtitle {
  font-family: var(--fontFamily_2);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: #1f2933;
}

.menu__sublink._active .menu__subtitle,
.menu__sublink:hover .menu__subtitle {
  color: var(--accent, #284b69);
}

.menu__subtext {
  font-family: var(--fontFamily_2);
  font-size: .8125rem;
  line-height: 1.35;
  color: #6b7480;
}

@media (min-width: 48em) {
  .menu__submenu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    z-index: 50;
    width: 380px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 33, 51, .14);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  }

  .menu__item--parent:hover .menu__submenu,
  .menu__item--open .menu__submenu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity .18s ease, transform .18s ease, visibility 0s;
  }

  .menu__item--parent:hover .menu__chevron {
    transform: rotate(180deg);
  }

  /* bridge the gap between the toggle and the dropdown so hover is not lost */
  .menu__item--parent::after {
    content: '';
    position: absolute;
    left: -20px;
    right: -20px;
    top: 100%;
    height: 16px;
  }

  .menu__submenu li + li {
    margin-top: 2px;
  }
}

@media (max-width: 47.99875em) {
  .menu__link--parent {
    width: 100%;
    justify-content: space-between;
  }

  .menu__submenu {
    display: none;
    padding: 8px 0 0;
  }

  .menu__item--open .menu__submenu {
    display: block;
  }

  .menu__sublink {
    padding: 8px 4px;
  }
}

/* ---------- Request form ---------- */
.site-request-form__hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-request-form__invalid {
  border-color: #d93025 !important;
}

.site-request-form__response {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.3;
}

.site-request-form__response:empty {
  display: none;
}

.site-request-form__response--error {
  color: #d93025;
}

.site-request-form__response--ok {
  color: #1e7e34;
}

/* =====================================================================
   Design tokens: accent colour from the logo, two button styles
   ===================================================================== */
:root {
  --accent: #284b69;
  --accent-hover: #1c3750;
  --accent-soft: #eaf0f5;
  --text-muted: #5b6470;
}

/* Primary button: filled accent */
.button,
.home__button,
.services__button,
.form__btn,
.button--primary {
  background-color: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
  border-radius: .625rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--s) var(--e), border-color var(--s) var(--e), color var(--s) var(--e);
}

.button:hover,
.home__button:hover,
.services__button:hover,
.form__btn:hover,
.button--primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.form__btn {
  padding: 1rem 2.5rem;
  font-weight: 700;
  font-size: 1.125rem;
}

.form__btn:disabled {
  opacity: .6;
  cursor: wait;
}

/* "Все статьи" came from the theme in the body font (Onest 400); match the other buttons */
.blog__button {
  font-family: var(--fontFamily_2);
  font-weight: var(--fontWeight_700);
  letter-spacing: normal;
}

/* Phone numbers: the header one is Inter, footer/contacts used the body font */
.footer__phone,
.contacts__phone {
  font-family: var(--fontFamily_2);
}

/* Outline button */
.button--outline,
.blog__button,
.project__button,
.policy__bottom-close {
  background-color: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.button--outline:hover,
.blog__button:hover,
.project__button:hover,
.policy__bottom-close:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button--outline,
.button--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--fontFamily_2);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.3;
}

/* Links in the menu */
.menu__link:hover,
.menu__link._active,
.menu__sublink:hover,
.menu__sublink._active {
  color: var(--accent);
}

/* =====================================================================
   Header / footer
   ===================================================================== */
.home__title {
  color: #fff;
}

.footer__logo-image {
  width: 10.4375rem;
  height: auto;
  /* the same logo as in the header, rendered white on the dark footer */
  filter: brightness(0) invert(1);
}

/* =====================================================================
   Banners (Портфолио, Блог): darken the picture so white text is readable
   ===================================================================== */
.banner {
  overflow: hidden;
}

.banner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(10, 22, 34, .78) 0%, rgba(10, 22, 34, .45) 55%, rgba(10, 22, 34, .15) 100%);
  pointer-events: none;
}

.banner__container {
  z-index: 5;
}

/* =====================================================================
   Home
   ===================================================================== */
.advantages__icon,
.reasons__icon {
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  border-radius: 0;
}

.constructive__container--stats {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.constructive__container--stats .constructive__body {
  max-width: none;
}

.constructive__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
}

.constructive__stat {
  padding: 1.25rem;
  border-radius: 1rem;
  background-color: var(--accent-soft);
}

.constructive__stat-value {
  font-family: var(--fontFamily);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  line-height: 1.1;
  color: var(--accent);
}

.constructive__stat-label {
  margin: .5rem 0 0;
  font-family: var(--fontFamily_2);
  font-size: .9375rem;
  line-height: 1.35;
  color: var(--text-muted);
}

@media (max-width: 61.99875em) {
  .constructive__container--stats {
    grid-template-columns: 1fr;
  }
}

/* Service cards: same text start, buttons pinned to the bottom */
.services__column {
  display: flex;
  flex-direction: column;
}

.services__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.services__name {
  margin-top: 0;
}

@media (min-width: 61.99875em) {
  .services__name {
    min-height: 3.9em;
  }
}

.services__button {
  margin-top: auto;
}

h3.objects__name,
h3.services__name {
  margin-bottom: 0;
}

.tabs__title._tab-active {
  background-color: var(--accent);
}

/* Revit screenshot: show the whole picture */
.tabs__image {
  object-fit: contain;
  object-position: center;
  background-color: #f4f6f8;
}

/* =====================================================================
   Blog cards: equal height
   ===================================================================== */
.blog__slider .swiper-slide {
  height: auto;
}

.blog__slide,
.blog__slide-content {
  display: flex;
  flex-direction: column;
}

.blog__slide-content {
  height: 100%;
}

.blog__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.blog__picture {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.blog__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog__name {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog__text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-muted);
}

/* =====================================================================
   Article
   ===================================================================== */
.blog-internal__content {
  max-width: 45rem; /* ~720px, 70-80 characters per line */
  margin-left: auto;
  margin-right: auto;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.blog-internal__row {
  max-width: 45rem;
  margin-left: auto;
  margin-right: auto;
}

.blog-internal__content > * + * {
  margin-top: 1em;
}

.blog-internal__content h2 {
  margin-top: 1.75em;
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
}

.blog-internal__content ul,
.blog-internal__content ol {
  padding-left: 1.5em;
}

.blog-internal__content ul li {
  list-style: disc;
}

.blog-internal__content ol li {
  list-style: decimal;
}

.blog-internal__content li + li {
  margin-top: .5em;
}

.blog-internal__content li::marker {
  color: var(--accent);
}

.blog-internal__content a {
  color: var(--accent);
  text-decoration: underline;
}

.blog-internal__content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* =====================================================================
   Request popup: scroll on short screens, never cut the message
   ===================================================================== */
.popup {
  align-items: flex-start;
  overscroll-behavior: contain;
}

.popup__inner {
  margin: auto;
  max-width: 640px;
}

@media (max-height: 820px) {
  .popup .form__textarea {
    height: 96px;
  }

  .popup .form__label + .form__label {
    margin-top: 10px;
  }

  .popup .form__btn-box {
    margin-top: 16px;
  }
}

/* =====================================================================
   Error page
   ===================================================================== */
.error-page {
  padding: 4rem 0 6rem;
}

.error-page__container {
  max-width: 45rem;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.error-page__code {
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.error-page__title {
  margin-top: 1rem;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
}

.error-page__text {
  margin-top: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.error-page__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.blog__body {
  padding-bottom: 1.5rem;
}

/* =====================================================================
   Design refresh: one palette, soft cards, calmer surfaces
   ===================================================================== */
:root {
  --navy: #10263a;
  --navy-2: #1b3a55;
  --surface: #f4f7fa;
  --line: #e3e8ee;
  --ink: #15212d;
  --shadow-sm: 0 2px 10px rgba(16, 38, 58, .06);
  --shadow: 0 18px 40px rgba(16, 38, 58, .12);
  --radius-lg: 20px;
}

body {
  color: var(--ink);
}

.title,
.constructive__title {
  color: var(--navy);
  letter-spacing: -.01em;
}

/* ---------- Header ---------- */
@media (min-width: 48em) {
  .menu__link {
    position: relative;
  }

  .menu__link:not(.menu__link--parent)::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
  }

  .menu__link:not(.menu__link--parent):hover::after,
  .menu__link._active:not(.menu__link--parent)::after {
    transform: scaleX(1);
  }
}

/* ---------- Hero ---------- */
.home__button {
  padding: 1.1rem 2.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(16, 38, 58, .35);
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.home__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(16, 38, 58, .45);
}

/* ---------- Advantages: white card overlapping the hero ---------- */
.advantages__columns {
  position: relative;
  z-index: 2;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.advantages__name {
  color: var(--navy);
}

.advantages__text {
  color: var(--text-muted);
}

/* ---------- Image cards: objects, services ---------- */
.objects__picture,
.services__picture {
  border-radius: 16px;
  overflow: hidden;
}

.objects__image,
.services__image {
  transition: transform .5s ease;
}

.objects__column:hover .objects__image,
.services__column:hover .services__image {
  transform: scale(1.04);
}

.objects__name {
  color: var(--navy);
}

.services__column {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.services__column:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.services__column .services__picture {
  border-radius: 0;
}

.services__body {
  padding: 1.25rem 1.375rem 1.5rem;
}

.services__name {
  color: var(--navy);
}

.services__text {
  color: var(--text-muted);
}

.services__button {
  width: 100%;
  justify-content: center;
}

/* ---------- Tabs (BIM model) ---------- */
.tabs__title {
  background-color: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.tabs__title:hover {
  background-color: var(--accent-soft);
}

.tabs__title._tab-active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tabs__picture,
.tabs__image {
  border-radius: 16px;
}

/* ---------- Reasons: navy cards ---------- */
.reasons__column {
  background: linear-gradient(160deg, var(--navy-2) 0%, var(--navy) 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.reasons__column:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.reasons__text {
  color: rgba(255, 255, 255, .78);
}

/* ---------- "Проектируем от 100 м²…" as a CTA band ---------- */
.project__container {
  padding-top: clamp(2.5rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-radius: 28px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, var(--navy-2) 0%, var(--navy) 100%);
  text-align: center;
}

.project .project__title {
  color: #fff;
}

.project .project__button {
  background: #fff;
  border-color: #fff;
  color: var(--navy);
  padding: 1rem 2.25rem;
  font-weight: 700;
}

.project .project__button:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--navy);
}

@media (min-width: 87.5em) {
  .project__container {
    max-width: 1230px;
  }
}

/* ---------- Blog cards ---------- */
.blog__slide {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

.blog__slide:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.blog__picture {
  border-radius: 0;
}

.blog__name {
  color: var(--navy);
}

/* ---------- Constructive stats ---------- */
.constructive__stat {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* ---------- Footer ---------- */
.footer {
  background-color: var(--navy);
}

.blog__body {
  background: #fff;
}

/* ---------- Banners (Портфолио, Блог) ---------- */
@media (min-width: 61.99875em) {
  .banner {
    border-radius: 28px;
  }
}

/* ---------- Article cover: darken for the white title, round corners ---------- */
.blog-internal__picture {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
}

.blog-internal__picture::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 22, 34, .05) 30%, rgba(10, 22, 34, .75) 100%);
  pointer-events: none;
}

.blog-internal__title {
  z-index: 2;
}

.blog-internal__row {
  color: var(--text-muted);
}

/* ---------- Portfolio ---------- */
.portfolio__picture {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.portfolio__title {
  color: var(--navy);
}

.portfolio__number {
  color: var(--accent);
}

/* ---------- Contacts ---------- */
.contacts__title {
  color: var(--navy);
}

.contacts__phone,
.contacts__email {
  color: var(--navy);
  transition: color .2s ease;
}

.contacts__phone:hover,
.contacts__email:hover {
  color: var(--accent);
}

.contacts__map {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}

@media (max-width: 29.99875em) {
  .portfolio__number {
    font-size: 2rem;
    white-space: nowrap;
  }
}

/* Advantages: 4 in a row on desktop, 2 on tablets, 1 on phones */
@media (min-width: 61.99875em) {
  .advantages__columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem 2rem;
  }
}

@media (min-width: 36em) and (max-width: 61.99875em) {
  .advantages__columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Portfolio: project pages ---------- */
.portfolio__link {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

.portfolio__link:hover {
  color: var(--accent);
}

.portfolio--single .portfolio__title {
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  line-height: 1.2;
}

.portfolio__cta {
  margin-top: 1.75rem;
}

.portfolio--others {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.portfolio__others-title {
  margin-bottom: 2rem;
  text-align: center;
}

.portfolio__all {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}
