/* =================================================================
   Tokens — extracted from the original arles.pub Format theme
   ================================================================= */
:root {
  --bg: #080d0f;
  --fg: #c7be89;
  --fg-mute: rgba(199, 190, 137, 0.5);
  --fg-soft: rgba(199, 190, 137, 0.75);
  --hover: #b39906;
  --border-mute: rgba(199, 190, 137, 0.15);

  --font-sans: "Work Sans", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "Cousine", ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-h: 70px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.gallery, body.nested_gallery {
  overflow: hidden;
  height: 100%;
  position: relative;
}

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

a { color: var(--fg); text-decoration: none; transition: color 200ms ease; }
a:hover { color: var(--hover); }

::selection { background: var(--fg); color: var(--bg); }

/* =================================================================
   Header (logo + breadcrumb)
   ================================================================= */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  padding: 22px 40px;
  z-index: 90;
  pointer-events: none;
}
.header > * { pointer-events: auto; }

.logo { margin: 0; position: relative; z-index: 2; }
.logo a {
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.page-name-small {
  position: absolute;
  inset: 0 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.page-name-small > * { pointer-events: auto; }
.page-name-small .breadcrumb-link { color: var(--fg); }
.page-name-small .breadcrumb-link:hover { color: var(--hover); }
.page-name-small .separator { margin: 0 14px; opacity: 0.6; }
.page-name-small .page-name { display: inline-block; }
.page-name-small .overview-icon {
  margin-left: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: transform 200ms ease;
}
.page-name-small .overview-icon:hover { transform: scale(1.1); }

body.page-photos .page-name-small,
body.listing:not(.nested_gallery) .page-name-small {
  /* Home/photos listing: show only logo, hide breadcrumb */
  display: none;
}

/* =================================================================
   Burger
   ================================================================= */
.burger {
  position: fixed;
  top: 16px;
  right: 28px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 200;
}
.burger-segments {
  position: relative;
  display: block;
  width: 18px;
  height: 14px;
}
.burger-top, .burger-bottom {
  position: absolute;
  left: 0;
  width: 18px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 250ms ease, top 250ms ease, bottom 250ms ease;
}
.burger-top { top: 4px; }
.burger-bottom { bottom: 4px; }
body.menu-open .burger-top { top: 7px; transform: rotate(45deg); }
body.menu-open .burger-bottom { bottom: 5.5px; transform: rotate(-45deg); }

/* =================================================================
   Slide-in menu
   ================================================================= */
.menu-container {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease-in-out;
  z-index: 150;
}
body.menu-open .menu-container {
  opacity: 1;
  pointer-events: auto;
}
.menu {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--bg);
  padding: 90px 50px 40px;
  overflow-y: auto;
  transform: translate3d(20px, 0, 0);
  transition: transform 250ms ease-in-out 0ms;
  display: flex;
  flex-direction: column;
}
body.menu-open .menu {
  transform: translate3d(0, 0, 0);
  transition-delay: 250ms;
}

.main-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.main-menu .item a {
  display: block;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--fg);
  transition: color 200ms ease;
}
.main-menu .item a:hover { color: var(--hover); }
.main-menu .item.selected a { color: var(--hover); }

.main-menu .social {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--border-mute);
}
.main-menu .social nav {
  display: flex;
  gap: 22px;
  align-items: center;
}
.social-link, .social-share {
  width: 22px;
  height: 22px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms ease;
}
.social-link:hover, .social-share:hover { color: var(--hover); }
.social-icon { width: 18px; height: 18px; }

.main-menu .footer {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-mute);
}
.main-menu .footer footer {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* =================================================================
   LISTING (home / photos)
   ================================================================= */
.main { min-height: 100vh; }

body.listing:not(.nested_gallery) .main { padding: 0; }

.collection-assets-container.is-compact {
  display: flex;
  flex-wrap: wrap;
  margin-top: 100px;
  /* Cap total width on ultra-wide screens; tiles keep the original
     centred-within-cell layout, the pair just stops growing past here. */
  max-width: 1680px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.collection-assets-container.is-compact .asset {
  width: 50%;
  min-height: min(50vw, 840px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  position: relative;
}
.collection-assets-container.is-compact .asset a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
}
.collection-image-container {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  transition: background-color 250ms ease;
}
.collection-image-container img {
  max-width: 62%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 600ms ease, box-shadow 250ms ease;
}
.is-compact .asset:hover .collection-image-container img {
  transform: scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
}
.collection-image-title {
  margin-top: 22px;
  text-align: center;
  font-family: var(--font-sans);
}
.collection-image-title .title {
  color: var(--fg);
  font-weight: 400;
  font-size: 21px;
  line-height: 1.3;
  transition: color 250ms ease;
}
.collection-image-title .see-more {
  color: var(--fg-mute);
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.is-compact .asset:hover .collection-image-title .title { color: var(--hover); }
.collection-caption-container { display: none; }

@media (max-width: 767px) {
  .collection-assets-container.is-compact { margin-top: 70px; }
  .collection-assets-container.is-compact .asset {
    width: 100vw;
    min-height: 90vh;
  }
  .collection-image-container { padding: 40px 20px; }
  .collection-image-container img { max-width: 80%; }
  .collection-image-title .title { font-size: 30px; }
}

/* =================================================================
   GALLERY (horizontal scroll, each item 50vw × 100vh)
   ================================================================= */
.main.gallery-container {
  height: 100vh;
  padding: 0;
  position: relative;
}
.assets-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.assets-container::-webkit-scrollbar { display: none; }
.assets-container.is-dragging { cursor: grabbing; }
/* Snap to slide boundaries (one slide width = 50vw on desktop, 100vw on
   mobile). This matches the step size used by our keyboard/button nav so
   smooth-scrolled targets aren't pulled to a different snap point. */
.assets-container > * { scroll-snap-align: start; }

.title-element {
  flex-shrink: 0;
  width: 50vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}
.title-element .text {
  position: relative;
  max-width: 500px;
  width: 80%;
  text-align: center;
}
.title-element h2 {
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.4;
  margin: 0 0 18px;
}
.title-element p {
  color: var(--fg);
  font-size: 15px;
  line-height: 1.7;
  margin: 0.4em 0;
}

.asset.image,
.asset.text {
  flex-shrink: 0;
  width: 50vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.asset.image img {
  object-fit: contain;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0.001;
  transition: opacity 300ms ease;
}
.asset.image img.loaded { opacity: 1; }
.asset.image.is-landscape img,
.asset.image.is-square img {
  max-width: 550px;
  width: 80%;
  height: auto;
}
.asset.image.is-portrait img {
  max-height: 700px;
  height: 64vh;
  width: auto;
  max-width: 90%;
}

.asset.text .text-content {
  position: relative;
  max-width: 500px;
  width: 80%;
  padding: 20px;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}
.asset.text .text-content p {
  margin: 0.4em 0;
}

/* Next-gallery teaser at the end of the scrolling row */
.next-nested-page {
  flex-shrink: 0;
  width: 50vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}
.nexted-nested-page-title {
  padding-left: 20px;
  padding-right: 110px;
  z-index: 2;
  pointer-events: none;
}
.nexted-nested-page-title .title {
  color: var(--fg);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.3;
  transition: color 250ms ease;
}
.next-nested-page:hover .nexted-nested-page-title .title { color: var(--hover); }
.nexted-nested-page-title .see-more {
  color: var(--fg-soft);
  font-size: 14px;
  margin-top: 6px;
}
.nexted-nested-page-cover-image {
  transition: opacity 250ms ease, transform 250ms ease;
  transform: translate(100%, -50%);
  opacity: 0.5;
  position: absolute;
  top: 50%;
  right: 90px;
  max-width: 600px;
  width: 80%;
}
.next-nested-page:hover .nexted-nested-page-cover-image { opacity: 1; }

@media (max-width: 767px) {
  .title-element,
  .asset.image,
  .asset.text,
  .next-nested-page { width: 100vw; }
  /* Match original: hide top breadcrumb on mobile; bottom link is enough. */
  body.gallery .page-name-small,
  body.nested_gallery .page-name-small { display: none; }
  /* Keep intro copy below the fixed header (logo). */
  .title-element {
    padding-top: calc(var(--header-h) + 20px);
    padding-bottom: 56px;
    box-sizing: border-box;
  }
  .title-element h2 { font-size: 24px; }
  .nexted-nested-page-cover-image { right: 50%; transform: translate(50%, -50%); opacity: 0.3; }
  .nexted-nested-page-title { padding: 0 20px; text-align: center; }
}

/* =================================================================
   Gallery — bottom-left back link and bottom-center counter
   ================================================================= */
.breadcrumb-link.bottom {
  position: fixed;
  bottom: 20px;
  left: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg);
  z-index: 60;
  transition: color 200ms ease;
}
.breadcrumb-link.bottom:hover { color: var(--hover); }

.gallery-counter {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 60;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.gallery-counter.hidden { opacity: 0; }

/* --- Prev / next slide buttons -------------------------------------- */
.gallery-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 64px;
  height: 96px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--fg);
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 200ms ease, color 200ms ease, transform 200ms ease;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-nav svg {
  display: block;
  width: 32px;
  height: 32px;
}
.gallery-nav:hover { opacity: 1; color: var(--hover); }
.gallery-nav:focus-visible { opacity: 1; outline: none; }
.gallery-nav-prev { left: 0; }
.gallery-nav-prev:hover { transform: translateY(-50%) translateX(-2px); }
.gallery-nav-next { right: 0; }
.gallery-nav-next:hover { transform: translateY(-50%) translateX(2px); }
.gallery-nav.disabled {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  .breadcrumb-link.bottom { bottom: 14px; left: 16px; }
  /* On touch devices, swipe is the natural gesture; hide the arrows. */
  .gallery-nav { display: none; }
}

/* =================================================================
   Zoom lightbox (click image → fullscreen)
   ================================================================= */
.gallery-zoom-container {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 15, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  z-index: 250;
}
.gallery-zoom-container.active {
  opacity: 1;
  pointer-events: auto;
  cursor: zoom-out;
}
.gallery-zoom-container img {
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.gallery-zoom-container.landscape img { width: auto; height: 100vh; max-width: 100vw; }
.gallery-zoom-container.portrait img { width: auto; height: 100vh; max-width: 100vw; }

/* =================================================================
   Overview grid (click ▦ icon in breadcrumb → grid of all images)
   ================================================================= */
.gallery-overview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 15, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
  z-index: 180;
  overflow-y: auto;
}
.gallery-overview-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.gallery-overview-inner {
  display: flex;
  flex-wrap: wrap;
  padding: 80px 40px 80px;
  align-items: stretch;
}
.overview-asset {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px;
  padding: 20px;
  min-height: 360px;
  width: calc(33.333% - 60px);
}
.overview-asset.image img {
  cursor: pointer;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  transition: transform 250ms ease;
}
.overview-asset.image img:hover { transform: scale(1.04); }
.overview-asset.text .text-content {
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 36px 22px;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  width: 100%;
}
/* Title/intro card behaves like a clickable thumbnail. */
.overview-asset-title { cursor: pointer; }
.overview-asset-title .text-content {
  transition: border-color 200ms ease, color 200ms ease, transform 200ms ease;
}
.overview-asset-title:hover .text-content {
  border-color: var(--hover);
  color: var(--hover);
  transform: scale(1.02);
}
.overview-asset-title h2 {
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 12px;
  color: inherit;
}
.overview-asset-title p { margin: 0.3em 0; color: inherit; }
.close-overview {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--fg);
  font-size: 3rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
}
.close-overview:hover { color: var(--hover); }

@media (max-width: 1024px) {
  .overview-asset { width: calc(50% - 60px); min-height: 280px; }
}
@media (max-width: 600px) {
  .gallery-overview-inner { padding: 70px 16px 80px; }
  .overview-asset { margin: 12px; width: calc(50% - 24px); min-height: 200px; padding: 0; }
}

/* =================================================================
   About page (text+banner)
   ================================================================= */
.main.about-page { padding: var(--header-h) 0 80px; }

.about-cover {
  width: 100%;
  height: 50vh;
  max-height: 600px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}
.about-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 760px) {
  .about-cover { height: 35vh; }
}

.about-blocks {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 60px;
  max-width: 1100px;
  margin: 70px auto 0;
  padding: 0 40px;
}
@media (max-width: 760px) {
  .about-blocks { grid-template-columns: 1fr; gap: 36px; padding: 0 24px; margin-top: 40px; }
}
.about-block h2 {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--fg);
  font-size: 26px;
  margin: 0 0 18px;
}
.about-block p {
  color: var(--fg);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 1em;
}
.about-block a {
  color: var(--hover);
  font-weight: 600;
}
.about-block a:hover {
  text-decoration: underline;
}

/* =================================================================
   Mobile header adjustments
   ================================================================= */
@media (max-width: 767px) {
  .header { padding: 18px 20px; }
  .burger { right: 8px; }
}
