/*
Theme Name: Куда пойти
Theme URI: https://kudapojti.pl
Author: Куда пойти
Author URI: https://kudapojti.pl
Description: Минималистичная block theme. Та же лента, что у новостного издания: крупный материал, сетка карточек, рубрики в подвале. Палитра чернил, лайма и лаванды на кремовом фоне.
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kudapojti
Tags: block-theme, full-site-editing, news, minimalist, russian
*/

html { scroll-behavior: smooth; }

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

.kp-card { transition: transform 160ms ease, box-shadow 160ms ease; }
.kp-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(37, 25, 52, 0.08); }

.kp-eyebrow,
.kp-eyebrow a {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--wp--preset--color--ink);
  text-decoration: none;
}
.kp-eyebrow a:hover { color: var(--wp--preset--color--ink); }

.kp-rule {
  border: 0;
  border-top: 1px solid var(--wp--preset--color--rule);
  margin: 2rem 0;
}

.kp-thumb-fallback {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(145deg, #E6E0F6 0%, #F3F0E9 52%, #F4FBD4 100%);
}

header.wp-block-template-part:has(.kp-header) {
  margin: 0;
  padding: 0;
}

.kp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.kp-header {
  position: relative;
  z-index: 20;
  background: #F3F0E9;
  color: #251934;
}
.kp-header a {
  color: #251934;
  text-decoration: none;
}
.kp-header a:hover { color: #251934; }
.kp-header a:focus-visible,
.kp-header summary:focus-visible,
.kp-topics-check:focus-visible + .kp-header__inner .kp-topics-toggle {
  outline: 2px solid #251934;
  outline-offset: 3px;
}

.kp-topics-check {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.kp-header__inner {
  width: min(1160px, calc(100% - 2rem));
  margin-inline: auto;
  padding-block: 0.85rem 0.35rem;
}

.kp-header__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #E4DFD4;
}

.kp-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  margin-right: auto;
  min-height: 44px;
  justify-content: center;
}
.kp-brand:hover { color: #251934; }
.kp-brand__name {
  font-family: var(--wp--preset--font-family--serif);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kp-brand__place {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
  color: #6B6178;
}

.kp-topics-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(37, 25, 52, 0.22);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.kp-topics-check:checked + .kp-header__inner .kp-topics-toggle {
  background: #DBFA69;
  color: #251934;
  border-color: #DBFA69;
}

.kp-search { position: relative; }
.kp-search summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  list-style: none;
  cursor: pointer;
}
.kp-search summary::-webkit-details-marker { display: none; }
.kp-search summary:hover { background: rgba(37, 25, 52, 0.06); }
.kp-search__form {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  right: 0;
  display: flex;
  gap: 0.4rem;
  width: min(22rem, 80vw);
  padding: 0.55rem;
  border: 1px solid #E4DFD4;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 8px 24px rgba(37, 25, 52, 0.08);
}
.kp-search__form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 10px;
  background: #F3F0E9;
  color: #251934;
  font: inherit;
  font-size: 1rem;
}
.kp-search__form button {
  min-height: 44px;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 10px;
  background: #DBFA69;
  color: #251934;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.kp-search__form button:focus-visible,
.kp-search__form input:focus-visible {
  outline: 2px solid #251934;
  outline-offset: 2px;
}

.kp-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.35rem;
  align-items: center;
  padding-block: 0.35rem;
  border-bottom: 1px solid #E4DFD4;
}
.kp-topic {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.02rem;
  font-weight: 500;
}
.kp-topic.is-current { font-weight: 600; }

.kp-places {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.kp-places__pin {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  color: #A597E8;
}
.kp-places__nav {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 0.15rem;
}
.kp-places__scroller {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.kp-places__scroller::-webkit-scrollbar { display: none; }
.kp-place,
.kp-more summary {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.95rem;
  white-space: nowrap;
}
.kp-place.is-current,
.kp-more.is-current > summary {
  background: #DBFA69;
  color: #251934;
}
.kp-more { position: relative; flex: 0 0 auto; }
.kp-more summary {
  list-style: none;
  cursor: pointer;
  color: #251934;
}
.kp-more summary::-webkit-details-marker { display: none; }
.kp-more summary:hover { background: rgba(37, 25, 52, 0.06); }
.kp-more.is-current > summary:hover { background: #DBFA69; }
.kp-more__menu {
  position: absolute;
  z-index: 30;
  top: calc(100% - 0.15rem);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 11.5rem;
  padding: 0.35rem;
  border: 1px solid #E4DFD4;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 8px 24px rgba(37, 25, 52, 0.08);
}
.kp-more__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.2rem 0.75rem;
  border-radius: 10px;
}
.kp-more__link:hover {
  background: rgba(37, 25, 52, 0.06);
  color: #251934;
}
.kp-more__link.is-current {
  background: #DBFA69;
  color: #251934;
}

@media (max-width: 899px) {
  .kp-topics-toggle { display: inline-flex; }
  .kp-topics { display: none; }
  .kp-topics-check:checked + .kp-header__inner .kp-topics {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .kp-topic { min-height: 48px; }
  .kp-places {
    margin-inline-start: -0.35rem;
  }
  .kp-places__scroller { padding-inline-end: 0.35rem; }
}

@media (forced-colors: active) {
  .kp-header a:focus-visible,
  .kp-header summary:focus-visible,
  .kp-topics-check:focus-visible + .kp-header__inner .kp-topics-toggle {
    outline: 2px solid CanvasText;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kp-header *,
  .kp-header *::before,
  .kp-header *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.kp-footer-tags { width: 100%; }
.kp-footer-tags .wp-block-categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.kp-footer-tags .wp-block-categories-list li { margin: 0; }
.kp-footer-tags .wp-block-categories-list a {
  display: inline-block;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--wp--preset--color--rule);
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1.3;
  text-decoration: none;
  color: var(--wp--preset--color--ink);
  background: var(--wp--preset--color--surface);
}
.kp-footer-tags .wp-block-categories-list a:hover {
  border-color: var(--wp--preset--color--violet);
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--ink);
}

.kp-footer-tile {
  padding: var(--wp--preset--spacing--40);
  border: 1px solid var(--wp--preset--color--rule);
  border-radius: 10px;
  background: var(--wp--preset--color--surface);
}
.kp-footer-tile .wp-block-heading {
  margin-top: 0;
  margin-bottom: var(--wp--preset--spacing--30);
  font-size: 1rem;
}
.kp-footer-about-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.kp-footer-about-list li { margin: 0; }
.kp-footer-about-list a { text-decoration: none; font-size: 0.95rem; }
.kp-footer-about-list a:hover { text-decoration: underline; }
.kp-footer-tile--about p { margin: 0; line-height: 1.55; }

.wp-block-query-pagination { gap: 0.4rem; }
.wp-block-query-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--wp--preset--color--ink);
}
.wp-block-query-pagination .page-numbers.current {
  background: var(--wp--preset--color--ink);
  color: var(--wp--preset--color--accent);
}
.wp-block-query-pagination .page-numbers:hover {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--ink);
}

.wp-block-post-content { max-width: 42rem; }
.wp-block-post-content.alignwide { max-width: 42rem; margin-left: auto; margin-right: auto; }

@media (max-width: 781px) {
  .kp-footer-tiles.wp-block-columns { flex-direction: column; }
}
