/**
 * Cube Improvements — Separate stylesheet
 */

/* Override CSS animation — JS drives rotation now */
#sidebar-cube,
.sidebar-cube {
  animation: none !important;
  transition: transform 1s ease-in-out;
}

/* Cube hidden until all ad slots report */
.sidebar-cube-controls.cube-pending,
.sidebar-cube-scene.cube-pending,
#sidebar-cube-scene.cube-pending {
  visibility: hidden;
  height: 0;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Remove default face border when showing fallback */
.cube__face:has(.cube-fallback[style*="flex"]) {
  border: none !important;
  background: transparent !important;
}

/* ================================================================
   FALLBACK CARDS — Native Ad Style
   Image on top, info bar at bottom
   ================================================================ */
.cube-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
}

/* Card wrapper */
.cube-fallback__card,
.cube-fallback__card:hover,
.cube-fallback__card:visited,
.cube-fallback__card:active,
.cube-fallback__card:focus {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  text-decoration: none !important;
  color: #fff !important;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

/* ---- Image area (top ~60%) ---- */
.cube-fallback__image {
  flex: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
}

/* Fallback bg colors when no image */
.cube-fallback__card--tides .cube-fallback__image { background-color: #4C76A5; }
.cube-fallback__card--weather .cube-fallback__image { background-color: #2899CE; }
.cube-fallback__card--sun_moon .cube-fallback__image { background-color: #525A60; }
.cube-fallback__card--explore .cube-fallback__image { background-color: #4C76A5; }

/* Gradient scrim on image for harbor name readability */
.cube-fallback__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

/* Harbor name — bottom-left of image */
.cube-fallback__harbor {
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 1;
  line-height: 1.2;
}

/* ---- Info bar (bottom) ---- */
.cube-fallback__info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  position: relative;
  z-index: 1;
}

/* USH brand colors per card type */
.cube-fallback__card--tides .cube-fallback__info { background: #4C76A5; }
.cube-fallback__card--weather .cube-fallback__info { background: #4C76A5; }
.cube-fallback__card--sun_moon .cube-fallback__info { background: #525A60; }
.cube-fallback__card--explore .cube-fallback__info { background: #4C76A5; }

.cube-fallback__info-left {
  flex: 1;
  min-width: 0;
}

.cube-fallback__info-right {
  flex-shrink: 0;
}

/* Title */
.cube-fallback__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.8) !important;
  line-height: 1.2;
}

/* Data value */
.cube-fallback__data {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: #fff !important;
}

/* Subtitle */
.cube-fallback__subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7) !important;
  margin-top: 1px;
}

/* CTA button — pill style */
.cube-fallback__cta {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 5px 12px;
  transition: all 0.25s ease;
  background: transparent;
  white-space: nowrap;
  color: #fff !important;
}

/* Hover — CTA fills */
.cube-fallback__card:hover .cube-fallback__cta {
  background: #fff;
  color: #4C76A5 !important;
  border-color: #fff;
}

/* Hover — image brightens */
.cube-fallback__card:hover .cube-fallback__image {
  filter: brightness(1.05);
}
