/* Ilya Dorman — Horizon theme, rebuilt from ilya-dorman.format.com.
   Format's licensed faces (Lydian, Freight Sans) are swapped for the closest
   open fonts: Belleza for the logo and headings, Alegreya Sans for text. */

@font-face {
  font-family: 'Belleza';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/belleza/belleza-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/alegreya-sans/alegreya-sans-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/fonts/alegreya-sans/alegreya-sans-latin-400-italic.woff2) format('woff2');
}

:root {
  --text: #545454;
  --muted: #898989;
  --accent: #2d2d2d;
  --bg: #ffffff;
  --heading-font: 'Belleza', 'Optima', 'Candara', sans-serif;
  --body-font: 'Alegreya Sans', 'Freight Sans Book', 'Gill Sans', sans-serif;
  --image-margin: 10px;
}

/* Swap gallery documents in one frame when cross-document transitions are available. */
::view-transition-group(root),
::view-transition-old(root),
::view-transition-new(root) { animation: none; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
h1, h2, p, ul, li, figure, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; }

body {
  color: var(--text);
  background: var(--bg);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body:not(.gallery) { display: flex; flex-direction: column; min-height: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */

#menu_container {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: var(--bg);
}
#menu_container .menu_padding { padding: 1.5em 2em; }
.header_container { display: flex; align-items: center; justify-content: space-between; position: relative; }

#head_logo {
  flex: 0 1 40%;
  max-width: 430px;
  padding-right: 40px;
  text-align: left;
  min-height: 30px;
}
#logo h1 { font-weight: normal; font-size: inherit; }
#logo a {
  display: inline-block;
  color: var(--accent);
  font-family: var(--heading-font);
  font-weight: normal;
  font-size: 30px;
  line-height: 1.1em;
  letter-spacing: -0.005em;
  -webkit-text-stroke: 0.55px currentColor; /* Belleza is lighter than Lydian */
  text-decoration: none;
}

.nav { flex: 1 1 60%; max-width: 900px; text-align: right; }
#menu { font-size: 0; }
#menu > li { display: inline-block; vertical-align: middle; white-space: nowrap; margin-bottom: 1px; }
#menu .item a,
.social_text li a {
  display: block;
  padding: 0.7em;
  color: var(--muted);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1em;
  text-decoration: none;
  transition: color 0.2s;
}
#menu .item a:hover,
#menu .item a:focus-visible,
.social_text li a:hover { color: var(--accent); text-decoration: underline; }
#menu .item.selected > a { color: var(--accent); text-decoration: none; }
.social_text { display: flex; align-items: center; }
#menu .mobile_nav_item { display: none; }
.mobile-menu-trigger { display: none; }

/* ---------- gallery (horizontal scroll) ---------- */

body.gallery { height: 100%; overflow: hidden; }
body.gallery .page { height: 100%; display: flex; flex-direction: column; }
body.gallery #menu_container { position: static; flex: none; }

body.gallery #content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
body.gallery #content::-webkit-scrollbar { display: none; }
body.gallery-footer #content { padding-bottom: 48px; }
.gallery .assets { height: 100%; }

#assets_wrap {
  display: flex;
  flex-flow: row nowrap;
  width: max-content;
  padding-left: 2em;
  height: min(100%, var(--gallery-h, calc(100vh - 135px)));
}
.gallery .asset {
  position: relative;
  flex-shrink: 0;
  height: 100%;
  aspect-ratio: var(--ar, 1.5);
  margin-right: var(--image-margin);
}
.gallery .asset:last-child { border-right: var(--image-margin) solid transparent; box-sizing: content-box; }
.gallery .asset .wrap { height: 100%; width: 100%; position: relative; }
.gallery .asset .img {
  /* The preview and full image share a box, including on capped mobile slides. */
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  aspect-ratio: var(--ar, 1.5);
  max-height: 100%;
  background-color: var(--placeholder, transparent);
  background-image: var(--lqip, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.gallery .asset picture,
.gallery .asset noscript { display: block; width: 100%; height: 100%; }
html:not(.js) .gallery .asset [data-deferred] { display: none; }
.gallery .asset img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.js .gallery .asset:not(.image-lead):not(.image-loaded) img { opacity: 0; }

/* Left/right halves page through the photos, with Format's arrow cursors. */
.gallery #content.cursor_right { cursor: url(/assets/cursors/right_black.png) 22 24, e-resize; }
.gallery #content.cursor_left { cursor: url(/assets/cursors/left_black.png) 0 24, w-resize; }

/* captions (overlay, opened from a "Caption" button) */
.gallery .asset .image_text {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  bottom: 10px;
  right: 10px;
  height: 30px;
  padding: 5px 10px;
  font-size: 14px;
  transition: opacity 300ms ease;
}
.gallery .asset .open_caption.opened { opacity: 0; pointer-events: none; }
.gallery .asset .image_text_container {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 2;
  padding: 30px 10% 20px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms;
  cursor: auto;
}
.gallery .asset .image_text_container.visible { opacity: 1; visibility: visible; }
.gallery .asset .image_text_container p { font-size: 16px; line-height: 1.5em; color: var(--text); }
.gallery .asset .close_caption {
  top: 0;
  right: 0;
  bottom: auto;
  height: auto;
  background: none;
  padding: 12px;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 200;
  font-size: 30px;
  line-height: 0.8;
}

/* ---------- footer ---------- */

.footer_text {
  color: var(--text);
  font-size: 12px;
  text-align: left;
  margin-top: auto;
  padding: 20px 24px;
}
.gallery .footer_text {
  position: fixed;
  left: 24px;
  bottom: 18px;
  margin: 0;
  padding: 18px 0 0;
}

/* ---------- content pages (contact, 404) ---------- */

body.content #content { flex: 1 0 auto; padding: 150px 2em 60px; }
.content_page { max-width: 1040px; margin: 0 auto; }
.text_row { text-align: center; margin-bottom: 36px; }
.small-text { color: var(--muted); font-size: 14px; line-height: 1.7; letter-spacing: 0.04em; }
.xl-headline {
  color: var(--text);
  font-family: var(--heading-font);
  font-weight: normal;
  font-size: 48px;
  line-height: 1.4;
  -webkit-text-stroke: 0.4px currentColor;
}
.intro { margin-top: 12px; font-size: 16px; line-height: 1.7; }

.form_row { width: 66.66%; margin: 0 auto; }
.email_form fieldset { border: 0; margin-bottom: 24px; display: flex; flex-direction: column-reverse; }
.email_form label { display: block; margin-top: 8px; font-size: 16px; color: var(--text); }
.email_form ::placeholder { color: transparent; }
.email_form input,
.email_form textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--text);
  border-radius: 2px;
  padding: 10px 12px;
  outline: none;
}
.email_form input:focus,
.email_form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.email_form textarea { resize: vertical; min-height: 180px; }
.email_form .submit { flex-direction: row; }
.btn {
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--text);
  border-radius: 2px;
  padding: 12px 28px;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--text); color: #fff; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form_status { margin-bottom: 24px; padding: 12px 14px; font-size: 16px; line-height: 1.5; border: 1px solid var(--text); border-radius: 2px; }
.form_status_error { border-color: #a33; color: #a33; }

/* ---------- small helpers ---------- */

.toast,
#image_protection_notice {
  position: fixed;
  z-index: 1000;
  color: #000;
  background: #fff;
  padding: 8px;
  width: 200px;
  font-size: 11px;
  line-height: 1.35;
  font-family: Arial, Helvetica, sans-serif;
  border-radius: 4px;
  box-shadow: 0 0 5px #222;
  pointer-events: none;
}
.toast { width: auto; bottom: 24px; left: 50%; transform: translateX(-50%); font-size: 13px; padding: 8px 12px; }

/* ---------- mobile ---------- */

@media screen and (max-width: 767px) {
  :root { --mobile-header-height: 88px; }
  .header_container { min-height: calc(var(--mobile-header-height) - 3em); }
  #head_logo { flex-basis: 75%; max-width: none; padding-right: 0; min-height: 0; position: relative; z-index: 2; }
  #logo a { font-size: 28px; letter-spacing: -0.018em; transform: translateY(2px); }
  .footer_text, #share_button { display: none; }

  .mobile-menu-trigger {
    display: block;
    position: absolute;
    right: -9px;
    top: 50%;
    margin-top: -22px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    z-index: 2;
  }
  .mobile-menu-open-button-icon {
    position: absolute;
    top: 11px;
    left: 10px;
    display: block;
    width: 25px;
    height: 2px;
    background: var(--muted);
    transition: transform 0.3s, opacity 0.3s;
  }
  .mobile-menu-open-button-icon.middle { transform: translateY(8px); }
  .mobile-menu-open-button-icon.bottom { transform: translateY(16px); }
  .open-mobile-menu .mobile-menu-open-button-icon.top { transform: translateY(10px) rotate(-45deg); }
  .open-mobile-menu .mobile-menu-open-button-icon.middle { opacity: 0; }
  .open-mobile-menu .mobile-menu-open-button-icon.bottom { transform: translateY(10px) rotate(45deg); }

  .nav {
    position: absolute;
    inset: calc(100% + 1.5em) -2em auto;
    max-width: none;
    height: calc(100vh - var(--mobile-header-height));
    height: calc(100dvh - var(--mobile-header-height));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background: var(--bg);
    text-align: left;
    visibility: hidden;
  }
  .open-mobile-menu { overflow: hidden; }
  .open-mobile-menu .nav { visibility: visible; }
  #menu { padding: 10px 30px 0; }
  #menu > li { display: block; margin-bottom: 0; white-space: normal; }
  #menu .item a {
    padding: 12px 0;
    font-size: 21px;
    line-height: 21px;
    color: var(--text);
  }
  #menu .item.selected a { color: #000; }
  #menu > .social { margin: 10px 0; }
  #menu > .social .social_text li a { display: flex; align-items: center; min-height: 44px; padding: 0.7em 1.4em 0.7em 0; }
  #menu .mobile_nav_item { display: block; }
  #menu .nav_footer_text p { font-size: 14px; color: var(--muted); line-height: 1.7; text-align: right; }

  body.gallery-footer #content { padding-bottom: 0; }

  body.content #content { padding: calc(var(--mobile-header-height) + 48px) 28px 40px; }
  .text_row { margin-bottom: 78px; }
  .small-text { margin-bottom: 11.7px; color: var(--muted); font-size: 11.7px; }
  .xl-headline { font-size: 31.2px; }
  .form_row { width: 100%; }

  .email_form { --field-border: rgba(84, 84, 84, 0.5); }
  .email_form fieldset { position: relative; min-width: 0; margin-bottom: 0; }
  .email_form fieldset > label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .email_form :is(input, textarea) {
    display: block;
    padding: 12px 14px;
    border-color: var(--field-border);
    border-radius: 0;
  }
  .email_form fieldset > input { height: 48px; border-bottom-width: 0; }
  .email_form textarea { min-height: 217px; }
  .email_form ::placeholder { color: var(--text); opacity: 0.7; }
  .email_form :focus::placeholder { opacity: 0; }
  .email_form .submit { margin-top: 11px; }
  .email_form .btn { min-height: 52px; padding: 15px 30px; border-color: var(--field-border); border-radius: 0; }
}

/* Wide phones in landscape use the compact desktop navigation. */
@media screen and (min-width: 768px) and (max-width: 1023px) and (max-height: 500px) and (orientation: landscape) {
  .header_container { align-items: flex-start; }
  #head_logo { padding-top: 5px; }
  body.gallery-footer #content { padding-bottom: 54px; }
}

/* Short, wide desktop windows keep the fullscreen gallery treatment. */
@media only screen and (min-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  body.gallery #menu_container { display: none; }
  body.gallery-footer #content { padding-bottom: 0; }
  .gallery .footer_text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
