/*
Theme Name: Pics Gallery Edge
Author: HomeLab
Description: Edge-to-edge photo gallery with titles and dates overlaid on each image, plus an accessible original-size lightbox.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: pics-gallery-edge
*/
:root {
  color-scheme: light;
  --bg: #f9f8f5;
  --surface: #eeece7;
  --text: #282723;
  --muted: #77746d;
  --line: #e4e1da;
  --accent: #b47d4b;
  --content-width: 1240px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.5; }
body.pics-modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: #89613d; }
button, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 20px; padding: 12px 18px; background: #fff; z-index: 10000; }
.skip-link:focus { top: 20px; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header { max-width: var(--content-width); width: calc(100% - 80px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 40px 0 30px; border-bottom: 1px solid var(--line); }
.brand { letter-spacing: -.065em; font-weight: 760; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: .9; }
.brand-dot { color: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 38px; font-size: .88rem; letter-spacing: .045em; }
.main-nav a { padding: 10px 0; color: var(--muted); }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--text); }
.main-nav a[aria-current] { border-bottom: 1px solid var(--accent); }
.site-main { width: calc(100% - 80px); max-width: var(--content-width); margin: 0 auto; flex: 1; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 64px 0 45px; }
.intro-simple { padding-bottom: 35px; }
.eyebrow { display: block; text-transform: uppercase; font-weight: 650; font-size: .69rem; color: var(--accent); letter-spacing: .2em; margin-bottom: 14px; }
.intro h1, .single-heading h1 { font-size: clamp(2.35rem, 5vw, 4.75rem); line-height: 1.07; letter-spacing: -.07em; font-weight: 620; margin: 0; }
.intro p { font-size: .98rem; color: var(--muted); margin: 19px 0 0; }
.archive-shortcut { font-size: .85rem; border-bottom: 1px solid var(--text); padding: 6px 0; white-space: nowrap; }
.archive-shortcut span { margin-left: 9px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 22px; row-gap: 41px; }
.photo-card { min-width: 0; }
.photo-link { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); border-radius: 3px; }
.gallery-image { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; transition: transform .5s cubic-bezier(.2,.75,.2,1), filter .35s; }
.photo-link:hover .gallery-image, .photo-link:focus-visible .gallery-image { transform: scale(1.045); filter: brightness(.8); }
.photo-overlay { position: absolute; right: 14px; bottom: 14px; color: white; font-size: .79rem; font-weight: 550; opacity: 0; transform: translateY(5px); transition: all .2s; background: rgba(0,0,0,.35); padding: 8px 11px; border-radius: 3px; }
.photo-link:hover .photo-overlay, .photo-link:focus-visible .photo-overlay { opacity: 1; transform: none; }
.photo-placeholder { display: grid; place-items: center; color: var(--muted); }
.photo-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 13px; }
.photo-title { font-size: .94rem; font-weight: 590; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-meta time { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.gallery-pagination { padding: 60px 0 70px; }
.gallery-pagination .nav-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; }
.gallery-pagination .page-numbers { display: grid; place-items: center; min-width: 39px; height: 39px; padding: 0 12px; font-size: .86rem; color: var(--muted); border: 1px solid transparent; border-radius: 3px; }
.gallery-pagination a.page-numbers:hover, .gallery-pagination .page-numbers.current { color: var(--text); border-color: var(--line); background: #fff; }
.gallery-pagination .prev, .gallery-pagination .next { padding: 0 15px; color: var(--text); }
.empty-message { padding: 60px 0; color: var(--muted); }
.site-footer { width: calc(100% - 80px); max-width: var(--content-width); margin: 0 auto; border-top: 1px solid var(--line); padding: 28px 0 40px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: .76rem; }
/* Single photographs */
.single-main { max-width: 1050px; }
.breadcrumb { margin-top: 40px; color: var(--muted); font-size: .86rem; }
.single-heading { padding: 50px 0 35px; }
.single-photo { display: grid; position: relative; place-items: center; min-height: 380px; background: var(--surface); padding: 15px; }
.detail-image { max-height: min(76vh, 950px); width: auto; height: auto; object-fit: contain; display: block; }
.single-zoom { position: absolute; bottom: 20px; right: 20px; background: rgba(255,255,255,.9); padding: 9px 13px; font-size: .82rem; }
.single-description { color: var(--muted); max-width: 700px; padding: 22px 0 0; }
.single-description p { margin-top: 0; }
.post-neighbors { display: flex; justify-content: space-between; gap: 20px; margin: 58px 0 75px; border-top: 1px solid var(--line); padding-top: 23px; font-size: .89rem; }
/* Archive page and generic pages */
.archive-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0 0 85px; }
.archive-panel { border: 1px solid var(--line); background: #fff; padding: clamp(24px, 4vw, 45px); min-width: 0; }
.archive-panel h2 { margin: 0; font-weight: 600; font-size: 1.6rem; letter-spacing: -.04em; }
.archive-panel p { color: var(--muted); font-size: .88rem; margin: 9px 0 20px; }
.archive-select { width: 100%; padding: 12px 15px; background: var(--bg); border: 1px solid var(--line); color: var(--text); }
.archive-months { columns: 2; column-gap: 20px; padding: 16px 0 0; margin: 0; list-style: none; }
.archive-months li { break-inside: avoid; padding: 8px 0; color: var(--muted); font-size: .88rem; }
.archive-months li a { color: var(--text); }
.archive-months li a:hover { color: var(--accent); }
.text-main { max-width: 1000px; }
.page-body { max-width: 750px; margin-bottom: 80px; }
.page-body a { text-decoration: underline; text-underline-offset: 3px; }
.page-body img { height: auto; }
.primary-link { display: inline-block; padding: 14px 19px; background: var(--text); color: white; }
.primary-link:hover { color: white; background: #4f483f; }
/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 50px 70px 30px; color: white; background: rgba(10,10,10,.97); }
.lightbox-top { position: absolute; top: 17px; left: 26px; right: 26px; display: flex; justify-content: space-between; align-items: center; }
.lightbox-counter { color: #bcbcbc; font-size: .78rem; }
.lightbox-close, .lightbox-arrow { color: #f5f5f5; background: transparent; border: 0; }
.lightbox-close { font-size: 2.2rem; width: 45px; height: 45px; line-height: 1; }
.lightbox-arrow { position: absolute; top: 50%; font-size: 1.7rem; width: 58px; height: 58px; transform: translateY(-50%); border-radius: 50%; }
.lightbox-arrow:hover, .lightbox-close:hover { background: rgba(255,255,255,.12); }
.lightbox-prev { left: 9px; }
.lightbox-next { right: 9px; }
.lightbox-figure { width: min(100%, 1500px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; margin: 0; }
#pics-lightbox-img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 155px); object-fit: contain; }
.lightbox-caption { width: 100%; display: flex; justify-content: space-between; gap: 30px; align-items: center; font-size: .8rem; color: #c9c9c9; }
.lightbox-caption strong { color: white; font-weight: 570; margin-right: 15px; }
.lightbox-caption a { text-decoration: underline; text-underline-offset: 3px; color: #e2e2e2; white-space: nowrap; }
.lightbox-caption a:hover { color: white; }
@media (max-width: 980px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .photo-meta { flex-direction: column; gap: 3px; }
  .site-header, .site-main, .site-footer { width: calc(100% - 52px); }
}
@media (max-width: 600px) {
  .site-header, .site-main, .site-footer { width: calc(100% - 32px); }
  .site-header { padding: 26px 0 22px; }
  .brand { font-size: 2.5rem; }
  .main-nav { gap: 20px; font-size: .82rem; }
  .intro { display: block; padding: 45px 0 27px; }
  .intro h1 { font-size: clamp(2.4rem, 9vw, 3.7rem); }
  .archive-shortcut { display: inline-block; margin-top: 23px; }
  .gallery-grid { column-gap: 11px; row-gap: 28px; }
  .photo-link { aspect-ratio: 3 / 4; }
  .photo-title { font-size: .85rem; }
  .photo-meta time { font-size: .7rem; }
  .photo-overlay { display: none; }
  .gallery-pagination { padding: 45px 0; }
  .gallery-pagination .page-numbers { min-width: 32px; height: 35px; padding: 0 6px; }
  .site-footer { padding-bottom: 28px; flex-wrap: wrap; }
  .single-heading { padding: 30px 0 25px; }
  .single-photo { min-height: 200px; padding: 7px; }
  .archive-columns { grid-template-columns: 1fr; gap: 16px; }
  .archive-months { columns: 1; }
  .lightbox { padding: 66px 8px 64px; }
  .lightbox-arrow { top: auto; bottom: 4px; transform: none; font-size: 1.35rem; }
  .lightbox-prev { left: 25px; }
  .lightbox-next { right: 25px; }
  .lightbox-top { left: 15px; right: 15px; top: 8px; }
  #pics-lightbox-img { max-height: calc(100dvh - 200px); }
  .lightbox-caption { display: block; padding: 0 12px; text-align: center; font-size: .74rem; }
  .lightbox-caption strong { display: block; margin: 0 0 3px; }
  .lightbox-caption a { display: inline-block; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* v1.1: chronological archive, grouped into compact annual galleries. */
.year-navigation { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 0 25px; }
.year-chip { display: inline-flex; align-items: center; gap: 13px; padding: 10px 14px; border-radius: 3px; background: #fff; border: 1px solid var(--line); font-size: .91rem; font-weight: 630; }
.year-chip:hover, .year-chip:focus-visible { border-color: var(--accent); }
.year-chip span { color: var(--muted); font-size: .76rem; font-weight: 450; }
.year-section { padding: 28px 0 45px; scroll-margin-top: 24px; border-top: 1px solid var(--line); }
.year-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding-bottom: 22px; }
.year-heading-text { display: flex; align-items: baseline; gap: 17px; }
.year-heading h2 { font-size: clamp(1.75rem, 3vw, 2.6rem); line-height: 1.1; letter-spacing: -.05em; font-weight: 600; margin: 0; }
.year-heading-text span { color: var(--muted); font-size: .81rem; }
.year-heading > a, .archive-back a { font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.year-gallery-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 23px 13px; }
.year-gallery-single { padding-bottom: 45px; }
.archive-photo-card { min-width: 0; }
.archive-photo-link { display: block; aspect-ratio: 1 / 1; background: var(--surface); overflow: hidden; border-radius: 3px; }
.archive-image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, filter .35s ease; }
.archive-photo-link:hover .archive-image, .archive-photo-link:focus-visible .archive-image { transform: scale(1.045); filter: brightness(.9); }
.archive-photo-empty { display: grid; place-items: center; font-size: .75rem; color: var(--muted); }
.archive-photo-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .76rem; color: var(--muted); margin-top: 8px; }
.archive-photo-title:hover { color: var(--text); }
.archive-back { padding: 15px 0 70px; }
.archive-categories { padding: 32px 0 65px; border-top: 1px solid var(--line); }
.archive-categories h2 { margin: 0 0 15px; font-size: 1.14rem; font-weight: 600; }
.category-links { display: flex; gap: 8px; flex-wrap: wrap; }
.category-links a { display: inline-flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 3px; font-size: .82rem; }
.category-links span { color: var(--muted); font-size: .73rem; }
@media (max-width: 980px) {
  .year-gallery-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .year-gallery-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px 9px; }
  .year-heading { align-items: start; }
  .year-heading-text { flex-direction: column; gap: 4px; }
  .year-heading > a { font-size: .74rem; }
  .archive-photo-title { font-size: .72rem; }
}
@media (max-width: 390px) {
  .year-gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* v1.2 — a darker, seamless editorial layout.  It only changes presentation:
   posts, annual archives, original-image lightbox and permalinks are retained. */
:root {
  color-scheme: dark;
  --bg: #101010;
  --surface: #242424;
  --text: #f6f4ef;
  --muted: #aaa8a1;
  --line: rgba(255, 255, 255, .14);
  --accent: #e9a968;
  --content-width: 100%;
}
body { background: var(--bg); color: var(--text); }
a:hover { color: var(--accent); }
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline-color: var(--accent);
  outline-offset: -5px;
}
.site-header {
  width: 100%;
  max-width: none;
  padding: 24px clamp(18px, 4vw, 64px);
  background: var(--bg);
  border-bottom-color: var(--line);
}
.brand {
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}
.main-nav {
  gap: clamp(18px, 3vw, 42px);
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.main-nav a { color: var(--muted); }
.main-nav a:hover,
.main-nav a[aria-current] { color: var(--text); }
.main-nav a[aria-current] { border-bottom-color: var(--accent); }
.site-main {
  width: 100%;
  max-width: none;
  margin: 0;
}
.gallery-intro,
.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(46px, 8vw, 100px) clamp(18px, 4vw, 64px) clamp(30px, 4vw, 54px);
  background: var(--bg);
}
.intro-simple { padding-bottom: clamp(26px, 4vw, 44px); }
.gallery-kicker,
.eyebrow { color: var(--accent); }
.gallery-intro h1,
.intro h1,
.single-heading h1 {
  max-width: 11ch;
  color: var(--text);
  font-size: clamp(2.35rem, 5vw, 5.3rem);
  font-weight: 620;
  letter-spacing: -.075em;
  line-height: .96;
}
.intro h1 { max-width: none; }
.gallery-intro p,
.intro p { color: var(--muted); }
.archive-shortcut {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}
.archive-shortcut:hover { border-bottom-color: var(--accent); }

/* Photographs meet edge-to-edge; there is deliberately no grid gap. */
.gallery-grid,
.year-gallery-grid {
  width: 100%;
  gap: 0;
  background: var(--bg);
}
.photo-card,
.archive-photo-card { min-width: 0; }
.photo-link,
.archive-photo-link {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: var(--surface);
}
.photo-link { aspect-ratio: 4 / 3; }
.archive-photo-link { aspect-ratio: 1 / 1; }
.gallery-image,
.archive-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .75, .2, 1), filter .35s ease;
}
.photo-link::after,
.archive-photo-link::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 44%, rgba(0, 0, 0, .12) 58%, rgba(0, 0, 0, .77) 100%);
  opacity: .9;
}
.photo-link:hover .gallery-image,
.photo-link:focus-visible .gallery-image,
.archive-photo-link:hover .archive-image,
.archive-photo-link:focus-visible .archive-image {
  transform: scale(1.045);
  filter: brightness(.78);
}
.photo-caption,
.archive-photo-caption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
  padding: clamp(16px, 2.25vw, 28px);
  color: #fff;
}
.photo-title,
.archive-photo-title {
  display: -webkit-box;
  max-width: 76%;
  overflow: hidden;
  color: #fff;
  font-size: clamp(.9rem, 1.3vw, 1.15rem);
  font-weight: 620;
  letter-spacing: -.025em;
  line-height: 1.16;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.photo-date,
.archive-photo-date {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .82);
  font-size: .67rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  line-height: 1.2;
  text-align: right;
  text-transform: uppercase;
}
.archive-photo-caption { padding: 12px; }
.archive-photo-title { font-size: .76rem; font-weight: 600; }
.archive-photo-date { font-size: .57rem; }
.photo-meta { display: none; }
.photo-placeholder,
.archive-photo-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.photo-placeholder::after,
.archive-photo-empty::after { display: none; }

.gallery-pagination {
  padding: 52px clamp(18px, 4vw, 64px) 68px;
  background: var(--bg);
}
.gallery-pagination .page-numbers { color: var(--muted); }
.gallery-pagination a.page-numbers:hover,
.gallery-pagination .page-numbers.current {
  color: var(--text);
  background: #1b1b1b;
}
.gallery-pagination .prev,
.gallery-pagination .next { color: var(--text); }
.site-footer {
  width: 100%;
  max-width: none;
  padding: 28px clamp(18px, 4vw, 64px) 36px;
  background: var(--bg);
  border-top-color: var(--line);
  color: var(--muted);
}

/* The same frame carries through to the single photo and annual archive. */
.single-main,
.text-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 64px);
}
.breadcrumb,
.single-description,
.post-neighbors { color: var(--muted); }
.breadcrumb,
.post-neighbors { border-color: var(--line); }
.single-photo { border-radius: 0; background: #181818; }
.single-zoom { background: rgba(0, 0, 0, .65); color: #fff; }
.archives-main .intro { border-bottom: 1px solid var(--line); }
.year-navigation {
  gap: 8px;
  padding: 28px clamp(18px, 4vw, 64px);
  background: var(--bg);
}
.year-chip {
  border-radius: 0;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}
.year-chip:hover,
.year-chip:focus-visible { border-color: var(--accent); }
.year-section {
  margin: 0;
  padding: 0;
  border-top-color: var(--line);
}
.year-heading {
  padding: 27px clamp(18px, 4vw, 64px) 21px;
  background: var(--bg);
}
.year-heading h2 { color: var(--text); }
.year-heading-text span,
.year-heading > a,
.archive-back a { color: var(--muted); }
.year-gallery-single { padding-bottom: 0; }
.archive-back { padding: 28px clamp(18px, 4vw, 64px) 68px; }
.archive-categories {
  padding: 32px clamp(18px, 4vw, 64px) 68px;
  border-top-color: var(--line);
}
.category-links a {
  border-radius: 0;
  border-color: var(--line);
  color: var(--text);
}
.category-links a:hover { border-color: var(--accent); }
.lightbox { background: rgba(6, 6, 6, .98); }

@media (max-width: 600px) {
  .site-header { padding-top: 20px; padding-bottom: 20px; }
  .main-nav { gap: 18px; font-size: .7rem; }
  .gallery-intro,
  .intro {
    display: block;
    padding-top: 48px;
    padding-bottom: 28px;
  }
  .gallery-intro h1,
  .intro h1 { max-width: 12ch; }
  .archive-shortcut { display: inline-block; margin-top: 25px; }
  .photo-link { aspect-ratio: 1 / 1; }
  .photo-caption { padding: 13px; }
  .photo-title { max-width: 72%; font-size: .83rem; }
  .photo-date { font-size: .55rem; }
  .year-gallery-grid { gap: 0; }
  .archive-photo-caption { padding: 8px; }
  .archive-photo-title { max-width: 100%; font-size: .64rem; }
  .archive-photo-date { display: none; }
  .year-heading { padding-top: 23px; padding-bottom: 18px; }
  .site-footer { padding-bottom: 28px; }
}
