/* =============================================================
 * Jan Kubíček — public site
 * ============================================================= */

:root {
  --bg: #0b0b0b;
  --bg-elev: #141414;
  --fg: #f3f1ec;
  --muted: #8a8580;
  --accent: #e6c275;
  --border: rgba(255, 255, 255, 0.08);
  --max-w: 1440px;
  --gap: 14px;
  --radius: 2px;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html { overflow-x: clip; }
body { overflow-x: clip; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(11, 11, 11, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.brand__name { white-space: nowrap; }

.site-nav {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}

.site-nav__link {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 0.2s ease;
  position: relative;
  padding: 4px 0;
}

.site-nav__link.is-active,
.site-nav__link:hover { color: var(--fg); }

.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
}

.lang-switch {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.lang-switch__link {
  color: var(--muted);
  padding: 2px 4px;
  border: 1px solid transparent;
}
.lang-switch__link.is-active {
  color: var(--fg);
  border-color: var(--border);
}

.nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1px;
  background: var(--fg);
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}
.nav-toggle span:nth-child(1) { top: 10px; }
.nav-toggle span:nth-child(2) { top: 16px; }
.nav-toggle span:nth-child(3) { top: 22px; }
body.nav-open .nav-toggle span:nth-child(1) { top: 16px; transform: rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { top: 16px; transform: rotate(-45deg); }

/* ---------- Main / layout ----------------------------------- */

.site-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 32px 96px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  letter-spacing: 0.02em;
  margin: 0 0 24px;
}

.section-cta {
  margin-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-cta a { color: var(--accent); }

/* ---------- Hero -------------------------------------------- */

.hero {
  text-align: center;
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--border);
}
.hero__inner {
  position: relative;
  z-index: 1;
}
.hero__title {
  font-family: var(--serif);
  font-size: clamp(3rem, 9vw, 7.5rem);
  font-weight: 300;
  letter-spacing: 0.02em;
  margin: 0 0 16px;
  line-height: 1;
}
.hero__subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin: 0;
}

/* Full-bleed banner variant. The banner is an <img>, not a CSS
   background, so its natural aspect ratio is always preserved (no
   cropping that happens with `background-size: cover` when the hero
   box aspect doesn't match the image). The title/subtitle is overlaid
   on top. The bleed uses negative margins driven by `50% - 50vw`; the
   `overflow-x: clip` on html/body (above) absorbs any scrollbar-gutter
   sliver. */
.hero--has-banner {
  position: relative;
  margin-top: -32px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  border-bottom: none;
  color: #fff;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(220px, 30vw, 360px);
  display: grid;
}
.hero__bg {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  /* If the image is naturally shorter than min-height, expand to fill
     so the overlay text still has a visual backdrop. */
  min-height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero--has-banner .hero__inner {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  z-index: 2;
  padding: 24px;
  text-align: center;
}
.hero--has-banner::after {
  content: "";
  grid-area: 1 / 1;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,0.20) 0%, rgba(0,0,0,0.55) 100%);
}
.hero--has-banner .hero__title {
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.hero--has-banner .hero__subtitle {
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}

.featured { margin-top: 64px; }

/* ---------- Filter bar -------------------------------------- */

.gallery__head {
  margin-bottom: 32px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.filter {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.filter:hover { color: var(--fg); border-color: var(--muted); }
.filter.is-active {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

/* ---------- Grid -------------------------------------------- */

.grid {
  column-count: 3;
  column-gap: var(--gap);
}

@media (max-width: 980px) { .grid { column-count: 2; } }
@media (max-width: 560px) { .grid { column-count: 1; } }

.grid--featured { column-count: 3; }
@media (max-width: 980px) { .grid--featured { column-count: 2; } }
@media (max-width: 560px) { .grid--featured { column-count: 1; } }

.card {
  break-inside: avoid;
  margin: 0 0 var(--gap);
  background: var(--bg-elev);
  position: relative;
  overflow: hidden;
}

.card__link {
  display: block;
  position: relative;
}

.card__img {
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
}
.card__img.is-loaded { opacity: 1; }
.card__link:hover .card__img { transform: scale(1.03); }

.card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.65) 90%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.card__link:hover .card__overlay { opacity: 1; transform: none; }

.card__title {
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.card__tags {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
}

.grid-sentinel {
  height: 1px;
  margin-top: 32px;
}
.grid-loading {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ---------- Prose (about) ----------------------------------- */

.prose {
  max-width: 720px;
  margin: 0 auto;
}
.prose__body p,
.prose__body li {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--fg);
  margin: 0 0 1.2em;
  font-weight: 400;
}
.prose__body li { margin-bottom: 0.4em; }
.prose__body ul,
.prose__body ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose__body h2,
.prose__body h3,
.prose__body h4 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 1.6em 0 0.6em;
  line-height: 1.25;
}
.prose__body h2 { font-size: 1.8rem; }
.prose__body h3 { font-size: 1.4rem; }
.prose__body h4 { font-size: 1.15rem; }
.prose__body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 16px;
  margin: 1.2em 0;
  color: var(--muted);
  font-style: italic;
}
.prose__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose__body a:hover { text-decoration-thickness: 2px; }
.prose__body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- Forms ------------------------------------------- */

.contact { max-width: 640px; margin: 0 auto; }
.contact__intro {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 1rem;
}

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__input {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s ease;
}
.field__input:focus { border-color: var(--accent); }
.field__input--textarea { resize: vertical; min-height: 120px; }

.hp { position: absolute; left: -9999px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px 22px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { border-color: var(--fg); }
.btn--primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  width: max-content;
}
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.alert {
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 0.9rem;
}
.alert--ok { border-color: rgba(94, 191, 99, 0.5); color: #b7e6b9; }
.alert--err { border-color: rgba(220, 88, 88, 0.5); color: #f4b1b1; }

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

.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

/* ---------- Lightbox ---------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.lightbox.is-open { display: flex; }
.lightbox__frame {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  overflow-y: auto;
}
.lightbox__frame::-webkit-scrollbar {
  width: 6px;
}

.lightbox__frame::-webkit-scrollbar-track {
  background: #969c9f;
  border-radius: 1px;
}

.lightbox__frame::-webkit-scrollbar-thumb {
  background: #737a7d;
  border-radius: 1px;
  border: 1px solid #737a7d;
}
.lightbox__img {
  max-width: min(1200px, 100%);
  max-height: 80vh;
  object-fit: contain;
}
.lightbox__title {
  font-family: var(--serif);
  font-size: 1.15rem;
}
.lightbox__desc {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 720px;
  text-align: center;
}
.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--fg);
  cursor: pointer;
  font-size: 28px;
  padding: 8px 14px;
}
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }

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

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 14px 20px;
    gap: 16px;
  }
  .nav-toggle { display: inline-block; justify-self: end; order: 3; }
  .lang-switch { order: 2; justify-self: end; }
  .site-nav {
    position: fixed;
    top: 64px;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(100dvh - 64px);
    max-height: calc(100vh - 64px);
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    background: var(--bg);
    padding: 32px 24px 48px;
    gap: 24px;
    align-items: center;
    justify-content: flex-start;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 49;
  }
  body.nav-open .site-nav { transform: translateX(0); }
  .site-nav__link { font-size: 1rem; padding: 8px 0; }
  .site-main { padding: 32px 18px 64px; }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 420px) {
  .site-header { gap: 8px; padding: 12px 14px; }
  .brand { font-size: 1.05rem; }
  .lang-switch { font-size: 0.68rem; }
}