#megamenu-mobile { display: none; }

/* megamenu */
#megamenu {
  position: fixed;
  width: 90%;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 24px;
  z-index: 999999;
  color: #000;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Najde jakýkoliv prvek, který obsahuje tvůj sloupec, a udělá z něj grid */
#megamenu *:has(> .megamenu-column) {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 40px 60px;
  width: 100%;
  align-items: start;
}

/* Fallback pro starší prohlížeče */
#megamenu .view-content,
#megamenu .view-content > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

#megamenu h3 {
  font-size: 1.5em;
  padding-bottom: 10px;
  margin-bottom: 0;
  line-height:1em;
}

#megamenu .megamenu-column.open h3{padding-bottom:10px;margin:0;}

/* padding dole když je otevřený */
#megamenu .megamenu-column.open {padding-bottom:s0px;}

#megamenu a {font-weight:600;color: #000; text-decoration: none;display:block;padding:6px 20px 6px 20px; }
#megamenu a:hover{text-decoration:underline}
.megamenu-item { padding:0;}

/* Reset pro samotné sloupce */
.megamenu-column {
  display: block !important;
  width: auto !important;
}

/* Nastavení kontejneru pro nadpis a datum */
.views-field-title .field-content {
  display: flex;
  justify-content: space-between; /* Roztáhne prvky: jeden vlevo, druhý vpravo */
  align-items: baseline;          /* Zarovná text na stejnou linku, i když mají různé velikosti */
  width: 100%;                    /* Zajistí využití celé šířky sloupce */
  gap: 15px;                      /* Mezera mezi textem a datem, aby se neslepily */
}

/* Styl pro nadpis (vlevo) */
.views-field-title .nazev {
  flex-grow: 1;                   /* Nechá nadpis zabrat zbývající místo */
}

/* Styl pro datum (vpravo) */
.views-field-title .datum {
  white-space: nowrap;            /* Zabrání zalomení data na dva řádky */
  /* display:none; */
}
.views-field-title:hover .datum {
  white-space: nowrap;            /* Zabrání zalomení data na dva řádky */
  display:block;
}



/* IKONY: Křížek */
.close {
  position: absolute;
  right: 32px;
  top: 32px;
  width: 32px;
  height: 32px;
  opacity: 0.3;
  cursor: pointer;
  background: none;
  border: none;
  display: block;
}

.close:hover { opacity: 1; }

.close:before, .close:after {
  position: absolute;
  left: 15px;
  top: 0;
  content: ' ';
  height: 32px;
  width: 2px;
  background-color: #333;
}

.close:before { transform: rotate(45deg); }
.close:after { transform: rotate(-45deg); }

.mobile-only { display: none; !important;}
.dekstop-only { display: block; !important;}


/* Hlavní kontejner upoutávky - nyní ovládá tečku i text dohromady */
.upoutavka {
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  align-items: center; /* Vertikální zarovnání na střed */
  gap: 10px;           /* Mezera mezi tečkou a textem z Views */
  white-space: nowrap; /* Zabrání zalomení na nový řádek */
}

/* Zajištění, aby vnitřní elementy z Views nerozbíjely řádek */
.upoutavka .views-element-container,
.upoutavka .field-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px; /* Mezera mezi slovy uvnitř Views (text, odkaz, čas) */
}

/* Odkazy a čas */
.upoutavka a, 
.upoutavka time {
  display: inline-block;
}

/* Obrázky v menu */
.megamenu-category-image {
  max-width: 100%;
  height: auto;
  padding-bottom: 20px;
}

.megamenu-category-image img {
  max-width: 100%;
  height: auto;
}

/* Definice blikající tečky */
.dot {
  height: 10px;
  width: 10px;
  background-color: #ff0000;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0; /* Tečka se nikdy nezmáčkne */
}

.dot::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #ff0000;
  animation: pulse 1.5s infinite ease-in-out;
  opacity: 0.7;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }
  #megamenu .megamenu-column.open {padding-bottom:20px;}
  

  #megamenu {
    width: 95%;
    top: 10px !important;
    padding: 40px;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-sizing: border-box;
  }

  #megamenu *:has(> .megamenu-column) {
    grid-template-columns: 1fr !important;
    gap: 20px;
    display: block !important;
  }
  
  .megamenu-column .views-row {
    display: none;
  }
  
  .megamenu-column.open .views-row {
    display: block !important;
    margin:0 0 10px 0;
  }

  .megamenu-column h3 {
    cursor: pointer;
    position: relative;
    padding-right: 40px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  #megamenu h3 {
  padding-bottom: 24px;
}
  

  .megamenu-column h3::after {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    text-align: center;
    font-size: 1.6em;
    font-weight: 300;
    color: #00bd00;
    line-height: 1;
    transition: all 0.2s ease;
  }

  .megamenu-column:not(.open) h3::after {
    content: '+';
    font-size: 1em;
    margin-top: -10px;
    right: 5px;
  }

  .megamenu-column.open h3::after {
    content: '-';
    font-size: 1em;
    margin-top: 0;
    right: 5px;
  }
  
  #megamenu .floatleft {
    float: left !important;
    width: 90% !important;
    display: block !important;
  }

  #megamenu .floatright {
    float: right !important;
    width: 10% !important;
    display: block !important;
  }
  
  .close {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 24px;
  height: 24px;
}

.views-field-title .datum {
  display:block;
}
.views-field-title:hover .datum {
  font-weight:300;
}

#megamenu .upoutavka a {
 padding:0;
}

}