/*
Theme Name: Lewis Denby
Description: A photography portfolio with a scrolling homepage and individual project galleries.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 7.4
Author: Lewis Denby
License: GNU General Public License v2 or later
Text Domain: lewis-denby
*/

:root {
  --paper: #fcfbf5;
  --ink: #191919;
  --gutter: clamp(18px, 4vw, 64px);
  --copy: min(42vw, 58rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--wp-admin--admin-bar--height, 0px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.45 "Courier New", Courier, monospace;
}
a { color: inherit; text-underline-offset: .18em; }
button { color: inherit; font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 100000;
  top: calc(var(--wp-admin--admin-bar--height, 0px) + .5rem);
  left: .5rem;
  width: auto;
  height: auto;
  padding: .5rem;
  clip-path: none;
  background: var(--paper);
}

.masthead { padding: clamp(20px, 1.15vw, 32px) var(--gutter) 0; text-align: center; }
.wordmark { display: inline-block; font-size: clamp(2.5rem, 4.35vw, 6.5rem); line-height: 1; text-decoration: none; text-transform: uppercase; }
.site-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 clamp(14px, 3vw, 64px); }
.site-nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  font-size: clamp(.95rem, 1.6vw, 2.35rem);
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a:hover, .site-nav a:focus-visible { font-weight: bold; }
.hero, .copy-section, .portfolio { min-height: calc(100svh - var(--wp-admin--admin-bar--height, 0px)); }
.hero { display: flex; flex-direction: column; }
.hero-stage { flex: 1; display: grid; place-items: center; padding: 28px var(--gutter) clamp(40px, 5vw, 116px); }
.copy-section { display: grid; place-items: center; padding: 64px var(--gutter); }
.copy {
  width: var(--copy);
  font-size: clamp(1.35rem, 2.2vw, 3rem);
  line-height: 1.22;
  text-align: justify;
  overflow-wrap: anywhere;
}
.copy p { margin: 0 0 1.2em; }
.copy p:last-child { margin-bottom: 0; }
.portfolio { padding: clamp(44px, 4vw, 90px) var(--gutter); }
.project-list { width: min(56vw, 84rem); margin: 0 auto; padding: 0; list-style: none; display: grid; gap: clamp(44px, 5.4vw, 120px); }
.project-card { justify-self: start; min-width: 0; max-width: 100%; }
.project-card:nth-child(even) { justify-self: end; }
.project-card a { display: block; text-decoration: none; }
.project-card img { display: block; width: min(21vw, 31rem); max-width: 100%; height: auto; }
.project-card h2 { margin: .5em 0 0; font-size: clamp(1.25rem, 2.05vw, 3rem); line-height: 1.15; font-weight: normal; }
.project-card a:hover h2, .project-card a:focus-visible h2 { text-decoration: underline; }

.carousel { position: relative; min-width: 0; }
.hero .carousel { width: min(42vw, 70rem); }
.slides { margin: 0; padding: 0; list-style: none; }
.slide { margin: 0; }
.slide img { display: block; width: 100%; height: auto; object-fit: contain; }
.carousel.is-ready .slide img { height: 100%; }
.hero .carousel.is-ready .slide { height: min(28vw, 54svh, 46.67rem); }
.carousel button { border: 0; background: transparent; cursor: pointer; min-width: 44px; min-height: 44px; }
.carousel button:hover { font-weight: bold; }
.project-page { padding: clamp(42px, 4.5vw, 110px) var(--gutter) 36px; text-align: center; }
.project-page .carousel { width: min(55.6vw, 96rem); margin: 0 auto; }
.project-page .carousel.is-ready .slide { height: min(37.07vw, 66svh, 64rem); }
.project-controls { position: absolute; inset: 0; pointer-events: none; }
.project-controls button { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: auto; font-size: clamp(2rem, 2.8vw, 4rem); }
.project-controls [data-prev] { right: calc(100% + clamp(4px, 1.6vw, 34px)); }
.project-controls [data-next] { left: calc(100% + clamp(4px, 1.6vw, 34px)); }
.project-page h1 { margin: .9em auto 0; font-size: clamp(1.5rem, 2.2vw, 3.25rem); line-height: 1.15; font-weight: normal; overflow-wrap: anywhere; }
.entry { max-width: 58rem; margin: 3rem auto; padding-inline: var(--gutter); text-align: left; overflow-wrap: anywhere; }
.entry img { max-width: 100%; height: auto; }
.project-page .entry { padding-inline: 0; }

@media (max-width: 760px) {
  :root { --copy: min(100%, 36rem); }
  .masthead { padding-top: 28px; }
  .wordmark { font-size: clamp(1.7rem, 8vw, 3.8rem); }
  .site-nav { gap: 0 clamp(9px, 3vw, 24px); }
  .site-nav a { font-size: clamp(.75rem, 3.35vw, 1rem); }
  .hero .carousel, .project-page .carousel { width: min(100%, 42rem); }
  .hero .carousel.is-ready .slide { height: min(109vw, 57svh, 34rem); }
  .project-page .carousel.is-ready .slide { height: min(109vw, 61svh, 39rem); touch-action: pan-y; }
  .copy { text-align: left; font-size: clamp(1.22rem, 5vw, 1.7rem); }
  .project-list { width: min(100%, 36rem); }
  .project-card, .project-card:nth-child(even) { justify-self: stretch; }
  .project-card img { width: 100%; }
  .project-controls { position: static; display: flex; justify-content: space-between; pointer-events: auto; }
  .project-controls button { position: static; transform: none; line-height: 1; }
  .project-page h1 { margin-top: .55em; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 760px) {
  .hero .carousel.is-ready:not(.has-portrait) .slide,
  .project-page .carousel.is-ready:not(.has-portrait) .slide { height: min(66vw, 55svh, 28rem); }
}

.project-page .carousel.is-ready .slides {
  display: flex;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  direction: ltr;
}
.project-page .carousel.is-ready .slide { flex: 0 0 100%; min-width: 0; }
