/* Custom styles for 50years interactive tidsresa */

/* Custom Fonts & Base styling */
body {
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
}

h1, h2, h3, .font-cinzel {
  font-family: 'Cinzel', serif;
}

/* Hide scrollbars for timeline container but preserve scrolling functionality */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Polaroid Photo Frame Styling */
.polaroid-wrapper {
  perspective: 1000px;
}

.polaroid-container {
  transform: rotate(-1.5deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  max-width: 420px;
  width: 100%;
}

.polaroid-container:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: 0 25px 50px rgba(212, 175, 55, 0.15);
}

/* Timeline nodes */
.year-node {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.year-node:hover {
  transform: scale(1.1);
  color: #D4AF37;
}

.year-node-active {
  background: radial-gradient(circle, #F3E5AB 0%, #D4AF37 100%);
  color: #121214 !important;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
  transform: scale(1.2) translateY(-2px);
  font-weight: 800;
}

.year-node-milestone {
  border: 2px solid #D4AF37;
  position: relative;
}

.year-node-milestone::after {
  content: '★';
  position: absolute;
  top: -8px;
  right: -8px;
  background: #D4AF37;
  color: #121214;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Fact block effects */
.fact-block {
  transition: all 0.25s ease-out;
}

.fact-block:hover {
  transform: translateY(-2px);
  background-color: rgba(30, 30, 36, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Modals layout */
.modal-overlay {
  transition: opacity 0.3s ease-out;
}

/* Custom transitions for year cards */
#year-view-container {
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.fade-out {
  opacity: 0 !important;
  transform: scale(0.98) translateY(10px) !important;
}

.fade-in {
  opacity: 1 !important;
  transform: scale(1) translateY(0) !important;
}

/* BIG SCREEN / STORBILDSLÄGE OVERRIDES */
body.storbild {
  background-color: #0b0b0c;
}

body.storbild #main-header {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #1e1e24;
}

body.storbild #timeline-navigation {
  display: none; /* Hide navigation bar on big screen for cleaner projection layout */
}

body.storbild #year-view-container {
  max-width: 95vw;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

body.storbild .polaroid-container {
  max-width: 720px; /* Make photo frame huge on projector */
  transform: rotate(-1deg);
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
}

body.storbild #year-title {
  font-size: 2.5rem;
  margin-top: 1.5rem;
}

body.storbild #year-age {
  font-size: 1.5rem;
}

body.storbild #year-personal-memory {
  font-size: 1.45rem;
  line-height: 1.7;
}

body.storbild .fact-block {
  padding: 1.25rem;
  border-radius: 1rem;
}

body.storbild .fact-block p {
  font-size: 1.05rem;
  line-height: 1.6;
}

body.storbild .fact-block span {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

body.storbild footer {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

/* ──────────────────────────────────────────────
   Dual-photo stack wrapper (Björn & Åsa mode)
────────────────────────────────────────────── */

.dual-stack-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.dual-stack-wrapper .polaroid-container {
  position: relative;
  z-index: 2;
}

.dual-stack-wrapper.has-stack .polaroid-stack-layer {
  opacity: 1;
}

/* On ultrawide screens allow single polaroid to grow a bit */
@media (min-width: 1280px) {
  #polaroid-stack-wrapper {
    max-width: 520px;
  }
  .polaroid-container {
    max-width: 520px;
  }
}

@media (min-width: 1536px) {
  #polaroid-stack-wrapper {
    max-width: 680px;
  }
  .polaroid-container {
    max-width: 680px;
  }
}

@media (min-width: 2200px) {
  #polaroid-stack-wrapper {
    max-width: 900px;
  }
  .polaroid-container {
    max-width: 900px;
  }
}

/* ──────────────────────────────────────────────
   Photo Stack Effect
────────────────────────────────────────────── */

#polaroid-stack-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 420px;
}

.polaroid-stack-layer {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: #ece7de;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#polaroid-stack-wrapper.has-stack .polaroid-stack-layer {
  opacity: 1;
}

.stack-layer-mid {
  background: #ede8df;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.5);
  transform: rotate(3deg) translate(6px, 3px);
  z-index: 0;
}

.stack-layer-back {
  background: #e5dfd5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transform: rotate(-2.5deg) translate(-5px, 6px);
  z-index: -1;
}

#polaroid-stack-wrapper .polaroid-container {
  position: relative;
  z-index: 2;
}

/* ──────────────────────────────────────────────
   Photo Filmstrip Thumbnails
────────────────────────────────────────────── */

.filmstrip-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.filmstrip-thumb:hover {
  opacity: 1;
  border-color: rgba(212, 175, 55, 0.6);
  transform: scale(1.05) translateY(-2px);
}

.filmstrip-thumb.active {
  border-color: #D4AF37;
  opacity: 1;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* ──────────────────────────────────────────────
   Lightbox
────────────────────────────────────────────── */

#lightbox-modal {
  animation: lightbox-in 0.25s ease-out;
}

#lightbox-modal.closing {
  animation: lightbox-out 0.2s ease-in forwards;
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lightbox-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

#lightbox-img {
  filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.8));
}

.lightbox-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 42px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.5;
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox-thumb:hover {
  opacity: 0.85;
  border-color: rgba(212, 175, 55, 0.5);
}

.lightbox-thumb.active {
  border-color: #D4AF37;
  opacity: 1;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

/* ──────────────────────────────────────────────
   Ken Burns pan/zoom animations for polaroid images
────────────────────────────────────────────── */

@keyframes kb-zoom-in {
  0%   { transform: scale(1.0) translate(0%, 0%); }
  100% { transform: scale(1.12) translate(-2%, -1.5%); }
}

@keyframes kb-zoom-out {
  0%   { transform: scale(1.12) translate(-2%, -1.5%); }
  100% { transform: scale(1.0) translate(0%, 0%); }
}

@keyframes kb-pan-left {
  0%   { transform: scale(1.1) translate(3%, 0%); }
  100% { transform: scale(1.1) translate(-3%, 0%); }
}

@keyframes kb-pan-right {
  0%   { transform: scale(1.1) translate(-3%, 1%); }
  100% { transform: scale(1.1) translate(3%, -1%); }
}

@keyframes kb-drift {
  0%   { transform: scale(1.08) translate(2%, 2%); }
  100% { transform: scale(1.14) translate(-2%, -1%); }
}

.ken-burns-1 { animation: kb-zoom-in  14s ease-in-out forwards; }
.ken-burns-2 { animation: kb-zoom-out 14s ease-in-out forwards; }
.ken-burns-3 { animation: kb-pan-left 16s ease-in-out forwards; }
.ken-burns-4 { animation: kb-pan-right 16s ease-in-out forwards; }
.ken-burns-5 { animation: kb-drift   18s ease-in-out forwards; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(18, 18, 20, 0.5);
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.6);
}
