/*
 * kdetosom.sk portal — everything Bootstrap 5 does not already do.
 *
 * Deliberately small. Bootstrap carries the grid, the cards, the navbar and the
 * dropdown; this file is only the tiles, the card media box and a few tone choices.
 */

:root {
  --ktp-radius: .6rem;
}

/* ---------------------------------------------------------------- header --- */

.ktp-header {
  background: var(--bs-body-bg);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.ktp-hero {
  background: linear-gradient(180deg, var(--bs-tertiary-bg), var(--bs-body-bg));
}

/* --------------------------------------------------------- category tiles --- */

.ktp-tile {
  --ktp-tile-bg: #4a5d23;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 6.5rem;
  padding: .7rem .75rem;
  border-radius: var(--ktp-radius);
  background: var(--ktp-tile-bg);
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.ktp-tile:hover,
.ktp-tile:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 .4rem .9rem rgba(0, 0, 0, .18);
  filter: brightness(1.08);
}

.ktp-tile:focus-visible {
  outline: 3px solid var(--bs-focus-ring-color, rgba(13, 110, 253, .5));
  outline-offset: 2px;
}

/* The icon sits behind the label, oversized and faded — decoration, not information,
   which is why it is aria-hidden in the markup. */
.ktp-tile-icon {
  position: absolute;
  top: -.35rem;
  right: -.35rem;
  font-size: 3.2rem;
  line-height: 1;
  opacity: .22;
  pointer-events: none;
}

.ktp-tile-name {
  font-weight: 600;
  font-size: .875rem;
  line-height: 1.25;
  /* Category names run long ("Kultúrne a historické zaujímavosti"); three lines is
     the point where a tile stops being a tile. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ktp-tile-count {
  font-size: .75rem;
  opacity: .8;
}

.ktp-tile-on {
  box-shadow: inset 0 0 0 3px #fff, 0 .4rem .9rem rgba(0, 0, 0, .2);
}

.ktp-tile-check {
  position: absolute;
  top: .4rem;
  left: .45rem;
  font-size: 1rem;
}

/* ----------------------------------------------------------------- cards --- */

.ktp-card {
  border-radius: var(--ktp-radius);
  overflow: hidden;
}

.ktp-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--bs-tertiary-bg);
}

.ktp-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ktp-card-noimage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--bs-secondary-color);
}

.ktp-card-audio {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: .9rem;
}

/* --------------------------------------------------------------- detail ---- */

.ktp-description {
  line-height: 1.7;
}

.ktp-description p:last-child {
  margin-bottom: 0;
}

.ktp-photo img {
  width: 100%;
}

/* --------------------------------------------------------------- events ---- */

.ktp-event-poster {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ---------------------------------------------------------------- footer --- */

.ktp-footer {
  background: var(--bs-tertiary-bg);
}

@media (prefers-reduced-motion: reduce) {
  .ktp-tile { transition: none; }
  .ktp-tile:hover, .ktp-tile:focus-visible { transform: none; }
}
