/* ads.css - the highlights ("акценти") and the note about browser storage (main.js: initAds).
   Loaded on every page right after style.css: it uses the colours and fonts from its :root.
   Moved out of style.css on 02.12.2026. */
/* ============================================================
   HIGHLIGHTS ("акценти") + NOTE ABOUT BROWSER STORAGE (main.js: initAds)
   ============================================================ */
.kp-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 1.25rem;
  background: rgba(28, 24, 22, 0.97);
  color: #f3f1ed;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}
.kp-consent p {
  margin: 0;
  max-width: 60rem;
  text-wrap: pretty;
}
.kp-consent a {
  color: var(--color-secondary-light);
  text-decoration: underline;
  white-space: nowrap;
}
.kp-consent-ok {
  flex: none;
  padding: 0.55rem 1.75rem;
  border: 0;
  border-radius: 2px;
  background: var(--color-secondary);
  color: #1c1816;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.kp-consent-ok:hover,
.kp-consent-ok:focus-visible {
  background: var(--color-secondary-light);
}

.kp-ad-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.kp-ad-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}
.kp-ad {
  position: relative;
  max-width: 100%;
}
.kp-ad a {
  display: block;
}
.kp-ad img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(90vw, 720px);
  max-height: calc(100vh - 5rem);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
/* a wide picture (16:9 and the like - main.js sets the class once it has loaded):
   at 720 px its text would be too small to read */
.kp-ad-wide img {
  max-width: min(90vw, 1280px);
}
.kp-ad-close {
  position: absolute;
  top: -18px;
  right: -18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1c1816;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.kp-ad-close:hover,
.kp-ad-close:focus-visible {
  background: var(--color-secondary);
  color: #1c1816;
}

@media (max-width: 480px) {
  .kp-consent {
    padding: 0.7rem 0.9rem;
    font-size: 0.8rem;
  }
  .kp-consent-ok {
    width: 100%;
  }
  .kp-ad-close {
    top: -14px;
    right: -8px;
    width: 40px;
    height: 40px;
  }
}

/* Small highlights: left / right beside the content, or at the bottom */
.kp-ad-small {
  position: fixed;
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s, transform 0.4s ease;
}
.kp-ad-small.is-open {
  opacity: 1;
  visibility: visible;
}
.kp-ad-small a {
  display: block;
}
.kp-ad-small img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.kp-ad-left,
.kp-ad-right {
  top: 50%;
  transform: translateY(-50%);
}
.kp-ad-left {
  left: 12px;
}
.kp-ad-right {
  right: 12px;
}
.kp-ad-left img,
.kp-ad-right img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.kp-ad-bottom {
  left: 50%;
  bottom: 12px;
  width: max-content;                  /* as wide as its picture, so the ✕ sits on it */
  transform: translate(-50%, 16px);
}
.kp-ad-bottom.is-open {
  transform: translate(-50%, 0);
}
.kp-ad-bottom img {
  max-width: min(96vw, 728px);         /* not %: the box takes its width from the picture */
  max-height: 25vh;
}
.kp-ad-small .kp-ad-close {
  top: -12px;
  right: -10px;
  width: 32px;
  height: 32px;
  font-size: 22px;
}
.kp-ad-bottom .kp-ad-close {
  right: 0;
}

@media (prefers-reduced-motion: reduce) {
  .kp-ad-backdrop,
  .kp-ad-small {
    transition: none;
  }
}

/* A printed page shows only the page */
@media print {
  .kp-consent,
  .kp-ad-backdrop,
  .kp-ad-small {
    display: none !important;
  }
}
