/* WPVoyager++ integrated UI modules */

/* Title alignment fixes for newer WordPress defaults */
.titlebar h1,
.titlebar h2,
.parallax-title h1,
.parallax-title h2,
.post-title .entry-title,
.entry-title {
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin-top: 0;
  margin-bottom: 0.45em;
  text-wrap: balance;
}

#header {
  position: sticky;
  top: 0;
  z-index: 9998;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(130%) blur(4px);
  border: 0 !important;
  box-shadow: none !important;
  transition: transform 240ms ease;
}

#header.wpvpp-header-hidden {
  transform: translateY(calc(-100% - 8px)) !important;
}

#header::before,
#header::after,
#header .menu,
#header .menu ul,
#header .menu ul > li > a {
  border-top: 0 !important;
}

.wpvpp-theme-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: transparent;
  padding: 0;
  width: 60px;
  height: 32px;
  cursor: pointer;
}

.wpvpp-theme-toggle-track {
  position: relative;
  display: block;
  width: 60px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4ea1e0, #1e73bf);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transition: background 220ms ease;
  overflow: hidden;
}

.wpvpp-theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 240ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.wpvpp-theme-icon {
  position: absolute;
  top: 8px;
  font-size: 14px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.98);
  transition: transform 240ms ease, opacity 240ms ease;
}

.wpvpp-theme-icon-sun {
  left: 9px;
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

.wpvpp-theme-icon-moon {
  right: 9px;
  opacity: 0.45;
  transform: translateY(2px) rotate(-20deg);
}

.admin-bar #header {
  top: 32px;
}

.home .post-title .entry-title,
.home .fullscreen-image-title .entry-title,
.home .fullscreen-image-title h1,
.home .fullscreen-image-title h2 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* OSM map adjustments */
#map-container .leaflet-container,
#map-container #map,
#map-container #map_elements,
.custom_map {
  width: 100%;
  min-height: 320px;
}

.map-box,
.leaflet-popup-content {
  min-width: 220px;
}

.leaflet-popup-content img {
  max-width: 100%;
  height: auto;
}

.leaflet-popup-content .map-box-icon {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Integrated cookie banner */
.wpvpp-cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100000;
  background: #1f2933;
  color: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.wpvpp-cookie.is-visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wpvpp-cookie p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.wpvpp-cookie button {
  border: 0;
  background: #1e73be;
  color: #fff;
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
  white-space: nowrap;
}

/* Integrated lightbox */
.wpvpp-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 100001;
  display: none;
  align-items: center;
  justify-content: center;
}

.wpvpp-lightbox.is-open {
  display: flex;
}

.wpvpp-lb-image {
  max-width: min(94vw, 1500px);
  max-height: 90vh;
  object-fit: contain;
}

.wpvpp-lb-close,
.wpvpp-lb-prev,
.wpvpp-lb-next {
  position: absolute;
  border: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  font-size: 28px;
  width: 42px;
  height: 42px;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
}

.wpvpp-lb-close {
  top: 16px;
  right: 16px;
}

.wpvpp-lb-prev {
  left: 16px;
}

.wpvpp-lb-next {
  right: 16px;
}

.wpvpp-no-scroll {
  overflow: hidden;
}

/* Dark mode (system/manual) */
body.wpvpp-dark {
  background: #0f172a;
  color: #d1d5db;
}

body.wpvpp-dark #header {
  background: rgba(15, 23, 42, 0.92);
  border: 0 !important;
}

body.wpvpp-dark .wpvpp-theme-toggle {
  background: transparent;
}

body.wpvpp-dark .wpvpp-theme-toggle-track {
  background: linear-gradient(90deg, #1c3f67, #0f2f55);
}

body.wpvpp-dark .wpvpp-theme-knob {
  transform: translateX(28px);
}

body.wpvpp-dark .wpvpp-theme-icon-sun,
.wpvpp-theme-toggle.is-dark .wpvpp-theme-icon-sun {
  opacity: 0.45;
  transform: translateY(2px) rotate(20deg);
}

body.wpvpp-dark .wpvpp-theme-icon-moon,
.wpvpp-theme-toggle.is-dark .wpvpp-theme-icon-moon {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

body.wpvpp-dark .titlebar,
body.wpvpp-dark .container,
body.wpvpp-dark .post-content,
body.wpvpp-dark article,
body.wpvpp-dark #footer {
  background-color: transparent;
  color: #d1d5db;
}

body.wpvpp-dark a {
  color: #93c5fd;
}

body.wpvpp-dark h1,
body.wpvpp-dark h2,
body.wpvpp-dark h3,
body.wpvpp-dark h4 {
  color: #f3f4f6;
}

@media (max-width: 782px) {
  .admin-bar #header {
    top: 46px;
  }

  .wpvpp-cookie.is-visible {
    flex-direction: column;
    align-items: flex-start;
  }
}
