/* HomePage specific styles - only unique HomePage styles kept here */

/* --- UNIQUE HOMEPAGE LAYOUT/CONTENT STYLES --- */

/* Page load animations */
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInMain {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Initial page load animation */
body {  animation: fadeInPage 1.1s cubic-bezier(.23,1,0.32,1) forwards;
  opacity: 0;
}

/* Dark mode background handled by common.css ::before pseudo-element */

/* Header animation - starts first */
header {
  animation: fadeInRow 0.8s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

/* Content wrapper animation - starts second */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Content rows animations */
.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 0.8s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: calc(0.2s + (var(--row-index, 0) * 0.1s));
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: calc(0.3s + (var(--row-index, 0) * 0.1s));
}

/* Footer animation - last to appear */
footer {
  animation: fadeInRow 0.8s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.3s cubic-bezier(.23, 1, 0.32, 1),
              color 0.3s cubic-bezier(.23, 1, 0.32, 1),
              box-shadow 0.3s cubic-bezier(.23, 1, 0.32, 1),
              transform 0.3s cubic-bezier(.23, 1, 0.32, 1);
  transform: translateY(0);
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  font-size: 1.2rem;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin-left: 0.5rem;
}

.img-box.large-img {
  background: #eee !important;
  z-index: 1;
  width: 320px !important;
  height: 220px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Remove background when img-box contains an image */
.img-box.large-img:has(img) {
  background: transparent !important;
}

/* Alternative approach for browsers that don't support :has() */
.img-box.large-img.has-image {
  background: transparent !important;
}

/* Style for images inside large img-box */
.img-box.large-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 4px 32px rgba(0,0,0,0.18);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
}

/* Unikátní dark mode pro HomePage */
body.dark-mode .highlight {
  color: var(--color-highlight);
}
body.dark-mode .modal-content {
  background: #222;
  color: #e8f0f0;
}
body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
}

/* Force hide theme toggle button below 900px width */
@media (max-width: 900px) {
  #themeToggle {
    display: none !important;
  }
}

/* Odstraněn pseudo-element body::after, background se nastavuje přímo na body */

body.dark-mode {
  --color-text: #e8f0f0;  --color-bg: #0d1f21;  --color-primary: #3AB7BF;
  --color-secondary: #217482;
  --color-accent: #cfc554;
  --color-highlight: #f5e642;
  --color-header-bg: var(--color-bg); /* Changed to use the same color as body */  --color-border-glow: rgba(127, 211, 228, 0.3);
  background-color: var(--color-bg);
  color: var(--color-text);
}

header {
  background-color: var(--color-bg);
  padding-left: 2vw;
  padding-right: 1vw;
  position: relative;
  border: none;
  outline: none;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  gap: 0.7rem;
  width: 100vw;
  max-width: none;
  margin: 0;
  left: 50%;
  right: 50%;
  transform: translateX(-50%);
  padding-left: 2vw;
  padding-right: 2vw;
  box-sizing: border-box;
}

.logo {
  height: 150px;
  display: flex;
  align-items: center;
  margin: 0;
}

#logo_image {
  height: 150px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  /* Use src attribute in HTML instead of CSS content */
}

/* This will be handled by JavaScript to ensure proper switching */

.contact {
  display: block;
  width: auto;
  margin-top: 1.5rem;
  text-align: center;
}

.header_contact {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  font-size: 0.9rem;
  width: auto;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

#header_email {
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
}

a.header_email,
a.header_email:link,
a.header_email:visited,
a.header_email:active,
.header_email:hover {
  color: inherit;
}

a.header_email,
a.header_email:link,
a.header_email:visited,
a.header_email:active {
  text-decoration: none;
  font-weight: inherit;
  font-family: inherit;
}

a.header_email:hover {
  color: var(--color-highlight);
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background-color: transparent; /* Changed to transparent */
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 0.5rem;
  position: relative;
}

.nav_button {
  position: relative;
  margin: 0;
}

.nav_button:not(:first-child) {
  margin-left: -1px;
}

@media (max-width: 700px) {
  .nav_button:not(:last-child)::after {
    display: none;
  }
}

/* --- NAVBAR BUTTONS --- */
@keyframes buttonPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes buttonActivate {
  0% { transform: scale(1); }
  30% { transform: scale(0.95); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes buttonClick {
  0% { transform: scale(1); }
  40% { transform: scale(0.92); }
  70% { transform: scale(1.05); }
  85% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.nav_button {
  background: transparent !important;
  border: 1px solid transparent;
  color: var(--color-text) !important;
  box-shadow: none;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  z-index: 2;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  margin: 0 0.3rem;
  overflow: hidden;
}

/* Gray separator lines between navbar buttons */
.nav_button:not(:last-child)::after {
  content: '';
  display: inline-block;
  position: absolute;
  right: -0.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 1.5em;
  background-color: #aaa;
  opacity: 0.5;
  transition: background-color var(--transition-speed) var(--transition-function),
              opacity var(--transition-speed) var(--transition-function);
}

body.dark-mode .nav_button:not(:last-child)::after {
  background-color: #777;
  opacity: 0.6;
}

@media (max-width: 700px) {
  .nav_button:not(:last-child)::after {
    display: none;
  }
}

.nav_button.clicking {
  animation: buttonClick 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary)) !important;
  color: white !important;
  border-color: var(--color-accent);
}

.nav_button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.nav_button:hover, .nav_button:focus {
  color: var(--color-primary) !important;
  border-color: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(59, 151, 165, 0.15);
  transform: translateY(-2px);
}

.nav_button:hover::before, .nav_button:focus::before {
  opacity: 0.1;
}

.nav_button:active {
  animation: buttonActivate 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  transform: translateY(0);
}

.nav_button.active {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary)) !important;
  color: white !important;
  border: 1px solid var(--color-accent);
  box-shadow: 0 2px 10px rgba(59, 151, 165, 0.2);
  animation: buttonPulse 2s infinite ease-in-out;
}

body.dark-mode .nav_button {
  background: transparent !important;
  border-color: transparent;
  color: var(--color-text) !important;
}

body.dark-mode .nav_button::before {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-accent));
}

body.dark-mode .nav_button:hover, body.dark-mode .nav_button:focus {
  color: var(--color-accent) !important;
  border-color: var(--color-secondary);
  box-shadow: 0 2px 8px rgba(58, 183, 191, 0.15);
}

body.dark-mode .nav_button.active {
  background: linear-gradient(to bottom, var(--color-secondary), var(--color-primary)) !important;
  color: var(--color-highlight) !important;
  border: 1px solid var(--color-highlight);
  box-shadow: 0 2px 10px rgba(58, 183, 191, 0.3);
}


#themeToggle {
  position: relative;
  margin: 0;
  align-self: center;
  z-index: 2000;
  border-radius: 50%;
  aspect-ratio: 1/1;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  background-color: var(--color-accent);
  color: #000f08;
  border: 1px solid transparent;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

#themeToggle:hover {
  transform: translateY(-2px) rotate(10deg);
  box-shadow: 0 3px 10px rgba(138, 123, 0, 0.2);
  border-color: var(--color-secondary);
  background-color: var(--color-highlight);
}

#themeToggle:active {
  transform: scale(0.95);
  box-shadow: 0 1px 5px rgba(138, 123, 0, 0.15);
  transition: all 0.1s ease;
}

#themeToggle.disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark-mode #themeToggle {
  background-color: var(--color-highlight);
  color: #0d1f21;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-color: transparent;
}

body.dark-mode #themeToggle:hover {
  transform: translateY(-2px) rotate(-10deg);
  background-color: var(--color-accent);
  color: #0d1f21;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  border-color: var(--color-secondary);
}

.top-bar {
  position: relative;
}

@media (max-width: 900px) {
  body {
    background-size: 100vw auto;
    background-position: center 120px; /* posun bg níž */
  }
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: clamp(1.2rem, 3vw, 2rem);/* zpět menší mezera */
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 48px;
  }
  #logo_image {
    height: 48px;
    width: auto;
    max-width: 98vw;
    min-width: unset;
  }
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    justify-content: flex-start;
    padding-left: 2vw;
    padding-right: 2vw;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .header-nav {
    justify-content: center;
  }
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    justify-content: flex-start;
  }  #themeToggle {
    margin-left: 0;
    margin-top: 0.5rem;
    /* Keep the theme toggle visible, position at top right */
    position: absolute;
    top: 10px;
    right: 10px;
  }
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: clamp(1.2rem, 3vw, 2rem); /* posun main výš */
  }
}

@media (max-width: 780px) {
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
  /* Keep theme toggle visible */
  #themeToggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }  body.dark-mode header {
    box-shadow: none;
  }
  body.dark-mode nav {
    padding: 0.3rem 0.2rem;
    border-radius: 3px;
    box-shadow: none;
  }
}

@media (max-width: 700px) {
  body, body.dark-mode {
    background-size: 100vw auto;
    background-position: center 20px;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(24px, 6vw, 60px);
    min-height: 16px;
    max-height: 70px;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* --- FIX: Fallbacky pro viditelnost a barvy --- */
.row {
  opacity: 1 !important;
}

.nav_button {
  color: var(--color-text, #000f08) !important;
  z-index: 2;
}

/* Removed styles for .img-box.large-img and its box-shadow */

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(400px, 32vw, 700px);
  min-height: 350px;
  max-height: 700px;
}

@media (max-width: 1000px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(420px, 85vw, 1200px) auto;
  background-position: center 150px; /* Přizpůsobeno většímu logu */
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

/* Opravdu zarovnat text Poradna úplně vpravo a nahoru v pravé části řádku */
.row.poradna-row {
  align-items: flex-start;
}
.row.poradna-row .right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
}

.row.poradna-row .right .clickable-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.row.poradna-row .right .clickable-block h3 {
  align-self: flex-end;
  margin-bottom: 1.5rem;
}

/* Opravdu zarovnat text Poradna úplně vpravo a nahoru v pravé části řádku */
.row.even#poradnaRow {
  align-items: center;
  justify-content: center;
}

#sortimentRow {
  align-items: center;
  justify-content: center;
  margin-bottom: 64px;
}

#sortimentRow .left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

#sortimentRow h3 {
  text-align: center;
  margin: 0;
  align-self: center;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
}

.row.even#poradnaRow .right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.row.even#poradnaRow h3 {
  text-align: center;
  margin: 0;
  align-self: center;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
}

.row.poradna-row .right p {
  text-align: center;
  margin: 0 auto;
  padding-top: 1rem;
  max-width: 80%;
}

/* Vystředění a posunutí textu "Přijďte se podívat..." lehce dolů */
.row.poradna-row .right p {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 3rem;
  text-align: center;
  align-self: center;
  width: 100%;
}
/* Zarovnání Poradna jako tlačítko úplně vpravo pomocí align-self */
.row.poradna-row .right h3 {
  align-self: flex-end;
  margin: 0;
  padding: 0;
  /* text-align: right; odstraněno */
  width: 100%;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
  overflow: hidden;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.row.even#poradnaRow {
  position: relative;
  z-index: 1;
  margin-bottom: 64px;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Base clickable block style */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(.23, 1, 0.32, 1);
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
  transform: translateY(-2px);
  transition: background 0.3s cubic-bezier(.23, 1, 0.32, 1),
              color 0.3s cubic-bezier(.23, 1, 0.32, 1),
              box-shadow 0.3s cubic-bezier(.23, 1, 0.32, 1),
              transform 0.3s cubic-bezier(.23, 1, 0.32, 1);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  transition: transform 0.7s cubic-bezier(.23, 1, 0.32, 1),
              color 0.3s cubic-bezier(.23, 1, 0.32, 1),
              background-color 0.3s cubic-bezier(.23, 1, 0.32, 1);
  transform-origin: center;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Removed styles for .img-box.large-img and its box-shadow */
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

/* --- FORCE DIVIDER HEIGHT AT END OF FILE --- */
.divider {
  width: 100%;
  height: clamp(200px, 14vw, 250px) !important;
  min-height: 200px !important;
  max-height: 250px !important;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

/* --- ANIMACE POPUPU --- */
@keyframes popupFadeIn {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Highlighted state */
.row h3.popup-highlight {
  background: #43a7d6;
  color: #fff;
  transform: translateY(8px);
  transition: transform 0.7s cubic-bezier(.23, 1, 0.32, 1),
              background-color 0.7s cubic-bezier(.23, 1, 0.32, 1),
              color 0.7s cubic-bezier(.23, 1, 0.32, 1);
}

/* Closing animation */
.clickable-block.closing h3.popup-highlight {
  transform: translateY(0);
  background: none;
  color: inherit;
  transition: transform 0.7s cubic-bezier(.23, 1, 0.32, 1),
              background-color 0.7s cubic-bezier(.23, 1, 0.32, 1),
              color 0.7s cubic-bezier(.23, 1, 0.32, 1);
}

/* Animation for the title during popup closing */
.main-popup-row.closing ~ .row .clickable-block h3.popup-highlight {
  transform: translateY(5px);
  transition: transform 0.7s cubic-bezier(.23, 1, 0.32, 1),
              color 0.3s cubic-bezier(.23, 1, 0.32, 1),
              background-color 0.3s cubic-bezier(.23, 1, 0.32, 1);
}
@keyframes popupFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(40px) scale(0.98); }
}
@keyframes scrollHighlight {
  0% { background-color: transparent; }
  30% { background-color: rgba(127, 211, 228, 0.2); }
  100% { background-color: transparent; }
}

/* Clickable popup styles - naznačení, že při kliknutí se může zavřít */
.clickable-popup {
  cursor: pointer;
}

/* --- PULLDOWN POPUP DESIGN --- */
.main-popup-box {
  width: 100%;
  max-width: none;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 20;
  margin-top: 0;
  margin-bottom: 64px;
}
.main-popup-inner {
  width: 100%;
  max-width: var(--main-max-width, 900px); /* fallback if --main-max-width not set */
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: rgba(255,255,255,0.98);
  border-radius: 1.2rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1.5px 0.5px rgba(71,163,179,0.08);
  overflow: hidden;
  animation: popup-fadein 0.5s cubic-bezier(.23,1,0.32,1);
}
body.dark-mode .main-popup-inner {
  background: #0a232a !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.38), 0 1.5px 0.5px rgba(67,167,214,0.13);
}
@media (max-width: 700px) {
  .main-popup-inner {
    flex-direction: column;
    max-width: 95vw;
    min-width: unset;
  }
}
.main-popup-text {
  flex: 2 1 0;
  padding: 2rem 1.5rem 1.5rem 2rem;
  font-size: 1.13rem;
  color: #1a2a2a;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.main-popup-text strong {
  color: var(--color-primary);
  font-size: 1.18em;
  margin-bottom: 0.5em;
}
body.dark-mode .main-popup-text {
  color: var(--color-text, #f0fff8) !important;
}
body.dark-mode .main-popup-text strong {
  color: var(--color-accent, #b5a108) !important;
}
.main-popup-image {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e5f7fb 60%, #f7e34a 100%);
  min-width: 120px;
  padding: 1.2rem 1.2rem 1.2rem 0.5rem;
}
.main-popup-image img {
  max-width: 100px;
  max-height: 120px;
  border-radius: 0.7rem;
  box-shadow: 0 2px 12px rgba(71,163,179,0.13);
  background: #fff;
}
body.dark-mode .main-popup-image {
  background: linear-gradient(135deg, #0a232a 60%, #43a7d6 100%) !important;
}
body.dark-mode .main-popup-image img {
  background: #0a232a !important;
  box-shadow: 0 2px 12px rgba(67,167,214,0.22) !important;
}
.main-popup-close {
  position: absolute;
  top: 0.7rem;
  right: 1.1rem;
  background: none;
  border: none;
  font-size: 2.1rem;
  color: #47a3b3;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 2;
}
.main-popup-close:hover {
  color: #298ebc;
}
body.dark-mode .main-popup-close {
  color: var(--color-accent, #b5a108) !important;
}
body.dark-mode .main-popup-close:hover {
  color: #fff !important;
}
@media (max-width: 700px) {
  .main-popup-text {
    padding: 1.3rem 1.1rem 1.1rem 1.3rem;
    font-size: 1.01rem;
  }
  .main-popup-image {
    padding: 0.7rem 0.7rem 0.7rem 0.7rem;
    min-width: 80px;
  }
  .main-popup-image img {
    max-width: 70px;
    max-height: 80px;
  }
}
@keyframes popup-fadein {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- PAGE LOAD ANIMATION --- */
body.page-fadein {
  opacity: 0;
  transform: translateY(40px);
  transition: none;
  animation: fadeInPage 1.1s cubic-bezier(.23,1,0.32,1) forwards;
}
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.preload {
  opacity: 0;
  transform: translateY(40px);
  transition: none;
}
body.page-loaded {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s cubic-bezier(.23,1,0.32,1), transform 0.8s cubic-bezier(.23,1,0.32,1);
}

/* Removed empty ruleset for .page-fadein.page-fadein-active as it is not needed. */

body.dark-mode.page-fadein {
  background-color: var(--color-bg);
}

/* Zrušení blur efektu na obrázku v popupu */
.main-popup-image img {
  filter: none !important;
}

/* Zrušení blur efektu a přidání podsvícení pro obrázek u klikacího textu */
/* Opravdu zruš blur a přidej pouze podsvícení pro obrázek vedle textu */
.img-box img {
  filter: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 12px !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Pokud je obrázek přímo v .img-box bez <img>, přidej podsvícení i na .img-box */
.img-box {
  box-shadow: none !important;
  background: #eee !important;
  border-radius: 12px !important;
}

/* Lehké podsvícení pro popup */
.main-popup-row {
  box-shadow: none !important;
  background: rgba(255,255,255,0.98);
  border-radius: 16px;
}
body.dark-mode .main-popup-row {
  background: rgba(10, 35, 42, 0.98);
}

/* Zvýraznění nadpisu po animaci popupu */
.row h3.popup-highlight {
  background: #43a7d6;
  color: #fff;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}

/* --- REMOVED DUPLICATE ANIMATIONS --- */

/* Base popup styling */
.main-popup-row {
  max-height: 0;
  opacity: 0;
  transform: translateY(0);
  will-change: max-height, opacity, transform;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: 
    max-height 0.5s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.4s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Show state animation */
.main-popup-row.show {
  max-height: 800px; /* Higher to accommodate different content sizes */
  opacity: 1;
  transform: translateY(0);
}

/* Content in show state */
.main-popup-row.show .main-popup-inner {
  opacity: 1;
  transform: translateY(0);
  transition: 
    opacity 0.4s 0.1s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.4s 0.1s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Closing state animation */
.main-popup-row.closing {
  max-height: 0;
  opacity: 0;
  transform: translateY(80px);
  transition: 
    max-height 0.8s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Content in closing state */
.main-popup-row.closing .main-popup-inner {
  opacity: 0;
  transform: translateY(60px);
  transition: 
    opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}
.main-popup-row:not(.show):not(.closing) {
  opacity: 0;
  pointer-events: none;
  animation: popupFadeOut 0.7s cubic-bezier(.23,1,0.32,1);
  transform: translateY(40px) scale(0.98);
}
@keyframes popupFadeIn {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes popupFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(40px) scale(0.98); }
}

.main-popup-row {
  opacity: 0;
  pointer-events: none;
  transform: translateY(0) scale(0.98);
  transition: opacity 0.6s, transform 0.6s;
  will-change: opacity, transform;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  z-index: 1002;
  margin-top: 0;
}
.main-popup-row.show {
  opacity: 1;
  pointer-events: auto;
  animation: popupFadeIn 0.7s cubic-bezier(.23,1,0.32,1);
  transform: translateY(0) scale(1);
}
.main-popup-row:not(.show) {
  opacity: 0;
  pointer-events: none;
  animation: popupFadeOut 0.7s cubic-bezier(.23,1,0.32,1);
  transform: translateY(40px) scale(0.98);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Highlight text adjustments */
.highlight {
  z-index: 2;
  position: relative;
  text-align: center;
  width: 100%;
  margin: 2rem auto;
  padding: 1rem;
  font-size: clamp(1.1rem, 2vw, 1.8rem);
  color: var(--color-highlight);
}

h3.highlight {
  clear: both;
  display: block;
  position: relative;
  z-index: 2;
  background-color: var(--color-bg, #f0fff8);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-top: 64px;
}

/* Dark mode */
body.dark-mode {
  --color-text: #e8f0f0;  --color-bg: #0d1f21; /* tmavá modrozelená */  --color-primary: #3AB7BF; /* světlá modrá */  --color-secondary: #217482; /* tmavší tyrkysová */
  --color-accent: #cfc554; /* olivová */
  --color-highlight: #f5e642; /* světlá žlutá */
  --color-header-bg: var(--color-bg); /* Changed to use the same color as body */
  --color-border-glow: rgba(127, 211, 228, 0.3);
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg); /* Changed to directly use body bg color */
  color: var(--color-text);
  box-shadow: none;
}

body.dark-mode .top-bar {
  background-color: var(--color-bg); /* Changed to directly use body bg color */
}

/* Make sure the divider in dark mode has the same color as the header */
body.dark-mode .divider {
  border-top: none;
  border-bottom: none;
  margin-top: -1px; /* Fix for any gap between header and divider */
  position: relative; /* Enable positioning context */
}

/* Fix for line between header and divider in dark mode */
body.dark-mode .divider::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 3px; /* Cover any possible line */
  background-color: var(--color-bg); /* Changed to match body background color */
  z-index: 5;
}

/* Add special class to header for fixing browser rendering issues */

body.dark-mode header {
  background-color: var(--color-bg); /* Changed to directly use body bg color */
  color: var(--color-text);
  box-shadow: none;
  position: relative; /* Enable positioning context */
  z-index: 4;
  border-bottom: 0;
}

body.dark-mode .contact,
body.dark-mode .header_contact,
body.dark-mode #header_email {
  color: var(--color-text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .header_contact li {
  position: relative;
  padding-left: 5px;
}

body.dark-mode .header_contact li::before {
  content: '';
  position: absolute;
  left: -8px;
  opacity: 0.7;
}

body.dark-mode a.header_email,
body.dark-mode a.header_email:link,
body.dark-mode a.header_email:visited,
body.dark-mode a.header_email:active {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
  position: relative;
}

body.dark-mode a.header_email:hover {
  text-decoration: none;
}

body.dark-mode nav {
  background-color: transparent;
  box-shadow: none;
  border-radius: 4px;
}

body.dark-mode .nav_button {
  background: transparent !important;
  color: var(--color-primary) !important;
  border: 2px solid transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

/* Dark mode separator styling moved to header-footer.css */

body.dark-mode main {
  background: #041A22;
  color: var(--color-text);
  box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.28);
}

body.dark-mode main h2 {
  color: var(--color-highlight);
  background: linear-gradient(90deg, var(--color-bg) 0%, #041A22 50%, var(--color-bg) 100%);
}

body.dark-mode .highlight {
  color: var(--color-highlight);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #0a232a;
}

body.dark-mode .left .clickable-block:hover, 
body.dark-mode .right .clickable-block:hover {
  background: var(--color-secondary);
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67, 167, 214, 0.28);
}

body.dark-mode footer {
  background-color: #0c2628;
  color: #f0fff8;
  border-top: 1px solid rgba(67, 167, 214, 0.2);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid transparent !important;
  color: var(--color-text);
}
body.dark-mode .nav_button:hover, body.dark-mode .nav_button:focus {
  border: 2px solid transparent !important;
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* --- FIX: Fallbacky pro viditelnost a barvy --- */
.row {
  opacity: 1 !important;
}

.nav_button {
  color: #000f08 !important;
  z-index: 2;
}

.img-box.large-img {
  background: #eee !important;
  z-index: 1;
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(48px, 6vw, 180px);
  min-height: 32px;
  max-height: 180px;
}

/* Remove any previous .divider rules with !important or large static values below this comment! */

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  --main-max-width: 900px;
  width: 100%;
  max-width: var(--main-max-width);
  margin: 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}
@media (max-width: 950px) {
  main {
    --main-max-width: 98vw;
  }
}
@media (max-width: 700px) {
  main {
    --main-max-width: 100vw;
  }
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
  transform: translateY(2px);
  transition: all 0.3s cubic-bezier(.23, 1, 0.32, 1);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  transition: all 0.7s cubic-bezier(.23, 1, 0.32, 1);
  transform: translateY(0);
  position: relative;
}

/* When popup is opening, slide the title down smoothly */
.main-popup-row.show ~ .row .clickable-block h3.popup-highlight {
  transform: translateY(8px);
  background: #43a7d6;
  color: #fff;
  transition: all 0.7s cubic-bezier(.23, 1, 0.32, 1);
}

/* When popup is closing, slide the title back up smoothly */
.main-popup-row.closing ~ .row .clickable-block h3.popup-highlight {
  transform: translateY(0);
  background: none;
  color: inherit;
  transition: all 0.7s cubic-bezier(.23, 1, 0.32, 1);
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  position: relative;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(150px, 35vw, 300px);
  min-height: 100px;
  max-height: 300px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.7s cubic-bezier(.23, 1, 0.32, 1),
              background-color 0.7s cubic-bezier(.23, 1, 0.32, 1),
              color 0.7s cubic-bezier(.23, 1, 0.32, 1);
  will-change: transform, background-color, color;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(48px, 6vw, 90px);
  min-height: 32px;
  max-height: 90px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(90px, 12vw, 250px);
  min-height: 70px;
  max-height: 250px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(200px, 14vw, 250px);
  min-height: 200px;
  max-height: 250px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* === DIVIDER: clean responsive version === */
.divider {
  width: 100%;
  height: clamp(200px, 14vw, 250px);
  min-height: 200px;
  max-height: 250px;
}

/* Menší výška pro střední obrazovky (900px–1150px) */
@media (max-width: 1150px) and (min-width: 900px) {
  .divider {
    height: clamp(90px, 8vw, 140px);
    min-height: 80px;
    max-height: 140px;
  }
}

/* Ještě menší výška pod 900px */
@media (max-width: 899px) and (min-width: 780px) {
  .divider {
    height: clamp(48px, 6vw, 90px);
    min-height: 32px;
    max-height: 90px;
  }
}

/* Skrytí divideru pod 780px */
@media (max-width: 779px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
 
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
  color: #fff;
}

body.dark-mode footer {
  background-color: #222;
  color: #f0fff8;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .header-nav {
    justify-content: center;
  }
  nav {
    gap: 0.5rem;
    margin-left: 2vw;
    margin-right: 2vw;
  }
  .nav_button {
    max-width: 48vw;
    min-width: 120px;
  }
  #themeToggle {
    position: absolute;
    top: 1.2rem;
    right: 2vw;
    margin: 0;
    align-self: flex-end;
    z-index: 101;
  }
}

@media (max-width: 630px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
  }
  .nav_button {
    flex: 1 1 45%;
    min-width: 140px;
    max-width: 48vw;
    height: 60px;
    font-size: 1rem;
    white-space: normal;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .content .row,
  .content .row.even {
    flex-direction: column !important;
    align-items: stretch;
    gap: 1rem;
  }
  .left, .right {
    align-items: center;
    width: 100%;
    text-align: center;
  }
  .img-box {
    width: 100%;
    margin: 0 auto;
    min-height: 80px;
    max-width: 100%;
  }
  .left h3, .right h3 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    display: inline-block;
    width: auto;
    max-width: 100%;
  }
}

@media (max-width: 521px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 60vw;
    min-width: unset;
    margin: 0 auto 0.5rem auto;
    display: block;
  }
  .top-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    position: relative;
  }
  .header-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
  }
  #themeToggle {
    margin: 0.7rem auto 0 auto;
    display: flex;
    align-self: center;
  }
}
@media (max-width: 480px) {
  body {
    background-size: cover;
    background-position: center top;
  }
  .logo {
    position: static;
    top: unset;
    left: unset;
    height: 40px;
  }
  #logo_image {
    height: 40px;
    width: auto;
    max-width: 90vw;
    min-width: unset;
  }
  .nav_button {
    min-width: 60px;
    min-height: 60px;
    max-width: 100vw;
    max-height: 60px;
    width: 100%;
    height: 60px;
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0;
    white-space: normal;
    text-overflow: clip;
    overflow: hidden;
  }
  /* divider */
  .divider {
    width: 100%;
    height: clamp(12px, 4vw, 32px);
    min-height: 8px;
    max-height: 36px;
  }
  #themeToggle {
    top: 0.5rem;
    right: 1vw;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    aspect-ratio: 1/1;
  }
}

/* Zarovnání loga, navigace a darkmode buttonu do jednoho řádku a středové zarovnání */
.header-left {
  display: flex;
  flex-direction: row;
  align-items: center; /* Zarovnání středů loga a navigace */
  gap: 1.2rem;
  margin-left: 0;
  width: auto;
  position: static;
  z-index: 2001;
}

@media (max-width: 900px) {
  .header-left {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }
  .logo {
    height: 32px;
  }
}

/* divider */
.divider {
  width: 100%;
  height: clamp(40px, 10vw, 160px);
  min-height: 32px;
  max-height: 180px;
}

@media (max-width: 780px) {
  .divider {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    display: none !important;
  }
  main {
    margin-top: 0.5rem !important; /* malá mezera pod top-bar i bez divideru */
  }
}

/* Main */
main {
  width: 100%;
  max-width: clamp(320px, 80vw, 900px);
  margin: 0 auto 0 auto; /* Odstraněn margin-top, mezera je řešena dividerem */
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.07);
  padding: clamp(1rem, 3vw, 2rem) clamp(1vw, 2.5vw, 3vw);
  animation: fadeInMain 1.1s cubic-bezier(.23,1,0.32,1);
  flex: 1 0 auto;
  background-repeat: no-repeat;
  background-size: clamp(480px, 95vw, 1400px) auto;
  background-position: center 100px;
}

@media (max-width: 900px) {
  main {
    max-width: clamp(320px, 88vw, 600px);
    margin-top: 0 !important;
  }
}
@media (max-width: 700px) {
  main {
    max-width: clamp(320px, 98vw, 540px);
  }
}
@media (max-width: 480px) {
  main {
    max-width: 100vw;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0 !important;
  }
}

main h2 {
  color: var(--color-secondary);
  background: linear-gradient(90deg, var(--color-bg) 0%, #fff 50%, var(--color-bg) 100%);
  text-align: center;
  margin-bottom: 2rem;
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  font-weight: bold;
  border-radius: 12px;
  padding: clamp(0.5rem, 2vw, 1rem) 0.5rem;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  letter-spacing: 1px;
}


/* Obsah mainu */
.content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.row {
  display: flex;
  gap: 2rem;
  align-items: center;
  opacity: 1 !important;
  transform: translateY(40px);
  animation: fadeInRow 1s cubic-bezier(.23,1,0.32,1) forwards;
  animation-delay: 0.3s;
}

.row.even {
  flex-direction: row-reverse;
  animation-delay: 0.5s;
}

.left, .right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
}

/* Nové: celý blok (nadpis + obrázek) je klikací */
.left .clickable-block, .right .clickable-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s, box-shadow 0.18s;
}
.left .clickable-block:hover, .right .clickable-block:hover {
  background: #43a7d6;
  color: #fff;
  box-shadow: 0 8px 24px 0 rgba(67,167,214,0.18);
}

.left .clickable-block h3, .right .clickable-block h3 {
  margin: 0;
  background: none;
  color: inherit;
  padding: 0;
  transition: none;
  cursor: pointer;
}

.left .clickable-block .img-box, .right .clickable-block .img-box {
  margin: 0;
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  max-width: 80px;
  max-height: 80px;
  border-radius: 8px;
  box-shadow: 0 1px 6px 0 rgba(0,0,0,0.04);
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-box.large-img {
  width: 320px;
  height: 220px;
  min-width: 220px;
  min-height: 120px;
  max-width: 420px;
  max-height: 320px;
  background: #eee !important;
  border-radius: 18px;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.13);
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
@media (max-width: 900px) {
  .img-box.large-img {
    width: 98vw;
    max-width: 98vw;
    height: 160px;
    min-width: 120px;
    min-height: 80px;
    margin: 1rem auto 0 auto;
  }
}
@media (max-width: 700px) {
  .img-box.large-img {
    width: 100vw;
    max-width: 100vw;
    height: 120px;
    min-width: 80px;
    min-height: 60px;
    margin: 1rem auto 0 auto;
  }
}

/* Footer */
footer {
  background-color: #8a2c2b;
  color: #f0fff8;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  /* Překryje případné přesahy obrázku */
  background-clip: border-box;
  flex-shrink: 0;
}

footer .footer-copyright {
  flex: 1 1 200px;
  text-align: left;
  font-size: 1rem;
}

footer .contact {
  flex: 1 1 200px;
  justify-content: flex-end;
  align-items: center;
  padding: 0;
  text-align: right;
  font-size: 1rem;
  display: flex;
}

footer .header_contact {
  width: auto;
  margin: 0;
  padding: 0;
  display: inline-block;
  text-align: right;
}

@media (max-width: 700px) {
  footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  footer .footer-copyright,
  footer .contact {
    text-align: center;
    justify-content: center;
  }
  footer .header_contact {
    text-align: center;
  }
}

/* Modal overlay styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.2s;
  animation: fadeInOverlay 0.25s cubic-bezier(.23,1,0.32,1);
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 98vw;
  width: 600px;
  min-width: 260px;
  min-height: 220px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 4px 32px 0 rgba(0,0,0,0.18);
  position: relative;
  text-align: left;
  font-size: 1.15rem;
  color: var(--color-text);
  animation: scaleInModal 0.35s cubic-bezier(.23,1,0.32,1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #8a2c2b;
}

/* Dark mode */
body.dark-mode {
  --color-text: #f0fff8;
  --color-bg: #04161a;
  --color-primary: #4ca8b8;
  --color-secondary: #43a7d6;
  --color-accent: #b5a108;
  background-color: var(--color-bg);
  color: var(--color-text);
}

body.dark-mode header {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-secondary);
}

body.dark-mode main {
  background: #0a232a;
  color: var(--color-text);
}

body.dark-mode main h2 {
  color: var(--color-accent);
  background: linear-gradient(90deg, var(--color-bg) 0%, #0a232a 50%, var(--color-bg) 100%);
}

body.dark-mode .nav_button {
  background-color: var(--color-primary);
  border: 2px solid var(--color-secondary);
  color: var(--color-text);
}

body.dark-mode .highlight {
  color: var(--color-accent);
}

body.dark-mode .modal-content {
  color: var(--color-text);
  background: #18322a;
}

body.dark-mode .left h3:hover, body.dark-mode .right h3:hover {
  background: #1abc9c;
}

/* Force hide theme toggle button below 900px width */
@media (max-width: 900px) {
  #themeToggle {
    display: none !important;
  }
}