/* Joey Haley Archive - Unified Styles */
:root {
  --bg: #0b0b0b;
  --fg: #f3f3f3;
  --muted: #a0a0a0;
  --edge: #1e1e1e;
  --hit: #fafafa;
  --grid: clamp(16px, 2.2vw, 28px);
  --accent: #2563eb;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--grid) * 1.25) var(--grid);
}

/* Header / Nav */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--grid);
  border-bottom: 1px solid var(--edge);
  padding-bottom: var(--grid);
}

.brand {
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

nav ul {
  display: flex;
  gap: calc(var(--grid) * .75);
  list-style: none;
  padding: 0;
  margin: 0;
}

nav a {
  opacity: .85;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

nav a[aria-current="page"] {
  opacity: 1;
  border-color: var(--edge);
  background: #101010;
}

nav a:hover {
  opacity: 1;
}

/* Hero grid */
.hero {
  display: grid;
  gap: var(--grid);
  margin-top: calc(var(--grid) * 1.25);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tile {
  position: relative;
  border: 1px solid var(--edge);
  border-radius: 18px;
  overflow: hidden;
  background: #0f0f0f;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tile:hover {
  border-color: #2a2a2a;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.tile figure {
  margin: 0;
  aspect-ratio: 5/6;
  display: grid;
  place-items: center;
  background: #111;
  overflow: hidden;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.96);
  transition: transform 0.3s ease;
}

.tile:hover img {
  transform: scale(1.05);
}

.tile .cap {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(8px);
  color: var(--hit);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: .9rem;
  border: 1px solid rgba(255, 255, 255, .12);
  transition: all 0.3s ease;
}

.tile:hover .cap {
  background: rgba(0, 0, 0, .8);
  border-color: rgba(255, 255, 255, .2);
}

/* Intro / Bio */
.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid);
  margin: calc(var(--grid) * 1.5) 0;
}

.intro h1 {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 52px);
  line-height: 1.08;
}

.intro p {
  color: var(--muted);
  max-width: 68ch;
  margin: 0;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cta {
  border: 1px solid var(--edge);
  padding: 12px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.cta:hover {
  border-color: #2a2a2a;
  background: rgba(255, 255, 255, 0.05);
}

/* Footer */
footer {
  border-top: 1px solid var(--edge);
  margin-top: calc(var(--grid) * 2);
  padding-top: calc(var(--grid) * 1);
}

footer .sitemap {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

footer .sitemap a {
  color: var(--muted);
  transition: color 0.2s ease;
}

footer .sitemap a:hover {
  color: var(--fg);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 120px 20px; /* Reserve space for controls and info */
}

.modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 200px); /* Account for controls and info panel */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--edge);
  color: var(--fg);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  z-index: 1001;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #2a2a2a;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--edge);
  color: var(--fg);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s ease;
  z-index: 1001;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #2a2a2a;
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-info {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--edge);
  color: var(--fg);
  padding: 12px 20px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 40px);
  z-index: 1002;
}

.modal-title {
  font-weight: 500;
}

.modal-fullres {
  color: var(--accent);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.modal-fullres:hover {
  color: var(--hit);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .modal.active {
    padding: 60px 10px 100px 10px;
  }
  
  .modal-image {
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 160px);
  }
  
  .modal-nav {
    width: 44px;
    height: 44px;
  }
  
  .modal-prev {
    left: 10px;
  }
  
  .modal-next {
    right: 10px;
  }
  
  .modal-close {
    top: 10px;
    right: 10px;
  }
  
  .modal-info {
    bottom: 10px;
    left: 10px;
    right: 10px;
    transform: none;
    flex-direction: column;
    gap: 8px;
    max-width: none;
  }
}

/* Landscape mobile adjustments */
@media (max-height: 500px) {
  .modal.active {
    padding: 50px 20px 70px 20px;
  }
  
  .modal-image {
    max-height: calc(100vh - 120px);
  }
  
  .modal-info {
    bottom: 5px;
    padding: 8px 16px;
  }
}
