/* ========================================
   Views — Home, Training, Gallery
   ======================================== */

/* ---- Home / Dashboard ---- */
.home-hero {
  text-align: center;
  padding: 8px 0 16px;
}

.home-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.home-subtitle {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  margin-top: 2px;
}

/* Polaroid Stack */
.polaroid-stack {
  position: relative;
  height: 280px;
  margin: 8px auto 24px;
  max-width: 340px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  perspective: 600px;
}

.polaroid-stack:active {
  transform: scale(0.98);
}

.polaroid {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -110px;
  width: 220px;
  background: white;
  padding: 8px 8px 28px 8px;
  border-radius: 2px;
  box-shadow: 0 3px 12px rgba(61, 44, 30, 0.18), 0 1px 3px rgba(61, 44, 30, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.polaroid-stack:hover .polaroid:nth-child(1) {
  transform: rotate(-6deg) translate(-16px, -4px) !important;
}

.polaroid-stack:hover .polaroid:nth-child(2) {
  transform: rotate(5deg) translate(20px, 0px) !important;
}

.polaroid img,
.polaroid video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-radius: 1px;
  background: var(--cream-dark);
}

.polaroid-media {
  position: relative;
}

.polaroid-media video {
  width: 100%;
  height: 164px;
  object-fit: cover;
  display: block;
}

.polaroid-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  pointer-events: none;
}

.polaroid-caption {
  font-family: 'Caveat', 'Comic Sans MS', cursive, sans-serif;
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
  margin-top: 6px;
  line-height: 1.2;
  max-height: 18px;
  overflow: hidden;
}

.polaroid-hint {
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-darker);
  opacity: 0.8;
}

.polaroid-empty {
  text-align: center;
  padding: 60px 20px;
  font-size: 36px;
  color: var(--text-muted);
}

.polaroid-empty span {
  font-size: 14px;
  display: block;
  margin-top: 8px;
}

/* Home Quick Stats */
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.home-stat {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.home-stat:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-md);
}

.home-stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.home-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

/* Home Section Titles */
.home-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* Home Today Summary */
.home-today {
  margin-top: 20px;
}

.home-today-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.home-today-item {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.home-today-emoji {
  font-size: 16px;
}

.home-latest {
  font-size: 13px;
  color: var(--text-light);
  padding: 10px 14px;
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-latest-label {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.home-view-day-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  margin-top: 4px;
}

.home-view-day-btn:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}

/* Home Milestone section */
#home-milestone {
  margin-bottom: 8px;
}

/* ---- Gallery ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--gold-light);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gallery-item:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-md);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item .gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  padding: 24px 10px 8px;
  text-align: center;
}

.gallery-item .gallery-date {
  font-size: 11px;
  font-weight: 600;
}

.gallery-item .gallery-caption {
  font-size: 10px;
  opacity: 0.85;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item .gallery-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* ---- Desktop ---- */
@media (min-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
