/* Photo Projects Styles - Shared between CSS-only and JavaScript-enhanced galleries */

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #111;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 20px;
  line-height: 1.6;
}

a {
  color: #fff;
  text-decoration: none;
}

/* Header */
header a {
    text-decoration: underline;
}

header a:hover {
    color: orange;
    cursor: pointer !important;
    text-decoration: none;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  margin-bottom: 20px;
}

/* Gallery Grid - Desktop only */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Mobile: Single column, no grid */
@media (max-width: 768px) {
  .gallery {
    display: block;
  }
  
  .photo-card {
    margin-bottom: 20px;
  }
}

/* Photo Card */
.photo-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

/* Desktop: Clickable cards with hover */
@media (min-width: 769px) {
  @media (hover: hover) {
    .photo-card:hover {
      background-color: #000;

      & *, & .photo-info .date {
        color: orange;
      }

    }
  }
}

/* Mobile: Not clickable, no hover */
@media (max-width: 768px) {
  .photo-card {
    pointer-events: none;
    cursor: default;
  }
}

.photo-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  background-color: #2a2a2a;
}

/* Mobile: Full aspect ratio, no cropping */
@media (max-width: 768px) {
  .photo-card img {
    height: auto;
    object-fit: contain;
  }
}

/* Photo Info */
.photo-info {
  padding: 15px;
  color: #fff;
}

.photo-info .caption {
  margin-bottom: 10px;
  line-height: 1.5;
}

.photo-info .date {
  color: rgba(255, 255, 255, 0.5);
  font-family: Menlo, "Courier New", Courier, monospace;
  font-size: 0.75em;
  text-transform: uppercase;
}

/* Truncate long captions in gallery */
.photo-info .caption {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 769px) {
  .photo-info .caption {
    -webkit-line-clamp: 5;
    line-clamp: 5;
  }
}

/* Modal Styles - Desktop only */
/* ============ */

/* Hide modal by default */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  align-items: flex-start;
  justify-content: center;
}

/* Show modal when :target matches - Desktop only */
@media (min-width: 769px) {
  .modal:target {
    display: flex;
  }
}

/* Hide modals on mobile completely */
@media (max-width: 768px) {
  .modal {
    display: none !important;
  }
}

/* Modal Container */
.modal-content {
  position: relative;
  max-width: 90vw;
  margin: 60px auto 20px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

/* Close Button */
.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.7);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1001;
  transition: background 0.2s;
  text-decoration: none;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

/* Modal Image */
.modal-image {
  width: 100%;
  max-width: 90vw;
  max-height: 70vh;
  height: auto;
  display: block;
  object-fit: contain;
  background-color: #2a2a2a;
}

/* Modal Info */
.modal-info {
  padding: 20px;
  color: #fff;
}

.modal-caption {
  margin-bottom: 10px;
  line-height: 1.5;
}

.modal-date {
  color: rgba(255, 255, 255, 0.5);
  font-family: Menlo, "Courier New", Courier, monospace;
  font-size: 0.75em;
  text-transform: uppercase;
}

.modal-source {
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
}

.modal-source a {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  text-decoration: underline;
}

.modal-source a:hover {
  color: orange;
  text-decoration: none;
}

/* Navigation Buttons */
.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 1001;
  transition: background 0.2s;
  font-size: 24px;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

.modal-nav.prev {
  left: 20px;
}

.modal-nav.next {
  right: 20px;
}

/* Overlay Click to Close - invisible link covering entire modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: transparent;
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.photo-card img {
  animation: fadeIn 0.4s ease-in;
}

