/* ═══════════════════════════════════════════════════════════════════════════
   components.css — All UI components
   Zach Miller Studio — v2.0
═══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   FEATURED WORK (home page)
══════════════════════════════════════════════════════════════════════════ */
.featured-work {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 5rem;
}

.featured-image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: calc(100vh - 13rem);
  overflow: hidden;
}
.featured-image-wrap img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 13rem);
  height: auto;
  display: block;
  cursor: pointer;
  transition: filter var(--t-base);
  filter: saturate(0.92);
}
.featured-image-wrap img:hover {
  filter: saturate(1);
}

.featured-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.15rem 2rem;
  padding-top: 1.2rem;
}
.featured-meta-item {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.featured-meta-key {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.featured-meta-val {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.4;
}
.featured-meta-val em {
  font-style: italic;
}
.featured-meta-val strong {
  font-weight: 500;
  color: var(--ink);
}

/* ══════════════════════════════════════════════════════════════════════════
   GALLERY GRID (salon-style — work subpages)
══════════════════════════════════════════════════════════════════════════ */
.gallery-header {
  margin-top: 5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.gallery-title {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.gallery-count {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  text-decoration: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: saturate(0.85);
  transition: filter var(--t-base), transform 0.5s var(--ease);
}
.gallery-item:hover img {
  filter: saturate(1);
  transform: scale(1.02);
}

/* Hover overlay with title */
.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0.8rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--t-base);
  pointer-events: none;
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}
.gallery-overlay-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.3;
}
.gallery-overlay-year {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

@media (max-width: 960px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
}
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .featured-work, .gallery-header, .post-list { margin-top: 3rem; }
}
@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 2px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   WORK DETAIL (individual work page)
══════════════════════════════════════════════════════════════════════════ */
.back-links {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color var(--t-fast);
}
.back-link::before { content: '\2190'; }
.back-link:hover { color: var(--ink); }

.work-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.work-image-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: calc(100vh - 18rem);
  overflow: hidden;
}
.work-image-wrap img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 18rem);
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: filter var(--t-base);
  filter: saturate(0.92);
}
.work-image-wrap img:hover {
  filter: saturate(1);
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem 2rem;
  padding-top: 1.2rem;
  padding-bottom: 1rem;
}
.work-meta-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  line-height: 1.4;
}
.work-meta-key {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.work-meta-val {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.4;
}
.work-meta-val strong {
  font-weight: 600;
  color: var(--ink);
}

.work-statement {
  max-width: 60ch;
  margin-top: 1rem;
  margin-left: auto;
  margin-right: auto;
}
.work-statement p {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-mid);
}

/* Work navigation (prev/next) */
.work-nav {
  display: flex;
  justify-content: space-between;
  padding-top: 2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--rule-light);
}
.work-nav a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color var(--t-fast);
}
.work-nav a:hover { color: var(--ink); }

/* ══════════════════════════════════════════════════════════════════════════
   WRITING / BLOG
══════════════════════════════════════════════════════════════════════════ */
.post-list {
  display: flex;
  flex-direction: column;
  margin-top: 5rem;
}
.post-entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0 2rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--t-base);
}
.post-entry:last-child { border-bottom: 1px solid var(--rule); }
.post-entry:hover { opacity: 0.6; }

.post-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-dim);
  padding-top: 0.2rem;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.post-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.post-excerpt {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.82rem;
  color: var(--ink-mid);
  line-height: 1.6;
}
.post-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
.post-tag {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.1rem 0.4rem;
}

@media (max-width: 640px) {
  .post-entry { grid-template-columns: 1fr; gap: 0.4rem 0; }
  .post-date { padding-top: 0; }
}

/* ── Blog post single ── */
.post-header {
  margin-top: 6rem;
  margin-bottom: 3rem;
}
.post-header .post-date {
  display: block;
  margin-bottom: 0.75rem;
}
.post-header h1 {
  font-family: var(--font-sans);
  font-weight: 900;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.post-body {
  max-width: 62ch;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-mid);
}
.post-body p { margin-bottom: 1.5em; }
.post-body p:last-child { margin-bottom: 0; }
.post-body h2 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 2.5em 0 0.75em;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 2em 0;
  font-style: italic;
  color: var(--ink-mid);
}

/* ══════════════════════════════════════════════════════════════════════════
   ABOUT
══════════════════════════════════════════════════════════════════════════ */
.about-content {
  margin-top: 6rem;
}
.about-statement {
  max-width: 60ch;
  margin-bottom: 3.5rem;
}
.about-statement p {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--ink-mid);
  margin-bottom: 1.4em;
}
.about-statement p:first-child {
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--ink);
}

/* CV accordion */
.cv-section {
  border-top: 1px solid var(--rule);
}
.cv-section:last-child { border-bottom: 1px solid var(--rule); }

.cv-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color var(--t-fast);
  user-select: none;
  list-style: none;
}
.cv-toggle::-webkit-details-marker { display: none; }
.cv-toggle:hover { color: var(--accent); }
.cv-toggle::after {
  content: '+';
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink-dim);
  transition: color var(--t-fast);
}
details[open] .cv-toggle::after {
  content: '\2212';
  color: var(--ink);
}
.cv-content { padding-bottom: 1.5rem; }
.cv-entry {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0 1.5rem;
  padding: 0.6rem 0;
}
.cv-entry + .cv-entry { border-top: 1px solid var(--rule-light); }
.cv-year {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-dim);
  padding-top: 0.1rem;
}
.cv-text {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-mid);
}
.cv-text strong {
  font-weight: 500;
  color: var(--ink);
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════════
   CONTACT
══════════════════════════════════════════════════════════════════════════ */
.contact-content {
  margin-top: 6rem;
}
.contact-intro {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-mid);
  max-width: 50ch;
  margin-bottom: 3rem;
}
.contact-intro strong {
  font-weight: 500;
  color: var(--ink);
}

.form-group { margin-bottom: 1.75rem; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.6rem;
}
.form-input,
.form-textarea {
  display: block;
  width: 100%;
  max-width: 50ch;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--ink);
  transition: border-color var(--t-fast);
  border-radius: 0;
  -webkit-appearance: none;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  outline: none;
}
.form-textarea {
  resize: none;
  min-height: 120px;
  line-height: 1.65;
}
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.7rem 1.6rem;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  margin-top: 0.5rem;
}
.btn:hover {
  background: var(--accent);
  color: #ffffff;
}

.contact-detail {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.contact-row {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0 1rem;
  padding: 0.55rem 0;
  align-items: baseline;
}
.contact-row-key {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.contact-row-val {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.88rem;
  color: var(--ink-mid);
}

/* ══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-base), visibility var(--t-base);
  cursor: zoom-out;
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

/* ══════════════════════════════════════════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════════════════════════════════════════ */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════════════════
   GRADIENT FIELD (background atmosphere)
══════════════════════════════════════════════════════════════════════════ */
.gradient-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.25;
}
.gradient {
  position: absolute;
  border-radius: 50%;
  will-change: filter;
  transition: filter 0.6s var(--ease);
}

/* ══════════════════════════════════════════════════════════════════════════
   VIDEO EMBED
══════════════════════════════════════════════════════════════════════════ */
.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Self-hosted video on work detail */
.work-image-wrap video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 14rem);
  display: block;
}

/* Video thumbnail in gallery grid */
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  filter: saturate(0.85);
  transition: filter var(--t-base), transform 0.5s var(--ease);
}
.gallery-item:hover video {
  filter: saturate(1);
  transform: scale(1.02);
}
