/* Small supplement on top of the original rbpartner2 theme CSS.
   Keeps behaviour that the original achieved via WordPress/JS, adapted to React. */

#root { min-height: 100%; }

/* The hamburger (.dl-menuwrapper) is only used on mobile; hide it on desktop
   where the horizontal menu is shown (mobile rules re-enable it below). */
@media (min-width: 769px) {
  .dl-menuwrapper { display: none !important; }
}

/* language switch rendered as a button instead of an <a><img>) */
.lang-go button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.lang-go button img { display: block; }

/* clickable team card opens its description (original used :target / JS) */
.go-team-desc { cursor: pointer; }
.item-team .team-desc { cursor: default; }

/* original used 150px WP thumbnails (with width attr); we serve full-size
   images, so constrain them to the card to avoid oversized photos */
.go-team-desc img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  object-position: top center;
}

/* The theme laid out team cards with floats + margin resets tied to
   :nth-child(5n+1), assuming exactly 5 cards per row after the <h2>.
   We render every member (no show-more wrapper), which breaks that grid.
   Use a robust flex-wrap grid instead; the absolutely-positioned bio
   popup (.team-desc.active) still anchors to its relative .item-team. */
.partners-block,
.exspert-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px 90px;
}
.partners-block > h2,
.exspert-block > h2 {
  flex: 0 0 100%;
  margin: 0 0 6px;
}
.partners-block .item-team,
.exspert-block .item-team {
  float: none;
  margin: 0;
  width: 150px;
}

/* deals tabs interactivity */
.sdelka-list li { cursor: pointer; }

/* generic safety: images inside rich content shouldn't overflow */
.content img, .deal-txt img, .team-desc img { max-width: 100%; height: auto; }

/* keep router links looking like the theme's anchors */
a { cursor: pointer; }

/* Remove the gray section bands behind the team groups (per request) */
.partners-block-wrp,
.exspert-block-wrp {
  background-color: transparent;
}

/* =====================================================================
   Responsive / mobile adaptation
   The original theme was a fixed 1200px desktop layout (mobile used a
   separate server-rendered template). These rules make the single React
   layout fluid and usable down to phone widths.
   ===================================================================== */

/* Fluid container instead of the hard 1200px width */
@media (max-width: 1240px) {
  header,
  .wrapper,
  footer .wrapper {
    width: 100% !important;
    max-width: 1200px;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
  }
  .content { max-width: 100%; box-sizing: border-box; }
  .home-slide,
  .about-slide,
  .global-scope-slide,
  .uslugi-slide {
    min-width: 0 !important;
    background-size: cover;
  }
  img { max-width: 100%; }
}

/* Tablet: tighten the home two-column hero */
@media (max-width: 1000px) and (min-width: 769px) {
  .left-slide-1 { width: 58%; }
  .right-slide-1 { width: 38%; margin-left: 0; }
}

/* ---------------- Phones / small tablets ---------------- */
@media (max-width: 768px) {
  header {
    height: auto;
    padding: 14px 15px;
    position: relative;
  }
  .logo { float: left; margin-top: 0; }

  /* hamburger toggle (top-right) */
  .dl-menuwrapper {
    display: inline-block !important;
    position: absolute;
    right: 15px;
    top: 16px;
    margin: 0;
    min-width: 48px;
  }

  /* social + language under the logo row */
  .rght-block { float: none; display: block; width: 100%; clear: both; }
  .top-menu-block { text-align: left; margin-top: 14px; }
  .lang-go { float: none; }

  /* collapsible navigation */
  .menu { width: 100%; }
  #menu { width: 100%; }
  #menu ul { display: none; width: 100%; }
  .menu-open #menu ul { display: block; }
  #menu ul li { float: none; display: block; margin: 0; }
  #menu ul li a {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid #e4e4e4;
  }

  /* hero / awards */
  .slide-ttl { font-size: 20px; padding-top: 26px; }
  .home-slide { height: auto; padding-bottom: 30px; }
  .awrd-wrp { flex-wrap: wrap; }
  .slide-awrd { margin: 12px; width: 240px; }

  /* section headings + "more" links flow inline on mobile */
  .home-slide-ttl { font-size: 20px !important; }
  a.go-detail {
    position: static !important;
    display: inline-block;
    margin-top: 16px;
    right: auto !important;
    bottom: auto !important;
  }
  .home-slide-2 { padding-bottom: 30px; }

  /* home hero two-column -> stacked */
  .left-slide-1,
  .right-slide-1 {
    float: none;
    width: 100%;
    height: auto;
    margin: 0 0 18px 0;
    padding-left: 0;
  }
  .right-slide-1 { height: 180px; }

  /* featured deals + deals page grids: centered flexible cards */
  ul.deals-list,
  ul.objects_list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
  ul.deals-list li,
  ul.objects_list li {
    margin: 0 !important;
    width: 150px;
    height: auto;
  }

  /* team grid: centered, 2-up */
  .partners-block,
  .exspert-block {
    gap: 22px 16px;
    justify-content: center;
    padding: 0 10px;
  }
  /* keep the bio popup on-screen (it normally pops out to the side) */
  .team-desc.active {
    position: static !important;
    width: 100% !important;
    left: auto !important;
    right: auto !important;
    min-height: 0 !important;
    margin-top: 8px;
  }
  .item-team { margin-bottom: 10px; }

  /* footer stacks */
  footer { height: auto; padding-bottom: 24px; }
  footer .wrapper { padding-top: 24px; }
  .left-menu,
  .right-info { float: none; display: block; width: 100%; }
  .left-menu ul { margin-right: 30px; }
  .right-info { margin-top: 20px; font-size: 15px; }

  /* generic content/services */
  .usluga-list .usluga-item a { font-size: 15px; }
  h1 { font-size: 22px; }
}
