/* Irving Posluns Photography — shared styles.
   Gill Sans Light is built into Apple devices and ships with Microsoft Office; Lato Light is the free fallback. */

:root {
  --ink: #333333;          /* charcoal text */
  --ink-soft: #666666;
  --rule: #d9d9d9;
  --paper: #ffffff;
  --page-max: 1024px;
  --font: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", "Lato", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.55;
}
a { color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }

.page { max-width: var(--page-max); margin: 0 auto; padding: 0 16px; }

/* Header: logo on the left, menu + title on the right (from the mockup) */
/* The menu + title block is centred on the page (in line with the content below);
   the logo sits at the left edge, and the block keeps an equal gutter on both sides so they never touch. */
.site-header {
  position: relative;
  padding: 28px 0 24px;
}
.site-header .logo { position: absolute; left: 0; top: 50%; transform: translateY(-50%); line-height: 0; }
.site-header .logo img { width: 120px; height: 120px; }
.site-header > div { padding: 0 136px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 34px; justify-content: center; margin-bottom: 10px; }
.site-nav a { text-decoration: none; font-size: 21px; letter-spacing: .01em; padding: 2px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a:focus-visible { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.site-title { text-align: center; }
.site-title h1 { margin: 0; font-weight: 300; font-size: 46px; line-height: 1.1; letter-spacing: .005em; }
.site-title .dates { margin: 4px 0 0; font-size: 24px; color: var(--ink-soft); }

/* Home: portrait, then a slow random cross-fade through the archive */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1048 / 1009;
  background: var(--paper);
  overflow: hidden;
}
.stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
}
.stage img.show { opacity: 1; }
.caption {
  min-height: 1.6em;
  margin: 10px 0 0;
  text-align: center;
  font-size: 17px;
  color: var(--ink-soft);
  transition: opacity 1.2s ease-in-out;
}
.caption.fade { opacity: 0; }

/* Text pages */
.prose { max-width: 720px; margin: 8px auto 40px; }
.prose h2 { font-weight: 300; font-size: 32px; margin: 8px 0 18px; text-align: center; }
.prose h3 { font-weight: 400; font-size: 21px; margin: 30px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose figure { margin: 26px 0; }
.prose figcaption { font-size: 15px; color: var(--ink-soft); text-align: center; margin-top: 8px; }
.note { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 14px 0; margin: 24px 0; }
.wide-figure { margin: 8px 0 32px; }

/* Footer: language toggle + tutorial link */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 36px;
  padding: 18px 0 36px;
  text-align: center;
  font-size: 16px;
  color: var(--ink-soft);
}
.lang { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.lang a, .lang span { text-decoration: none; }
.lang .current { color: var(--ink); border-bottom: 1px solid var(--ink); }
.lang .soon { color: #aaa; cursor: default; }

@media (max-width: 860px) {
  .site-header { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 16px; }
  .site-header .logo { position: static; transform: none; }
  .site-header > div { padding: 0; }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .site-header .logo img { width: 88px; height: 88px; }
  .site-nav { gap: 4px 20px; }
  .site-nav a { font-size: 18px; }
  .site-title h1 { font-size: 30px; }
  .site-title .dates { font-size: 19px; }
  .prose h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .stage img, .caption { transition: none; }
}

/* Contact page */
.contact-card { font-style: normal; margin: 22px 0 16px; line-height: 1.6; }
.contact-lines { margin-bottom: 22px; }
.lang a[aria-current="page"] { color: var(--ink); border-bottom: 1px solid var(--ink); }

/* ---------- Image Viewer ---------- */
.hero-link { display: block; margin: 4px 0 26px; cursor: pointer; }
.hero-link img { width: 100%; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end;
  padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 18px;
}
.toolbar label { display: flex; flex-direction: column; font-size: 14px; color: var(--ink-soft); gap: 4px; }
.toolbar select, .toolbar input[type=search] {
  font: inherit; font-size: 17px; color: var(--ink); padding: 7px 10px; border: 1px solid #bbb; border-radius: 4px; background: #fff; min-width: 170px;
}
.toolbar input[type=search] { min-width: 220px; }
.toolbar .count { margin-left: auto; font-size: 15px; color: var(--ink-soft); padding-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 14px; }
.tile { text-decoration: none; display: block; }
.tile .frame { aspect-ratio: 1; background: #f4f4f4; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.tile .frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transition: opacity .4s; opacity: 0; }
.tile .frame img.loaded { opacity: 1; }
.tile .label { font-size: 15px; line-height: 1.35; margin-top: 6px; }
.tile .label small { display: block; color: var(--ink-soft); font-size: 13px; }
.tile .picked { position: absolute; top: 6px; right: 6px; background: var(--ink); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 10px; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 0; }
.more { display: block; margin: 24px auto 0; }

.btn {
  font: inherit; font-size: 17px; padding: 9px 18px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; text-decoration: none; display: inline-block;
}
.btn.secondary { background: #fff; color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Selection bar (bottom of viewer pages when something is selected) */
.selbar {
  position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.97);
  border-top: 1px solid var(--rule); padding: 12px 0; margin-top: 24px;
  display: none; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.selbar.show { display: flex; }
.selbar .thumbs { display: flex; gap: 6px; }
.selbar .thumbs img { width: 44px; height: 44px; object-fit: cover; }

/* Photo page */
.photo-wrap { margin: 4px 0 18px; text-align: center; }
.photo-wrap img { margin: 0 auto; max-height: 82vh; width: auto; }
.photo-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0 16px; font-size: 16px; }
.photo-nav a { text-decoration: none; }
.photo-nav .disabled { visibility: hidden; }
.photo-info { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; border-top: 1px solid var(--rule); padding-top: 18px; }
.photo-info h2 { font-weight: 300; font-size: 30px; margin: 0 0 6px; }
.photo-info .where { color: var(--ink-soft); margin: 0 0 14px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0; font-size: 16px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; }
.actions { display: flex; flex-direction: column; gap: 10px; min-width: 230px; }
.actions .hint { font-size: 14px; color: var(--ink-soft); margin: 0; max-width: 240px; }

@media (max-width: 860px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
  .toolbar label, .toolbar select, .toolbar input[type=search] { width: 100%; min-width: 0; }
  .toolbar .count { margin-left: 0; }
  .photo-info { grid-template-columns: 1fr; }
  .actions { min-width: 0; }
}

/* ---------- Account ---------- */
html.gated main { visibility: hidden; }
.account .lead { font-size: 22px; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.msg { padding: 12px 14px; border-radius: 4px; margin: 16px 0; }
.msg.ok { background: #f1f5f1; border: 1px solid #b9cdb9; }
.msg.err { background: #fbf1f0; border: 1px solid #e0b4ae; }
.auth-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 22px; align-items: start; margin-top: 10px; }
.card { border: 1px solid var(--rule); border-radius: 6px; padding: 18px; }
.card h3 { margin-top: 0; }
.card label { display: block; font-size: 15px; color: var(--ink-soft); margin-bottom: 12px; }
.card input:not([type=checkbox]), .card select {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 17px; color: var(--ink);
  padding: 8px 10px; border: 1px solid #bbb; border-radius: 4px; background: #fff;
}
.card .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.card .check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); }
.card .check input { margin-top: 5px; }
.sel-list { display: grid; gap: 12px; margin: 8px 0 16px; }
.sel-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; align-items: center; }
.sel-item img { width: 90px; height: 90px; object-fit: cover; }
.account .prose, .prose.account { max-width: 860px; }
@media (max-width: 720px) {
  .auth-grid { grid-template-columns: 1fr; }
  .card .two { grid-template-columns: 1fr; }
  .sel-item { grid-template-columns: 70px 1fr; }
  .sel-item img { width: 70px; height: 70px; }
  .sel-item .btn { grid-column: 2; justify-self: start; }
}
.confirm { border: 1px solid var(--rule); border-radius: 6px; padding: 14px; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.confirm[hidden] { display: none; }
.confirm p { width: 100%; margin: 0 0 4px; }

/* ---------- Tutorial ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 20px 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 6px 54px; margin-bottom: 18px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.steps h3 { margin: 4px 0 6px; }
@media (max-width: 720px) { .steps > li { padding-left: 46px; } .steps > li::before { width: 32px; height: 32px; font-size: 16px; } }
