/* ===============================
   AKTUALITY — karty a galérie
=============================== */

.aktualita {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  padding: 22px;
}

.aktualita-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.aktualita-date {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #777;
}

.preview-text,
.full-text {
  line-height: 1.6;
  color: var(--text);
  margin-top: 14px;
}

.full-text {
  display: none;
}

.read-more-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  padding: 6px 14px;
  margin-top: 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(128,128,128,0.2);
  border: 1px solid transparent;
  outline: none;
  color: var(--redcolor);
  text-decoration: none;
  font-weight: 600;
  transition: all 200ms ease;
}
.read-more-btn:hover {
  background: rgba(128,128,128,0.35);
  text-decoration: underline;
  transform: translateY(0px) scale(1.02);
}


/* rozbalený stav */
.aktualita.expanded .preview-text { display: none; }
.aktualita.expanded .full-text { display: block; }
.aktualita.expanded .carousel { display: block; }

/* skrytá galéria pred rozbalením */
.carousel { display: none; }

/* ===============================
   AKTUALITY – TABUĽKA
=============================== */
.aktualita-table {
  display: none;
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.20);
}

.aktualita.expanded .aktualita-table {
  display: grid;
}

.aktualita-table-title {
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: none;
}

.aktualita.expanded .aktualita-table-title {
  display: block;
}

.aktualita-table-popis {
  display: none;
}

.aktualita.expanded .aktualita-table-popis {
  display: block;
}

.aktualita-table.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.aktualita-table.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.aktualita-table .table-head {
  padding: 10px 14px;
  font-weight: 700;
  background: rgba(219,18,21,0.08);
  border-right: 1px solid rgba(0,0,0,0.20);
  border-bottom: 1px solid rgba(0,0,0,0.20);
}

.aktualita-table.grouped .row {
  display: contents;
}

.aktualita-table.grouped .cell {
  padding: 10px 14px;
  font-size: 0.95rem;
  border-right: 1px solid rgba(0,0,0,0.20);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.06);
}

.aktualita-table.grouped .cell.title {
  font-weight: 700;
}

.aktualita-table.cols-3 .table-head:nth-child(3n),
.aktualita-table.cols-3 .cell:nth-child(3n) {
  border-right: none;
}

.aktualita-table.cols-4 .table-head:nth-child(4n),
.aktualita-table.cols-4 .cell:nth-child(4n) {
  border-right: none;
}

.aktualita-table.grouped .row:last-child .cell {
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  .aktualita-table {
    border: 1px solid rgba(255,255,255,0.20);
  }
  .aktualita-table .table-head {
    border-right: 1px solid rgba(255,255,255,0.20);
    border-bottom: 1px solid rgba(255,255,255,0.20);
  }
  .aktualita-table.grouped .cell {
    border-right: 1px solid rgba(255,255,255,0.20);
    box-shadow: inset 0 -1px 0 rgba(255,255,255,0.06);
  }
}

/* ===============================
   CAROUSEL
=============================== */
.carousel {
  position: relative;
  margin-top: 16px;
  overflow: hidden;
  padding: 0 6px; /* polovica gapu */
  box-sizing: border-box;
}

.carousel-track {
  display: flex;
  gap: 12px;
  margin-left: -6px;
  margin-right: -6px;
  transition: transform 0.4s ease;
}

.carousel-item {
  flex: 0 0 calc((100% - 24px) / 3);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  background: #000;
}

/* KRITICKÁ ČASŤ */
.carousel-item img {
  width: 100%;
  height: 160px;              /* FIX */
  object-fit: cover;          /* FIX */
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.9);
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

/* ===============================
   FILTER
=============================== */
.filter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 22px auto;
  padding: 0;
  list-style: none;
  text-align: center;
}

.filter button {
  appearance: none;
  border: 1px solid #e3e3e3;
  background: #fff;
  color: #333;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.12s ease, transform 0.08s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

.filter button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.filter button.active,
.filter button[aria-pressed="true"] {
  background: #d9302a;
  color: #fff;
  border-color: #d9302a;
  box-shadow: 0 6px 18px rgba(217,48,42,0.12);
}

.filter-top {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-year {
  margin-top: 10px;
  text-align: center;
}

.hidden-by-filter {
  display: none !important;
}

.arrow {
  display: inline-block;
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.year-toggle {
  appearance: none;
  border: none;
  background: none;
  font-weight: 600;
  cursor: pointer;
  color: #333;
}

.year-toggle .arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.year-toggle.open .arrow {
  transform: rotate(180deg);
}

.year-options {
  display: none;
  margin-top: 10px;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-year.open .year-options {
  display: flex;
}

/* ===============================
   LIGHTBOX
=============================== */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  pointer-events: auto; /* umožní klik mimo obrázok */
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  z-index: 2;
  pointer-events: none; /* klik priamo na obrázok sa neberie */
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.lightbox button {
  position: absolute;
  z-index: 3;
  background: rgba(255,255,255,0.9);
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-close {
  top: 16px;
  right: 16px;
}

.lightbox-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-counter {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* ===============================
   RESPONSIVE
=============================== */
@media (max-width:900px){ .carousel-item{flex: 0 0 calc((100% - 12px) / 2); } }
@media (max-width:600px) { 
  .carousel-item {
    flex: 0 0 100%; 
  } 
  .aktualita-table {
    display: none;
    border: none;
  }

  .aktualita.expanded .aktualita-table {
    display: block;
  }

  .aktualita-table .table-head {
    display: none;
  }

  .aktualita-table.grouped .row {
    display: block;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid rgba(0,0,0,0.20);
  }

  .aktualita-table.grouped .cell {
    border: none;
    box-shadow: none;
    padding: 4px 0;
    font-size: 0.95rem;
  }

  .aktualita-table.grouped .cell.title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
  }
  
  @media (prefers-color-scheme: dark) {
    .aktualita-table.grouped .row {
      border: 1px solid rgba(255,255,255,0.20);
    }
  }
}
@media (max-width: 560px) {
  .filter { gap: 8px; }
  .filter button { padding: 7px 12px; font-size: 0.9rem; }
}
