/* Photography Portfolio Grid */
.photo-grid {
  --photo-gutter: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 180px;
  gap: var(--photo-gutter);
  grid-auto-flow: dense;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 8px 40px rgba(2, 6, 10, 0.6);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s ease;
  animation: fadeInUp 0.6s ease-out backwards;
}

.photo-item:nth-child(1) {
  animation-delay: 0.1s;
}
.photo-item:nth-child(2) {
  animation-delay: 0.2s;
}
.photo-item:nth-child(3) {
  animation-delay: 0.3s;
}
.photo-item:nth-child(4) {
  animation-delay: 0.4s;
}
.photo-item:nth-child(5) {
  animation-delay: 0.5s;
}
.photo-item:nth-child(6) {
  animation-delay: 0.6s;
}
.photo-item:nth-child(7) {
  animation-delay: 0.7s;
}
.photo-item:nth-child(8) {
  animation-delay: 0.8s;
}
.photo-item:nth-child(9) {
  animation-delay: 0.9s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.photo-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.06));
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}

.photo-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(2, 6, 10, 0.7);
}
.photo-item:hover::before {
  opacity: 0.12;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
  position: relative;
  z-index: 2;
}
.photo-item:hover img {
  transform: scale(1.12);
  filter: brightness(0.75) saturate(1.2);
}

.photo-overlay {
  display: none !important;
}

/* Grid Item Sizes */
.photo-large {
  grid-column: span 2;
  grid-row: span 2;
}
.photo-tall {
  grid-row: span 2;
}
.photo-wide {
  grid-column: span 2;
}

/* Slight face-focus adjustment for tall portrait items so faces sit higher in frame */
.photo-tall img,
.photo-large img {
  object-position: center 28%;
}

/* Specific tweak for the main portrait so the head sits higher in frame */
.face-center img {
  object-position: center 12% !important;
}

@media (max-width: 640px) {
  .face-center img {
    object-position: center 22% !important;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .photo-grid {
    --photo-gutter: 18px;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 200px;
  }
}
@media (max-width: 768px) {
  .photo-grid {
    --photo-gutter: 14px;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }
  .photo-overlay h3 {
    font-size: 18px;
  }
  .photo-overlay p {
    font-size: 13px;
  }
  .photo-overlay {
    padding: 20px;
  }
}
@media (max-width: 640px) {
  .photo-grid {
    --photo-gutter: 12px;
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
  }
  .photo-large,
  .photo-tall,
  .photo-wide {
    grid-column: span 1;
    grid-row: span 1;
  }
  .photo-overlay h3 {
    font-size: 16px;
  }
  .photo-overlay p {
    font-size: 12px;
  }
}

/* Portfolio Tiles (featured projects) */
.portfolio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 980px) {
  .portfolio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .portfolio {
    grid-template-columns: 1fr;
  }
}

.tile {
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.tile h3 {
  margin: 12px 12px 0;
  font-size: 20px;
}
.tile p {
  margin: 4px 12px 12px;
  color: var(--muted);
  font-size: 15px;
}
.tile img {
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  transition: transform 0.3s ease;
}
.tile:hover img {
  transform: scale(1.05);
}
@media (max-width: 640px) {
  .tile h3 {
    font-size: 18px;
    margin: 10px 10px 0;
  }
  .tile p {
    font-size: 14px;
    margin: 4px 10px 10px;
  }
}

/* Featured Videos: thumbnail and timestamp badge */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.video-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 20px rgba(10, 46, 92, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.video-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(10, 46, 92, 0.08);
}
.video-thumbnail {
  position: relative;
  width: 100%;
  height: 220px;
  background: #000;
  overflow: hidden;
}
.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-info {
  padding: 14px;
}
.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.video-ts {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

@media (max-width: 980px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .video-thumbnail {
    height: 200px;
  }
}
@media (max-width: 640px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .video-thumbnail {
    height: 180px;
  }
}

/* Section title override for portfolio headings */
.section-title,
h2.section-title {
  color: #0a2e5c;
  font-size: 36px;
  text-align: center;
  margin-bottom: 48px;
}

/* Dark section overrides (used for photography section) */
.section.dark {
  background: #0b0b0c;
  color: #e5e7eb;
}
.section.dark .section-title {
  color: #e5e7eb;
}
.section.dark .photo-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(10, 10, 10, 0.6) 40%,
    transparent 100%
  );
}
.section.dark .photo-item::before {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.05) 100%
  );
}
.section.dark .photo-overlay h3,
.section.dark .photo-overlay p {
  color: #ffffff;
}
