/* /webcams — polished frontend page */

body.fe-wc-page {
  background: var(--md-sys-color-background);
}

/* Hero uses global .hero; only spacing tweaks */
.fe-wc-hero {
  padding-bottom: 48px;
}

.fe-wc-page-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* Map card — overlaps hero like live-strip on start page */
.fe-wc-map-card {
  position: relative;
  z-index: 2;
  margin: -28px 0 40px;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-level2);
  overflow: hidden;
}

.fe-wc-map-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background: linear-gradient(
    180deg,
    var(--md-sys-color-surface-container-low) 0%,
    var(--md-sys-color-surface) 100%
  );
}

.fe-wc-map-card__title {
  margin: 0;
  font: 700 22px/1.2 var(--md-ref-typeface-brand);
  letter-spacing: -0.01em;
  color: var(--md-sys-color-on-surface);
}

.fe-wc-map-card__hint {
  margin: 6px 0 0;
  font: 400 14px/1.45 var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface-variant);
}

.fe-wc-map-card__count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font: 600 13px/1 var(--md-ref-typeface-plain);
}

.fe-wc-map {
  width: 100%;
  height: min(52vh, 480px);
  min-height: 280px;
}

/* Feed section */
.fe-wc-feed {
  padding-top: 0;
}

.fe-wc-feed__head {
  margin-bottom: 20px;
}

.fe-wc-feed__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fe-wc-feed__empty {
  margin: 0;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
}

/* Single webcam entry */
.fe-wc-entry {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-level1);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.fe-wc-entry:hover {
  box-shadow: var(--md-sys-elevation-level2);
}

.fe-wc-entry.is-highlighted {
  border-color: var(--md-sys-color-primary);
  box-shadow:
    var(--md-sys-elevation-level2),
    0 0 0 2px color-mix(in srgb, var(--md-sys-color-primary) 28%, transparent);
}

.fe-wc-entry__layout {
  display: grid;
  grid-template-columns: 1fr;
}

.fe-wc-entry__side {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.fe-wc-entry__map {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 220px;
  background: var(--md-sys-color-surface-container-high);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.fe-wc-entry__map .maplibregl-canvas {
  width: 100% !important;
  height: 100% !important;
}

.fe-wc-entry__map--empty {
  display: grid;
  place-items: center;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.45;
}

.fe-wc-entry__map--empty .material-symbols-outlined {
  font-size: 40px;
}

.fe-wc-entry__meta {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fe-wc-entry__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.fe-wc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  font: 600 11px/1 var(--md-ref-typeface-plain);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fe-wc-badge--live {
  background: color-mix(in srgb, var(--md-sys-color-error) 12%, var(--md-sys-color-surface));
  color: var(--md-sys-color-error);
}

.fe-wc-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: fe-wc-pulse 1.6s ease-in-out infinite;
}

@keyframes fe-wc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.fe-wc-entry__title {
  margin: 0;
  font: 700 20px/1.25 var(--md-ref-typeface-brand);
  letter-spacing: -0.01em;
  color: var(--md-sys-color-on-surface);
}

.fe-wc-entry__place {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font: 500 14px/1.4 var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface-variant);
}

.fe-wc-entry__place .material-symbols-outlined {
  font-size: 18px;
  color: var(--md-sys-color-error);
  flex-shrink: 0;
  margin-top: 1px;
}

.fe-wc-entry__desc {
  margin: 4px 0 0;
  font: 400 14px/1.5 var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface-variant);
}

.fe-wc-entry__map-link {
  margin-top: 8px;
  font: 600 13px/1 var(--md-ref-typeface-plain);
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

.fe-wc-entry__map-link:hover {
  text-decoration: underline;
}

/* Viewer / media */
.fe-wc-entry__viewer {
  position: relative;
  background: #0d1117;
  min-height: 240px;
  display: flex;
  align-items: stretch;
}

.fe-wc-media {
  width: 100%;
  display: block;
}

.fe-wc-media--img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  object-position: center;
}

.fe-wc-media--iframe {
  width: 100%;
  min-height: 280px;
  border: 0;
  aspect-ratio: 16 / 10;
}

.fe-wc-media--link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  width: 100%;
  background: var(--md-sys-color-surface-container-low);
}

.fe-wc-media--link img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--md-sys-shape-corner-medium);
}

.fe-wc-media--error {
  margin: auto;
  padding: 24px;
  color: var(--md-sys-color-error);
}

/* Map markers */
.fe-wc-map-marker {
  color: var(--md-sys-color-error);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.fe-wc-map-marker--sm {
  font-size: 28px;
}

/* Map popup */
.fe-wc-map-popup-wrap .maplibregl-popup-content {
  padding: 14px;
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-level3);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.fe-wc-popup__title {
  display: block;
  font: 600 15px/1.3 var(--md-ref-typeface-plain);
  margin-bottom: 4px;
}

.fe-wc-popup__place {
  display: block;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 10px;
}

.fe-wc-popup__thumb {
  display: block;
  width: 100%;
  max-height: 100px;
  object-fit: cover;
  border-radius: var(--md-sys-shape-corner-small);
}

.fe-wc-popup__thumb--placeholder {
  display: grid;
  place-items: center;
  min-height: 64px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}

.fe-wc-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font: 600 13px/1 var(--md-ref-typeface-plain);
  cursor: pointer;
}

.fe-wc-popup__btn:hover {
  filter: brightness(1.06);
}

.fe-wc-popup__btn .material-symbols-outlined {
  font-size: 18px;
}

/* Tablet+ */
@media (min-width: 720px) {
  .fe-wc-page-wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .fe-wc-map-card {
    margin-top: -36px;
    margin-bottom: 48px;
  }

  .fe-wc-entry__layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: stretch;
  }

  .fe-wc-entry__side {
    border-bottom: 0;
    border-right: 1px solid var(--md-sys-color-outline-variant);
    min-height: 100%;
  }

  .fe-wc-entry__map {
    aspect-ratio: auto;
    flex: 1 1 auto;
    min-height: 200px;
    max-height: none;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
  }

  .fe-wc-entry__viewer {
    min-height: 100%;
  }

  .fe-wc-media--img {
    min-height: 100%;
    height: 100%;
  }
}

@media (min-width: 905px) {
  .fe-wc-hero {
    margin-left: 24px;
    margin-right: 24px;
    border-radius: var(--md-sys-shape-corner-extra-large);
  }

  .fe-wc-map {
    height: 440px;
  }

  .fe-wc-feed__list {
    gap: 24px;
  }
}
