/* Kavya's Photo Blog - Main Site Styles */
@import url('shared.css');

/* Header */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
}

.site-nav a {
  margin-left: 1.5rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--primary);
}

.nav-divider {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  margin-left: 1.5rem;
}

/* Auth UI in header - uses shared .auth-btn and .user-info */
.site-nav .auth-btn {
  margin-left: 1rem;
}

.site-nav .user-info {
  margin-left: 1rem;
}

#user-name {
  color: var(--text);
  font-weight: 500;
}

/* Main Content */
.site-content {
  min-height: calc(100vh - 140px);
  padding: 2rem 0;
}

/* Timeline */
.timeline {
  max-width: 900px;
  margin: 0 auto;
}

.timeline h1 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.timeline-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.year-header {
  font-size: 2rem;
  color: var(--primary);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.month-header {
  font-size: 1.25rem;
  color: var(--text-light);
  margin: 1.5rem 0 1rem;
}

/* Post Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.post-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-thumbnail {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slideshow for multiple images */
.post-thumbnail[data-slideshow="true"] {
  position: relative;
}

.post-thumbnail[data-slideshow="true"] .slideshow-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.post-thumbnail[data-slideshow="true"] .slideshow-image:first-child {
  position: relative;
  opacity: 1;
}

/* Pause indicator on hover */
.post-thumbnail[data-slideshow="true"]:hover::after {
  content: '⏸';
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.photo-count, .has-video {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  z-index: 10;
}

.has-video {
  right: auto;
  left: 8px;
}

/* Video-only post placeholder */
.video-only-thumbnail .video-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-only-thumbnail .video-icon {
  font-size: 3rem;
  opacity: 0.9;
}

.video-only-thumbnail .has-video {
  left: auto;
  right: 8px;
  top: 8px;
}

.post-info {
  padding: 0.75rem;
}

.post-info time {
  display: inline-block;
  background: var(--primary);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-right: 0.5rem;
}

.post-info h4 {
  font-size: 0.95rem;
  margin: 0.5rem 0 0.25rem;
}

.post-info .location {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Photo Post */
.photo-post {
  max-width: 900px;
  margin: 0 auto;
}

.post-header {
  text-align: center;
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.post-meta {
  color: var(--text-light);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-meta time {
  margin-right: 0.5rem;
}

.post-location a {
  color: var(--primary);
  text-decoration: none;
}

/* Edit Post Button */
.edit-post-btn {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  padding: 0.35rem 0.75rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.edit-post-btn:hover {
  background: #c2185b;
}

/* Photo Gallery */
.photo-gallery {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.photo-gallery.single {
  grid-template-columns: 1fr;
}

.photo-gallery.two {
  grid-template-columns: repeat(2, 1fr);
}

.photo-gallery.multi {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.photo-item {
  margin: 0;
}

.photo-item a {
  display: block;
}

.photo-item img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
}

.photo-item img:hover {
  opacity: 0.9;
}

.photo-item figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Video Section */
.video-section {
  margin: 1.5rem 0;
}

.video-item {
  margin: 0 0 1rem;
}

.video-item video {
  width: 100%;
  border-radius: var(--radius);
}

.video-highlight {
  background: #fff3cd;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Post Content */
.post-content {
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 2rem 0;
}

.post-content p {
  margin-bottom: 1rem;
}

/* Map */
.post-map {
  margin: 2rem 0;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: var(--radius);
}

.post-map h3 {
  margin-bottom: 1rem;
}

/* Photo Details */
.photo-details {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: var(--radius);
}

.photo-details summary {
  cursor: pointer;
  font-weight: 600;
}

.photo-details ul {
  list-style: none;
  margin-top: 1rem;
}

.photo-details li {
  margin-bottom: 0.5rem;
}

/* Post Navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  color: var(--primary);
  text-decoration: none;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 1rem;
  cursor: pointer;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-content {
  text-align: center;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-caption {
  color: white;
  margin-top: 1rem;
  font-size: 1rem;
}

/* Footer */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  text-align: center;
  color: var(--text-light);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 600px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .photo-gallery.multi {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .site-header .container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .site-nav a {
    margin: 0 0.75rem;
  }
}
