:root {
  --bg-color: #0f0f0f;
  --text-color: #e0e0e0;
  --accent-color: #d4af37;
  --font-serif: "Cormorant Garamond", serif;
  --font-sans: "Montserrat", sans-serif;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  width: 100%;
  display: block;
}

/* Navigation */
nav {
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  background: #0f0f0f;
  z-index: 100;
}
.logo {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: #fff;
}
.back-link {
  color: var(--accent-color);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 2px;
  border: 1px solid var(--accent-color);
  padding: 8px 16px;
  transition: 0.3s;
}
.back-link:hover {
  background: var(--accent-color);
  color: #000;
}

/* Header */
.full-header {
  padding: 30px 5% 40px 5%;
  text-align: center;
}
.full-header h1 {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 10px;
}
.full-header p {
  color: #888;
  font-size: 0.9rem;
}

/* DYNAMIC PINTEREST LAYOUT */
.portfolio-full-grid {
  padding: 0 5% 80px 5%;

  /* --- CRITICAL FIX: Dynamic Columns --- */
  /* Instead of fixed 'column-count: 4', we use column-width */
  column-width: 200px;
  column-gap: 20px;
}

.masonry-item-full {
  break-inside: avoid;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
  cursor: pointer;
}

.masonry-item-full:hover {
  transform: translateY(-5px);
}

.masonry-item-full img {
  aspect-ratio: auto 1;
  filter: grayscale(100%);
  transition:
    transform 0.5s ease,
    filter 0.5s ease;
    
}

.masonry-item-full:hover img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

.item-overlay {
  position: absolute;
  inset: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.masonry-item-full:hover .item-overlay {
  opacity: 1;
}
.item-title {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}
.item-cat {
  color: var(--accent-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-top: 5px;
}

/* Footer (Consistent with Index) */
footer {
  background-color: #050505;
  color: #fff;
  padding: 20px 5% 10px 5%;
  border-top: 1px solid #222;
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.social-item {
  color: #999;
  font-size: 1.3rem;
  transition: all 0.3s ease;
}

.social-item:hover {
  color: var(--accent-color);
  transform: scale(1.2);
}

.copyright {
  color: #666;
  font-size: 0.85rem;
  margin-top: 10px;
}

/* Responsive Logic Handled by 'column-width' automatically. 
           No media queries needed for columns, just font sizes. */
@media (max-width: 768px) {
  .full-header h1 {
    font-size: 1.8rem;
  }
  nav {
    padding: 15px 20px;
  }
  .back-link {
    padding: 6px 7px;
    font-size: 0.5rem;
  }
}

/* ============================================ */
/* SKELETON LOADING STYLES */
/* ============================================ */

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* Navigation Skeleton */
.skeleton-nav {
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #222;
  background: #0f0f0f;
}

.skeleton-logo {
  width: 150px;
  height: 30px;
}

.skeleton-back-btn {
  width: 120px;
  height: 35px;
}

/* Header Skeleton */
.skeleton-header {
  padding: 60px 5% 40px 5%;
  text-align: center;
}

.skeleton-header-title {
  width: 300px;
  height: 45px;
  margin: 0 auto 15px;
}

.skeleton-header-subtitle {
  width: 200px;
  height: 20px;
  margin: 0 auto;
}

/* Portfolio Grid Skeleton */
.skeleton-portfolio-grid {
  padding: 0 5% 80px 5%;
  column-width: 280px;
  column-gap: 20px;
}

.skeleton-portfolio-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* Different Heights for Natural Look */
.skeleton-portfolio-item:nth-child(1),
.skeleton-portfolio-item:nth-child(5),
.skeleton-portfolio-item:nth-child(9) {
  height: 350px;
}

.skeleton-portfolio-item:nth-child(2),
.skeleton-portfolio-item:nth-child(6),
.skeleton-portfolio-item:nth-child(10) {
  height: 280px;
}

.skeleton-portfolio-item:nth-child(3),
.skeleton-portfolio-item:nth-child(7),
.skeleton-portfolio-item:nth-child(11) {
  height: 400px;
}

.skeleton-portfolio-item:nth-child(4),
.skeleton-portfolio-item:nth-child(8),
.skeleton-portfolio-item:nth-child(12) {
  height: 320px;
}

/* Hide Real Content While Loading */
body.loading nav,
body.loading .full-header,
body.loading .portfolio-full-grid,
body.loading footer {
  display: none;
}

/* Mobile: Pinterest 2-Column Layout */
@media (max-width: 768px) {
  .portfolio-full-grid {
    column-width: 150px; /* ← Magic number for 2 columns */
    column-gap: 10px;
    padding: 0 3% 60px 3%;
  }

  /* Smaller overlay text */
  .item-title {
    font-size: 0.9rem;
  }

  .item-cat {
    font-size: 0.7rem;
  }

  .item-overlay {
    padding: 12px;
  }
}
