/* Regionální soubor Błędowice — static site stylesheet.
   Layout and measurements follow the Spacious theme by ThemeGrill (GPLv3),
   which this site used under WordPress. No JavaScript anywhere. */

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lato-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/lato-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --green: #0da519;
  --green-dark: #007300;
  --line: #eaeaea;
  --text: #666;
  --heading: #222;
  --title: #444;
  --dark: #3a3a3a;
  --row-height: 150px;  /* minimum: rows then grow to fill, three 3:2 photos fit at full width */
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, div, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure { margin: 0; padding: 0; }

body {
  padding: 30px 0;
  background: #fff;
  color: var(--text);
  font: 16px/20px "Lato", sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--green); text-decoration: none; }
strong { font-weight: bold; }
em, i, cite { font-style: italic; }
h1, h2, h3, h4, h5, h6 { padding-bottom: 18px; color: var(--heading); font-weight: normal; }
h1 { font-size: 30px; line-height: 36px; }
h2 { font-size: 28px; line-height: 34px; }
h3 { font-size: 26px; line-height: 32px; }
h4 { font-size: 24px; line-height: 30px; }
h5 { font-size: 22px; line-height: 28px; }
h6 { font-size: 19px; line-height: 25px; }
p { margin-bottom: 15px; line-height: 24px; }
ul, ol { list-style: none; }
sup { position: relative; bottom: 1ex; height: 0; font-size: 10px; line-height: 1; vertical-align: baseline; }
img { max-width: 100%; height: auto; margin-bottom: 18px; vertical-align: top; }

#page {
  max-width: 1268px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 6px rgba(100, 100, 100, .3);
}
.inner-wrap { max-width: 1218px; margin: 0 auto; }

/* ---------- Header ---------- */
.header-bar { border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 15px 0; }
.branding { margin-right: 25px; padding: 10px 20px 0 0; }
.site-title { padding-bottom: 5px; font-size: 30px; line-height: 36px; color: var(--heading); font-weight: normal; }
.site-title a { color: var(--title); font-size: 36px; }
.site-title a:hover { color: var(--green); }

/* ---------- Main menu ---------- */
.main-nav { margin-left: auto; padding-top: 5px; }
.nav-toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.menu-toggle { display: none; cursor: pointer; }
.menu { display: flex; flex-wrap: wrap; justify-content: flex-end; }
.menu > li { position: relative; padding-left: 20px; }
.menu a { display: block; height: 46px; padding-top: 16px; color: var(--title); }
.menu > li:hover > a,
.menu > li:focus-within > a,
.menu > li.current > a,
.menu > li.current-ancestor > a { color: var(--green); }
.menu svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.menu .flag { width: 16px; height: 11px; margin: 0; }

.sub-menu {
  display: none;
  position: absolute;
  top: 45px;
  left: 25px;
  z-index: 9999;
  width: 150px;
  border-top: 1px solid var(--green);
  background: rgba(255, 255, 255, .8);
}
.menu > li:hover > .sub-menu,
.menu > li:focus-within > .sub-menu { display: block; }
.sub-menu li { border-bottom: 1px solid var(--line); }
.sub-menu a { height: auto; padding: 6px 10px; color: var(--text); font-size: 13px; line-height: 21px; }
.sub-menu a:hover,
.sub-menu a:focus { background: #fff; color: var(--green); }

/* ---------- Page title band ---------- */
.title-band {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  background: var(--green);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .5);
}
.title-band h1 { padding: 0; color: #fff; font-size: 22px; line-height: 36px; }

/* ---------- Home slider: radio inputs give click control, keyframes give autoplay ---------- */
#featured-slider { position: relative; border-bottom: 1px solid var(--line); }
.slide-radio { position: absolute; width: 1px; height: 1px; opacity: 0; }
.slides { position: relative; aspect-ratio: 3 / 2; overflow: hidden; }
.slides img { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; object-fit: cover; opacity: 0; }
.dots { position: absolute; bottom: 15px; z-index: 2; width: 100%; line-height: 0; text-align: center; }
.dots label { display: inline-block; width: 18px; height: 6px; margin: 0 4px; background: #fff; cursor: pointer; }
.dots label:hover { background: var(--green); }

/* Autoplay: 5 slides, 6s each. Negative delays start each one mid-cycle. The extra 1s skips the
   slide 5 to slide 1 crossfade, which would otherwise play over slide 1 right at page load. */
@keyframes slide-fade {
  0%, 20% { opacity: 1; }
  23.3%, 96.7% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes dot-active {
  0%, 19.99% { background: var(--green); }
  20%, 100% { background: #fff; }
}
#slide-auto:checked ~ .slides img { animation: slide-fade 30s infinite; }
#slide-auto:checked ~ .dots label { animation: dot-active 30s infinite; }
#slide-auto:checked ~ .slides img:nth-child(1), #slide-auto:checked ~ .dots label:nth-child(1) { animation-delay: -1s; }
#slide-auto:checked ~ .slides img:nth-child(2), #slide-auto:checked ~ .dots label:nth-child(2) { animation-delay: -25s; }
#slide-auto:checked ~ .slides img:nth-child(3), #slide-auto:checked ~ .dots label:nth-child(3) { animation-delay: -19s; }
#slide-auto:checked ~ .slides img:nth-child(4), #slide-auto:checked ~ .dots label:nth-child(4) { animation-delay: -13s; }
#slide-auto:checked ~ .slides img:nth-child(5), #slide-auto:checked ~ .dots label:nth-child(5) { animation-delay: -7s; }

/* Manual choice: clicking a dot stops autoplay and pins that slide. */
#slide-1:checked ~ .slides img:nth-child(1),
#slide-2:checked ~ .slides img:nth-child(2),
#slide-3:checked ~ .slides img:nth-child(3),
#slide-4:checked ~ .slides img:nth-child(4),
#slide-5:checked ~ .slides img:nth-child(5) { opacity: 1; }
#slide-1:checked ~ .dots label:nth-child(1),
#slide-2:checked ~ .dots label:nth-child(2),
#slide-3:checked ~ .dots label:nth-child(3),
#slide-4:checked ~ .dots label:nth-child(4),
#slide-5:checked ~ .dots label:nth-child(5) { background: var(--green); }

@media (prefers-reduced-motion: reduce) {
  #slide-auto:checked ~ .slides img,
  #slide-auto:checked ~ .dots label { animation: none; }
  #slide-auto:checked ~ .slides img:nth-child(1) { opacity: 1; }
  #slide-auto:checked ~ .dots label:nth-child(1) { background: var(--green); }
}

/* ---------- Content ---------- */
#main { padding: 40px 0 10px; }
#primary { width: 61.5763547%; margin: 0 auto; padding-bottom: 60px; }
.home #primary { padding-bottom: 45px; }
.entry-content ul { padding-left: 35px; margin-bottom: 30px; list-style: square; }
.entry-content a:hover { text-decoration: underline; }
.entry-content a.thumb:hover { text-decoration: none; }
figure { text-align: center; }
.alignleft { display: inline; float: left; margin-right: 30px; }
.alignright { display: inline; float: right; margin-left: 30px; }
.aligncenter { display: block; clear: both; margin-right: auto; margin-left: auto; }
img.alignleft, img.alignright, img.aligncenter { margin-bottom: 1.625em; }
.figure { margin: 0 0 1em; }
.figure .aligncenter { display: table; }
.text-center { text-align: center; }

.columns { display: flex; flex-wrap: wrap; margin-bottom: 1.75em; }
.column { flex-grow: 1; min-width: 0; overflow-wrap: break-word; }
@media (max-width: 599px) {
  .column { flex-basis: 100% !important; }
}
@media (min-width: 600px) and (max-width: 781px) {
  .column:not(:only-child) { flex-basis: calc(50% - 1em) !important; flex-grow: 0; }
  .column:nth-child(2n) { margin-left: 2em; }
}
@media (min-width: 782px) {
  .columns { flex-wrap: nowrap; }
  .column { flex-basis: 0; }
  .column[style*="flex-basis"] { flex-grow: 0; }
  .column:not(:first-child) { margin-left: 2em; }
}

.pdf-viewer { display: block; width: 100%; height: 80vh; min-height: 480px; margin-bottom: 15px; border: 1px solid var(--line); }

/* ---------- Photo galleries: justified rows, each thumb grows in proportion to its aspect ratio ---------- */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.gallery::after { content: ""; flex: 999 1 0; }  /* keeps the last row from stretching */
.thumb {
  display: block;
  flex: var(--r) 1 calc(var(--r) * var(--row-height));
  aspect-ratio: var(--r);
  overflow: hidden;
  cursor: zoom-in;
}
.thumb img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; transition: transform .25s; }
.thumb:hover img, .thumb:focus img { transform: scale(1.05); }

/* Lightbox opens through the URL fragment (:target). Lazy images stay unfetched until opened. */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .92);
}
.lightbox:target { display: flex; }
html:has(.lightbox:target) { overflow: hidden; }
.lb-backdrop { position: absolute; inset: 0; cursor: zoom-out; }
.lightbox img {
  position: relative;
  width: auto;
  height: auto;
  max-width: calc(100vw - 130px);
  max-height: calc(100vh - 40px);
  margin: 0;
  pointer-events: none;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  color: #fff;
  font-size: 44px;
  line-height: 1;
  text-align: center;
  opacity: .8;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; text-decoration: none; }
.lb-close { top: 10px; right: 15px; width: 44px; }
.lb-prev, .lb-next { top: 50%; width: 55px; padding: 20px 0; transform: translateY(-50%); }
.lb-prev { left: 5px; }
.lb-next { right: 5px; }

/* ---------- Footer ---------- */
.footer-bar { padding: 10px 0; border-top: 1px solid var(--line); background: #f8f8f8; }
.copyright { color: var(--text); font-size: 12px; line-height: 18px; }
.copyright a { color: var(--text); }
.copyright a:hover { color: var(--green); }

/* Back-to-top button fades in with scroll where the browser supports scroll-driven animation. */
#scroll-up { display: none; }
@supports (animation-timeline: scroll()) {
  @keyframes scroll-up-in { from { opacity: 0; visibility: hidden; } 15%, to { opacity: .8; visibility: visible; } }
  #scroll-up {
    display: block;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    width: 38px;
    height: 38px;
    background: var(--green);
    color: #fff;
    font-size: 22px;
    line-height: 38px;
    text-align: center;
    opacity: 0;  /* stays hidden on pages too short to scroll, where the timeline is inactive */
    visibility: hidden;
    animation: scroll-up-in linear both;
    animation-timeline: scroll();
  }
}

/* ---------- Responsive, at the theme's breakpoints ---------- */
@media (max-width: 1308px) {
  #page { width: 97%; }
  .inner-wrap { width: 94%; }
}
@media (max-width: 1078px) {
  body { padding: 15px 0; }
  .copyright { text-align: center; }
}
@media (max-width: 768px) {
  :root { --row-height: 110px; }
  .header-row { display: block; }
  .branding { margin: 0 0 10px; padding: 0; text-align: center; }
  .main-nav { margin: 0; padding: 0; }
  .menu-toggle {
    display: block;
    padding: 5px 22px;
    background: var(--dark);
    color: #fff;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
  }
  .menu-toggle::before { content: "\2261"; margin-right: 10px; }
  .menu-toggle:hover { background: var(--green); }
  .nav-toggle-input:focus-visible + .menu-toggle { outline: 2px solid var(--green); outline-offset: 2px; }
  .menu { display: none; }
  .nav-toggle-input:checked ~ .menu { display: block; }
  .menu > li { padding: 0; }
  .menu li { background: var(--dark); }
  .menu li:hover, .menu li.current { background: var(--green); }
  .menu a, .menu > li:hover > a, .menu > li.current > a, .menu > li.current-ancestor > a,
  .menu > li:focus-within > a { display: block; height: auto; padding: 10px 40px; color: #fff; }
  .sub-menu { display: block; position: static; width: auto; border: 0; background: none; }
  .sub-menu li { border: 0; }
  .sub-menu a, .sub-menu a:hover, .sub-menu a:focus { padding: 10px 40px 10px 60px; background: none; color: #fff; font-size: 16px; line-height: 20px; }
  #primary { width: 100%; }
  .lightbox img { max-width: calc(100vw - 16px); }
  .lb-prev, .lb-next { font-size: 38px; text-shadow: 0 0 6px #000; }
}
@media (max-width: 600px) {
  .dots { bottom: 5px; }
  .dots label { width: 12px; height: 4px; margin: 0 3px; }
}
@media (max-width: 420px) {
  .inner-wrap { width: 95%; }
}
