@layer legacy {
.spot {
  display: block;
  position: relative;
  overflow: hidden;
}

.spot__link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-indent: -9999px;
  z-index: 512;
}

.spot--loading {
  height: 200px;
  background: #ddd;
}

@keyframes spot-map-shimmer {
  0%   { background-position: -1200px 0; }
  100% { background-position: 1200px 0; }
}

.spot__map-placeholder {
  width: 100%;
  aspect-ratio: 3 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(105deg, #0f1b2d 25%, #1a2e47 50%, #0f1b2d 75%);
  background-size: 1200px 100%;
  animation: spot-map-shimmer 2.2s infinite linear;
}

.spot__map-placeholder--container {
  aspect-ratio: unset;
  height: 100%;
  border-radius: inherit;
}

.spot__map-placeholder--square {
  aspect-ratio: 1 / 1;
}

.spot__map-placeholder__icon {
  font-size: 1.75rem;
  opacity: 0.35;
  line-height: 1;
}

.spot__map-placeholder__label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

[data-theme="dark"] .spot__map-placeholder {
  background: linear-gradient(105deg, #080f1a 25%, #0f1b2d 50%, #080f1a 75%);
  background-size: 1200px 100%;
}

.spot--card {
  border: 1px solid #dddddd;
  border-radius: 1rem;
  /* padding: 1rem; */
  background-color: white;

  & .spot__map {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    display: block;
    object-fit: cover;
    filter: brightness(0.9) saturate(1.2);             /* removes bottom gap */
  }

  & .spot__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* Flexbox to center the title perfectly */
    display: flex;
    align-items: center;         /* vertical center */
    justify-content: center;     /* horizontal center */
    flex-direction: column;
    /* Optional dark overlay for better text readability */
    /* background-color: rgba(0, 0, 0, 0.4); */
  }

  & .spot__name {
    color: white;
    /* font-family: Arial, sans-serif; */
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    margin: 0;
    padding: 0;
  }
  
  & .spot__city {
    color: white;
  }
}

.spot--hero {
  height: 50vh;
  min-height: 320px;
  max-height: 640px;

  & .spot__map-frame {
    height: 100%;
  }

  & .spot__map {
    height: 100%;
    object-fit: cover;
  }

  & .spot__map-placeholder {
    height: 100%;
    aspect-ratio: unset;
    border-radius: inherit;
  }
}

.spot__hero-bar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.spot__hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.spot__hero-bar .button--grey {
  --button-background-color: white;
  --button-background-color-hover: color-mix(in oklab, white, #000 8%);
}

.spot__hero-bar .share-dialog .button--grey {
  --button-background-color: var(--color-grey-light, #f5f5f5);
  --button-background-color-hover: color-mix(in oklab, var(--button-background-color), #000 8%);
}

.spot__marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 12;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.spot__forecasts-avg-today {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  font-weight: bold;
  font-size: 1.1rem;
  z-index: 10;
}

.spot__wind-forecast-today {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  text-align: right;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  font-weight: bold;
  font-size: 1.1rem;
  z-index: 10;
}

.spot__tide.tide {
  position: absolute;
  bottom: 0.75rem;
  left: 1rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  font-weight: bold;
  font-size: 1.1rem;
  z-index: 10;
}

.spot__current-wind-direction,
.spot__wind-direction-avg-today {
  text-align: center;
}

.spot__map-container {
  width: 100%;
  /* aspect-ratio: 1 / 1; */
  height: 300px;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;

  & .spot__map--hero {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.9) saturate(1.2);
  }
}

.spot__map-label {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 0.4rem 0.85rem 0.4rem 0.6rem;
  color: white;
  white-space: nowrap;
  z-index: 10;

  & .spot__map-label__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;

    & svg {
      width: 14px;
      height: 17px;
      fill: white;
    }
  }

  & .spot__map-label__text {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 1.2;
  }

  & .spot__map-label__name {
    font-size: 0.875rem;
    font-weight: 700;
  }

  & .spot__map-label__country {
    font-size: 0.7rem;
    opacity: 0.8;
  }
}

.spot__map-container:fullscreen {
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  margin-bottom: 0;
}

.spot__map-container:-webkit-full-screen {
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  margin-bottom: 0;
}

.spot__map-container:-moz-full-screen {
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  margin-bottom: 0;
}

.spot__map-container:-ms-fullscreen {
  height: 100vh;
  width: 100vw;
  border-radius: 0;
  margin-bottom: 0;
}

.spot__map-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.spot__map-controls-bottom {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 1000;
}

.spot__map-controls-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.spot__map-controls-group--zoom .spot__map-control {
  border-radius: 0;
}

.spot__map-controls-group--zoom .spot__map-control--zoom-in {
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
  /* border-bottom: none; */
  border-bottom: 2px solid #dddddd;
}

.spot__map-controls-group--zoom .spot__map-control--zoom-out {
  border-bottom-left-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
  border-top: none;
}

.spot__map-control {
  background: white;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: bold;
  color: #333;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
  border: 2px solid #dddddd;
  transition: all 0.2s ease;
  padding: 0;
  line-height: 1;
  position: relative;
  box-sizing: border-box;
}

.spot__map-control:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.spot__map-control:active {
  background: #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.spot__map-control--zoom-in,
.spot__map-control--zoom-out {
  font-size: 1.5rem;
}

.spot__map-control--zoom-out {
  font-size: 2rem;
  line-height: 0.8;
}

.spot__map-control--fullscreen {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  position: relative;
}

.spot__map-control-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.spot__map-control-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  display: block;
}

.spot__models {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.spot__model-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
  white-space: nowrap;
}

.spot__model-badge--long {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
}
/* ---- /Spot save button ---- */

/* ---- Spot show mobile hero ---- */

.spot-show-hero {
  margin-bottom: 1.5rem;

  & .spot__map-container {
    border-radius: 0;
    margin-bottom: 0;
  }
}

.spot-show-hero__panel {
  padding: 1rem;
  background: var(--secondary-background-color, white);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.spot-show-hero__identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.spot-show-hero__name {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.spot-show-hero__location {
  font-size: 0.875rem;
  color: var(--secondary-text-color, #64748b);
  margin: 0;
}

.spot-show-hero__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.spot-show-hero__coords {
  font-size: 0.75rem;
  color: var(--secondary-text-color, #94a3b8);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Directions button ---- */

.button--icon.spot-show-hero__directions-btn {
  flex-shrink: 0;
  --button-svg-size: 30px;

  & svg {
    fill: transparent;
    stroke: #aaaaaa;
  }
}

/* ---- Directions dialog (bottom sheet) ---- */

.directions-dialog {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  margin: 0;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: none;
  border-radius: 1.25rem 1.25rem 0 0;
  background: var(--secondary-background-color, #fff);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
}

.directions-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.directions-dialog__sheet {
  display: flex;
  flex-direction: column;
}

.directions-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.directions-dialog__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-text-color);
}

.directions-dialog__apps {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.directions-app {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  text-decoration: none;
  color: var(--primary-text-color, #1a1a1a);
  transition: background 0.15s ease;

  &:hover,
  &:active {
    background: var(--hover-background-color, rgba(0, 0, 0, 0.04));
    text-decoration: none;
    color: var(--primary-text-color, #1a1a1a);
  }
}

.directions-app__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.directions-app__icon--waze { background: #33ccff; }
.directions-app__icon--google { background: #4285f4; }
.directions-app__icon--apple { background: #1c1c1e; }
.directions-app__icon--osm { background: #7ebc6f; }

.directions-app__name {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-text-color, #1a1a1a);
}

.directions-app__arrow {
  flex-shrink: 0;
  color: var(--secondary-text-color, #94a3b8);
  height: 40px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 40px;

  & svg {
    height: 20px;
    width: auto;
    fill: var(--secondary-text-color, #94a3b8);
    /* transform: rotate(180deg); */
  }
}

/* ---- Share dialog (desktop fallback for navigator.share) ---- */

.share-dialog {
  margin: auto;
  width: 100%;
  max-width: 360px;
  padding: 0;
  border: none;
  border-radius: 1.25rem;
  background: var(--secondary-background-color, #fff);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.share-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.share-dialog__sheet {
  display: flex;
  flex-direction: column;
}

.share-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.share-dialog__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-text-color);
}

.share-dialog__targets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 1.25rem;
}

.share-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease;

  &:hover,
  &:active {
    opacity: 0.8;
    text-decoration: none;
  }
}

.share-target__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;

  & svg {
    height: 1.25rem;
    width: auto;
    fill: white;
  }
}

.share-target__icon--whatsapp { background: #25d366; }
.share-target__icon--facebook { background: #1877f2; }
.share-target__icon--x { background: #000000; }
.share-target__icon--instagram {
  font-size: 0.9rem;
  background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}
.share-target__icon--email { background: var(--secondary-text-color, #6b7280); }

.share-target__name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary-text-color, #1a1a1a);
  text-align: center;
}

.share-dialog__copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
}

.share-dialog__copy-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--background-color, #f3f4f6);
  color: var(--primary-text-color);
  font-size: 0.875rem;
}

.share-dialog__copy-button {
  flex-shrink: 0;
  height: 40px;
}

/* ---- /Spot show mobile hero ---- */

.spot__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;

  & h2 {
    margin: 0;
  }
}

}
