.timelapse-cal{ padding: 6px 2px 10px; max-width: 720px; margin: 0 auto; }
.tl-cal-head{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.tl-title{ font-size: 18px; font-weight: 800; }
.tl-weekdays{ display:grid; grid-template-columns: repeat(7, 1fr); gap:8px; margin-top:12px; }
.tl-weekdays .wd{ text-align:center; opacity:.75; font-size:12px; }
.tl-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:8px; margin-top:8px; }
.tl-daycell{ border:1px solid rgba(255,255,255,.10); border-radius:14px; padding:8px; cursor:pointer; background: rgba(255,255,255,.04); position:relative; overflow:hidden; aspect-ratio: 1 / 1; display:flex; align-items:flex-start; justify-content:flex-start; }
.tl-daycell:hover{ border-color: rgba(255,255,255,.22); }
.tl-daycell.muted{ opacity:.45; }
.tl-daycell .d{ font-weight:800; font-size:14px; }
.tl-daycell .tag{ position:absolute; right:10px; top:10px; font-size:11px; opacity:.75; }
.tl-day{ margin-top: 4px; }
.tl-day-grid{ display:grid; grid-template-columns: repeat(6, 1fr); gap:10px; margin-top:10px; }
.tl-hour{ border:1px solid rgba(255,255,255,.10); border-radius:14px; overflow:hidden; background: rgba(255,255,255,.04); cursor:pointer; }
.tl-hour img{ width:100%; height:96px; object-fit:cover; display:block; }
.tl-hour .cap{ padding:8px 10px; font-size:12px; opacity:.8; display:flex; justify-content:space-between; }
@media (max-width: 960px){ .tl-day-grid{ grid-template-columns: repeat(4, 1fr);} }
@media (max-width: 640px){ .tl-day-grid{ grid-template-columns: repeat(3, 1fr);} }



/* --- Calendar UX improvements --- */
.tl-daycell.today{
  outline: 2px solid rgba(255, 215, 0, .75);
  box-shadow: 0 0 0 2px rgba(0,0,0,.25) inset;
}
.tl-daycell.disabled{
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.tl-hour.missing img{
  opacity: .35;
}


.tl-daycell.has-images{
  border-color: rgba(110,255,160,.65);
  box-shadow: 0 0 0 1px rgba(110,255,160,.22) inset;
}

.tl-daycell.ph{ visibility:hidden; }


/* --- Timelapse clock overlay (top-right) --- */
#modalLightbox .modal-body{ position: relative; }
.tl-clock{
  position:absolute;
  top:10px;
  right:10px;
  width:66px;
  height:66px;
  border-radius:999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  z-index: 3;
}
.tl-clock-face{
  position:relative;
  width:54px;
  height:54px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.tl-clock-face:before,
.tl-clock-face:after{
  content:'';
  position:absolute;
  left:50%;
  top:50%;
  width:2px;
  height:6px;
  background: rgba(255,255,255,.6);
  transform: translate(-50%, -24px);
  border-radius:999px;
}
.tl-clock-face:after{
  width:6px;
  height:2px;
  transform: translate(18px, -50%);
}
.tl-clock-face .hand{
  position:absolute;
  left:50%;
  top:50%;
  transform-origin: 50% 100%;
  background: rgba(255,255,255,.92);
  border-radius:999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.tl-clock-face .hand.hour{
  width:3px;
  height:18px;
  transform: translate(-50%, -100%) rotate(0deg);
  opacity:.95;
}
.tl-clock-face .hand.minute{
  width:2px;
  height:24px;
  transform: translate(-50%, -100%) rotate(0deg);
  opacity:.9;
}
.tl-clock-face .center{
  position:absolute;
  left:50%;
  top:50%;
  width:6px;
  height:6px;
  border-radius:999px;
  background: rgba(255,255,255,.95);
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
@media (max-width: 520px){
  .tl-clock{ width:58px; height:58px; top:8px; right:8px; }
  .tl-clock-face{ width:48px; height:48px; }
  .tl-clock-face .hand.hour{ height:16px; }
  .tl-clock-face .hand.minute{ height:22px; }
}

/* --- Timelapse lightbox v2 --- */
.tl-lightbox .tl-lightbox-body{ position:relative; padding:0; overflow:hidden; }
.tl-lightbox-img{
  width:100%;
  height: min(72vh, 720px);
  object-fit: cover;
  display:block;
  border-radius: 18px;
}
@media (max-width: 720px){
  .tl-lightbox-img{ height: min(70vh, 640px); border-radius: 16px; }
}
@media (max-width: 420px){
  .tl-lightbox-img{ height: min(68vh, 560px); border-radius: 14px; }
}

.tl-controls-overlay{
  position:absolute;
  inset: 10px 10px auto 10px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  pointer-events:none;
  z-index: 6;
}
.tl-controls-left, .tl-controls-right{ display:flex; gap:10px; align-items:center; pointer-events:auto; }
.tl-ctrl{ backdrop-filter: blur(6px); background: rgba(0,0,0,.35); border:1px solid rgba(255,255,255,.20); }
.tl-ctrl:hover{ background: rgba(0,0,0,.48); }

.tl-time-badge{
  position:absolute;
  right:12px;
  bottom:12px;
  z-index:7;
  padding:10px 12px;
  border-radius: 999px;
  background: rgba(30, 150, 70, .90);
  border: 1px solid rgba(140, 255, 180, .55);
  color:#fff;
  font-weight: 800;
  letter-spacing: .02em;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}
@media (max-width: 520px){
  .tl-time-badge{ font-size: 13px; padding: 9px 11px; }
}
@media (max-width: 360px){
  .tl-time-badge{ font-size: 12px; padding: 8px 10px; }
}

/* clock: top-right, but leave room for controls */
.tl-clock{ top: 64px; right: 12px; z-index: 5; }

/* Mobile: hide controls until tap */
@media (max-width: 720px){
  #modalLightbox .tl-controls-overlay{
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
  }
  #modalLightbox.show-controls .tl-controls-overlay{
    opacity: 1;
    transform: translateY(0);
  }
}


/* --- Mobile play/pause state (bottom-left) --- */
.tl-play-state{
  position:absolute;
  left:12px;
  bottom:12px;
  z-index:7;
  width:44px;
  height:44px;
  border-radius: 999px;
  display:none;
  align-items:center;
  justify-content:center;
  font-size:18px;
  font-weight:900;
  color: rgba(255,255,255,.92);
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
  pointer-events:none;
}
@media (max-width: 720px){
  .tl-play-state{ display:flex; width:42px; height:42px; font-size:17px; }
}

/* --- Mobile controls: Share left, Close right; no play/prev/next buttons --- */
@media (max-width: 720px){
  #modalLightbox .tl-controls-overlay{
    opacity: 1 !important;
    transform: none !important;
    inset: 0;
    pointer-events:none;
  }
  #modalLightbox .tl-controls-left,
  #modalLightbox .tl-controls-right{ pointer-events:none; }

  #lightboxPrev, #lightboxNext, #lightboxPlay{ display:none !important; }

  #lightboxShare{
    position:absolute;
    top:10px;
    left:10px;
    pointer-events:auto;
  }
  #lightboxClose{
    position:absolute;
    top:10px;
    right:10px;
    pointer-events:auto;
  }

  /* clock below close */
  .tl-clock{ top: 62px; right: 10px; }
}


/* Nunavik important days icons */
.tl-evts{ position:absolute; left:10px; bottom:10px; display:flex; gap:6px; }
.tl-evt{ display:inline-flex; align-items:center; justify-content:center; height:18px; min-width:18px; padding:0 6px; border-radius:999px; font-size:12px; line-height:1; border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.06); color:#fff; opacity:.95; }
.tl-evt.tl-evt-more{ opacity:.75; font-weight:800; }
.tl-evt-food{ background:rgba(255,255,255,.08); }
.tl-evt-elders{ border-color:rgba(255,209,102,.30); box-shadow:0 0 12px rgba(255,209,102,.10); }
.tl-evt-inuit{ border-color:rgba(120,170,255,.28); box-shadow:0 0 12px rgba(120,170,255,.10); }
.tl-evt-jbnqa{ border-color:rgba(255,140,120,.28); box-shadow:0 0 12px rgba(255,140,120,.10); }
.tl-evt-trc{ border-color:rgba(255,140,120,.28); box-shadow:0 0 12px rgba(255,140,120,.10); }
.tl-evt-nipd{ border-color:rgba(120,255,190,.18); box-shadow:0 0 12px rgba(120,255,190,.08); }


/* Big beating heart for Feb 14 */
.tl-heart-big{
  font-size: 22px !important;
  line-height: 1;
  display: inline-block;
  transform-origin: center;
  animation: tlHeartBeat 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.22));
}
@keyframes tlHeartBeat{
  0%{ transform: scale(1); }
  20%{ transform: scale(1.18); }
  40%{ transform: scale(1); }
  60%{ transform: scale(1.12); }
  100%{ transform: scale(1); }
}

/* Contextual popup for event labels */
.tl-evt-pop{
  position: absolute;
  z-index: 9999;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 18, 24, 0.96);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  max-width: min(320px, calc(100vw - 16px));
  pointer-events: none;
}

