body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  color: #000;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

/* Header & Navigation */
header {
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1000;
  border-bottom: 1px solid #eee;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 2rem;
}

.site-title {
  font-size: 2.2rem;
  margin: 0;
  font-weight: 900;
  background: red;
  color: black;
  display: inline-block;
  padding: 0 1rem;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 4px 4px 0px black;
}

nav {
  flex-grow: 1;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-links li a {
  font-size: 1rem;
  text-transform: lowercase;
  font-weight: 500;
}

.lang-switcher {
  font-size: 0.9rem;
  white-space: nowrap;
  padding-left: 1.5rem;
  border-left: 1px solid #ddd;
}

.lang-link.active {
  font-weight: bold;
  text-decoration: underline;
}

body:not([data-lang]) .lang-en,
[data-lang="da"] .lang-en {
  display: none !important;
}

[data-lang="en"] .lang-da {
  display: none !important;
}

/* Hide CMS links by default */
.cms-link-wrapper,
.edit-link-wrapper {
  display: none;
}

/* Show CMS links when logged in */
body.cms-logged-in .cms-link-wrapper,
body.cms-logged-in .edit-link-wrapper {
  display: inline-block;
}

.cms-link {
  opacity: 0.5;
}

.cms-link:hover {
  opacity: 1;
}

/* Main Content Wrapper */
main {
  padding: 0 2rem 2rem 2rem;
  /* Removed top padding to touch navbar */
  width: 100%;
  box-sizing: border-box;
  min-height: 40vh;
}

.content-wrapper {
  margin-top: 0;
}

/* Works Grid (Masonry Style) */
.works-grid {
  column-width: 300px;
  column-gap: 3rem;
  width: 100%;
  margin-top: 2rem;
}

.work-item {
  display: inline-block;
  /* Required for column-count to stack items vertically */
  width: 100%;
  margin-bottom: 3rem;
  break-inside: avoid;
  padding: 4px 4px 2px 4px;
    background: lightgrey;
    box-shadow: 5px 5px 5px grey;
  /* Prevent items from breaking across columns */
}

.work-item img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.5rem;
  background: #eee; /* Skeleton background */
}

.grid-thumb {
  transition: opacity 0.3s ease;
}

.work-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.work-title {
  font-weight: bold;
}

.work-excerpt {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  line-height: 1.4;
  color: #333;
}

/* Home Gallery (Massive Scrolling Full-Width) */
.home-gallery {
  display: block;
  /* Use block for predictable margin stacking */
  margin: 0 -2rem;
  /* Negate main padding for edge-to-edge images */
  background: #000;
}

.gallery-item {
  width: 100%;
  height: calc(100vh - 4.5rem);
  /* Adjusted for larger header */
  position: relative;
  overflow: hidden;
  margin-top: -20vh;
  /* Consistent overlap */

}


.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Crop to fill the container */
  display: block;
  border-bottom: none;
  /* Blend together vertically */
  filter: url('#gritty-red');
  -webkit-filter: url('#gritty-red');
}

.gallery-info {
  position: absolute;
  bottom: 20%;
  /* Move metadata out of the bottom 10% blend zone */
  left: 0;
  padding: 2rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 1);
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  /* CRITICAL: This puts everything on the left */
  justify-content: flex-end;
  gap: 0.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  pointer-events: none;
  text-align: left;
}

.gallery-info span {
  display: inline-block;
  width: fit-content;
  /* margin-right: auto;
  /* Force to the left */
  text-align: left; */
}

.gallery-title {
  font-weight: bold;
  font-size: 2rem !important;
  /* Reduced from 3rem */
  margin-bottom: 0.5rem;
  line-height: 1;
}

.gallery-type,
.gallery-category,
.gallery-date {
  font-size: 0.9rem !important;
  /* Reduced from 1.2rem */
  opacity: 0.9;
}

.gallery-excerpt {
  font-size: 0.8rem;
  max-width: 600px;
  margin-top: 0.5rem;
  line-height: 1.4;
  text-transform: none;
  /* Keep excerpts readable */
  letter-spacing: normal;
}

.gallery-item a:hover {
  text-decoration: none;
}

.gallery-item a:hover .gallery-title {
  text-decoration: underline;
}

/* Post Layout */
.post {
  width: 100%;
  margin: 0;
  padding: 0;
}

.post-layout {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  margin-top: 2rem;
  width: 100%;
}

.post-media {
  flex: 1; /* Take up remaining space */
  min-width: 0;
  display: flex;
  justify-content: center;
}

.post-media img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: calc(100vh - 200px); /* Fit within viewport */
  object-fit: contain;
  border: 1px solid #000;
  display: block;
}

.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 200px);
  overflow: hidden;
  border: 1px solid #000;
  background: #000;
}

.video-container iframe,
.video-container video {
  width: 100%;
  height: 100%;
}

.post-info-column {
  flex: 0 0 33%; /* Right column takes 1/3 width */
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid #000;
  padding: 0 0 1rem 0;
}

.post-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.prominent-links {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.prominent-links li {
  margin-bottom: 1rem;
}

.prominent-link {
  display: inline-block;
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  background: black;
  color: red !important;
  padding: 0.5rem 1rem;
  box-shadow: 4px 4px 0px red;
  transition: transform 0.1s;
}

.prominent-link:hover {
  text-decoration: none;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px red;
}

/* Footer */
footer {
  padding: 4rem 2rem;
  margin-top: 8rem;
  width: 100%;
  box-sizing: border-box;
  color: #000;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .post-layout {
    flex-direction: column;
    gap: 3rem;
  }
  
  .post-info-column {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .post-media {
    width: 100%;
  }

  .post-media img {
    max-height: 70vh;
    width: 100%; /* Try to be 100% width on small screens */
    object-fit: contain;
  }

  .video-container {
    max-height: 70vh;
  }
}

/* Info Page */
.info-content {
  width: 100%;
  margin-top: 2rem;
}

.info-content h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid #000;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.about-section {
  margin-top: 3rem;
  line-height: 1.8;
  max-width: 800px;
  /* Keep text readable */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .site-title {
    font-size: 1.8rem;
  }

  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav-links {
    gap: 0.8rem;
  }

  .nav-links li a {
    font-size: 0.9rem;
  }

  .lang-switcher {
    padding-left: 0;
    border-left: none;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    width: 100%;
  }

  /* Add some breathing room for the grid on mobile */
  .works-grid {
    column-gap: 1.5rem;
  }

  .home-gallery {
    margin: 0 -1rem;
  }

  .gallery-info {
    padding: 1rem;
    bottom: 5%;
  }

  .gallery-title {
    font-size: 1.8rem !important;
  }

  .gallery-type,
  .gallery-category,
  .gallery-date {
    font-size: 0.9rem !important;
  }

  .post-title {
    font-size: 1.2rem;
  }

  main,
  footer {
    padding: 1rem;
  }
}