/* patrikjahoda.cz – plain CSS, no build step.
   Mobile first; layout switches at 40em (640px) and 64em (1024px). */

:root {
  --accent: #f5b804;
  --accent-dark: #c99500;
  --ink: #1b1b1b;
  --ink-soft: #555;
  --paper: #fff;
  --paper-alt: #f4f4f2;
  --line: #e2e2e0;
  --max: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem; /* keep anchors below the sticky header */
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  text-wrap: pretty;
}

img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 800; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3rem, 6vw, 5rem); }
.section-lead { color: var(--ink-soft); max-width: 40rem; margin-bottom: 2rem; }
.kicker { text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.8rem; color: var(--accent-dark); font-weight: 700; margin-bottom: 0.25em; }
.lead { font-size: 1.15em; font-weight: 500; }

/* Skip link for keyboard users */
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--accent); color: var(--ink); padding: 0.5rem 1rem; border-radius: 0.25rem; z-index: 100; }
.skip:focus { top: 1rem; }

/* Buttons */
.btn {
  display: inline-block; padding: 0.7rem 1.4rem; border-radius: 0.25rem; font-weight: 700;
  text-decoration: none; background: var(--accent); color: var(--ink); border: 2px solid var(--accent);
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-outline { background: transparent; color: inherit; border-color: currentColor; }
.btn-outline:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.actions .btn { margin: 0.25rem 0.5rem 0.25rem 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  /* background spans the full width, content aligns with .wrap on wide screens */
  padding: 0.6rem max(var(--gutter), calc((100% - var(--max)) / 2));
  background: rgba(27, 27, 27, 0.92); color: #fff;
  backdrop-filter: blur(8px);
}
.brand { color: #fff; text-decoration: none; font-weight: 900; font-size: 1.25rem; letter-spacing: 0.02em; }
.brand span { color: var(--accent); }
.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer;
}
.nav-toggle .bar { display: block; height: 3px; background: #fff; border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.site-nav { display: none; position: absolute; inset: 100% 0 auto 0; background: #1b1b1b; border-top: 1px solid #333; }
.site-nav.open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0.5rem 0; }
.site-nav a { display: block; padding: 0.75rem max(var(--gutter), calc((100% - var(--max)) / 2)); color: #fff; text-decoration: none; font-weight: 600; }
.site-nav a:hover { color: var(--accent); }

@media (min-width: 64em) {
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; background: none; border: 0; }
  .site-nav ul { display: flex; gap: 0.25rem; padding: 0; }
  .site-nav a { padding: 0.5rem 0.9rem; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; }
}

/* Hero */
.hero { position: relative; min-height: min(85svh, 48rem); display: grid; background: #1b1b1b; color: #fff; isolation: isolate; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: brightness(0.55); z-index: -1; }
.hero-text { align-self: center; justify-self: center; text-align: center; padding: 4rem var(--gutter); max-width: 50rem; }
.hero h1 { font-size: clamp(2.5rem, 2rem + 4vw, 5.5rem); font-weight: 900; line-height: 1; margin-bottom: 1rem; text-shadow: 0 2px 20px rgba(0,0,0,0.4); }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15em; opacity: 0.9; margin-bottom: 1.75rem; }

/* About */
.about-grid { display: grid; gap: 2rem; align-items: center; }
.about-photo { margin: 0; max-width: 28rem; }
.about-photo img { border-radius: 0.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.signature { width: 11rem; margin: 1rem 0; }
.info-grid { display: grid; gap: 1.5rem; margin-top: 3rem; }
.info { background: var(--paper-alt); padding: 1.5rem; border-radius: 0.5rem; border-top: 4px solid var(--accent); }
.info p { margin: 0; color: var(--ink-soft); font-size: 0.95em; }

@media (min-width: 40em) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64em) {
  .about-grid { grid-template-columns: 2fr 3fr; gap: 4rem; }
}

/* Gallery */
.gallery { background: var(--paper-alt); }
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.tile { margin: 0; background: #fff; border-radius: 0.5rem; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.tile a { display: block; }
.tile img, .tile video { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: #222; }
.tile img { transition: transform 0.3s; }
.tile a:hover img { transform: scale(1.03); }
.tile figcaption { padding: 0.6rem 0.9rem; font-size: 0.9rem; font-weight: 600; }

/* Cards (posts) */
.cards { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); margin-bottom: 2rem; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 0.5rem; overflow: hidden; }
.card-img img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; }
.card-body { padding: 1.1rem 1.25rem 1.25rem; }
.card-body h3 a, .card-body h4 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover, .card-body h4 a:hover { color: var(--accent-dark); }
.card-body p:last-child { margin: 0; color: var(--ink-soft); font-size: 0.95em; }
.meta { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 0.6rem; }
.year { border-bottom: 2px solid var(--accent); display: inline-block; margin-top: 1rem; }
.races { background: var(--paper); }
.blog { background: var(--paper-alt); }

/* Partners */
.logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2rem 3rem; align-items: center; justify-content: center; }
.logos img { max-height: 4.5rem; width: auto; filter: grayscale(1); opacity: 0.75; transition: filter 0.2s, opacity 0.2s; }
.logos img:hover { filter: none; opacity: 1; }

/* Single post / page */
.post { max-width: 44rem; margin-inline: auto; padding: clamp(2rem, 5vw, 4rem) var(--gutter); }
.post-header h1 { font-size: clamp(1.9rem, 1.5rem + 2vw, 3rem); }
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); }
.post-hero { margin: 1.5rem 0 2rem; }
.post-hero img, .post-content img { border-radius: 0.5rem; }
.post-content figure { margin: 1.5rem 0; }
.post-content p { margin-bottom: 1.25em; }
.video { aspect-ratio: 16 / 9; margin: 1.5rem 0; }
.video iframe { width: 100%; height: 100%; border: 0; border-radius: 0.5rem; }
.post-back { margin-top: 2.5rem; }

/* Footer */
.site-footer { background: #1b1b1b; color: #ccc; padding: 2.5rem var(--gutter); text-align: center; font-size: 0.95rem; }
.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 1.5rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--accent); }
.site-footer p:last-child { margin: 0; color: #888; }

/* Lightbox (native <dialog>) */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; color: #fff; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 0.6rem; padding: 3.5rem 3.5rem 1.5rem; }
.lightbox img { max-width: min(100vw - 7rem, 90rem); max-height: calc(100vh - 7rem); width: auto; height: auto; object-fit: contain; border-radius: 0.25rem; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.lightbox figcaption { font-size: 0.95rem; color: #ddd; text-align: center; }
.lightbox button { position: absolute; background: rgba(255,255,255,0.12); color: #fff; border: 0; border-radius: 50%; width: 2.75rem; height: 2.75rem; font-size: 1.75rem; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background 0.15s; }
.lightbox button:hover { background: var(--accent); color: var(--ink); }
.lb-close { top: 0.75rem; right: 0.75rem; }
.lb-prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 0.5rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 40em) {
  .lightbox figure { padding: 3.5rem 0.5rem 1rem; }
  .lightbox img { max-width: calc(100vw - 1rem); max-height: calc(100vh - 6rem); }
}
