/*
Theme Name: RussiaGym
Theme URI: https://russiagym.ru/
Author: OpenAI
Author URI: https://openai.com/
Description: Кастомная тема для проекта RussiaGym
Version: 1.0
Text Domain: russiagym
*/

/* =========================================================
   BASE
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #f3f5f9;
  color: #111827;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.rg-lightbox-open {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3,
.rg-title,
.rg-project-name,
.rg-page-title {
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.3px;
}

.rg-container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 20px;
}

.rg-container-header {
  max-width: 1540px;
}

/* =========================================================
   COMMON CARD STYLE
========================================================= */
.rg-sidebar-inner,
.rg-map-wrap,
.rg-header-box,
.rg-footer-box,
.rg-page-title-box,
.rg-detail-card,
.rg-back-panel {
  background: #ffffff;
  border: 1px solid #e6eaf0;
  border-radius: 24px;
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.06);
}

/* =========================================================
   HEADER
========================================================= */
.rg-header {
  padding: 20px 0;
  background: transparent;
}

.rg-header-box {
  padding: 0 24px;
}

.rg-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 88px;
}

.rg-header-left,
.rg-header-middle,
.rg-header-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.rg-header-left {
  justify-content: flex-start;
}

.rg-header-middle {
  justify-content: center;
}

.rg-header-right {
  justify-content: flex-end;
}

.rg-logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.rg-logo a {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.rg-logo img,
.rg-logo .custom-logo {
  display: block;
  height: 62px;
  width: auto;
  max-width: 100%;
}

.rg-menu {
  display: flex;
  justify-content: center;
  align-items: center;
}

.rg-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.rg-menu-list li {
  margin: 0;
  padding: 0;
}

.rg-menu-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #eef2f7;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.rg-menu-list a:hover,
.rg-menu-list .current-menu-item > a,
.rg-menu-list .current_page_item > a {
  background: #e5eaf1;
  color: #111827;
}

.rg-social {
  display: flex;
  align-items: center;
  gap: 18px;
}

.rg-social-desktop {
  justify-content: flex-end;
}

.rg-social-mobile {
  justify-content: center;
  margin-top: 16px;
}

.rg-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  text-decoration: none;
  background: transparent;
  box-shadow: none;
}

.rg-social-btn i {
  font-size: 25px;
  color: #3b6eea;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.rg-social-btn:hover i {
  color: #1d4ed8;
  opacity: 0.9;
  transform: translateY(-2px);
}

.rg-burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: #eef2f7;
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.rg-burger i {
  font-size: 18px;
  color: #6b7280;
  transition: color 0.2s ease;
}

.rg-burger:hover {
  background: #e5eaf1;
}

.rg-burger:hover i {
  color: #111827;
}

.rg-mobile-panel {
  display: none;
  padding: 0 0 18px;
}

.rg-mobile-panel.is-open {
  display: block;
}

.rg-mobile-menu {
  border-top: 1px solid #edf1f5;
  padding-top: 18px;
}

.rg-mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rg-mobile-menu-list li {
  margin: 0;
  padding: 0;
}

.rg-mobile-menu-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #eef2f7;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.rg-mobile-menu-list a:hover,
.rg-mobile-menu-list .current-menu-item > a,
.rg-mobile-menu-list .current_page_item > a {
  background: #e5eaf1;
  color: #111827;
}

/* =========================================================
   FOOTER
========================================================= */
.rg-footer {
  padding: 20px 0;
  background: transparent;
}

.rg-footer-box {
  padding: 0 24px;
}

.rg-footer-inner {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.rg-copyright {
  font-size: 15px;
  color: #111827;
}

.rg-footer-logo {
  text-align: center;
}

.rg-footer-logo img {
  display: block;
  height: 44px;
  width: auto;
  margin: 0 auto;
}

.rg-footer-dev {
  display: flex;
  justify-content: flex-end;
}

.rg-footer-dev-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 16px;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.rg-footer-dev-link:hover {
  color: #111827;
}

/* =========================================================
   HOME MAP PAGE
========================================================= */
body.home .rg-container {
  max-width: 1700px;
}

.rg-map-page {
  width: 100%;
}

.rg-map-layout {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 28px;
  align-items: stretch;
}

.rg-sidebar {
  min-width: 0;
}

.rg-sidebar-inner {
  padding: 26px;
  height: 760px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: visible;
}

.rg-title {
  margin: 0 0 20px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  color: #111827;
}

.rg-filter-wrap {
  margin-bottom: 20px;
}

.rg-select {
  width: 100%;
  padding: 14px 48px 14px 18px;
  border-radius: 14px;
  border: 1px solid #d8dee8;
  background-color: #f3f5f9;
  font-size: 16px;
  color: #1f2937;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml;utf8,<svg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M5 7L10 12L15 7' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;

  cursor: pointer;
  transition: border 0.2s ease, background-color 0.2s ease;
}

.rg-select:hover {
  border-color: #c9d2e1;
  background-color: #eef2f7;
  background-image: url("data:image/svg+xml;utf8,<svg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M5 7L10 12L15 7' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

.rg-select:focus {
  outline: none;
  border-color: #3b6eea;
  background-color: #eef2ff;
}

.rg-project-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: visible;
  padding: 8px 10px 12px 0;
  margin-right: -10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rg-project-list::-webkit-scrollbar {
  width: 6px;
}

.rg-project-list::-webkit-scrollbar-thumb {
  background: #d7dde5;
  border-radius: 10px;
}

.rg-project-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e2e6ed;
  border-radius: 20px;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.rg-project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
  border-color: #d4dbe5;
}

.rg-project-card.is-map-hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
  border-color: #d4dbe5;
}

.rg-project-thumb-wrap {
  width: 110px;
  height: 110px;
  min-width: 110px;
  min-height: 110px;
  max-width: 110px;
  max-height: 110px;
  border-radius: 16px;
  overflow: hidden;
  background: #e9edf3;
  aspect-ratio: 1 / 1;
  align-self: start;
}

.rg-project-thumb,
.rg-project-thumb-wrap img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  max-width: none;
  max-height: none;
  display: block;
  object-fit: cover;
  object-position: center center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.rg-project-thumb-empty {
  width: 100%;
  height: 100%;
  background: #e9edf3;
}

.rg-project-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.rg-project-name {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
  word-break: break-word;
}

.rg-project-city {
  margin: 0 0 12px;
  font-size: 14px;
  color: #8a94a6;
}

.rg-project-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b6eea, #2f5fe0);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.rg-project-button:hover {
  background: linear-gradient(135deg, #2f5fe0, #234fc7);
  color: #fff;
}

.rg-empty {
  padding: 18px 0;
  font-size: 15px;
  color: #6b7280;
}

.rg-map-wrap {
  overflow: hidden;
  padding: 0;
}

.rg-map {
  width: 100%;
  height: 760px;
  border-radius: 24px;
}

/* =========================================================
   PAGE + SINGLE WIDTH
========================================================= */
body.single .rg-container,
body.page .rg-container {
  max-width: 1120px;
}

/* =========================================================
   PAGE + SINGLE CONTENT
========================================================= */
.rg-page-title-box {
  padding: 22px 28px;
  margin-bottom: 24px;
}

.rg-page-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 800;
  color: #111827;
}

.rg-detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.rg-detail-left,
.rg-detail-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.rg-detail-card {
  padding: 22px;
  overflow: hidden;
}

.rg-detail-main-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

.rg-section-title {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
}

.rg-single-text {
  font-size: 17px;
  line-height: 1.75;
  color: #374151;
}

.rg-single-text p {
  margin: 0 0 1.2em;
}

.rg-single-text p:last-child {
  margin-bottom: 0;
}

.rg-single-text h2,
.rg-single-text h3,
.rg-single-text h4 {
  margin: 1.6em 0 0.7em;
  color: #111827;
  line-height: 1.25;
  font-weight: 700;
}

.rg-single-text h2 {
  font-size: 28px;
}

.rg-single-text h3 {
  font-size: 23px;
}

.rg-single-text h4 {
  font-size: 20px;
}

.rg-single-text a {
  color: #2563eb;
  text-decoration: none;
}

.rg-single-text a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.rg-single-text img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.rg-single-text figure {
  margin: 1.6em 0;
}

.rg-single-text figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

.rg-single-text ul,
.rg-single-text ol {
  margin: 0 0 1.2em 1.4em;
  padding: 0;
}

.rg-single-text li {
  margin-bottom: 0.5em;
}

.rg-single-text blockquote {
  margin: 1.6em 0;
  padding: 20px 24px;
  border-left: 4px solid #2563eb;
  background: #f8fafc;
  border-radius: 16px;
  color: #374151;
}

.rg-gallery-card {
  margin-top: 0;
}

.rg-page-gallery-card {
  margin-top: 24px;
}

.rg-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.rg-gallery-item {
  appearance: none;
  border: 0;
  padding: 0;
  background: #eef2f7;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  display: block;
}

.rg-gallery-item img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.rg-gallery-item:hover img {
  transform: scale(1.03);
}

.rg-video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.rg-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rg-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: none;
  z-index: 9999;
  -webkit-transform: translateZ(0);
}

.rg-lightbox.is-open {
  display: block;
}

.rg-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
}

.rg-lightbox-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 20px)
    calc(env(safe-area-inset-right, 0px) + 72px)
    calc(env(safe-area-inset-bottom, 0px) + 20px)
    calc(env(safe-area-inset-left, 0px) + 72px);
  overflow: hidden;
}

.rg-lightbox-image {
  max-width: min(1200px, 100%);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 40px);
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 2;
}

.rg-lightbox-close,
.rg-lightbox-nav {
  position: absolute;
  z-index: 3;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s ease;
}

.rg-lightbox-close:hover,
.rg-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

.rg-lightbox-close {
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  font-size: 22px;
}

.rg-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 999px;
  font-size: 22px;
}

.rg-lightbox-prev {
  left: calc(env(safe-area-inset-left, 0px) + 16px);
}

.rg-lightbox-next {
  right: calc(env(safe-area-inset-right, 0px) + 16px);
}

.rg-back-panel {
  margin-top: 24px;
  padding: 22px;
}

.rg-back-wrap {
  text-align: center;
}

.rg-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b6eea, #2f5fe0);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rg-back-button:hover {
  background: linear-gradient(135deg, #2f5fe0, #234fc7);
  color: #fff;
  transform: translateY(-2px);
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1400px) {
  .rg-container {
    max-width: 1400px;
  }

  .rg-container-header {
    max-width: 1360px;
  }

  body.single .rg-container,
  body.page .rg-container {
    max-width: 1120px;
  }

  .rg-map-layout {
    grid-template-columns: 380px 1fr;
  }

  .rg-map,
  .rg-sidebar-inner {
    height: 680px;
  }
}

@media (max-width: 991px) {
  .rg-page-title {
    font-size: 30px;
  }

  .rg-detail-layout {
    grid-template-columns: 1fr;
  }

  .rg-single-text {
    font-size: 16px;
  }
}

@media (max-width: 900px) {
  .rg-header-inner {
    grid-template-columns: 1fr auto;
    gap: 14px;
    min-height: 78px;
  }

  .rg-header-middle,
  .rg-social-desktop {
    display: none;
  }

  .rg-burger {
    display: inline-flex;
  }

  .rg-logo,
  .rg-logo a {
    justify-content: flex-start;
  }

  .rg-logo img,
  .rg-logo .custom-logo {
    height: 52px;
  }

  .rg-header-box,
  .rg-footer-box {
    padding: 0 18px;
  }

  .rg-mobile-panel {
    text-align: center;
  }

  .rg-mobile-menu {
    border-top: 1px solid #edf1f5;
    padding-top: 18px;
  }

  .rg-mobile-menu-list {
    align-items: center;
  }

  .rg-mobile-menu-list a {
    min-width: 180px;
  }

  .rg-social-mobile {
    justify-content: center;
    margin-top: 16px;
  }

  .rg-footer-inner {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
    padding: 16px 0;
  }

  .rg-footer-dev {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .rg-container {
    padding: 0 14px;
  }

  .rg-map-layout {
    grid-template-columns: 1fr;
  }

  .rg-map-wrap {
    order: 1;
  }

  .rg-sidebar {
    order: 2;
  }

  .rg-map,
  .rg-sidebar-inner {
    height: auto;
  }

  .rg-map {
    height: 420px;
  }

  .rg-sidebar-inner {
    padding: 18px;
    border-radius: 18px;
  }

  .rg-title {
    font-size: 24px;
  }

  .rg-project-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    align-items: start;
  }

  .rg-project-thumb-wrap {
    width: 88px;
    height: 88px;
    min-width: 88px;
    min-height: 88px;
    max-width: 88px;
    max-height: 88px;
  }

  .rg-project-content {
    justify-content: flex-start;
  }

  .rg-project-name {
    font-size: 16px;
  }

  .rg-page-title-box {
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 18px;
  }

  .rg-page-title {
    font-size: 22px;
  }

  .rg-detail-card,
  .rg-back-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .rg-gallery-grid {
    grid-template-columns: 1fr;
  }

  .rg-gallery-item img {
    height: 200px;
  }

  .rg-single-text {
    font-size: 15px;
    line-height: 1.7;
  }

  .rg-lightbox-content {
    padding:
      calc(env(safe-area-inset-top, 0px) + 16px)
      calc(env(safe-area-inset-right, 0px) + 10px)
      calc(env(safe-area-inset-bottom, 0px) + 16px)
      calc(env(safe-area-inset-left, 0px) + 10px);
  }

  .rg-lightbox-image {
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 32px);
    border-radius: 14px;
  }

  .rg-lightbox-close {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    width: 42px;
    height: 42px;
  }

  .rg-lightbox-nav {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .rg-lightbox-prev {
    left: calc(env(safe-area-inset-left, 0px) + 6px);
  }

  .rg-lightbox-next {
    right: calc(env(safe-area-inset-right, 0px) + 6px);
  }
}

.rg-post-wide-image {
  margin-top: 24px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.rg-post-wide-image img {
  width: 100%;
  height: auto;
  display: block;
}
