/* -------------------------
   Font: Plain
   ------------------------- */
@font-face {
  font-family: "Plain";
  src: url("font/Plain-Ultrathin/Plain-Ultrathin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plain";
  src: url("font/Plain-Light/Plain-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plain";
  src: url("font/Plain-Regular/Plain-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plain";
  src: url("font/Plain-Super/Plain-Super.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* -------------------------
   Reset / base
   ------------------------- */
html {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}

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

:root {
  --header-height: 50px;
  --page-padding-x: clamp(14px, 3vw, 24px);
  --carousel-height: clamp(320px, 60vh, 520px);
  --section-gap: 60px;

  --color-bg: #ffffff;
  --color-text: #000;

  --glass-blur: 12px;
  --overlay-ms: 400ms;
}

@media (min-width: 600px) {
  :root {
    --carousel-height: clamp(420px, 70vh, 760px);
    --section-gap: 138px;
  }
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  font-size: 15px;
  font-family: "Plain", "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent scrolling when overlay is open */
body.overlay-active {
  overflow: hidden;
}

main {
  padding-top: var(--header-height);
}

.spacer-80 {
  height: var(--section-gap);
}

.body-section {
  scroll-margin-top: var(--header-height);
}

/* -------------------------
   Carousel (no gaps)
   ------------------------- */
.carousel {
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}

.carousel-track {
  display: flex;
  gap: 0;
  height: var(--carousel-height);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-image {
  display: block;
  height: 100%;
  width: auto;
  flex: 0 0 auto;
  object-fit: cover;
  border: 2px solid var(--color-bg);
}

.carousel-caption {
  box-sizing: border-box;
  padding: 10px var(--page-padding-x) 0;
  font-size: 14px;
  font-style: normal;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .carousel-caption {
    font-size: 11px;
    padding-top: 8px;
  }
}

.carousel-caption-lead {
  font-weight: 700;
  font-style: normal;
}

.photographer-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 160ms ease;
}

.photographer-link:hover {
  opacity: 0.5;
}

/* -------------------------
   Archives mosaic
   ------------------------- */
.archives-mosaic {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0;
}

@media (max-width: 600px) {
  .mosaic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mosaic-item {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.mosaic-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mosaic-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.mosaic-hover-track {
  display: flex;
  gap: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
}

.mosaic-hover-track::-webkit-scrollbar {
  display: none;
}

.mosaic-thumb {
  height: 100%;
  width: auto;
  flex: 0 0 auto;
  object-fit: cover;
  display: block;
}

.mosaic-item:hover .mosaic-hover,
.mosaic-item:focus-within .mosaic-hover {
  opacity: 1;
  pointer-events: auto;
}

.mosaic-item:hover .mosaic-image,
.mosaic-item:focus-within .mosaic-image {
  opacity: 0;
}

/* -------------------------
   Archives viewer
   ------------------------- */
.archive-viewer {
  position: fixed;
  inset: 0;
  z-index: 4100;
  display: none;
  background: var(--color-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}

body.viewer-open .archive-viewer {
  display: block;
}

.archive-viewer-stage {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.archive-viewer-image {
  max-width: calc(100vw - 60px);
  max-height: calc(100vh - var(--header-height) - 60px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

@supports (height: 100dvh) {
  .archive-viewer-image {
    max-height: calc(100dvh - var(--header-height) - 60px);
  }
}

.archive-viewer-nav {
  display: none;
}

.archive-viewer-stage {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.archive-viewer-folder {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  color: var(--color-text);
  user-select: none;
  pointer-events: none;
}
.archive-viewer-folder .photographer-link {
  pointer-events: auto;
}

/* -------------------------
   Header (Atmos-style)
   ------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: var(--header-height);
  background: transparent;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 5000;
  user-select: none;
  pointer-events: none;
  transition: background var(--overlay-ms) ease,
              -webkit-backdrop-filter var(--overlay-ms) ease,
              backdrop-filter var(--overlay-ms) ease;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(245, 245, 245, 0.30);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  opacity: 0;
  transition: opacity var(--overlay-ms) ease;
  pointer-events: none;
  z-index: -1;
}

.site-header:hover::before,
body.overlay-active .site-header::before,
body.viewer-open .site-header::before {
  opacity: 1;
}

.site-header > * {
  pointer-events: auto;
}

.logo-link {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.logo {
  display: block;
  max-height: calc(var(--header-height) - 10px);
  height: calc(var(--header-height) * 0.35);
  width: auto;
}

.header-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-style: normal;
  font-size: 12px;
  cursor: pointer;
  text-transform: capitalize;
}

.header-btn:hover {
  opacity: 0.6;
}

/* -------------------------
   Overlays (Menu & Search)
   ------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 4900;
  background: var(--color-bg);
  color: var(--color-text);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--overlay-ms) ease, visibility var(--overlay-ms) ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.overlay-inner {
  padding: calc(var(--header-height) + 40px) 30px 60px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* --- Menu overlay --- */
.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 48px;
}

.menu-link {
  font-family: "DM Serif Display", serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  font-style: normal;
  line-height: 1.15;
  color: inherit;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity 160ms ease;
}

.menu-link:hover {
  opacity: 0.5;
}

.menu-about {
  margin-bottom: 36px;
  margin-left: auto;
  margin-top: 20px;
  text-align: right;
}

.menu-presentation {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.4;
  font-weight: 300;
  font-style: normal;
  margin: 0 0 6px;
  max-width: 52ch;
  margin-left: auto;
}

.menu-contact {
  margin-top: auto;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.menu-contact-link {
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 300;
  font-style: normal;
  color: inherit;
  text-decoration: none;
}

.menu-contact-link:hover {
  text-decoration: underline;
}

/* --- Search overlay --- */
.overlay-search .overlay-inner {
  align-items: stretch;
}

.search-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--color-text);
  background: transparent;
  font-family: "DM Serif Display", serif;
  font-size: clamp(24px, 4vw, 42px);
  font-style: normal;
  font-weight: 400;
  color: var(--color-text);
  padding: 12px 0;
  outline: none;
  letter-spacing: -0.01em;
}

.search-input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.search-results {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 160ms ease;
}

.search-result-item:hover {
  opacity: 0.6;
}

.search-result-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  flex: 0 0 auto;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-title {
  font-size: 17px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.2;
}

.search-result-category {
  font-size: 13px;
  font-style: italic;
  opacity: 0.55;
}

.search-no-results {
  font-size: 17px;
  font-style: italic;
  opacity: 0.4;
  padding-top: 12px;
}

/* -------------------------
   Platform / viewport fixes
   ------------------------- */
html.ios .archive-viewer {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Mobile menu: condense content to right half, nav stays left */
@media (max-width: 600px) {
  .menu-about {
    max-width: 55vw;
  }

  .menu-presentation {
    font-size: 15px;
  }

  .menu-contact-link {
    font-size: 13px;
  }
}

/* -------------------------
   Footer
   ------------------------- */
.site-footer {
  text-align: center;
  padding: 48px 24px 32px;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0.4;
}

.site-footer p {
  margin: 0;
}

.site-footer p {
  margin: 0;
}

/* -------------------------
   Mobile tweaks
   ------------------------- */
@media (max-width: 600px) {
  .site-header {
    padding: 0 16px;
  }

  .overlay-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Disable heavy blur effects on mobile */
  .site-header::before {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.92);
  }

  .overlay.active {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.97);
  }
}
