@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Source+Serif+4:ital@1&display=swap');

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #0b0b0c;
  color: #ededeb;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

a, button { color: inherit; text-decoration: none; font-family: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Header ---------- */

.site-header {
  border-bottom: 0.5px solid #2a2a2a;
  padding: 18px 24px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #ededeb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.lang-switch {
  display: flex;
  gap: 4px;
  background: #1a1a1a;
  border-radius: 8px;
  padding: 3px;
}

.lang-switch a {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  color: #ededeb;
}

.lang-switch a.active {
  background: #ededeb;
  color: #0b0b0c;
}

.main-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.main-nav a {
  border: 0.5px solid #333;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  cursor: pointer;
}

.main-nav a.active {
  background: #ededeb;
  color: #0b0b0c;
  border-color: #ededeb;
}

/* ---------- Galleri ---------- */

.gallery-wrap { padding: 24px; }

.masonry {
  column-gap: 10px;
  column-count: 2;
}

@media (min-width: 640px) { .masonry { column-count: 3; } }
@media (min-width: 1024px) { .masonry { column-count: 4; } }

.masonry-item {
  break-inside: avoid;
  margin-bottom: 10px;
  display: block;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  width: 100%;
}

.masonry-item .frame {
  width: 100%;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
}

.masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-state {
  text-align: center;
  padding: 64px 0;
  color: #888;
  font-size: 14px;
}

.tag-context {
  font-size: 14px;
  color: #9a9a96;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-context span { color: #ededeb; }

.tag-context button {
  background: none;
  border: none;
  color: #9cc0dd;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- Lightbox ---------- */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.lightbox-overlay.open {
  display: flex;
  flex-direction: column;
}

.lightbox-close {
  position: fixed;
  top: 12px;
  right: 12px;
  background: rgba(26, 26, 26, 0.9);
  border: none;
  color: #ededeb;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 102;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lightbox-nav {
  position: fixed;
  top: 45%;
  transform: translateY(-50%);
  background: rgba(26, 26, 26, 0.9);
  border: none;
  color: #ededeb;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 102;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

@media (hover: none) and (pointer: coarse) {
  .lightbox-nav { display: none; }
}

.lightbox-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 56px 16px 0;
  touch-action: pan-y;
}

.lightbox-image-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

.lightbox-image-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-body {
  flex-shrink: 0;
  width: 100%;
  max-width: 640px;
  padding: 14px 8px 18px;
  text-align: center;
}

.lightbox-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.lightbox-latin {
  font-size: 13px;
  color: #9a9a96;
  font-style: italic;
  font-family: 'Source Serif 4', Georgia, serif;
  margin: 2px 0 0;
}

.tag-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}

.tag-pills button {
  border: 0.5px solid #333;
  background: #1a1a1a;
  color: #ccc;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
}

.tag-pills button:hover {
  border-color: #9cc0dd;
  color: #9cc0dd;
}

/* ---------- Helskärmsläge ---------- */

.lightbox-overlay.fullscreen .lightbox-body { display: none; }

.lightbox-overlay.fullscreen .lightbox-close,
.lightbox-overlay.fullscreen .lightbox-nav {
  opacity: 0;
  pointer-events: none;
}

.lightbox-overlay.fullscreen .lightbox-content { padding: 0; }

.lightbox-overlay.fullscreen .lightbox-image-frame {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.lightbox-overlay.fullscreen .lightbox-image-frame img {
  border-radius: 0;
  cursor: zoom-out;
}
