@import url('tokens.css');
@import url('fonts.css');

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container--sm { max-width: 640px; }
.container--form { max-width: 720px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0 0 0.5em; text-wrap: balance; }
p { margin: 0 0 1em; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-strong); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--gold-strong); display: inline-block; }

/* ---------- top nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 70px; width: auto; object-fit: contain; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink); }
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; font-size: 14px; padding: 8px 11px; border-radius: 3px; text-decoration: none;
  color: var(--ink-soft); transition: background .15s, color .15s;
}
.nav-links a:hover, .nav-links a:focus-visible { background: var(--paper-2); color: var(--ink); }
.nav-links a.current { color: var(--gold-strong); font-weight: 600; }
.nav-cta {
  font-size: 13.5px; font-weight: 600; padding: 9px 14px; border-radius: 3px; text-decoration: none;
  background: var(--gold); color: #241a08; white-space: nowrap; transition: transform .15s ease;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-links a.nav-social { display: inline-flex; align-items: center; gap: 8px; padding: 8px 9px; }
.nav-social-label { display: none; }
.nav-toggle { display: none; }

@media (min-width: 1101px) {
  .brand { flex: 1; }
  .brand span { flex: 1; text-align: center; white-space: nowrap; }
}

@media (max-width: 1100px) {
  .nav-links { display: none; width: 100%; flex-direction: column; gap: 0; }
  .nav-links.is-open { display: flex; }
  .nav-social-label { display: inline; }
  .site-nav { flex-wrap: wrap; }
  .nav-toggle {
    display: inline-flex; margin-left: auto; border: 1px solid var(--line); background: var(--surface);
    border-radius: 4px; padding: 8px 10px; font-family: var(--font-mono); font-size: 12px; cursor: pointer;
  }
}

/* ---------- hero ---------- */
.hero { position: relative; min-height: 46vh; display: flex; align-items: flex-end; overflow: hidden; }
.hero .kb {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center;
  animation: kenburns 26s ease-in-out infinite alternate;
}
.hero .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,15,8,.82) 0%, rgba(20,15,8,.36) 55%, rgba(20,15,8,.1) 100%);
}
.hero-content { position: relative; width: 100%; padding-top: 48px; padding-bottom: 48px; color: #f6efda; }
.hero-content .eyebrow {
  color: #241a08; background: var(--gold); display: inline-block; padding: 5px 10px; border-radius: 2px;
}
.hero-content .eyebrow::before { content: none; }
.hero-content h1 { font-size: clamp(28px, 4.6vw, 46px); color: #fbf6e7; line-height: 1.12; max-width: 620px; }
.hero-content p { color: #e8dfc4; font-size: 16px; max-width: 620px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
@keyframes kenburns { 0% { transform: scale(1.04) translate(0,0); } 100% { transform: scale(1.15) translate(-1.5%,-1.5%); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-family: var(--font-body); font-weight: 600; font-size: 14px; text-decoration: none;
  border-radius: 4px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--gold); color: #241a08; }
.btn.ghost { border-color: rgba(246,239,218,.55); color: #f6efda; background: transparent; }
.btn.confirm { background: var(--field); color: #f3f1e2; }
.btn.outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn.danger { background: var(--danger); color: #fff6f1; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- sections ---------- */
section.block { padding: 56px 0; border-bottom: 1px solid var(--line); }
section.block.alt { background: var(--paper-2); }
.block-head { max-width: 68ch; margin-bottom: 30px; }
.block-head h1, .block-head h2 { font-size: clamp(24px, 3.2vw, 32px); }
.block-head p { color: var(--ink-soft); }
.block-foot { margin-top: 26px; }

/* ---------- news ---------- */
.news-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.news-head-row .pulse-label { display: flex; align-items: center; gap: 10px; }
.news-eyebrow { margin: 0; }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rust);
  box-shadow: 0 0 0 0 rgba(156,65,38,.55); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(156,65,38,.55); }
  70% { box-shadow: 0 0 0 9px rgba(156,65,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(156,65,38,0); }
}
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.news-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 20px 18px 18px;
  position: relative; transition: transform .18s ease, box-shadow .18s ease; text-decoration: none; color: inherit;
}
.news-card:hover { transform: translateY(-3px); box-shadow: 0 14px 26px -14px var(--shadow); }
.news-card--static { cursor: default; }
.news-card--static:hover { transform: none; box-shadow: none; }
.news-stamp {
  position: absolute; top: -10px; left: 16px; transform: rotate(-3deg); background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 2px;
}
.news-card h3 { font-size: 16px; margin-top: 8px; line-height: 1.3; }
.news-card p { font-size: 13.5px; color: var(--ink-soft); margin: 8px 0 0; }
.news-body { font-size: 14.5px; color: var(--ink-soft); margin-top: 8px; }
.news-body p, .news-body div, .news-body ul { margin: 0 0 0.7em; }
.news-body p:last-child, .news-body div:last-child, .news-body ul:last-child { margin-bottom: 0; }
.news-body a { color: var(--gold-strong); text-decoration: underline; }
.news-body ul { padding-left: 1.4em; }
.news-body li { margin: 0 0 0.3em; }

/* Barvy z editoru aktualit (app/sanitize.php je jako jediné povolí) -
   stejné třídy jako v administraci (public_html/css/admin.css). */
.rte-c-ink { color: var(--ink); }
.rte-c-gold { color: var(--gold-strong); }
.rte-c-field { color: var(--field-strong); }
.rte-c-rust { color: var(--rust); }
.rte-c-danger { color: var(--danger); }
.rte-c-blue { color: var(--blue); }
.rte-c-purple { color: var(--purple); }
.rte-c-teal { color: var(--teal); }
.empty-note { color: var(--ink-soft); font-size: 14px; }

/* ---------- products ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.prod-card {
  border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease; display: block;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: 0 16px 28px -16px var(--shadow); }
.prod-card .ph { display: block; width: 100%; height: 130px; object-fit: cover; object-position: center; }
.prod-card span { display: block; padding: 12px 14px; font-weight: 600; }

/* ---------- about / counters ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 34px; align-items: start; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; } }
.counters { display: flex; gap: 26px; flex-wrap: wrap; }
.about-aside { display: flex; flex-direction: column; gap: 34px; }
.about-docs h3 { font-size: 16px; margin-bottom: 14px; }

/* ---------- dokumenty (modernizace farmy) ---------- */
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px;
}
.doc-list-item a { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 600; }
.doc-list-item a:hover { color: var(--gold-strong); }
.doc-list-item a svg { flex-shrink: 0; color: var(--gold-strong); }
.doc-list-item a span { overflow-wrap: anywhere; }
.doc-date { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.counter b { display: block; font-family: var(--font-display); font-size: 30px; color: var(--field-strong); }
.counter span { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- crop page ---------- */
.crop-hero { position: relative; height: 260px; border-radius: 6px; overflow: hidden; margin-bottom: 30px; }
.crop-hero .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.crop-hero .scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,15,8,.7), rgba(20,15,8,.1)); }
.crop-badge {
  position: absolute; top: 18px; left: 18px; z-index: 1;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-strong); transform: rotate(-4deg);
  box-shadow: 0 10px 22px -10px rgba(0,0,0,.5);
}
.crop-badge svg { width: 32px; height: 32px; }
@media (max-width: 560px) {
  .crop-hero { height: 200px; }
  .crop-badge { width: 48px; height: 48px; top: 14px; left: 14px; }
  .crop-badge svg { width: 26px; height: 26px; }
}
.crop-hero h1 { position: relative; padding: 24px; color: #fbf6e7; align-self: flex-end; margin: 0; }
.crop-hero { display: flex; align-items: flex-end; }
.crop-intro { font-size: 17px; max-width: 65ch; }
.crop-section { margin-bottom: 26px; }
.crop-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.crop-table th, .crop-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.crop-table th { background: var(--paper-2); font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.table-scroll { overflow-x: auto; }

.crop-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.crop-gallery-item {
  display: block; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; border: 1px solid var(--line);
}
.crop-gallery-item img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease;
}
.crop-gallery-item:hover img { transform: scale(1.06); }

/* ---------- lightbox (prohlížeč fotek galerie) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(20, 15, 8, .92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 88vw; max-height: 82vh; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .25);
  color: #f6efda; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; transition: background .15s ease; padding: 0;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, .18); }
.lightbox-close { top: 20px; right: 20px; width: 42px; height: 42px; }
.lightbox-prev, .lightbox-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #e8dfc4; font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em;
}
body.lightbox-open { overflow: hidden; }
@media (max-width: 560px) {
  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 20px; }
  .lightbox-close { width: 36px; height: 36px; font-size: 20px; top: 12px; right: 12px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

.about-history { margin-top: 22px; }
.about-history img { border-radius: 4px; border: 1px solid var(--line); box-shadow: 0 14px 26px -16px var(--shadow); }
.about-history figcaption { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }

/* ---------- forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field .optional { font-weight: 400; color: var(--ink-soft); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password],
.field input[type=date], .field input[type=number], .field textarea, .field select {
  width: 100%; font-family: var(--font-body); font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.field .error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.phone-input {
  display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); overflow: hidden;
}
.phone-input:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.phone-input:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.phone-prefix {
  display: flex; align-items: center; padding: 10px 0 10px 12px;
  color: var(--ink-soft); font-family: var(--font-body); font-size: 15px; user-select: none;
}
.phone-input input[type=tel] {
  border: none; background: transparent; padding: 10px 12px 10px 5px; width: 100%; min-width: 0;
}
.phone-input input[type=tel]:focus { outline: none; }

.crop-picker { display: grid; gap: 12px; margin-bottom: 8px; }
.crop-picker-row {
  display: grid; grid-template-columns: 1fr 140px; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; background: var(--surface);
}
.crop-picker-row label { margin: 0; font-weight: 600; font-size: 14.5px; }
.crop-picker-row .qty-wrap { display: flex; align-items: center; gap: 6px; }
.crop-picker-row .qty-wrap span { font-size: 12.5px; color: var(--ink-soft); }

.alert { border-radius: 4px; padding: 12px 14px; font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert.success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.alert.info { background: var(--paper-2); color: var(--ink-soft); border-color: var(--line); }

/* ---------- contact ---------- */
.contact-top { display: flex; gap: 24px; flex-wrap: wrap; align-items: stretch; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 26px; flex: 1 1 calc(37.5% - 12px); min-width: 280px; }
.contact-card .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 12px; }
.contact-card p { margin: 0 0 6px; }
.contact-card .contact-phone { margin-top: 12px; }
.contact-photo {
  flex: 1 1 calc(62.5% - 12px); min-width: 280px; min-height: 260px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 6px;
}
.contact-map { margin-top: 24px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.contact-map iframe { display: block; width: 100%; height: 420px; border: 0; }

/* ---------- footer ---------- */
.site-footer { padding: 30px 0; font-size: 13px; color: var(--ink-soft); }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-contact { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-link { color: var(--ink-soft); text-decoration: underline; }
.footer-link:hover { color: var(--ink); }
.footer-link--btn {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
}

/* ---------- cookie lišta ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  padding: 16px 24px; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px var(--shadow);
}
.cookie-banner:not([hidden]) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px;
}
.cookie-banner p { margin: 0; max-width: 68ch; font-size: 13.5px; color: var(--ink-soft); }
.cookie-banner a { color: var(--gold-strong); text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 560px) {
  .cookie-banner { justify-content: flex-start; }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1; }
}

/* ---------- social odkazy ---------- */
.social-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft);
  text-decoration: none; transition: color .15s ease;
}
.social-link:hover, .social-link:focus-visible { color: var(--gold-strong); }
.social-link--text { font-size: 14px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

::selection { background: var(--gold); color: #241a08; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
