:root {
  --cg-bg: #f5f8ff;
  --cg-card: rgba(255,255,255,.82);
  --cg-border: rgba(10, 31, 68, 0.08);
  --cg-text: #102341;
  --cg-muted: #60708b;
  --cg-primary: #2159ff;
  --cg-primary-soft: #edf3ff;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  color: var(--cg-text);
  background:
    radial-gradient(circle at top left, rgba(33, 89, 255, 0.08), transparent 24%),
    linear-gradient(180deg, #f9fbff 0%, #eff4ff 100%);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}

.navbar-brand {
  letter-spacing: .01em;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.custom-logo {
  max-height: 56px;
  width: auto;
}

.brand-mark,
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--cg-primary-soft);
  color: var(--cg-primary);
  flex: 0 0 auto;
}

.hero-section,
.bg-grid {
  position: relative;
}

.bg-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(16,35,65,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16,35,65,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 80%);
  pointer-events: none;
}

.hero-section > .container {
  position: relative;
  z-index: 1;
}

.hero-panel,
.content-card {
  background: var(--cg-card);
  border: 1px solid var(--cg-border);
  border-radius: 1.5rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 42px rgba(12, 33, 77, 0.08);
}

.section-links {
  display: grid;
  gap: .75rem;
}

.section-link-item,
.building-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem;
  border: 1px solid var(--cg-border);
  border-radius: 1rem;
  background: rgba(255,255,255,.78);
  text-decoration: none;
  color: var(--cg-text);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.section-link-item:hover,
.building-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(12, 33, 77, 0.08);
  border-color: rgba(33,89,255,.22);
}

.section-link-item i,
.building-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .85rem;
  background: var(--cg-primary-soft);
  color: var(--cg-primary);
  font-size: 1.1rem;
}

.building-card small {
  display: block;
  color: var(--cg-muted);
}

.feature-list li {
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: .8rem;
  color: var(--cg-muted);
}

.feature-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--cg-primary);
  font-weight: 700;
}

.floor-plan-placeholder {
  background: linear-gradient(180deg, #ffffff 0%, #f1f6ff 100%);
  border: 1px dashed rgba(33,89,255,.28);
  min-height: 420px;
}

.floor-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--cg-primary-soft);
  color: var(--cg-primary);
  font-weight: 700;
}

.site-footer {
  background: rgba(255,255,255,.6);
}

.news-card {
  height: 100%;
  overflow: hidden;
  border-radius: 1.25rem;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--cg-border);
}

.news-card__thumb img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.news-card__body {
  padding: 1.1rem;
}

.news-card__body a {
  text-decoration: none;
  color: inherit;
}

.empty-state {
  min-height: 180px;
  border: 1px dashed rgba(33,89,255,.25);
  border-radius: 1.25rem;
  display: grid;
  place-items: center;
  gap: .75rem;
  text-align: center;
  color: var(--cg-muted);
  padding: 2rem;
}

.empty-state i {
  font-size: 1.8rem;
  color: var(--cg-primary);
}

.widget-grid {
  display: flex;
  flex-wrap: wrap;
}

.widget-grid .widget {
  width: 100%;
}

.widget-grid > * {
  flex: 1 1 280px;
}

.tour-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 73px);
}

.tour-sidebar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
}

.tour-sidebar-inner {
  padding: 1.5rem;
  height: 100%;
  overflow: auto;
}

.tour-stage {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.tour-viewer {
  width: 100%;
  height: calc(100vh - 73px);
  background: #0f1728;
}

.tour-info-card {
  border-radius: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--cg-border);
  background: linear-gradient(180deg, #fff 0%, #f7faff 100%);
  word-break: break-word;
}

.room-panel__subjects {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}

.room-panel__subjects span {
  font-size: .8rem;
  background: var(--cg-primary-soft);
  color: var(--cg-primary);
  border-radius: 999px;
  padding: .25rem .55rem;
}

.cg-marker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(16,35,65,.14);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  color: var(--cg-text);
  border-radius: 999px;
  padding: .5rem .75rem;
  min-width: 150px;
}

.cg-marker__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--cg-primary);
  box-shadow: 0 0 0 6px rgba(33,89,255,.12);
}

.cg-marker__title {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.15;
}

.cg-marker__meta {
  display: block;
  font-size: .72rem;
  color: var(--cg-muted);
}

.entry-content > * + * {
  margin-top: 1rem;
}

.psv-container,
.psv-canvas-container,
#psv-viewer {
  max-width: 100% !important;
  overflow: hidden !important;
}

@media (max-width: 991.98px) {
  .tour-layout {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .tour-sidebar {
    border-right: 0 !important;
    border-bottom: 1px solid var(--cg-border);
    width: 100%;
    max-width: 100%;
  }

  .tour-stage,
  .tour-viewer,
  #psv-viewer {
    width: 100%;
    max-width: 100%;
  }

  .tour-viewer {
    height: 72vh;
  }
}

@media (max-width: 575.98px) {
  .tour-sidebar-inner,
  .content-card,
  .hero-panel {
    padding: 1rem !important;
  }

  .tour-viewer {
    height: 62vh;
  }
}

/* ===== 360 tour add  ===== */
.building-page-icon-wrap {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f7fb;
  border: 1px solid #d9e2ef;
  border-radius: 22px;
}

.building-page-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.floor-plan-image {
  max-width: 100%;
  width: auto;
  height: 150px;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid #d9e2ef;
  background: #fff;
}

.floor-plan-empty {
  padding: 28px;
  border: 1px dashed #c8d6ea;
  border-radius: 18px;
  background: #f8fbff;
  width: 100%;
  max-width: 620px;
}

.floor-plan-placeholder {
  background: #f8fbff;
  border: 1px solid #d9e2ef;
}


/* ===== 360 tour overflow / width fix ===== */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body.page-template-page-tour-php,
body.page-template-page-tour-php .site,
body.page-template-page-tour-php .site-content,
body.page-template-page-tour-php .site-main {
  max-width: 100%;
  overflow-x: hidden;
}

body.page-template-page-tour-php .tour-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

body.page-template-page-tour-php .tour-sidebar {
  width: 100%;
  max-width: 360px;
  min-width: 0;
  overflow: hidden;
}

body.page-template-page-tour-php .tour-sidebar-inner {
  overflow: auto;
}

body.page-template-page-tour-php .tour-stage,
body.page-template-page-tour-php .tour-viewer,
body.page-template-page-tour-php #psv-viewer {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body.page-template-page-tour-php .tour-stage {
  position: relative;
}

body.page-template-page-tour-php #psv-viewer {
  display: block;
  height: calc(100vh - 73px);
  min-height: 520px;
}

body.page-template-page-tour-php #psv-viewer .psv-container,
body.page-template-page-tour-php #psv-viewer .psv-canvas-container,
body.page-template-page-tour-php #psv-viewer canvas {
  max-width: 100% !important;
  overflow: hidden !important;
}

@media (max-width: 991.98px) {
  body.page-template-page-tour-php .tour-layout {
    grid-template-columns: 1fr;
  }

  body.page-template-page-tour-php .tour-sidebar {
    max-width: 100%;
  }

  body.page-template-page-tour-php #psv-viewer {
    height: 60vh;
    min-height: 380px;
  }
}

/* ===== navbar ===== */
.site-header {
  position: sticky !important;
  top: 0;
  z-index: 99999;
  width: 100%;
}

.site-header .navbar {
  background: rgba(255,255,255,0.82) !important;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(10,31,68,.08);
  box-shadow: 0 8px 28px rgba(12,33,77,.06);
  padding: .85rem 0;
}

.navbar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cg-text) !important;
  transition: .25s ease;
}

.navbar-brand:hover {
  color: var(--cg-primary) !important;
}

.brand-title {
  color: var(--cg-text);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.2;
  white-space: nowrap;
  margin-left: 12px;
}

.navbar-nav {
  align-items: center;
  gap: .35rem;
}

.navbar-nav .menu-item > a,
.navbar-nav .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-weight: 600;
  color: var(--cg-text) !important;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
  .navbar-nav .menu-item > a:hover,
  .navbar-nav .nav-link:hover {
    background-color: var(--cg-primary-soft);
    color: var(--cg-primary) !important;
    transform: translateY(-1px);
  }
}

@media (hover: none) {
  .navbar-nav .menu-item > a:hover,
  .navbar-nav .nav-link:hover,
  .navbar-nav .menu-item > a:focus,
  .navbar-nav .nav-link:focus,
  .navbar-nav .menu-item > a:active,
  .navbar-nav .nav-link:active {
    background-color: transparent !important;
    color: var(--cg-text) !important;
    transform: none !important;
    box-shadow: none !important;
  }
}

.navbar-nav .current-menu-item > a,
.navbar-nav .current_page_item > a {
  background: transparent;
  color: var(--cg-text) !important;
  box-shadow: none;
}

.navbar-toggler {
  border: 1px solid rgba(33,89,255,.12);
  border-radius: 12px;
  padding: .45rem .7rem;
  box-shadow: none !important;
}

.navbar-toggler:hover {
  background: rgba(33,89,255,.06);
}

@media (max-width: 991.98px) {
  .navbar-collapse {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(10,31,68,.08);
    box-shadow: 0 12px 32px rgba(12,33,77,.08);
  }

  .navbar-nav {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    align-items: stretch !important;
    text-align: left !important;
  }

  .navbar-nav .menu-item {
    width: 100%;
    text-align: left !important;
  }

  .navbar-nav .menu-item > a,
  .navbar-nav .nav-link {
    width: 100%;
    display: flex;
    justify-content: flex-start !important;
    text-align: left !important;
    align-items: center;
    border-radius: 14px;
  }
}

/* ===== history ===== */
.history-intro {
  position: relative;
  padding: 1.2rem 1.35rem;
  border-radius: 1.25rem;
  background: #edf3ff;
  border: 1px solid rgba(33, 89, 255, .14);
  color: var(--cg-muted);
  box-shadow: none;
}

.history-intro p {
  margin-bottom: 0;
  padding-left: 0;
  line-height: 1.65;
}

.history-timeline {
  display: grid;
  gap: 0;
  margin-top: 1.25rem;
}

.history-event {
  display: grid;
  grid-template-columns: 160px 36px 1fr;
  gap: 1rem;
  position: relative;
}

.history-period {
  align-self: start;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: .55rem .8rem;
  border-radius: 999px;
  background: var(--cg-primary-soft);
  color: var(--cg-primary);
  border: 1px solid rgba(33, 89, 255, .16);
  font-weight: 700;
  font-size: .88rem;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 8px 18px rgba(33, 89, 255, .06);
}

.history-marker {
  position: relative;
  display: flex;
  justify-content: center;
}

.history-marker::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-top: .75rem;
  border-radius: 50%;
  background: var(--cg-primary);
  box-shadow: 0 0 0 6px rgba(33, 89, 255, .12);
  z-index: 2;
}

.history-marker::after {
  content: "";
  position: absolute;
  top: 1.85rem;
  bottom: -1.5rem;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(33, 89, 255, .35), rgba(33, 89, 255, .1)
  );
}

.history-event:last-child .history-marker::after {
  display: none;
}

.history-panel {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.35rem;
  border-radius: 1.25rem;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--cg-border);
  box-shadow: 0 12px 32px rgba(12, 33, 77, .07);
  backdrop-filter: blur(14px);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.history-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(33, 89, 255, .22);
  box-shadow: 0 16px 38px rgba(12, 33, 77, .1);
}

.history-panel h3 {
  margin-bottom: .65rem;
  color: var(--cg-text);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
}

.history-panel p {
  margin-bottom: .65rem;
  color: var(--cg-muted);
  line-height: 1.6;
}

.history-panel strong {
  color: var(--cg-text);
  font-weight: 700;
}

.history-full-name {
  padding: .8rem 1rem;
  border-radius: 1rem;
  background: rgba(237, 243, 255, .72);
  border: 1px solid rgba(33, 89, 255, .1);
  color: var(--cg-muted);
  font-style: normal;
}

.history-city {
  display: inline-flex;
  align-items: center;
  margin-top: .35rem;
  padding: .38rem .75rem;
  border-radius: 999px;
  background: #ffffff;
  color: var(--cg-text);
  border: 1px solid rgba(33, 89, 255, .16);
  font-size: .82rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(12, 33, 77, .05);
}

@media (max-width: 768px) {
  .history-event {
    grid-template-columns: 34px 1fr;
    gap: .75rem;
  }

  .history-period {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
  }

  .history-marker {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .history-marker::before {
    margin-top: .75rem;
  }

  .history-marker::after {
    top: 1.85rem;
    bottom: -1.5rem;
  }

  .history-panel {
    grid-column: 2;
    grid-row: 2;
    padding: 1rem;
  }

  .history-intro {
  padding: 1rem;
  }

  .history-intro p {
    padding-left: 0;
  }
}

/* ===== widgets ===== */
.resource-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    height: 100%;
    min-height: 220px;
    padding: 24px 18px;

    text-align: center;
    text-decoration: none;

    background: #fff;
    border: 1px solid rgba(13, 110, 253, 0.12);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);

    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.resource-card__logo {
    width: 86px;
    height: 86px;
    margin-bottom: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 24px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(13, 110, 253, 0.04));
    color: var(--bs-primary);
    font-size: 42px;
}

.resource-card__title {
    display: block;
    color: #1f2937;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 8px;
}

.resource-card__desc {
    display: block;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.35;
}

.resource-card:hover .resource-card__title {
    color: var(--bs-primary);
}

.vk-logo-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 56px;
    height: 56px;

    border-radius: 16px;
    background: #0077ff;
    color: #fff;

    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

html,
body {
  max-width: 100%;
  overflow-x: clip !important;
}

body.page-template-page-tour-php,
body.page-template-page-tour-php .site,
body.page-template-page-tour-php .site-content,
body.page-template-page-tour-php .site-main {
  max-width: 100%;
  overflow-x: clip !important;
}

.room-details-btn {
  padding: .5rem 1.15rem !important;
  font-size: 1rem !important;
  line-height: 1.25;
  border-radius: .5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main,
.site-main,
.site-content {
  flex: 1 0 auto;
}

.site-footer {
  margin-top: auto;
  flex-shrink: 0;
}

.content-card .badge {
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  line-height: 1.35;
}

@media (max-width: 740px) {
  .site-header .brand-title {
    display: none !important;
  }

  .site-header .navbar-brand {
    display: flex !important;
    align-items: center;
    gap: 0 !important;
  }

  .site-header .custom-logo {
    max-height: 48px !important;
  }
}

html {
  scroll-padding-top: 110px;
}

[id] {
  scroll-margin-top: 110px;
}

@media (max-width: 991.98px) {
  html {
    scroll-padding-top: 90px;
  }

  [id] {
    scroll-margin-top: 90px;
  }
}