/* ============================================
   Featured Photo Cube — compact strip version
   Drop this file at assets/css/featured-cube.css
   Load it alongside your existing gallery styles.
   ============================================ */

:root {
  --fc-bg: transparent;
  --fc-surface: #fff6ea;
  --fc-ink: #2c4a3e;
  --fc-ink-dim: rgba(44, 74, 62, 0.65);
  --fc-accent: #ffa44a;
  --fc-border: #2c4a3e;
  --fc-font-display: 'Bebas Neue', sans-serif;
  --fc-font-body: inherit;
}

/* ---------- compact strip near the top of the page ---------- */
.cube-feature {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0;
  background: transparent;
  color: var(--fc-ink);
  font-family: var(--fc-font-body);
  border: none;
}

#featured-cube-mount {
  position: absolute;
  top: 0;
  right: 1.25rem;
  margin: 0;
  z-index: 10;
}

/* split-screen / medium widths: go back to float so the filter row
   naturally shrinks and left-aligns instead of running under the cube */
@media (max-width: 1100px) and (min-width: 481px) {
  #featured-cube-mount {
    position: static;
    float: right;
    margin: 0 0 1rem 1.5rem;
  }
}

.cube-feature-text {
  text-align: center;
}

.cube-feature-label {
  font-family: var(--fc-font-display);
  letter-spacing: 1px;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--fc-ink-dim);
  margin: 0;
}

/* ---------- the cube itself, small ---------- */
.cube-scene {
  --cube-size: 64px;
  width: var(--cube-size);
  height: var(--cube-size);
  perspective: 700px;
  flex-shrink: 0;
}

.cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  cursor: pointer;
  outline: none;
  animation: cube-spin 16s linear infinite;
  transition: filter 0.3s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cube:hover,
.cube:focus-visible {
  animation-play-state: paused;
  filter: brightness(1.1);
}

.cube:focus-visible {
  box-shadow: 0 0 0 3px var(--fc-accent);
}

.cube.is-opening {
  animation-play-state: paused;
  transform: scale(0.85) !important;
  filter: brightness(1.3) blur(1px);
}

@keyframes cube-spin {
  from { transform: rotateX(0deg) rotateY(0deg); }
  to   { transform: rotateX(360deg) rotateY(360deg); }
}

.cube-face {
  position: absolute;
  width: var(--cube-size);
  height: var(--cube-size);
  background-size: cover;
  background-position: center;
  border: 2px solid var(--fc-border);
  box-shadow: inset 0 0 14px rgba(44, 74, 62, 0.25);
}

.face-front  { transform: translateZ(calc(var(--cube-size) / 2)); }
.face-back   { transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2)); }
.face-right  { transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2)); }
.face-left   { transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2)); }
.face-top    { transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2)); }
.face-bottom { transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2)); }

/* ---------- reveal overlay (full screen, unrelated to strip sizing) ---------- */
.reveal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 60px 0 40px;
  box-sizing: border-box;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.reveal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.reveal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 80vw;
  padding: 0;
  background: transparent;
  border: none;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.reveal-overlay.is-open .reveal-panel {
  transform: translateY(0);
  opacity: 1;
}

.reveal-close {
  position: fixed;
  top: 20px;
  right: 30px;
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.reveal-close:hover,
.reveal-close:focus-visible { color: var(--fc-accent); }

.reveal-img {
  display: block;
  max-width: 80vw;
  max-height: 55vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.reveal-caption {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #fff;
  max-width: 80vw;
  margin: 0;
  text-align: center;
}

.reveal-map-link {
  display: inline-block;
  font-size: 0.9rem;
  color: #fff;
  text-decoration: none;
  margin-top: 4px;
}
.reveal-map-link:hover {
  text-decoration: underline;
}

/* ---------- accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  .cube { animation: none; transition: none; }
  .reveal-overlay, .reveal-panel { transition: none; }
}

/* ---------- small screens: center instead of right-align ---------- */
@media (max-width: 480px) {
  #featured-cube-mount {
    position: static;
    text-align: center;
    margin: 0.25rem 0 0.75rem;
  }
}
