/* ============================================================================
   DESIGN SYSTEM — ebbarost.com
   Everything visual lives in this one file. Arial, black on white, no other
   colors. If you ever want to change a color or spacing site-wide, change
   the variable in :root below rather than hunting through the file.
   ============================================================================ */

:root {
  --font: Arial, Helvetica, sans-serif;
  --color-text: #000;
  --color-bg: #fff;
  --line-height: 1.5;

  /* Gap between stacked images in Works/Blog columns: ~1.5x line-height. */
  --image-gap: 2.25em;

  /* Desktop nav sidebar. */
  --nav-width: 220px;
  --nav-gutter: 48px;

  /* How far Works/Blog image columns sit right of the base content edge,
     so they don't crowd the nav sidebar. Text blocks (intro/outro/about/
     contact) do NOT get this extra offset — only image columns do. */
  --image-offset: 6vw;

  /* Comfortable reading width for body text blocks. */
  --text-max-width: 640px;

  /* Below this width, the nav switches from a fixed sidebar to a top bar. */
  --mobile-breakpoint: 860px;
}

/* ---- Reset --------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================================================
   NAVIGATION
   Same HTML on every screen size (see layouts/partials/nav.html) — only the
   CSS below changes between the desktop sidebar and the mobile top bar.
   ============================================================================ */

.site-nav {
  font-family: var(--font);
}

.nav-logo {
  display: block;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-links li {
  margin-top: 0.5em;
}

.nav-links a {
  font-size: 1.0625rem; /* between body text (1rem) and the logo */
}

.nav-links a[aria-current="page"] {
  text-decoration: underline;
}

.nav-toggle {
  display: none; /* shown only on mobile, see media query below */
}

/* ---- Desktop: fixed left sidebar ------------------------------------------ */

@media (min-width: 861px) {
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nav-width);
    height: 100vh;
    padding: 40px 24px;
    overflow-y: auto;
  }

  .nav-bar {
    display: block;
  }

  .nav-links {
    display: block;
    margin-top: 32px;
  }

  .site-main {
    margin-left: calc(var(--nav-width) + var(--nav-gutter));
    padding: 40px 40px 80px 0;
  }
}

/* ---- Mobile: top bar + toggle-open link list ------------------------------ */

@media (max-width: 860px) {
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--color-bg);
  }

  .nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
  }

  .nav-logo {
    font-size: 1.375rem;
  }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
  }

  .nav-toggle span {
    display: block;
    height: 2px;
    background: var(--color-text);
  }

  .nav-links {
    display: none;
    flex-direction: column;
    padding: 0 20px 24px;
  }

  .nav-links li {
    margin-top: 0;
    border-top: 1px solid #ddd;
  }

  .nav-links a {
    display: block;
    padding: 14px 0; /* generous tap target */
  }

  /* JS toggles this class on #site-nav when the hamburger is tapped. */
  .site-nav.nav-open .nav-links {
    display: flex;
  }

  .site-main {
    margin-left: 0;
    padding: 76px 20px 60px; /* top padding clears the fixed top bar */
  }
}

/* ============================================================================
   LANDING PAGE
   ============================================================================ */

.landing {
  max-width: 900px;
}

.landing picture,
.landing img {
  width: 100%;
}

/* ============================================================================
   SHARED: image columns (Works single page + Blog feed)
   Offset slightly right of the base content edge so images don't crowd the
   nav. Text blocks (intro/outro/about/contact) intentionally do NOT use
   this class, so they stay flush with the rest of the page.
   ============================================================================ */

.image-column {
  display: flex;
  flex-direction: column;
}

@media (min-width: 861px) {
  .image-column {
    margin-left: var(--image-offset);
  }
}

.image-item {
  margin: 0 0 var(--image-gap);
  max-width: 720px;
}

.image-item:last-child {
  margin-bottom: 0;
}

.image-item .lightbox-trigger {
  display: block;
  width: 100%;
}

.caption {
  margin: 0.5em 0 0;
  font-size: 0.9rem;
  color: #444;
}

/* ============================================================================
   WORKS — grid
   ============================================================================ */

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px 32px;
  max-width: 1100px;
}

.works-grid-item {
  display: block;
}

.works-grid-item picture,
.works-grid-item img {
  width: 100%;
}

.works-grid-title {
  display: block;
  margin-top: 0.75em;
  font-size: 1rem;
}

@media (max-width: 1100px) and (min-width: 621px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .works-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ============================================================================
   WORKS — single piece page
   ============================================================================ */

.work-text {
  max-width: var(--text-max-width);
}

.work-intro {
  margin-bottom: var(--image-gap);
}

.work-outro {
  margin-top: var(--image-gap);
}

/* ============================================================================
   BLOG — feed + year/month jump nav
   ============================================================================ */

.blog-layout {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

.blog-jump {
  flex: 0 0 140px;
  position: sticky;
  top: 40px;
  font-size: 0.9rem;
}

.blog-jump-year {
  font-weight: bold;
  margin-top: 1.25em;
}

.blog-jump-year:first-child {
  margin-top: 0;
}

.blog-jump-months a {
  display: block;
  padding: 0.15em 0;
}

.blog-feed {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 860px) {
  .blog-layout {
    flex-direction: column;
    gap: 24px;
  }

  .blog-jump {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    width: 100%;
  }

  .blog-jump-year {
    width: 100%;
    margin-top: 0.5em;
  }

  .blog-jump-months {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
  }
}

/* ============================================================================
   TEXT PAGES (About / Contact)
   ============================================================================ */

.text-page {
  max-width: var(--text-max-width);
}

.text-page h1 {
  font-size: 1.5rem;
  margin: 0 0 1em;
}

.text-page-body p {
  margin: 0 0 1em;
}

/* ============================================================================
   LIGHTBOX
   ============================================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-stage {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  cursor: zoom-in;
  touch-action: pinch-zoom;
}

.lightbox-stage.zoomed {
  cursor: grab;
}

.lightbox-stage.zoomed:active {
  cursor: grabbing;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.15s ease;
  transform-origin: center center;
  user-select: none;
}

.lightbox-image.zoomed {
  max-width: none;
  max-height: none;
  transform: scale(2.2);
}

.lightbox-caption {
  margin: 16px 0 0;
  font-size: 0.9rem;
  text-align: center;
  max-width: 700px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  font-size: 2rem;
  line-height: 1;
  padding: 12px 16px;
}

.lightbox-close {
  top: 12px;
  right: 12px;
}

.lightbox-prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 860px) {
  .lightbox-close,
  .lightbox-prev,
  .lightbox-next {
    font-size: 1.75rem;
    padding: 10px 14px;
  }
}
