/*
Theme Name: Zone One Photographic
Theme URI: https://zoneonephotographic.com
Author: Zone One Photographic
Description: A custom portfolio theme for Zone One Photographic. Content is fully editable through WordPress: page titles, text, Featured Images, and photo galleries (using the native Gallery block) all come from the WordPress editor.
Version: 1.0
Requires at least: 5.9
Requires PHP: 7.0
Text Domain: zone-one-photographic
*/

:root{
  --paper: #FFFFFF;
  --ink: #1C1A17;
  --ink-soft: #6B655B;
  --brass: #8A6E4B;
  --rule: #E4E1D9;
  --safelight: #A13D2E;
  --side-w: 76px;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  background:var(--paper);
  color:var(--ink);
  font-family:'Inter', sans-serif;
  line-height:1.5;
  overflow-x:hidden;
}

h1,h2,h3{ font-family:'Fraunces', serif; font-weight:450; letter-spacing:-0.01em; }
.mono{ font-family:'IBM Plex Mono', monospace; letter-spacing:0.03em; }
a{ color:inherit; text-decoration:none; }
::selection{ background:var(--brass); color:var(--paper); }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; scroll-behavior:auto !important; }
}

/* ---------- Side rails ---------- */
.rail{
  position:fixed; top:0; bottom:0; width:var(--side-w);
  display:flex; flex-direction:column; align-items:center;
  z-index:100;
}
.rail.left{ left:0; justify-content:space-between; padding:2.4rem 0; }
.rail.right{ right:0; justify-content:center; padding:2.4rem 0; }

.rail .brand{
  writing-mode:vertical-rl; transform:rotate(180deg);
  font-size:0.78rem; letter-spacing:0.14em; color:var(--ink);
}
.rail .subtitle{
  writing-mode:vertical-rl; transform:rotate(180deg);
  font-size:0.64rem; color:var(--ink-soft);
}

.rail.right .links{
  display:flex; flex-direction:column; gap:2.2rem; align-items:center;
  max-height:100%; overflow-y:auto; scrollbar-width:none;
}
.rail.right .links::-webkit-scrollbar{ display:none; }
.rail.right .links a{
  writing-mode:vertical-rl; transform:rotate(180deg);
  font-size:0.72rem; color:var(--ink-soft);
  display:flex; align-items:center; gap:0.55em;
  transition:color 0.25s ease;
  white-space:nowrap;
}
.rail.right .links a:hover{ color:var(--ink); }
.rail.right .links a.active{ color:var(--ink); }
.rail.right .links a .frame-no{ color:var(--brass); font-size:0.64rem; }
.rail.right .links a::after{
  content:''; width:1px; height:16px; background:var(--rule);
}
.rail.right .links a:last-child::after{ display:none; }

/* ---------- Main column ---------- */
main{
  max-width:900px;
  margin:0 auto;
  padding:0 6vw;
}

/* ---------- Hero ---------- */
.hero{
  padding:12vh 0 8vh;
  text-align:center;
  display:flex; flex-direction:column; align-items:center;
}
.hero-eyebrow{
  font-size:0.72rem; color:var(--brass);
  text-transform:uppercase; letter-spacing:0.16em;
  margin-bottom:1.4rem;
  display:flex; align-items:center; gap:0.6em;
}
.hero-eyebrow::before{
  content:''; width:7px; height:7px; border-radius:50%;
  background:var(--safelight);
  box-shadow:0 0 0 3px rgba(161,61,46,0.12);
}
.hero h1{
  font-size:clamp(2.3rem, 5vw, 3.8rem);
  line-height:1.05;
  max-width:16ch;
}
.hero h1 em{ font-style:italic; color:var(--brass); }
.hero-tagline{
  margin-top:1.5rem; max-width:46ch;
  font-size:1.05rem; color:var(--ink-soft);
}
.hero-meta{
  margin-top:2.4rem; display:flex; gap:2.6rem; flex-wrap:wrap; justify-content:center;
}
.hero-meta div{ font-size:0.72rem; color:var(--ink-soft); }
.hero-meta strong{
  display:block; font-family:'Fraunces', serif; font-size:1.3rem;
  color:var(--ink); font-weight:450;
}

.hero-frame{
  margin-top:4rem; position:relative;
  width:100%; max-width:640px;
  aspect-ratio:4/3; background:var(--ink);
  overflow:hidden; cursor:zoom-in;
}
.hero-frame img{ width:100%; height:100%; object-fit:cover; }
.hero-frame .tag{
  position:absolute; bottom:1.2rem; left:1.2rem;
  color:#F5F2EC; font-size:0.66rem;
  background:rgba(28,26,23,0.55); padding:0.35em 0.7em;
}

/* ---------- Section shell ---------- */
section{ padding:8vh 0; }
.section-head{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  border-bottom:1px solid var(--rule);
  padding-bottom:1.4rem; margin-bottom:3rem;
}
.section-head h2{ font-size:clamp(1.7rem, 3vw, 2.3rem); }
.section-head .count{ font-size:0.72rem; color:var(--ink-soft); margin-top:0.5rem; }

/* ---------- Back link (category pages) ---------- */
.back-link{
  display:inline-flex; align-items:center; gap:0.5em;
  font-size:0.74rem; color:var(--ink-soft);
  margin-bottom:0;
}
.back-link:hover{ color:var(--ink); }

/* ---------- Contact sheet gallery ---------- */
.sheet{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:2px;
  background:var(--rule);
  border:1px solid var(--rule);
}
.frame{
  position:relative;
  background:var(--ink);
  aspect-ratio:3/2;
  overflow:hidden;
  cursor:zoom-in;
}
.frame img{
  width:100%; height:100%; object-fit:cover;
  filter:saturate(0.92) contrast(1.02);
  transform:scale(1.06);
  transition:transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.5s ease;
}
.frame:hover img{ transform:scale(1); filter:saturate(1.05) contrast(1.05); }
.frame .fnum{
  position:absolute; top:8px; left:9px;
  font-size:0.6rem; color:rgba(245,242,236,0.7);
}
.frame .fcap{
  position:absolute; left:9px; bottom:8px; right:9px;
  display:flex; justify-content:space-between; align-items:flex-end;
  font-size:0.64rem; color:#F5F2EC;
  opacity:0; transform:translateY(6px);
  transition:opacity 0.35s ease, transform 0.35s ease;
}
.frame:hover .fcap{ opacity:1; transform:translateY(0); }
.frame::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(to top, rgba(0,0,0,0.55), transparent 45%);
  opacity:0; transition:opacity 0.35s ease;
}
.frame:hover::after{ opacity:1; }

.reveal{ opacity:0; transform:translateY(18px); transition:opacity 0.7s ease, transform 0.7s ease; }
.reveal.in{ opacity:1; transform:translateY(0); }

/* ---------- Table of contents (home "Work" list) ---------- */
.toc{ display:flex; flex-direction:column; }
.toc-item{
  display:grid; grid-template-columns:40px 110px 1fr auto;
  align-items:center; gap:1.4rem;
  padding:1.5rem 0; border-bottom:1px solid var(--rule);
  color:var(--ink); transition:padding-left 0.3s ease;
}
.toc-item:first-child{ border-top:1px solid var(--rule); }
.toc-item:hover{ padding-left:0.5rem; }
.toc-item:hover .toc-thumb img{ transform:scale(1.06); }
.toc-num{ font-size:0.76rem; color:var(--brass); }
.toc-thumb{ width:110px; aspect-ratio:4/3; overflow:hidden; background:var(--ink); }
.toc-thumb img{ width:100%; height:100%; object-fit:cover; filter:saturate(0.92); transition:transform 0.6s ease; }
.toc-text h3{ font-size:1.25rem; font-weight:450; }
.toc-text p{ font-size:0.84rem; color:var(--ink-soft); margin-top:0.3rem; max-width:48ch; }
.toc-count{ font-size:0.68rem; color:var(--ink-soft); white-space:nowrap; }

/* ---------- About ---------- */
.about{ display:flex; flex-direction:column; align-items:center; text-align:center; }
.about-portrait{
  width:100%; max-width:340px; aspect-ratio:4/5;
  background:var(--ink); overflow:hidden; cursor:zoom-in;
}
.about-portrait img{ width:100%; height:100%; object-fit:cover; }
.about-copy{ margin-top:2.4rem; }
.about-copy p{ font-size:1.02rem; color:var(--ink-soft); max-width:56ch; margin:0 auto 1.1rem; }
.about-copy p:first-of-type{ font-size:1.15rem; color:var(--ink); font-family:'Fraunces', serif; font-weight:400; }
.specs{ display:flex; gap:2.4rem; margin-top:2rem; flex-wrap:wrap; justify-content:center; }
.specs div{ font-size:0.7rem; color:var(--ink-soft); border-top:1px solid var(--rule); padding-top:0.6rem; min-width:130px; }
.specs strong{ display:block; color:var(--ink); font-size:0.84rem; font-weight:600; margin-bottom:0.15rem; }

/* ---------- Contact ---------- */
.contact{ text-align:center; }
.contact p{ color:var(--ink-soft); font-size:1.02rem; margin-bottom:2.2rem; max-width:44ch; margin-left:auto; margin-right:auto; }
.contact-btn{
  display:inline-flex; align-items:center; gap:0.7em;
  border:1px solid var(--ink);
  padding:0.9em 1.8em; font-size:0.82rem; color:var(--ink);
  transition:background 0.25s ease, color 0.25s ease;
}
.contact-btn:hover{ background:var(--ink); color:var(--paper); }
.contact-btn .dot{ width:6px; height:6px; border-radius:50%; background:var(--safelight); }
.contact-links{
  margin-top:2.6rem; display:flex; gap:2rem; justify-content:center;
  font-size:0.74rem; color:var(--ink-soft);
}
.contact-links a:hover{ color:var(--ink); }

footer{
  padding:2.4rem 0 3rem; display:flex; flex-direction:column; align-items:center; gap:0.8rem;
  font-size:0.68rem; color:var(--ink-soft); text-align:center;
  border-top:1px solid var(--rule); margin-top:2rem;
}
footer .foot-links{ display:flex; gap:1.6rem; }
footer .foot-links a:hover{ color:var(--ink); }

/* ---------- Lightbox ---------- */
.lightbox{
  position:fixed; inset:0; background:rgba(17,15,13,0.94);
  display:flex; align-items:center; justify-content:center;
  z-index:1000; opacity:0; pointer-events:none;
  transition:opacity 0.3s ease;
}
.lightbox.open{ opacity:1; pointer-events:auto; }
.lightbox img{
  max-width:88vw; max-height:86vh; object-fit:contain;
  box-shadow:0 20px 60px rgba(0,0,0,0.5);
  transform:scale(0.97); transition:transform 0.3s ease;
}
.lightbox.open img{ transform:scale(1); }
.lightbox-close{
  position:absolute; top:2rem; right:2rem;
  color:#F5F2EC; font-size:0.78rem;
  border:1px solid rgba(245,242,236,0.4);
  padding:0.6em 1.1em; cursor:pointer; background:none;
  font-family:'IBM Plex Mono', monospace;
}
.lightbox-close:hover{ background:#F5F2EC; color:var(--ink); }
.lightbox-cap{
  position:absolute; bottom:2rem; left:50%; transform:translateX(-50%);
  color:rgba(245,242,236,0.7); font-size:0.7rem; font-family:'IBM Plex Mono', monospace;
}
.lightbox img{ touch-action: pan-y; cursor:zoom-out; }
.lightbox-arrow{
  position:absolute; top:50%; transform:translateY(-50%);
  width:48px; height:48px; border-radius:50%;
  border:1px solid rgba(245,242,236,0.35);
  background:rgba(28,26,23,0.35);
  color:#F5F2EC; font-size:1.6rem; line-height:1;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background 0.25s ease, border-color 0.25s ease;
}
.lightbox-arrow:hover{ background:rgba(245,242,236,0.16); border-color:rgba(245,242,236,0.6); }
.lightbox-arrow.prev{ left:1.5rem; }
.lightbox-arrow.next{ right:1.5rem; }
.lightbox-arrow.hidden{ display:none; }
@media (max-width: 640px){
  .lightbox-arrow{ width:40px; height:40px; font-size:1.3rem; }
  .lightbox-arrow.prev{ left:0.6rem; }
  .lightbox-arrow.next{ right:0.6rem; }
}

/* ---------- Mobile nav ---------- */
.mobile-nav{ display:none; }

@media (max-width: 860px){
  .rail{ display:none; }
  .mobile-nav{
    display:flex; justify-content:space-between; align-items:center;
    padding:1.1rem 6vw; border-bottom:1px solid var(--rule);
    position:sticky; top:0; background:var(--paper); z-index:100;
  }
  .mobile-nav .links{ display:flex; gap:1.1rem; font-size:0.72rem; color:var(--ink-soft); flex-wrap:wrap; justify-content:flex-end; }
  .sheet{ grid-template-columns:repeat(2, 1fr); }
  .toc-item{ grid-template-columns:30px 80px 1fr; }
  .toc-count{ display:none; }
}

/* ---------- WordPress content typography (the_content output) ---------- */
.page-content{ text-align:center; }
.page-content p{
  font-size:1.02rem; color:var(--ink-soft); max-width:56ch;
  margin:0 auto 1.1rem;
}
.page-content > p:first-of-type{
  font-size:1.15rem; color:var(--ink); font-family:'Fraunces', serif; font-weight:400;
}
.hero-tagline{ margin-top:1.5rem; }
.hero-tagline p{ max-width:46ch; }
.gallery-content{ text-align:left; margin-top:2rem; }
.gallery-content > p{ text-align:center; margin:0 auto 2.5rem; max-width:56ch; }
.page-content a{ color:var(--brass); text-decoration:underline; text-underline-offset:3px; }

/* ---------- Native WordPress Gallery block, restyled as a contact sheet ---------- */
.gallery-content .wp-block-gallery{
  display:grid !important;
  grid-template-columns:repeat(3, 1fr) !important;
  gap:2px !important;
  background:var(--rule);
  border:1px solid var(--rule);
  list-style:none; padding:0; margin:0 0 1rem;
}
.gallery-content .wp-block-gallery .wp-block-image,
.gallery-content .wp-block-gallery.blocks-gallery-grid .blocks-gallery-item{
  position:relative;
  background:var(--ink);
  aspect-ratio:3/2;
  overflow:hidden;
  margin:0;
  cursor:zoom-in;
}
.gallery-content .wp-block-gallery img{
  width:100%; height:100%; object-fit:cover;
  filter:saturate(0.92) contrast(1.02);
  transform:scale(1.06);
  transition:transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.5s ease;
}
.gallery-content .wp-block-gallery .wp-block-image:hover img{
  transform:scale(1); filter:saturate(1.05) contrast(1.05);
}
.gallery-content .wp-block-gallery figcaption,
.gallery-content .wp-block-gallery .blocks-gallery-item__caption{
  position:absolute; left:9px; bottom:8px; right:9px; top:auto;
  font-size:0.64rem; color:#F5F2EC; font-family:'IBM Plex Mono', monospace;
  background:none; text-shadow:none;
  opacity:0; transform:translateY(6px);
  transition:opacity 0.35s ease, transform 0.35s ease;
}
.gallery-content .wp-block-gallery .wp-block-image:hover figcaption,
.gallery-content .wp-block-gallery .blocks-gallery-item:hover .blocks-gallery-item__caption{
  opacity:1; transform:translateY(0);
}
.gallery-content .wp-block-gallery .wp-block-image::after{
  content:''; position:absolute; inset:0;
  background:linear-gradient(to top, rgba(0,0,0,0.55), transparent 45%);
  opacity:0; transition:opacity 0.35s ease; pointer-events:none;
}
.gallery-content .wp-block-gallery .wp-block-image:hover::after{ opacity:1; }
.gallery-content .frame-index{
  position:absolute; top:8px; left:9px; z-index:2;
  font-size:0.6rem; color:rgba(245,242,236,0.7); font-family:'IBM Plex Mono', monospace;
  pointer-events:none;
}

@media (max-width: 860px){
  .gallery-content .wp-block-gallery{ grid-template-columns:repeat(2, 1fr) !important; }
}
