body {
    background-color: #e0f7fa;
    color: #2c3e50;
    font-family: 'Raleway', sans-serif;
}

h1,
h5,
.card-title {
    font-family: 'Urbanist', sans-serif;
}

.navbar {
    background-color: rgba(176, 214, 255, 0.6);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
}

.navbar-brand,
.nav-link {
    color: #3a2e2e !important;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #f7f7f7 !important;
}

.btn-light {
    box-shadow: 0 0 8px rgba(0, 136, 255, 0.2);
    transition: all 0.3s ease;
  }

  .btn-light:hover {
    background-color: #b8e2ff!important;
    box-shadow: 0 0 12px rgba(0, 136, 255, 0.3);
  }

  #theme-toggle {
    color: #3a2e2e;
  }

.osm-banner {
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
    z-index: 0;
}

.map {
    z-index: 1;
}

/* Override inline height and give room for the gradient to breathe */
.osm-banner #map {
    height: 500px !important;
    position: relative !important;
}

.live,
.offline {
    width: 100%;
    display: block;
}

.offline {
    filter: grayscale(45%) opacity(0.65);
}

/* Full-height overlay: ease-in bottom fade + side vignettes */
.map-gradient-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    background:
        /* left edge vignette */
        linear-gradient(to right,
            #e0f7fa 0%,
            rgba(224, 247, 250, 0.55) 5%,
            transparent 18%
        ),
        /* right edge vignette */
        linear-gradient(to left,
            #e0f7fa 0%,
            rgba(224, 247, 250, 0.55) 5%,
            transparent 18%
        ),
        /* bottom fade — slow start, fast finish */
        linear-gradient(to top,
            #e0f7fa             0%,
            rgba(224,247,250,.96) 7%,
            rgba(224,247,250,.85) 16%,
            rgba(224,247,250,.60) 30%,
            rgba(224,247,250,.30) 46%,
            rgba(224,247,250,.08) 62%,
            transparent          76%
        );
}

.bear-map-icon {
  width: 72px;
  height: 72px;
  animation: bearFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

@keyframes bearFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

.live-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.7);
    z-index: 1002;
}

.live-indicator::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    background-color: limegreen;
    border-radius: 50%;
    box-shadow: 0 0 10px limegreen;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.offline-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(128, 128, 128, 0.7);
    z-index: 999;
}

.offline-indicator::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    background-color: grey;
    border-radius: 50%;
}

.top-section {
    margin-top: -350px;
    position: relative;
    z-index: 1;
}

.card-img-top {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: center;
}

.card {
    border: none;
    margin-bottom: 2rem;
    z-index: 2;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card img {
    transition: transform 0.4s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card:hover img {
    transform: scale(1.1);
}

.post-img-overflow-hidden {
    overflow: hidden;
    position: relative;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 1rem;
    transition: background 0.3s;
}

.card:hover .card-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.days-count {
    margin-top: -0.2rem!important;
    font-size: 2rem;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
    color: white;
}

.card-img-container {
    position: relative;
}

.badge {
    margin-right: 0.25rem;
    font-size: 0.7rem;
}

footer {
    background-color: #004c70;
    color: #ffffff;
    padding: 2rem 0;
}

footer a {
    color: #00d4ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.icon-weather img {
    max-width: 80px;
    height: auto;
}

/* ── Weather card ── */
.weather-card {
  border-radius: 16px;
  overflow: hidden;
  padding: 1.1rem 1.2rem 1rem;
  background: linear-gradient(145deg, #cfe8f8 0%, #a8d5f0 55%, #86c5ea 100%);
  position: relative;
}

.weather-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
}

.weather-icon {
  flex-shrink: 0;
}

.weather-icon img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

.weather-main { flex: 1; min-width: 0; }

.weather-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(10, 50, 90, 0.55);
  margin-bottom: 0.2rem;
}

.weather-condition {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0a2e52;
  margin-bottom: 0.15rem;
}

.weather-temp {
  font-size: 1.45rem;
  font-weight: 800;
  color: #062040;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.weather-temp-sep {
  font-size: 1rem;
  opacity: 0.45;
  margin: 0 0.1rem;
}

.weather-feels {
  font-size: 0.7rem;
  color: rgba(6, 32, 64, 0.6);
  margin-top: 0.2rem;
}

.weather-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(10, 50, 90, 0.12);
}

.weather-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #0a2e52;
}

.weather-stat .bi {
  font-size: 0.82rem;
  opacity: 0.6;
}

.weather-stat-muted {
  color: rgba(10, 50, 90, 0.5);
  margin-left: 0.2rem;
}

/* Play Overlay Button */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, opacity 0.3s ease;
}

.play-icon {
    width: 80px;
    height: 80px;
    opacity: 0.95;
    transition: transform 0.2s ease, opacity 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
}

.play-overlay:hover .play-icon {
    transform: scale(1.1);
    opacity: 1;
}


.poi-marker {
    text-align: center;
    width: 60px;
}

.poi-marker .poi-image {
    border: 2px solid #444;
    background: #fff;
    padding: 2px;
    border-radius: 4px;
    width: 50px;
    height: 50px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.poi-marker .poi-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.poi-marker .poi-name {
    margin-top: 4px;
    font-size: 12px;
    color: #222;
    font-weight: 500;
    text-shadow: 1px 1px 1px #fff;
}

.poi-sign {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 4px;
  border-radius: 0px;
  font-size: 11px;
  white-space: nowrap;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.custom-poi-label {
  width: auto!important;
}

.glow-dot {
  filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.7));
  animation: pulse 1.5s ease-out infinite;
}

/* Pulse keyframes */
@keyframes pulse {
  0% {
    r: 6;
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.7));
  }
  70% {
    r: 20;
    opacity: 0,5;
    filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.5));
  }
  100% {
    r: 6;
    opacity: 0,5;
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.7));
  }
}

.map-layout,
.map-layout html,
.map-layout body {
  height: 100dvh;
  height: 100svh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-layout main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-site,
.map-content,
.map-wrapper-track {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
}

.map-site,
.map-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-content {
  height: 100dvh;
  height: 100svh;
}

.map-wrapper-track {
  flex: 1 1 auto;
  display: flex;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#map-track {
  flex: 1 1 auto;
  min-height: 0;
}

.map-controls-container {
  position: absolute;
  bottom: 0;
  left: 56px;
  right: 0;
  z-index: 998;
  transition: 0.1s ease;
  overflow: hidden;
}

.map-controls {
  height: 59px;
  background: rgba(176, 214, 255, 0.6);
  box-shadow: 1px -3px 12px rgba(0, 0, 0, 0.7);
}

.map-toggle-buttons {
  margin-left: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: end;
}

.map-toggle-buttons .btn {
    width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.map-toggle-buttons button span {
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
  }
#side-panel.expanded .map-toggle-buttons button span {
  opacity: 1;
}

.map-toggle-buttons .btn:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
.characters-map {
    position: fixed;
    margin-left: var(--event-left-offset, 0);
    top: 62px;
    right: 1rem;
    display: flex;
    z-index: 767;
}

.img-char-user {
  transition: transform 0.2s ease, box-shadow 0.2s ease!important;
}

.img-char-user:hover {
  transform: scale(1.1)!important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.card .img-char-user,
.img-char-user {
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.85);
  border-color: orange;
  border-width: 2px;
}

.card img.img-char-user {
  transform: none;
  max-width: none;
  height: auto;
}

.trip-card-fluid {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
  color: white;
}

.trip-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  transition: transform 0.3s ease;
  min-height: 260px;
  background-color: #111;
  color: white;
}

.trip-card:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.trip-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.trip-bg video,
.trip-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.4);
}

.trip-overlay {
  position: relative;
  z-index: 3;
  padding: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.character-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 1rem;
  pointer-events: none;
  gap: 1rem;
  flex-wrap: wrap;
  overflow: hidden;
  max-height: 100%;
}

.character-hero-overlay img {
  max-height: 220px;
  max-width: 25%;
  object-fit: contain;
}

.hero-count-1 img { max-width: 60%; }
.hero-count-2 img { max-width: 40%; }
.hero-count-3 img { max-width: 30%; }
.hero-count-4 img { max-width: 22%; }

.character-avatars {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.character-hero img {
  object-fit: contain;
  transition: transform 0.2s;
}
.trip-card.no-guests .character-hero img {
  height: 120px;
}
.trip-card.with-guests .character-hero img {
  height: 90px;
}
.character-hero img:hover {
  transform: scale(1.05);
}
.character-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
}
.character-guest img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #f8f9fa;
  padding: 2px;
}
.guest-name {
  font-size: 0.75rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-track {
  font-size: 0.85rem;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(3px);
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
}

.poi-list {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.poi-list .badge {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}

#event-card {
  position: fixed;
  bottom: 1rem;
  left: var(--event-left-offset, 0);
  right: 1rem;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  z-index: 1000;
  max-width: 800px;
  width: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: left 0.3s ease;
}

#event-media img {
  max-height: 50vh;
  width: 100%;
  object-fit: cover;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

#side-panel {
  position: fixed;
  top: var(--navbar-height, 56px);
  bottom: 0;
  left: 0;
  height: auto;
  max-height: 100%;
  width: 260px;
  max-width: 80%;
  background: rgba(176, 214, 255, 0.6);
  backdrop-filter: blur(6px);
  transition: transform 0.1s ease;
  z-index: 768;
  display: flex;
  flex-direction: column;
  padding: 1rem 0.5rem;
  transform: translateX(-204px);
}

#side-panel.expanded {
  transform: translateX(0);
}

#side-panel.expanded .map-toggle-buttons button {
  width: 100% !important;
  justify-content: flex-start;
  padding-left: 0.75rem;
}

#panel-toggle {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  margin-bottom: 5px;
  cursor: pointer;
  z-index: 10;
}

#panel-toggle i {
  color: #fff;
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.panel-content {
  display: flex;
  flex-direction: column;
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
}
.panel-extra-wrapper {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  padding-right: 4px;
}
/* Hide scrollbar — WebKit (Chrome, Safari) */
.panel-extra-wrapper::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

/* Hide scrollbar — Firefox */
.panel-extra-wrapper {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.panel-extra {
  margin-top: 1rem;
  transition: opacity 0.2s ease;
}

#side-panel.collapsed .panel-extra {
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.3s ease;
  }

#side-panel.expanded .panel-extra {
  opacity: 1;
  pointer-events: auto;
}

.image-thumb-cluster {
  position: relative;
  display: inline-block;
}

.image-polaroid-wrapper {
  position: absolute;
  width: 36px;
  height: 36px;
  top: 0;
  left: 0;
}

.image-polaroid-wrapper:nth-child(1) {
  transform: rotate(-12deg);
  z-index: 1;
}
.image-polaroid-wrapper:nth-child(2) {
  transform: rotate(0deg);
  z-index: 2;
}
.image-polaroid-wrapper:nth-child(3) {
  transform: rotate(12deg);
  z-index: 3;
}

.image-polaroid {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 2px solid white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  background: white;
}

.image-polaroid-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 16px;
  height: 16px;
  background-color: rgba(0, 0, 0, 0.2);
  color: white;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  pointer-events: none;
}

#imageClusterModal .swiper-slide {
  transform: none !important;
}

:root {
  --navbar-height: 56px;
  --controls-height: 59px;
}

@media (max-width: 576px) and (orientation: portrait) {
  :root {
    --navbar-height: 56px;
    --controls-height: 59px;
  }
}

.poi-card-marker {
    text-align: center;
    display: inline-block;
    border-radius: 8px;
    background-color: rgba(116, 122, 116, 0.863);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 0;
    width: 110px;
    overflow: visible;
    position: relative;
}

.poi-card-marker img {
    width: 100% !important;
    height: 60px;
    display: block;
    object-fit: cover;
    border-radius: 0.35rem;
    margin-bottom: 0.25rem;
}

.poi-pointer {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid rgb(116, 122, 116);
  filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.1));
  z-index: 10;
}

.poi-check {
  position: absolute;
  top: 3px;
  right: 3px;
  background: white;
  color: #28a745;
  font-size: 1rem;
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  line-height: 1;
}

.poi-card-marker.been {
  border: 2px solid #28a745;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
}

.poi-card-marker.not-been {
  border: 2px solid #888888;
  box-shadow: 0 0 6px rgba(40, 167, 69, 0.4);
  background-color: rgba(6, 6, 6, 0.6);
}

.poi-card-icon {
  display: inline-block;
  overflow: visible !important;
  background: transparent;
}

.poi-card-marker .title {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0rem 0.2rem;
  color: #88ff6c;
}

.poi-card-marker.not-been .title {
    color: #c9d9c5;
}

.poi-card-marker .chevron-down {
  position: absolute;
  bottom: -28px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: rgba(116, 122, 116, 0.863);
  z-index: 10;
  pointer-events: none;
}

.poi-connector-line {
  stroke: white;
  stroke-opacity: 0.8;
  filter: drop-shadow(0 0 2px #fff);
}

#lightboxOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1056;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightboxOverlay.d-none {
    display: none;
}

#lightboxOverlay.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

#lightboxImage {
    max-width: 90%;
    max-height: 90%;
    z-index: 2;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
}

.leaflet-marker-icon.fade {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* ── Gallery: filter bar ── */
.gallery-filters {
  position: sticky;
  top: var(--navbar-height, 56px);
  z-index: 100;
  background: rgba(224, 247, 250, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gf-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  overflow: hidden;
}

/* Segmented control */
.gf-seg {
  display: flex;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.gf-type {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.8rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  white-space: nowrap;
  line-height: 1;
}

.gf-type .bi { font-size: 0.82rem; }

.gf-type:hover:not(.active) { color: rgba(0, 0, 0, 0.65); }

.gf-type.active {
  background: #fff;
  color: #1a6b94;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.14);
}

@media (max-width: 576px) {
  .gf-type span { display: none; }
  .gf-type { padding: 0.28rem 0.65rem; }
}

/* ── Gallery: grid ── */
#gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

@media (min-width: 768px)  { #gallery { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 992px)  { #gallery { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1200px) { #gallery { grid-template-columns: repeat(6, 1fr); } }

.gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  background: #111;
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.gallery-thumb img,
.gallery-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-thumb img,
.gallery-item:hover .gallery-thumb video {
  transform: scale(1.05);
}

/* Play icon on video tiles */
.gallery-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.48);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.88rem;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Private badge */
.gallery-private-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 5;
  background: rgba(255, 193, 7, 0.9);
  color: #000;
  font-size: 0.6rem;
  padding: 2px 5px;
  border-radius: 4px;
}

  .media-thumbnail-wrapper {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
  }

  .youtube-post-detail {
    margin-top: -48px;
  }

  .blockquote {
    border-width: 0 0 0 10px;
    border-style: solid;
  }

  .blockquote p {
    margin-left: 10px;
  }

/* START MOSAIC AND MODAL */

.media-thumb {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: block;
}

.media-wrapper {
  position: relative;
  overflow: hidden;
}

.media-wrapper.portrait .media-thumb {
  aspect-ratio: 3 / 4;
}
.media-wrapper.landscape .media-thumb {
  aspect-ratio: 4 / 3;
}

.media-tile {
  cursor: pointer;
}

.media-tile:hover .media-thumb {
  filter: brightness(0.95);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.overlay-count {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-fullscreen .modal-body {
  overflow: hidden;
}

/* Each slide fills the screen correctly, including iOS dynamic chrome */
.swiper-media-slide {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100svh;
  height: 100dvh;
}

/* Nav arrows: hidden by default, appear on hover (desktop only) */
.swiper-button-next,
.swiper-button-prev {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.swiper-button-disabled {
  visibility: hidden;
}

#mediaSwiperModal:hover .swiper-button-next,
#mediaSwiperModal:hover .swiper-button-prev {
  opacity: 1;
  pointer-events: auto;
}

/* Touch devices: hide arrows entirely, rely on swipe + fraction counter */
@media (hover: none) and (pointer: coarse) {
  .swiper-button-next,
  .swiper-button-prev {
    display: none;
  }
}

/* Slide counter (fraction pagination) — top-center */
#mediaSwiperModal .swiper-pagination {
  top: max(env(safe-area-inset-top, 0px), 14px);
  bottom: auto !important;
}
#mediaSwiperModal .swiper-pagination-fraction {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.modal-fullscreen {
  overflow: hidden;
}

.modal-fullscreen .swiper-slide img {
  max-height: 100svh;
  max-height: 100dvh;
  max-width: 100vw;
  object-fit: contain;
}

.modal-fullscreen video {
  max-height: 100svh;
  max-height: 100dvh;
  max-width: 100vw;
  object-fit: contain;
}

.video-modal-wrapper img,
.video-modal-wrapper video {
  max-height: 100svh;
  max-height: 100dvh;
  max-width: 100vw;
  object-fit: contain;
}

/* Swipe-to-close: smooth snap-back after an incomplete drag */
#mediaSwiperModal .modal-content {
  will-change: transform, opacity;
}

.btn-close-light {
  position: absolute;
  width: 2rem;
  height: 2rem;
  padding: 0.5rem;
  top: 1rem;
  right: 1rem;
  z-index: 1056;
  filter: invert(1);
  opacity: 0.8;
}

.btn-close-light:hover {
  opacity: 1;
}

.private-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 5;
  font-size: 0.75rem;
  padding: 0.25em 0.5em;
  border-radius: 0.25rem;
  pointer-events: none;
}

.private-badge-right {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  z-index: 5;
  font-size: 0.75rem;
  padding: 0.25em 0.5em;
  border-radius: 0.25rem;
  pointer-events: none;
}

.tag-badges .badge {
  display: inline-block;
  font-size: .65rem;
  line-height: 1;
  padding: .125rem .35rem !important;
}

.tag-badges {
  display: flex;
  gap: .25rem;
  margin-top: .35rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 80%, rgba(0,0,0,0));
}
.tag-badges::-webkit-scrollbar { display: none; }

.modal-video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  cursor: pointer;
  display: none;
}

.video-modal-wrapper.paused .modal-video-play-button {
  display: block;
}

.video-modal-wrapper video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.video-mute-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  z-index: 10;
}

.sound-icon {
  width: 36px;
  height: 36px;
  display: block;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}

/* Caption scrim: gradient fades from solid at bottom to transparent above */
.media-hover-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  color: white;
  padding: 2rem 1rem 0.75rem;
  font-size: 0.85rem;
  pointer-events: none;
}

/* END MOSAIC AND MODAL */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    cursor: pointer;
}

.map-event-thumb{
  float: left !important;
  width: 140px !important;
  aspect-ratio: 1 / 1;
  object-fit: cover !important;
  margin: 0 .5rem .3rem 0;
  border-radius: .5rem;
  transform: none !important;
}

/* Clear the float so the parent wraps around the image+text */
.map-event-embed::after{
  content: "";
  display: table;
  clear: both;
}

/* Slightly larger thumb on wider screens */
@media (min-width: 768px){
  .map-event-thumb{ width: 140px; }
}

/* If screens get very narrow, shrink the thumb a bit more */
@media (max-width: 360px){
  .map-event-thumb{ width: 100px; }
}


/* ── Comment variables ── */
:root {
  --cmt-surface:      #ffffff;
  --cmt-border:       rgba(0, 0, 0, 0.07);
  --cmt-text:         #1a202c;
  --cmt-muted:        #718096;
  --cmt-link:         #0d6efd;
  --cmt-avatar-bg:    #e9ecef;
  --cmt-reply-line:   #e2e8f0;
  --cmt-input-bg:     #f8fafc;
  --cmt-input-border: #dee2e6;
  --cmt-reply-pill-bg:   rgba(13, 110, 253, 0.08);
  --cmt-reply-pill-text: #0d6efd;
}

#comments, .cmt-item[id] { scroll-margin-top: 80px; }

/* ── Section wrapper ── */
.post-comments-section {
  background: var(--cmt-surface);
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid var(--cmt-border);
}

@media (max-width: 576px) {
  .post-comments-section { padding: 1rem; }
}

/* ── Header ── */
.post-comments-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cmt-text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--cmt-border);
}

.post-comments-header .bi {
  font-size: 1rem;
  color: var(--cmt-link);
}

/* ── Empty state ── */
.post-comments-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem 0 0.5rem;
  color: var(--cmt-muted);
  text-align: center;
}

.post-comments-empty .bi { font-size: 2.2rem; opacity: 0.35; }
.post-comments-empty p { margin: 0; font-size: 0.88rem; }

/* ── Shared avatar ── */
.cmt-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cmt-avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cmt-muted);
}

.cmt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cmt-avatar .bi { font-size: 1.4rem; }

/* ── Compose form ── */
.cmt-form { margin-bottom: 1.25rem; }

.cmt-reply-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--cmt-reply-pill-bg);
  color: var(--cmt-reply-pill-text);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.cmt-cancel-reply {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.65;
  margin-left: 0.1rem;
}
.cmt-cancel-reply:hover { opacity: 1; }

.cmt-compose {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  min-width: 0;
}

.cmt-compose-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  background: var(--cmt-input-bg);
  border: 1.5px solid var(--cmt-input-border);
  border-radius: 22px;
  padding: 0.45rem 0.55rem 0.45rem 0.9rem;
  transition: border-color 0.18s;
  overflow: hidden;
}

.cmt-compose-field:focus-within {
  border-color: var(--cmt-link);
  background: var(--cmt-surface);
}

#comment-form textarea {
  flex: 1 1 0;
  min-width: 0;
  width: 0;
  border: 0 !important;
  background: transparent !important;
  color: var(--cmt-text) !important;
  padding: 0.2rem 0 !important;
  min-height: 26px;
  max-height: 180px;
  resize: none;
  box-shadow: none !important;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-y: auto;
  outline: none !important;
  border-radius: 0 !important;
}

#comment-form textarea::placeholder { color: var(--cmt-muted); }

.cmt-send-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cmt-link);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}

.cmt-send-btn:hover { background: #0b5ed7; transform: scale(1.08); }

/* Guest name field */
.cmt-form .form-control {
  border-radius: 10px;
  font-size: 0.88rem;
  background: var(--cmt-input-bg);
  border-color: var(--cmt-input-border);
  color: var(--cmt-text);
}
.cmt-form .form-control:focus {
  background: var(--cmt-surface);
  border-color: var(--cmt-link);
  box-shadow: none;
  color: var(--cmt-text);
}

/* ── Comment items ── */
.cmt-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--cmt-border);
}

.cmt-item:first-child { border-top: none; }

.cmt-body {
  flex: 1;
  min-width: 0;
}

/* JS hook alias */
.fb-main { flex: 1 1 auto; min-width: 0; }

.cmt-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

.cmt-name {
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--cmt-text);
}

.cmt-author-tag {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cmt-link);
  background: var(--cmt-reply-pill-bg);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.cmt-time {
  font-size: 0.72rem;
  color: var(--cmt-muted);
}

.cmt-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--cmt-text);
  word-wrap: break-word;
}

.cmt-actions {
  margin-top: 0.3rem;
}

.cmt-reply-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cmt-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.cmt-reply-btn:hover { color: var(--cmt-link); text-decoration: none; }

/* JS hook aliases */
.fb-text { word-wrap: break-word; color: var(--cmt-text); }
.fb-actions a { text-decoration: none; }

/* ── Replies ── */
.cmt-replies {
  padding-left: 0.8rem;
  border-left: 2px solid var(--cmt-reply-line);
  margin-top: 0.5rem;
}

/* JS hook alias */
.fb-replies { padding-left: 0.8rem; border-left: 2px solid var(--cmt-reply-line); }
.fb-replies .fb-more { margin: 0.25rem 0; }

.cmt-replies .cmt-item,
.fb-replies .cmt-item { padding: 0.6rem 0; }

.cmt-replies .cmt-avatar,
.fb-replies .cmt-avatar { width: 28px; height: 28px; flex-basis: 28px; }

.cmt-replies .cmt-avatar .bi,
.fb-replies .cmt-avatar .bi { font-size: 1.1rem; }

/* ── Long-comment clamp ── */
.fb-text[data-truncate="true"] {
  display: -webkit-box;
  -webkit-line-clamp: 8;
  line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-text[data-truncate="true"].expanded {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
}

.fb-see-more {
  display: none;
  cursor: pointer;
  user-select: none;
  color: var(--cmt-link);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
}
.fb-text.truncated + .fb-see-more { display: inline-block; margin-top: 0.25rem; }

/* ── Anchor highlight ── */
.cmt-item.fb-highlight .cmt-body {
  background: var(--cmt-reply-pill-bg);
  border-radius: 8px;
  padding: 4px 8px;
  margin: -4px -8px;
  transition: background 1s ease;
}

/* ── Show-more replies btn ── */
.fb-more .btn-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cmt-link);
  padding-left: 0;
  text-decoration: none;
}
.fb-more .btn-link:hover { text-decoration: underline; }

/* === Post Detail === */
.post-article {
  border-radius: 16px;
}

/* ── Admin FAB ── */
.admin-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1050;
}

.admin-fab-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #212529;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.admin-fab-btn:hover,
.admin-fab-btn:focus-visible {
  background: #343a40;
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  outline: none;
}

.admin-fab-menu {
  min-width: 210px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.08);
  padding: 0.35rem 0;
}

.admin-fab-menu .dropdown-item {
  font-size: 0.85rem;
  padding: 0.45rem 1rem;
}

/* ── Post detail: track map + legend ── */
.post-track-section {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.post-track-map {
  height: 300px;
  width: 100%;
  display: block;
}

@media (max-width: 576px) {
  .post-track-map { height: 220px; }
}

.track-legend-card {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f6f8;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

.track-legend-img {
  width: 76px;
  flex-shrink: 0;
  overflow: hidden;
}

.track-legend-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-legend-body {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.8rem;
}

.track-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.track-legend-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #0d1117;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-legend-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: #0d6efd;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.track-legend-link:hover { text-decoration: underline; }

.track-legend-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.75rem;
}

.track-legend-stat {
  display: flex;
  flex-direction: column;
}

.tls-label {
  font-size: 0.6rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tls-val {
  font-size: 0.78rem;
  font-weight: 600;
  color: #212529;
}

.post-hero-title {
  font-family: 'Urbanist', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 3.5vw + 1rem, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #0d1117;
}

.post-day-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2a7fa8;
  background: rgba(42, 127, 168, 0.1);
  border: 1px solid rgba(42, 127, 168, 0.22);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  vertical-align: middle;
}

.post-nav-section {
  margin-top: 1.75rem;
}

.post-nav-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  height: 76px;
  text-decoration: none;
  color: white;
  background-size: cover;
  background-position: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.post-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  color: white;
}

.post-nav-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 0;
}

.post-nav-arrow {
  position: absolute;
  top: 0;
  height: 100%;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  font-size: 1.1rem;
  z-index: 2;
}

.post-nav-arrow.prev { left: 0; }
.post-nav-arrow.next { right: 0; }

.post-nav-content {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  z-index: 1;
  padding: 0 0.5rem;
}

.post-nav-content-prev { left: 40px; right: 8px; }
.post-nav-content-next { right: 40px; left: 8px; text-align: right; }

.post-nav-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.75;
  display: block;
}

.post-nav-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  display: block;
}

@media (min-width: 576px) {
  .post-nav-link { height: 105px; }
  .post-nav-title { font-size: 0.85rem; }
}
/* Post edit form */
.edit-field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 0.5rem;
}

.post-stats {
  display: flex;
  flex-direction: column;
}

.post-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.1);
  font-size: 0.85rem;
}

.post-stats-row dt {
  font-weight: 400;
  opacity: 0.6;
}

.post-stats-row dd {
  font-weight: 600;
  margin: 0;
}

/* ── Media edit page ──────────────────────────────────────── */
.media-upload-zone {
  border: 2px dashed rgba(42, 127, 168, 0.35);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: inherit;
}

.media-upload-zone:hover,
.media-upload-zone--over {
  border-color: #2a7fa8;
  background: rgba(42, 127, 168, 0.06);
}

.media-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.media-edit-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(128, 128, 128, 0.15);
  background: var(--bs-card-bg, #fff);
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s;
}

.media-edit-card--new {
  border-color: rgba(42, 127, 168, 0.4);
  box-shadow: 0 0 0 2px rgba(42, 127, 168, 0.12);
}

.media-edit-card--uploading .media-edit-thumb img {
  opacity: 0.55;
}

.media-edit-card--error {
  border-color: rgba(220, 53, 69, 0.45);
}

.upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.2);
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: #2a7fa8;
  transition: width 0.15s linear;
}

.media-edit-card--deleted {
  opacity: 0.3;
  pointer-events: none;
}

.media-edit-thumb {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
  cursor: grab;
  flex-shrink: 0;
}

.media-edit-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: none;
}

.media-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  pointer-events: none;
}

.media-thumb-nopreview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.3;
}

.media-edit-fields {
  padding: 0.6rem;
  flex: 1;
}

.media-card-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s;
  line-height: 1;
}

.media-card-x:hover {
  background: rgba(220, 53, 69, 0.85);
}

.media-card-new-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: #2a7fa8;
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  z-index: 5;
}
/* ── End media edit page ─────────────────────────────────── */

/* Multi-step indicator */
.step-indicator {
  display: flex;
  align-items: center;
}

.step-indicator-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-indicator-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(128, 128, 128, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  transition: all 0.2s;
}

.step-indicator-item.active .step-indicator-dot {
  border-color: #2a7fa8;
  color: #2a7fa8;
  background: rgba(42, 127, 168, 0.1);
}

.step-indicator-item.done .step-indicator-dot {
  border-color: #2a7fa8;
  color: white;
  background: #2a7fa8;
}

.step-indicator-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
}

.step-indicator-item.active .step-indicator-label,
.step-indicator-item.done .step-indicator-label {
  color: #2a7fa8;
}

.step-indicator-line {
  width: 48px;
  height: 2px;
  background: rgba(128, 128, 128, 0.2);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.step-indicator-line--done {
  background: #2a7fa8;
}

/* Sticky save bar */
.post-edit-bar {
  position: fixed;
  bottom: 1.25rem;
  right: 1.5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 1050;
}

.post-edit-bar .btn {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* MapEvent toolbar */
.mapevent-toolbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(42, 127, 168, 0.06);
  border: 1px solid rgba(42, 127, 168, 0.18);
  border-radius: 8px;
}

.mapevent-toolbar-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2a7fa8;
  white-space: nowrap;
  padding-top: 5px;
  flex-shrink: 0;
}

.mapevent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mapevent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(42, 127, 168, 0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  line-height: 1;
}

.mapevent-chip:hover {
  background: rgba(42, 127, 168, 0.15);
  border-color: rgba(42, 127, 168, 0.55);
  transform: translateY(-1px);
}

.mapevent-chip--inserted {
  background: rgba(42, 168, 90, 0.2) !important;
  border-color: rgba(42, 168, 90, 0.5) !important;
}

.mapevent-chip .mapevent-chip-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  transition: none;
  transform: none !important;
}

.mapevent-chip-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(42, 127, 168, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #2a7fa8;
  flex-shrink: 0;
}

.mapevent-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapevent-chip-id {
  font-size: 0.62rem;
  opacity: 0.45;
  background: none;
  padding: 0;
  font-family: inherit;
}
/* === End Post Detail === */

/* ── Index: redesigned post cards ────────────────────────── */

/* Featured post */
.featured-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.featured-card {
  position: relative;
  min-height: clamp(420px, 48vw, 620px);
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 44px rgba(0,0,0,0.65);
}

.featured-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 2rem 1.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 55%, transparent 100%);
}

.featured-badge-tl {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 2;
}

.featured-new-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.67rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.featured-date {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

.featured-card-title {
  font-size: clamp(1.4rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  margin: 0.4rem 0 0.6rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

.featured-card-intro {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.72);
  max-width: 560px;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.featured-readmore-btn {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  padding: 0.38rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.featured-card:hover .featured-readmore-btn {
  background: rgba(255,255,255,0.24);
}

/* Regular post card */
.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 4px 16px rgba(0,0,0,0.28);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.48);
}

.post-card-media {
  position: absolute;
  inset: 0;
}

.post-card-media img,
.post-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-media img,
.post-card:hover .post-card-media video {
  transform: scale(1.05);
}

.post-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.85rem 0.85rem 0.75rem;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 65%, transparent 100%);
}

/* Day/date badge — top-right corner of regular cards */
.post-card-meta {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  z-index: 2;
}

/* Dark frosted-glass pill — legible on any image */
.post-day-tag--card {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.post-card-date {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  text-shadow: 0 1px 5px rgba(0,0,0,0.95), 0 0 2px rgba(0,0,0,0.8);
  letter-spacing: 0.01em;
}

.post-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.2rem 0 0.3rem;
  color: #fff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-card-intro {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
  margin: 0 0 0.3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-top: 0.1rem;
}

@media (max-width: 576px) {
  .top-section {
    margin-top: -390px;
  }
  .featured-card-overlay {
    padding: 1.25rem 1.25rem 1rem;
  }
  .post-card-title {
    font-size: 0.8rem;
  }
  .post-card-tags {
    display: none;
  }
}

/* ── End index cards ──────────────────────────────────────── */

/* ── Track detail: redesigned panel & controls ────────────── */

/* Floating character avatars */
.char-avatar-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.char-avatar-name {
  font-size: 0.62rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  white-space: nowrap;
}

/* Panel: track header (type icon + name + date) */
.track-panel-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.5rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 0.5rem;
}
.track-type-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  color: #fff;
}
.track-panel-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-panel-date {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  margin-top: 1px;
}

/* Panel: stats 2x2 grid */
.track-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}
.track-stat-cell {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.track-stat-icon {
  font-size: 0.95rem;
  opacity: 0.6;
  flex-shrink: 0;
  color: #fff;
}
.track-stat-val {
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  display: block;
  line-height: 1.1;
}
.track-stat-unit {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.5);
  display: block;
  line-height: 1;
}

/* Panel: speed control row */
.track-speed-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0.5rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
}
.track-speed-range {
  flex: 1;
  accent-color: #0d6efd;
  height: 4px;
}
.track-speed-pill {
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  color: #fff;
  min-width: 34px;
  text-align: center;
  white-space: nowrap;
}

/* Panel: divider + section label */
.track-panel-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0.4rem 0.5rem;
}
.track-section-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 0 0.5rem;
}

/* Panel: character chips */
.track-char-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 0.15rem 0.5rem 0.15rem 0.2rem;
  font-size: 0.72rem;
  color: #fff;
}

/* Panel: related post card */
.track-post-link {
  display: block;
  padding: 0 0.5rem 0.5rem;
  text-decoration: none;
  color: inherit;
}
.track-post-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  background: rgba(13,110,253,0.18);
  border: 1px solid rgba(13,110,253,0.3);
  border-radius: 10px;
  transition: background 0.15s ease;
}
.track-post-card:hover {
  background: rgba(13,110,253,0.3);
}
.track-post-icon {
  font-size: 1rem;
  color: #90caff;
  flex-shrink: 0;
}
.track-post-body {
  flex: 1;
  min-width: 0;
}
.track-post-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.track-post-meta {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  margin-top: 1px;
}
.track-post-arrow {
  color: rgba(255,255,255,0.35);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Controls bar: square icon buttons */
.map-ctrl-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Controls bar: timestamp */
.track-timestamp {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  min-width: 58px;
  text-align: right;
}

/* Track complete modal: flag icon */
.track-complete-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #1a6b3a, #0f4a2a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #4ade80;
}
/* ── End track detail ─────────────────────────────────────── */
