/* Sota Explore · Photography by John Krohn
   Light, warm "paper" frame with colours taken from the Sota Explore logo.
   The full-screen photo viewer stays dark so photos look their best. */

:root {
  --paper: #f6f3ec;
  --paper-deep: #ece6d9;
  --card: #fffdf8;
  --ink: #1c1b19;
  --ink-soft: #3d3a35;
  --muted: #6b665c;
  --line: #dcd4c4;

  /* from the logo */
  --teal: #276d71;
  --teal-deep: #154850;
  --teal-light: #5c98a3;
  --gold: #d8a051;
  --gold-deep: #c0893e;

  --gutter: clamp(16px, 4vw, 48px);
  --row-h: 260px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

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

/* Photos: no dragging, no text-style selection, no "Save image" on a long press in iPhone Safari. */
.tile img, .lb-img, .feature img, .gallery-card-img img {
  -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}

a { color: var(--teal); text-decoration-color: color-mix(in srgb, var(--teal) 45%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--teal-deep); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; color: var(--ink); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-logo { height: 46px; width: auto; flex: none; }
.brand-sub {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
  padding-left: 16px; border-left: 1px solid var(--line);
}

/* The home page shows the big logo, so the header carries only the menu there. */
.home .brand { visibility: hidden; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 24px; }
.site-nav a {
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; color: var(--ink-soft);
}
.site-nav a:hover { color: var(--teal); }
.nav-youtube { color: var(--teal) !important; }

.nav-toggle { display: none; }

@media (max-width: 1100px) {
  .brand-sub { display: none; }
}

@media (max-width: 860px) {
  .brand-logo { height: 38px; }
  .home .brand { visibility: visible; }

  .nav-toggle {
    display: grid; place-items: center;
    width: 44px; height: 44px; margin-right: -10px; flex: none;
    background: none; border: 0; color: var(--ink); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 22px; height: 2px; background: currentColor; position: relative; transition: transform .25s, opacity .25s;
  }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -7px; }
  .nav-toggle-bars::after { top: 7px; }
  .nav-open .nav-toggle-bars { background: transparent; }
  .nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  .nav-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: fixed; inset: 0; z-index: -1;
    display: flex; align-items: center; justify-content: center;
    background: var(--paper);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  .nav-open .site-nav { opacity: 1; visibility: visible; }
  .nav-open { overflow: hidden; }
  /* backdrop-filter would trap the full-screen menu inside the header bar */
  .nav-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .site-nav ul { flex-direction: column; align-items: center; gap: 20px; }
  .site-nav a { font-family: var(--serif); font-size: 1.75rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--teal); color: #fff; border: 1.5px solid var(--teal);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.button:hover { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.button-outline { background: transparent; color: var(--teal); }
.button-outline:hover { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ---------- Home ---------- */

.intro {
  text-align: center;
  padding: clamp(28px, 6vw, 64px) var(--gutter) clamp(36px, 6vw, 64px);
}
.intro-logo { width: min(560px, 88vw); height: auto; margin: 0 auto; animation: rise .9s ease-out both; }
.intro-sub {
  margin: 18px 0 0;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.intro-sub::before, .intro-sub::after { content: ""; width: 36px; height: 1px; background: var(--gold); }
.intro-tagline {
  margin: 18px auto 0; max-width: 36em;
  font-family: var(--serif); font-size: clamp(1.1rem, 2.2vw, 1.35rem); line-height: 1.5; color: var(--ink-soft);
}
@media (max-width: 480px) {
  .intro-sub { letter-spacing: 0.14em; font-size: 0.74rem; gap: 10px; }
  .intro-sub::before, .intro-sub::after { width: 20px; }
}
.intro-links { margin: 26px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.feature { margin: 0 0 0; position: relative; background: var(--paper-deep); }
.feature img { width: 100%; height: min(78vh, 820px); min-height: 320px; object-fit: cover; }
.feature figcaption {
  position: absolute; right: var(--gutter); bottom: 16px;
  font-size: 0.78rem; color: #fff; letter-spacing: 0.04em;
  background: rgba(20, 19, 17, .55); padding: 5px 12px; border-radius: 999px;
}

.galleries { padding: clamp(40px, 7vw, 80px) var(--gutter); }
.galleries + .galleries { padding-top: 0; }
.episodes { background: linear-gradient(var(--paper-deep), var(--paper)); padding-bottom: clamp(40px, 7vw, 80px) !important; }
.episodes + .galleries { padding-top: clamp(40px, 7vw, 80px); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.section-head p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.gallery-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(18px, 2.4vw, 32px);
}

.gallery-card { text-decoration: none; color: var(--ink); display: block; }
.gallery-card:hover { color: var(--ink); }
.gallery-card-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-deep); border-radius: 4px; }
.gallery-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.gallery-card:hover .gallery-card-img img { transform: scale(1.04); }
.badge-video {
  position: absolute; left: 10px; top: 10px;
  background: var(--teal-deep); color: #fff; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px 4px 22px; border-radius: 999px;
}
.badge-video::before { content: ""; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); border: 4px solid transparent; border-left: 6px solid var(--gold); border-right: 0; }
.gallery-card-text { padding-top: 12px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; }
.gallery-card-kicker { grid-column: 1 / -1; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-deep); }
.gallery-card-text h3 { font-size: 1.45rem; transition: color .2s; }
.gallery-card:hover h3 { color: var(--teal); }
.gallery-card-count { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }

/* ---------- Gallery page ---------- */

.gallery-header { padding: clamp(28px, 5vw, 56px) var(--gutter) 28px; max-width: 900px; }
.back-link { font-size: 0.82rem; color: var(--muted); text-decoration: none; letter-spacing: 0.02em; }
.back-link:hover { color: var(--teal); }
.gallery-kicker { margin: 18px 0 0; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); }
.gallery-header h1 { font-size: clamp(2.3rem, 6vw, 3.8rem); margin-top: 10px; }
.gallery-kicker + h1 { margin-top: 6px; }
.gallery-desc { margin: 14px 0 0; color: var(--ink-soft); font-size: 1.08rem; max-width: 42em; }
.gallery-count { margin: 10px 0 0; font-size: 0.82rem; color: var(--muted); }

.episode-video { padding: 0 var(--gutter) 36px; max-width: 1100px; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; box-shadow: 0 10px 30px rgba(28, 27, 25, .15); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-link { display: inline-block; margin-top: 12px; font-size: 0.9rem; font-weight: 500; }

/* Justified rows: every photo in a row has the same height, widths follow each photo's shape. */
.justified {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 var(--gutter) clamp(48px, 8vw, 96px);
}
.justified::after { content: ""; flex-grow: 1000000; }

.tile {
  position: relative; display: block; overflow: hidden;
  flex-grow: calc(var(--ar) * 100);
  flex-basis: calc(var(--ar) * var(--row-h));
  aspect-ratio: var(--ar);
  background: var(--paper-deep);
  cursor: zoom-in;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tile:hover img { transform: scale(1.025); }

.tile-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 14px 10px;
  font-size: 0.85rem; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.65), transparent);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s;
}
.tile:hover .tile-title, .tile:focus-visible .tile-title { opacity: 1; transform: none; }

@media (max-width: 640px) {
  :root { --row-h: 150px; }
  .justified { gap: 4px; padding-left: 4px; padding-right: 4px; }
}

@media (hover: none) { .tile-title { display: none; } }

/* ---------- Lightbox (stays dark) ---------- */

.lb-open { overflow: hidden; }

.lb {
  position: fixed; inset: 0; z-index: 50;
  display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
  background: rgba(12, 12, 11, .97);
  color: #ece7dd;
  touch-action: pan-y;
  animation: lb-in .2s ease-out;
}
.lb[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } }

.lb-figure { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 0 16px; min-width: 0; }
.lb-img { max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; transition: opacity .25s; user-select: none; -webkit-user-drag: none; }
.lb-img.loading { opacity: .25; }

.lb-cap { width: 100%; max-width: 760px; text-align: center; padding: 14px 16px 0; min-height: 64px; }
.lb-title { display: block; font-family: var(--serif); font-size: 1.3rem; color: #fff; }
.lb-caption { display: block; color: #a49d90; font-size: 0.92rem; margin-top: 2px; }
.lb-count { display: block; color: #a49d90; font-size: 0.75rem; letter-spacing: 0.1em; margin-top: 6px; }

.lb button {
  background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer;
  font: 300 2.4rem/1 var(--sans); width: 56px; height: 56px; justify-self: center;
}
.lb button:hover { color: #fff; }
.lb button:focus-visible { outline-color: var(--gold); }
.lb-close { position: absolute; top: 8px; right: 8px; font-size: 2rem !important; }

@media (max-width: 640px) {
  .lb { grid-template-columns: 1fr; }
  .lb-prev, .lb-next { display: none; }
  .lb-img { max-height: calc(100dvh - 170px); }
}

/* ---------- About & messages ---------- */

.about, .message-page { max-width: 700px; padding: clamp(36px, 7vw, 72px) var(--gutter); }
.about-logo { width: min(320px, 70vw); height: auto; margin-bottom: 28px; }
.about h1, .message-page h1 { font-size: clamp(2.3rem, 6vw, 3.4rem); margin-bottom: 8px; }
.about h2 { font-size: 1.6rem; margin: 34px 0 10px; }
.about p { font-size: 1.06rem; color: var(--ink-soft); }
.contact { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; }
.contact dt { color: var(--muted); font-size: 0.85rem; padding-top: 2px; }
.contact dd { margin: 0; }

.empty { color: var(--muted); padding: 0 var(--gutter); }

/* ---------- Footer ---------- */

.site-footer {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px 32px;
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  font-size: 0.85rem; color: var(--muted);
}
.site-footer p { margin: 0; }
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { width: 84px; height: auto; }
.footer-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: flex-end; }
.footer-links a { text-decoration: none; color: var(--ink-soft); font-weight: 500; }
.footer-links a:hover { color: var(--teal); }
.footer-copy { grid-column: 1 / -1; font-size: 0.78rem; }

@media (max-width: 640px) {
  .site-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

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