:root {
  --bg: #faf7f2;
  --fg: #2b2622;
  --muted: #7a7068;
  --accent: #8a5a44;
  --line: #e2dacf;
  --frame: #f0ebe3;
  --ivory: #f3ead6;        /* buttons: ivory (slonová kost) */
  --ivory-strong: #e9dcbf;
  --ivory-line: #d6c7a6;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pad: max(16px, env(safe-area-inset-left));
  --peek: 28px;  /* how much of the neighbouring slide shows: the hint that you can swipe */
  --gap: 12px;
  /* Slider height leaves room for the header and the start of the intro text on every screen
     (svh = height actually visible with the browser bars shown). */
  --slide-h: min(72vh, 820px);
  --slide-h: clamp(240px, calc(100svh - 300px), 820px);
}

@media (min-width: 900px) {
  :root { --peek: 7vw; --gap: 20px; }
}

@media (max-width: 760px) {
  :root {
    --slide-h: min(60vh, 105vw);
    --slide-h: clamp(220px, min(105vw, calc(100svh - 330px)), 820px);
  }
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--font);
}

a { color: inherit; }

button { font: inherit; color: inherit; }

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

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) var(--pad) 18px;
}

.brand {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
}

.techniques { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.techniques a {
  padding: 8px 16px;
  border: 1px solid var(--ivory-line);
  border-radius: 10px;  /* same shape as "Mám zájem" */
  background: var(--ivory);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.techniques a:hover { background: var(--ivory-strong); }

.techniques a[aria-current="page"] {
  background: var(--ivory-strong);
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}

.lang-switch {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .05em;
  text-decoration: none;
}

.lang-switch:hover { color: var(--fg); border-color: var(--fg); }

@media (max-width: 760px) {
  .brand { flex: 1; }
  .lang-switch { order: 2; }
  .techniques { order: 3; margin-left: 0; }
}

@media (max-width: 760px) {
  /* the two longer names get a bit more width, so none needs a third line */
  .techniques { display: grid; grid-template-columns: .84fr 1.08fr 1.08fr; gap: 6px; width: 100%; }
  .techniques a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 4px;
    font-size: 12.5px;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
  }
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--pad) 48px;
}

/* ---- home: slider ---- */

.hero {
  position: relative;
  margin: 4px calc(-1 * var(--pad)) 0;  /* full width: slides run to the screen edges */
}

.slides {
  position: relative;
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  padding: 0 calc(var(--peek) + var(--gap));
  scrollbar-width: none;
}

.slides::-webkit-scrollbar { display: none; }

.slide {
  position: relative;
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--slide-h);
  overflow: hidden;
  border-radius: 6px;
  background: var(--frame);
  scroll-snap-align: center;
  text-decoration: none;
}

.slide img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.slide-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(250, 247, 242, .93);
  font-size: 16px;
  font-weight: 700;
}

.arrow {
  position: absolute;
  top: calc(var(--slide-h) / 2 - 24px);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 247, 242, .92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.arrow.prev { left: calc(var(--peek) / 2); }
.arrow.next { right: calc(var(--peek) / 2); }
.arrow:disabled { opacity: 0; pointer-events: none; }

@media (hover: none) {
  .arrow { display: none; }  /* touch: swiping is the way */
}

.dots { display: flex; justify-content: center; gap: 4px; padding: 10px 0; }

.dots button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: radial-gradient(circle, var(--line) 0 5px, transparent 6px);
  cursor: pointer;
}

.dots button[aria-current="true"] {
  background: radial-gradient(circle, var(--accent) 0 5px, transparent 6px);
}

/* ---- home: intro ---- */

.intro {
  max-width: 680px;
  margin: 16px auto 0;
  font-size: 18px;
}

.intro p:first-child { font-size: 21px; line-height: 1.5; }

/* ---- technique gallery: one column, caption right (desktop) / below (mobile) ---- */

.page-title { margin: 20px 0 32px; font-size: 30px; font-weight: 700; line-height: 1.2; }

.work { display: grid; gap: 16px; margin: 0 0 72px; }

@media (min-width: 900px) {
  /* caption sits right next to the painting, whatever its proportions */
  .work { display: flex; align-items: flex-start; gap: 48px; }
  .work-image { flex: 0 0 auto; width: min(66%, calc(85vh * var(--w) / var(--h))); }
  .work-caption { flex: 1 1 260px; min-width: 240px; position: sticky; top: 24px; }
}

/* Width derived from the painting's proportions (--w/--h set per work) so that
   portrait paintings stay within 85 % of the screen height. */
.work-image {
  display: block;
  width: min(100%, calc(85vh * var(--w) / var(--h)));
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.work-image img {
  display: block;
  width: 100%;
  height: auto;
}

.work-caption h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; line-height: 1.25; }

.meta { margin: 0 0 10px; color: var(--muted); }

.price { margin: 0 0 14px; font-weight: 700; }

.sold {
  display: inline-block;
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
}

.interest, .contact .primary {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--ivory-line);
  border-radius: 10px;
  background: var(--ivory);
  color: var(--fg);
  font-weight: 700;
  cursor: pointer;
}

.interest:hover, .contact .primary:hover { background: var(--ivory-strong); }

.description { margin-top: 18px; color: var(--muted); }

/* quiet way back to the header (techniques) from deep in a long gallery */
.to-top {
  display: inline-block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.to-top:hover { color: var(--fg); text-decoration: underline; }

.work-caption .to-top { display: block; width: fit-content; }

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

/* ---- 404 (old WordPress links end up here) ---- */

.not-found { max-width: 680px; }

.not-found-links { display: flex; flex-wrap: wrap; gap: 8px; }

.button {
  padding: 10px 16px;
  border: 1px solid var(--ivory-line);
  border-radius: 10px;
  background: var(--ivory);
  font-weight: 700;
  text-decoration: none;
}

.button:hover { background: var(--ivory-strong); }

.not-found-en { margin-top: 32px; color: var(--muted); font-size: 15px; }

/* ---- lightbox ---- */

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(20, 17, 15, .95);
}

.lightbox[open] { display: flex; align-items: center; justify-content: center; }

.lightbox::backdrop { background: rgba(20, 17, 15, .95); }

.lightbox img { max-width: 96vw; max-height: 94vh; object-fit: contain; }

.lightbox .close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 247, 242, .9);
  font-size: 26px;
  cursor: pointer;
}

/* ---- contact window ---- */

.contact {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: hidden auto;  /* scroll only vertically, e.g. when the phone keyboard is up */
  padding: 24px;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.contact::backdrop { background: rgba(20, 17, 15, .55); }

.contact h2 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }

.contact-work { margin: 0 0 8px; color: var(--muted); }

.contact label { display: block; margin: 14px 0 6px; font-weight: 700; }

.contact input, .contact textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 17px;  /* 16px+ keeps iOS from zooming into the field */
}

.contact textarea { resize: vertical; }

.contact-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.contact-status { min-height: 1.4em; margin: 8px 0 0; font-weight: 700; }

.contact-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 12px; }

.contact .secondary {
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

/* honeypot: invisible to people, clipped in place (moving it off-screen made the window scroll) */
.hp {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  padding: 24px var(--pad) max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

.site-footer a, .site-footer .link { color: var(--fg); }

.link {
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  cursor: pointer;
}
