/*
Theme Name: Lo-Fi Art — Custom Logo
Theme URI: https://www.lo-fi.art
Author: Tim Milner
Description: A minimal, responsive photography gallery with masonry layout and fullscreen lightbox.
Version: 3.3.1
Text Domain: lo-fi-art
*/

:root {
  --bg: #000;
  --text: #fff;
  --muted: #8a8a8a;
  --soft: #1a1a1a;
  --pad: clamp(16px, 2.4vw, 42px);
  --gap: clamp(10px, 1.2vw, 20px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.lightbox-open {
  overflow: hidden;
}

a,
button {
  color: inherit;
}

a {
  text-decoration: none;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 1px solid #fff;
  outline-offset: 4px;
}

/* Header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px var(--pad) 30px;
}

.site-title {
  margin: 0;
  line-height: 0;
}

.site-logo-image {
  width: clamp(150px, 17vw, 250px);
  height: auto;
}

.site-title a:hover,
.site-footer a:hover,
.menu a:hover {
  opacity: .58;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  color: var(--muted);
  font-size: 12px;
}

/* Masonry gallery */

.gallery-shell {
  padding: 0 var(--pad);
}

.gallery-grid {
  column-count: 3;
  column-gap: var(--gap);
}

.gallery-item {
  break-inside: avoid;
  margin: 0 0 var(--gap);
  position: relative;
}

.gallery-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.gallery-image {
  width: 100%;
  height: auto;
  background: #080808;
  transition: opacity .2s ease;
}

.gallery-button:hover .gallery-image {
  opacity: .78;
}

.column-lofi_thumbnail {
  width: 100px;
}

.column-lofi_thumbnail img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

.gallery-caption {
  display: none;
}

.empty-gallery,
.standard-content {
  max-width: 720px;
  margin: 8vh auto;
  padding: 0 var(--pad);
}

.standard-content h1 {
  font-size: 16px;
  font-weight: 400;
}

.standard-content p {
  color: #ccc;
}

.pagination {
  display: flex;
  justify-content: space-between;
  padding: 40px var(--pad) 0;
  color: var(--muted);
  font-size: 11px;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(0, 0, 0, .98);
}

.lightbox.is-open {
  display: block;
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 64px clamp(18px, 5vw, 80px) 80px;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 145px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-control {
  position: absolute;
  z-index: 2;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: .7;
  transition: opacity .15s ease;
}

.lightbox-control:hover {
  opacity: 1;
}

.lightbox-close {
  top: 18px;
  right: 20px;
  width: 38px;
  height: 38px;
  font-size: 28px;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 72px;
  font-size: 34px;
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

.lightbox-info-toggle {
  left: 20px;
  bottom: 20px;
  width: 32px;
  height: 32px;
  border: 1px solid #555;
  border-radius: 50%;
  font-size: 13px;
  opacity: .8;
}

.lightbox-counter {
  position: absolute;
  right: 22px;
  bottom: 24px;
  color: var(--muted);
  font-size: 11px;
}

.lightbox-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  min-height: 86px;
  padding: 18px 76px 18px 62px;
  background: rgba(0, 0, 0, .92);
  border-top: 1px solid #202020;
}

.lightbox-info.is-visible {
  display: block;
}

.lightbox-title {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 400;
}

.lightbox-description,
.lightbox-meta {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.lightbox-meta {
  margin-top: 5px;
}

/* Single photo fallback / shareable URL */

.single-photo {
  min-height: calc(100vh - 90px);
  display: grid;
  place-items: center;
  padding: 0 var(--pad) 50px;
}

.photo-wrap {
  width: 100%;
  margin: 0;
}

.photo-wrap img {
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  object-fit: contain;
}

.photo-meta {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  max-width: 1400px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 11px;
}

.photo-title {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
}

.photo-description {
  max-width: 520px;
  margin-top: 10px;
}

/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 52px var(--pad) 24px;
  color: #555;
  font-size: 10px;
}

/* Responsive */

@media (max-width: 900px) {
  .gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-top: 19px;
    padding-bottom: 23px;
  }

  .site-logo-image {
    width: clamp(132px, 42vw, 170px);
  }

  .gallery-grid {
    column-count: 1;
  }

  .gallery-item {
    margin-bottom: 24px;
  }

  .lightbox-stage {
    padding: 58px 12px 92px;
  }

  .lightbox-image {
    max-height: calc(100vh - 158px);
  }

  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: 16px;
    transform: none;
    width: 44px;
    height: 44px;
    font-size: 28px;
  }

  .lightbox-prev {
    left: calc(50% - 58px);
  }

  .lightbox-next {
    right: calc(50% - 58px);
  }

  .lightbox-info-toggle {
    left: 18px;
    bottom: 22px;
  }

  .lightbox-counter {
    right: 18px;
    bottom: 26px;
  }

  .lightbox-info {
    padding: 15px 58px 15px 18px;
    min-height: 95px;
  }

  .photo-meta,
  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .gallery-image,
  .lightbox-control {
    transition: none;
  }
}
