/* Pavel Truhlík — gallery. Quiet off-white, uncropped photos, editorial serif. */
:root {
  --bg: #f7f5f0; --fg: #1d1a16; --muted: #7d7468; --line: #e4dfd5; --surface: #eeeae2;
  --display: "Fraunces", Georgia, serif; --body: "Inter Tight", system-ui, sans-serif;
  --maxw: 1480px; --gutter: 24px; --gap: 20px;
}
@media (max-width: 600px) { :root { --gutter: 16px; --gap: 12px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--body);
  min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font-family: var(--display); font-size: 1.4rem; line-height: 1.2; text-decoration: none; padding: 10px 0; }
.nav { display: flex; }
.nav a { padding: 6px 10px; font-size: .95rem; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--fg); }
@media (max-width: 600px) { .brand { font-size: 1.1rem; } .nav a { padding: 6px 0 6px 8px; } }

/* Gallery — masonry. Without JS: CSS columns. With JS (site.js): grid with per-tile row spans,
   so items read left to right, newest first. */
.gallery { padding-bottom: 72px; }
.intro { max-width: 640px; margin: 36px 0 40px; padding-left: 20px; border-left: 2px solid var(--line); }
.intro p { margin: 0; }
.intro-lead { font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.25; margin-bottom: 10px !important; }
.intro-text { color: var(--muted); font-size: 1.02rem; line-height: 1.6; }
@media (max-width: 600px) { .intro { margin: 24px 0 28px; padding-left: 14px; } }
.grid { columns: 4 240px; column-gap: var(--gap); }
.grid .card { break-inside: avoid; margin-bottom: 28px; }
.grid.is-masonry { columns: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  column-gap: var(--gap); grid-auto-rows: 4px; align-items: start; }
.grid.is-masonry .card { margin-bottom: 0; }
@media (max-width: 600px) {
  .grid { columns: 2; }
  .grid.is-masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .card { margin-bottom: 20px; }
}
.card { display: block; text-decoration: none; }
.card-photo { display: block; background: var(--surface); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, opacity .3s; }
.card:hover .card-photo img { transform: scale(1.025); }
.card-name { display: block; padding-top: 10px; font-family: var(--display); font-size: 1.05rem; line-height: 1.3; }
@media (max-width: 600px) { .card-name { font-size: .95rem; padding-top: 7px; } }
.pager { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 48px; color: var(--muted); }
.pager a { color: var(--fg); font-weight: 500; text-decoration: none; }
.empty { color: var(--muted); padding: 40px 0; }

/* Detail — photo and text side by side, both top-aligned. */
.detail { display: flex; gap: 48px; align-items: flex-start; padding-top: 32px; padding-bottom: 72px; }
.detail-photo { flex: 0 1 auto; min-width: 0; max-width: 62%; }
.detail-photo img { width: auto; height: auto; max-height: calc(100vh - 128px); }
.detail-text { flex: 1 1 320px; min-width: 0; max-width: 560px; }
.back { display: inline-block; margin-bottom: 20px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.back:hover { color: var(--fg); }
.detail-text h1 { font-size: clamp(2rem, 3.6vw, 3rem); }
.prose { font-size: 1.05rem; }
.prose p { margin: 0 0 .9em; }
.stepper { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 16px;
  border-top: 1px solid var(--line); font-size: .92rem; }
.stepper a { color: var(--muted); text-decoration: none; }
.stepper a:hover { color: var(--fg); }
@media (max-width: 760px) {
  .detail { flex-direction: column; align-items: stretch; gap: 20px; padding-top: 16px; }
  .detail-photo { max-width: none; }
  .detail-photo img { width: 100%; max-height: none; }
  .detail-text { flex-basis: auto; max-width: none; }
  .back { margin-bottom: 8px; }
}

/* Contact (in the footer of every page) */
.contact { background: var(--fg); color: var(--bg); padding-top: 56px; }
.contact-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 48px; }
.contact h2 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0; }
.contact-lines { display: flex; flex-direction: column; gap: 4px; }
.contact-link { font-family: var(--display); font-size: clamp(1.3rem, 3vw, 2rem); text-decoration: none; word-break: break-all;
  border-bottom: 1px solid rgba(247, 245, 240, .3); }
.contact-link:hover { border-bottom-color: var(--bg); }
.colophon { padding-top: 18px; padding-bottom: 22px; border-top: 1px solid rgba(247, 245, 240, .15); font-size: .85rem; color: #a59c8f; }
