/* GLOBAL DESIGN SETTINGS
   Change these values to adjust the site's colors, type, spacing, and image sizes.
   The mobile section below replaces some of them for narrow screens. */
:root {
  --page-background: #fff;
  --text-color: #181818;
  --muted-color: #363636;
  --accent-color: #2755c7;
  --font-family: "Asap", "Segoe UI", Arial, sans-serif;
  --artist-name-size: 20px;
  --navigation-size: 11px;
  --caption-size: 11px;
  --sidebar-width: 260px;
  --sidebar-left-padding: 45px;
  --sidebar-top-offset: 22vh;
  --page-gutter: 5vw;
  --gallery-slide-width: 68vw;
  --gallery-slide-max-width: 880px;
  --gallery-gap: 3.2vw;
  --gallery-image-max-height: 70vh;
  --home-image-width: 85%;
  --home-image-max-width: 892.5px;
  --home-image-max-height: 64.6vh;
  --home-image-top-offset: 16vh;
  --gallery-top-offset: 16vh;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Make widths and heights include their padding and borders. */
* {
  box-sizing: border-box;
}

/* Set basic browser-page behavior and prevent very narrow layouts. */
html {
  min-width: 320px;
  scroll-behavior: smooth;
}

/* Default page colors and font. Individual elements inherit these values. */
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page-background);
  color: var(--text-color);
  font-family: var(--font-family);
}

/* Links start with the same color as nearby text. */
a {
  color: inherit;
}

/* LEFT SIDEBAR
   Keeps the artist name and navigation fixed on the left on desktop. */
.sidebar {
  position: fixed;
  z-index: 2;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: var(--sidebar-top-offset) 20px 32px var(--sidebar-left-padding);
  background: var(--page-background);
}

/* Artist name at the top of the left-side menu. */
.wordmark {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  font-family: inherit;
  font-size: var(--artist-name-size);
  font-weight: 400;
  line-height: 1.15;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Spacing between the artist name and the menu. */
.site-navigation {
  margin-top: 31px;
}

/* Arrange menu entries vertically on desktop. */
.navigation-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Appearance of each menu link. */
.navigation-list a {
  display: inline-block;
  font-size: var(--navigation-size);
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
}

/* Highlight the menu item under the pointer or for the open page. */
.navigation-list a:hover,
.navigation-list a[aria-current="page"] {
  color: var(--accent-color);
  text-decoration: none;
}

/* MAIN AREA
   Leaves room for the fixed sidebar and holds the selected page. */
main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

/* Only the home page or the selected menu page should be visible. */
.page-view[hidden] {
  display: none;
}

/* HOMEPAGE
   Positions the featured artwork in the main area. */
.home-page {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
  justify-content: center;
  padding: var(--home-image-top-offset) 5vw 36px;
}

/* Width of the homepage artwork and its caption together. */
.featured-work {
  width: min(var(--home-image-width), var(--home-image-max-width));
  margin: 0;
}

/* Keep the featured artwork inside its available area without cropping it. */
.featured-image {
  display: block;
  width: 100%;
  max-height: var(--home-image-max-height);
  object-fit: contain;
  object-position: center;
}

/* Shared small caption style for featured and gallery works. */
.image-caption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 12px;
  color: var(--muted-color);
  font-size: var(--caption-size);
  font-weight: 400;
  line-height: 1.5;
}

.caption-title {
  font-weight: 400;
  font-style: italic;
}

.painting-dot-caption {
  position: relative;
}

.painting-title-dot {
  position: absolute;
  top: 0.4em;
  left: -18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #7a1f1f;
}

.caption-detail {
  opacity: 0.7;
}

/* ARTWORK AND VIDEO GALLERIES
   Each category is a separate page with its own horizontal rail. */
.gallery-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--gallery-top-offset) 0 24px;
}

/* Row above the rail, used for the previous/next buttons. */
.gallery-heading {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 var(--page-gutter) 12px;
}

/* Small section heading, used on biography, contact, and experience pages. */
.page-title {
  margin: 0;
  font-size: var(--caption-size);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
  text-transform: uppercase;
}

/* INDEX PAGES FOR PHOTOGRAPHY, VIDEO, AND EXHIBITION PROJECTS */
.project-index-page {
  min-height: 100vh;
  padding: var(--gallery-top-offset) var(--page-gutter) 48px;
}

.project-index-title {
  margin: 0 0 34px;
  font-size: var(--caption-size);
  font-weight: 400;
  text-transform: uppercase;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(264px, 100%), 1fr));
  gap: 42px 28px;
  max-width: 1280px;
}

.project-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.project-thumbnail,
.project-thumbnail-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 2;
  align-items: center;
  justify-items: center;
  background: #f5f5f3;
  color: #777;
}

.project-thumbnail {
  object-fit: cover;
  object-position: center;
}

.project-thumbnail-placeholder {
  font-size: 11px;
}

.project-card-caption {
  margin-top: 10px;
}

.project-card-title {
  margin-top: 0;
  font-size: var(--caption-size);
  font-style: italic;
  line-height: 1.5;
}

.project-card:hover .project-card-title,
.project-card:focus-visible .project-card-title {
  color: var(--accent-color);
}

.project-card:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.project-empty-message {
  margin: 0;
  color: #777;
  font-size: 11px;
}

/* Keep the previous/next buttons together at the right side of the gallery. */
.gallery-controls {
  display: flex;
  gap: 14px;
}

/* Minimal arrow buttons that move the gallery rail horizontally. */
.gallery-arrow {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #202020;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
}

/* A disabled arrow is faded when there are no more works in that direction. */
.gallery-arrow:disabled {
  color: #c4c4c4;
  cursor: default;
}

/* Visible keyboard focus outlines for links and gallery controls. */
.gallery-arrow:focus-visible,
.navigation-list a:focus-visible,
.wordmark:focus-visible,
.contact-link:focus-visible,
.project-back-link:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.project-back-link {
  color: #202020;
  font-size: var(--caption-size);
  text-decoration: none;
  text-transform: uppercase;
}

.project-back-link:hover {
  color: var(--accent-color);
}

/* Center each gallery item and leave enough end padding to center the first and last. */
.gallery-track {
  display: flex;
  gap: var(--gallery-gap);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 0 max(0px, calc((100% - min(var(--gallery-slide-width), var(--gallery-slide-max-width))) / 2)) 14px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(0px, calc((100% - min(var(--gallery-slide-width), var(--gallery-slide-max-width))) / 2));
  scrollbar-color: #d7d7d7 transparent;
  scrollbar-width: thin;
}

/* Empty photo/video categories show a centered message instead of a blank rail. */
.gallery-track.empty-gallery {
  min-height: min(58vh, 560px);
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Message shown until an empty category receives its first work. */
.gallery-empty-message {
  margin: 0;
  color: #777;
  font-size: 11px;
}

/* Focus outline when someone tabs to a gallery and uses the arrow keys. */
.gallery-track:focus-visible {
  outline: 1px solid #999;
  outline-offset: -2px;
}

/* One work in the scrolling row. Its width is controlled by the settings above. */
.gallery-slide {
  display: flex;
  flex: 0 0 min(var(--gallery-slide-width), var(--gallery-slide-max-width));
  flex-direction: column;
  margin: 0;
  scroll-snap-align: center;
}

.gallery-track.has-multiple-slides .gallery-slide {
  cursor: pointer;
}

/* Images keep their proportions and are not cropped by the gallery. */
.gallery-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: var(--gallery-image-max-height);
  object-fit: contain;
  object-position: left top;
}

/* Video player styling; the browser provides the playback controls. */
.gallery-video {
  display: block;
  width: 100%;
  max-height: var(--gallery-image-max-height);
  background: #f0f0f0;
  object-fit: contain;
}

.gallery-vimeo-embed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #f0f0f0;
}

.media-error {
  margin: 0;
  color: #777;
  font-size: 12px;
}

/* Text-only works use a centered card in the horizontal rail. */
.text-slide {
  min-height: min(60vh, 600px);
  justify-content: center;
}

/* Keep a long text-only caption from spanning too wide. */
.text-slide .image-caption {
  max-width: 520px;
}

/* TEXT PAGES
   Shared spacing for experience, biography, and contact information. */
.text-page {
  min-height: 100vh;
  padding: 9vh 8vw 6vh;
}

/* Add space below the page title before the text begins. */
.text-page > .page-title {
  margin-bottom: 42px;
}

/* Each experience role and its list of details. */
.experience-entry {
  max-width: 620px;
  margin: 0 0 34px;
}

/* Role or employer heading within the experience page. */
.experience-role {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 400;
}

/* Unbulleted details for each experience entry. */
.experience-list {
  margin: 0;
  padding: 0;
  color: #454545;
  font-size: 12px;
  line-height: 1.8;
  list-style: none;
}

/* Biography paragraph width and line spacing. */
.biography-copy {
  max-width: 650px;
  margin: 0;
  color: #363636;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.contact-copy {
  max-width: 650px;
  margin: 0 0 20px;
  color: #363636;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-line;
}

/* Email and phone links on the contact page. */
.contact-link {
  display: block;
  width: fit-content;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.7;
  text-decoration: none;
}

/* Underline contact links on hover so they are easy to identify. */
.contact-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Keep accessible headings available to screen readers while hiding them visually. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

/* MOBILE LAYOUT
   Move the menu above the page and make it scroll sideways on small screens.
   These settings also reduce image sizes and spacing for phones. */
@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
    --page-gutter: 6vw;
    --artist-name-size: 16px;
    --gallery-slide-width: 86vw;
    --gallery-image-max-height: 62vh;
    --home-image-max-height: 59.5vh;
    --home-image-top-offset: 0px;
    --gallery-top-offset: 26px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    justify-content: flex-start;
    width: 100%;
    padding: 17px 20px 14px;
    border-bottom: 1px solid #ededed;
  }

  /* Turn the vertical desktop menu into a single horizontal row. */
  .site-navigation {
    overflow-x: auto;
    margin-top: 16px;
    scrollbar-width: none;
  }

  .site-navigation::-webkit-scrollbar {
    display: none;
  }

  .navigation-list {
    width: max-content;
    flex-direction: row;
    gap: 20px;
    padding: 1px 2px 4px;
  }

  .navigation-list a {
    white-space: nowrap;
  }

  /* Remove desktop sidebar spacing from the page content. */
  main {
    margin-left: 0;
  }

  .home-page {
    align-items: center;
    min-height: calc(100vh - 90px);
    padding: 28px 5vw;
  }

  .gallery-page {
    min-height: calc(100vh - 90px);
    padding-top: clamp(68px, 10vh, 100px);
  }

  .project-index-page {
    min-height: calc(100vh - 90px);
    padding-top: var(--gallery-top-offset);
  }

  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(168px, 100%), 1fr));
    gap: 28px 16px;
  }

  /* Keep text-only gallery cards a comfortable height on phones. */
  .text-slide {
    min-height: min(62vh, 680px);
  }

  .text-page {
    min-height: calc(100vh - 90px);
    padding: 8vh 7vw 5vh;
  }
}

/* Respect the visitor's reduced-motion preference by disabling smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
  html,
  .gallery-track {
    scroll-behavior: auto;
  }
}
