/* =========================================================
   Home fixes / page-specific overrides
   Подключать после /css/editorial.css
========================================================= */


/* =========================================================
   KOTOCAFE GALLERY
========================================================= */

.kotocafe-page .kotocafe-gallery {
  width: 100%;
  margin: 28px 0 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
  grid-template-rows: repeat(3, minmax(72px, var(--kotocafe-gallery-height, 120px)));
  gap: 14px;
  align-items: stretch;
}

.kotocafe-page .kotocafe-gallery__item {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--theme-card-soft, #f3efe7);
  border: 1px solid var(--theme-border, rgba(21, 21, 21, .11));
}

.kotocafe-page .kotocafe-gallery__item:first-child {
  grid-row: 1 / span 3;
}

.kotocafe-page .kotocafe-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  margin: 0;
  transition: transform .28s ease;
}

.kotocafe-page .kotocafe-gallery__item:hover img {
  transform: scale(1.035);
}

@media (max-width: 900px) {
  .kotocafe-page .kotocafe-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 12px;
  }

  .kotocafe-page .kotocafe-gallery__item,
  .kotocafe-page .kotocafe-gallery__item:first-child {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .kotocafe-page .kotocafe-gallery__item:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 8;
  }
}

@media (max-width: 560px) {
  .kotocafe-page .kotocafe-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
  }

  .kotocafe-page .kotocafe-gallery__item,
  .kotocafe-page .kotocafe-gallery__item:first-child {
    grid-column: auto;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
  }
}


/* =========================================================
   HOME PROGRAMS — COMPACT CARDS WITHOUT IMAGES
========================================================= */

.kgv-main .kgv-program {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  aspect-ratio: auto;
  padding: 32px 34px;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(30, 24, 18, .11);
  background: #fdf6ea;
  color: inherit;
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;
}

.kgv-main .kgv-program:hover {
  transform: translateY(-3px);
  border-color: rgba(30, 24, 18, .18);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .055);
}

.kgv-main .kgv-program img {
  display: none !important;
}

.kgv-main .kgv-program > div {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.kgv-main .kgv-program h3 {
  margin: 0 0 18px;
  color: var(--theme-text, #151515);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -.045em;
}

.kgv-main .kgv-program p {
  margin: 0;
  color: var(--theme-muted, #5e5a54);
  font-size: 19px;
  line-height: 1.55;
}

.kgv-main .kgv-program .kgv-link {
  width: fit-content;
  margin-top: auto;
  padding-top: 44px;
  color: var(--theme-text, #151515);
  font-weight: 700;
  text-decoration: none;
}

.kgv-main .kgv-program .kgv-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.kgv-main .kgv-program + .kgv-program {
  margin-top: 0;
}

.kgv-main .kgv-section:has(.kgv-program) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.kgv-main .kgv-section:has(.kgv-program) > .kgv-section-head {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.kgv-main .kgv-section:has(.kgv-program) .kgv-program:nth-of-type(1) {
  background: #fdf6ea;
}

.kgv-main .kgv-section:has(.kgv-program) .kgv-program:nth-of-type(2) {
  background: #fbf0df;
}

.kgv-main .kgv-section:has(.kgv-program) .kgv-program:nth-of-type(3) {
  background: #fff7ec;
}

.kgv-main .kgv-section:has(.kgv-program) .kgv-program:nth-of-type(4) {
  background: #f7efe3;
}

@media (max-width: 860px) {
  .kgv-main .kgv-section:has(.kgv-program) {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .kgv-main .kgv-program {
    min-height: 0;
    padding: 28px;
  }

  .kgv-main .kgv-program h3 {
    font-size: 32px;
  }

  .kgv-main .kgv-program p {
    font-size: 17px;
  }
}

@media (max-width: 520px) {
  .kgv-main .kgv-program {
    padding: 24px;
    border-radius: 24px;
  }

  .kgv-main .kgv-program h3 {
    font-size: 29px;
  }
}
.form-field-checkbox {
  width: 100%;
  max-width: 760px;
  margin: 1.35rem 0 1.5rem;
}

.request-form .checkbox-label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  justify-content: start;
  width: 100%;
  max-width: 760px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.45;
  color: var(--theme-text, #151515);
}

.request-form .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  padding: 0;
  flex: none;
}

.request-form .checkbox-label span {
  display: block;
  max-width: 680px;
}

.request-form .checkbox-label a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.request-form .checkbox-label a:hover {
  text-decoration: none;
}

/* =========================================================
   CAT DONATE
========================================================= */

.cat-donate,
.cat-donate * {
  box-sizing: border-box;
}

.cat-donate {
  width: 100%;
  max-width: 900px;
  margin: 72px 0;
  padding: 56px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 32px;
  background: #fffdf8;
}

.cat-donate__eyebrow {
  margin: 0 0 18px;
  color: #8a8176;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cat-donate__title {
  margin: 0;
  color: var(--theme-text, #151515);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 5vw, 82px);
  line-height: .92;
  font-weight: 500;
  letter-spacing: -.05em;
}

.cat-donate__text {
  max-width: 720px;
  margin: 28px 0 40px;
  color: #333;
  font-size: 24px;
  line-height: 1.45;
}

.cat-donate__amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 26px;
}

.cat-donate__amount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  appearance: none;
  border: 1px solid #d9d2c8;
  border-radius: 999px;
  background: #fff;
  color: #151515;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
  transition:
    border-color .2s ease,
    background-color .2s ease,
    color .2s ease,
    transform .2s ease;
}

.cat-donate__amount:hover {
  border-color: #1f1f1f;
  transform: translateY(-1px);
}

.cat-donate__amount.is-active {
  border-color: #1f1f1f;
  background: #1f1f1f;
  color: #fff;
}

.cat-donate__actions-row {
  display: flex;
  justify-content: flex-start;
}

.cat-donate__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 280px;
  height: 58px;
  padding: 0 34px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #d9a441;
  color: #1f1f1f;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    opacity .2s ease;
}

.cat-donate__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

.cat-donate__button:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.cat-donate__custom {
  min-height: 82px;
  margin: 0 0 18px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.cat-donate__custom.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.cat-donate__mode-switch {
  display: inline-flex;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px;
  border: 1px solid rgba(30, 24, 18, .12);
  border-radius: 999px;
  background: #fffaf3;
}

.cat-donate__mode {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5d4d43;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cat-donate__mode.is-active {
  background: #df5a58;
  color: #fff;
}

.cat-donate__contacts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr);
  gap: 14px;
  min-height: 82px;
  margin: 0 0 24px;
}

.cat-donate__contacts[hidden] {
  display: none;
}

.cat-donate__field {
  display: grid;
  gap: 8px;
  color: #5d4d43;
  font-weight: 700;
}

.cat-donate__field input,
.cat-donate__field select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(30, 24, 18, .16);
  border-radius: 16px;
  background: #fff;
  color: #151515;
  font: inherit;
}

.cat-donate__button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 26px;
  border: 1px solid rgba(30, 24, 18, .16);
  border-radius: 999px;
  background: #fffaf3;
  color: #151515;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .cat-donate {
    padding: 40px 30px;
  }

  .cat-donate__title {
    font-size: 54px;
  }

  .cat-donate__text {
    font-size: 20px;
  }
}

@media (max-width: 720px) {
  .cat-donate__mode-switch,
  .cat-donate__actions-row {
    width: 100%;
  }

  .cat-donate__mode {
    flex: 1;
  }

  .cat-donate__contacts {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .cat-donate__button-secondary {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .cat-donate {
    margin: 48px 0;
    padding: 26px 20px;
    border-radius: 24px;
  }

  .cat-donate__title {
    font-size: 40px;
  }

  .cat-donate__text {
    margin: 20px 0 28px;
    font-size: 18px;
  }

  .cat-donate__amounts {
    gap: 10px;
  }

  .cat-donate__amount {
    flex: 1;
    min-width: 90px;
  }

  .cat-donate__button {
    width: 100%;
    min-width: 0;
  }

  .cat-donate__custom {
    min-height: 0;
  }
}


.cat-thanks{
    display:grid;
    grid-template-columns:360px 1fr;
    gap:42px;
    align-items:center;
    margin:42px 0;
    padding:38px;
    background:#fff8ef;
    border:1px solid rgba(30,24,18,.10);
    border-radius:30px;
}

.cat-thanks__photo img{
    display:block;
    width:100%;
    aspect-ratio:1/1;
    object-fit:cover;
    border-radius:22px;
}

.cat-thanks__eyebrow{
    margin:0 0 12px;
    color:#d06a53;
    font-size:15px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.cat-thanks__title{
    margin:0 0 18px;
    font-family:Georgia,"Times New Roman",serif;
    font-size:clamp(40px,4vw,58px);
    line-height:1;
}

.cat-thanks__text{
    max-width:720px;
    font-size:22px;
    line-height:1.45;
    color:#5d4d43;
}

.cat-thanks__actions{
    display:flex;
    flex-wrap:wrap;
    gap:14px;
    margin-top:28px;
}

@media (max-width:900px){

    .cat-thanks{
        grid-template-columns:1fr;
        padding:24px;
        gap:24px;
    }

    .cat-thanks__title{
        font-size:38px;
    }

    .cat-thanks__text{
        font-size:19px;
    }

}

.cat-donate__mode-switch {
  display: inline-flex;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px;
  border-radius: 999px;
  background: #fffaf3;
  border: 1px solid rgba(30,24,18,.12);
}

.cat-donate__mode {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5d4d43;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cat-donate__mode.is-active {
  background: #df5a58;
  color: #fff;
}

.cat-donate__contacts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr);
  gap: 14px;
  margin: 0 0 24px;
}

.cat-donate__contacts[hidden] {
  display: none;
}

.cat-donate__field {
  display: grid;
  gap: 8px;
  color: #5d4d43;
  font-weight: 700;
}

.cat-donate__field input,
.cat-donate__field select {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(30,24,18,.16);
  border-radius: 16px;
  background: #fff;
  color: #151515;
  font: inherit;
}

.cat-donate__actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cat-donate__button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 26px;
  border: 1px solid rgba(30,24,18,.16);
  border-radius: 999px;
  background: #fffaf3;
  color: #151515;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 720px) {
  .cat-donate__mode-switch,
  .cat-donate__actions-row {
    width: 100%;
  }

  .cat-donate__mode {
    flex: 1;
  }

  .cat-donate__contacts {
    grid-template-columns: 1fr;
  }

  .cat-donate__button-secondary {
    width: 100%;
  }
}

.kgv-btn-dark,
.kgv-btn-dark:link,
.kgv-btn-dark:visited {
  color: #fff !important;
}

.kgv-btn-dark:hover,
.kgv-btn-dark:focus {
  color: #fff !important;
}

.kgv-btn-dark svg {
  fill: currentColor;
}

/* =========================================
   Dark button contrast hard fix
   Keeps dark buttons readable across pages.
========================================= */

html body a.kgv-btn.kgv-btn-dark,
html body a.kgv-btn.kgv-btn-dark:link,
html body a.kgv-btn.kgv-btn-dark:visited,
html body .kgv-btn.kgv-btn-dark,
html body .kgv-btn.kgv-btn-dark:link,
html body .kgv-btn.kgv-btn-dark:visited,
html body .cat-thanks .kgv-btn.kgv-btn-dark,
html body .kgorod-cat-detail__actions .kgv-btn.kgv-btn-dark {
  background: #151515 !important;
  border-color: #151515 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body a.kgv-btn.kgv-btn-dark *,
html body .kgv-btn.kgv-btn-dark *,
html body .cat-thanks .kgv-btn.kgv-btn-dark *,
html body .kgorod-cat-detail__actions .kgv-btn.kgv-btn-dark * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body a.kgv-btn.kgv-btn-dark:hover,
html body a.kgv-btn.kgv-btn-dark:focus,
html body .kgv-btn.kgv-btn-dark:hover,
html body .kgv-btn.kgv-btn-dark:focus,
html body .cat-thanks .kgv-btn.kgv-btn-dark:hover,
html body .cat-thanks .kgv-btn.kgv-btn-dark:focus,
html body .kgorod-cat-detail__actions .kgv-btn.kgv-btn-dark:hover,
html body .kgorod-cat-detail__actions .kgv-btn.kgv-btn-dark:focus {
  background: #2a2a2a !important;
  border-color: #2a2a2a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.cat-thanks__primary,
.cat-thanks__primary:link,
.cat-thanks__primary:visited,
.cat-thanks__primary:hover,
.cat-thanks__primary:focus {
  background: #151515 !important;
  border-color: #151515 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.cat-thanks__primary * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.kgv-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 16, 12, 0.78);
}

.kgv-gallery-lightbox.is-open {
  display: flex;
}

.kgv-gallery-lightbox-image {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  object-fit: contain;
}

.kgv-gallery-lightbox-close,
.kgv-gallery-lightbox-prev,
.kgv-gallery-lightbox-next {
  position: absolute;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2d2119;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.kgv-gallery-lightbox-close {
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 30px;
  line-height: 1;
}

.kgv-gallery-lightbox-prev,
.kgv-gallery-lightbox-next {
  top: 50%;
  width: 54px;
  height: 54px;
  transform: translateY(-50%);
  font-size: 42px;
  line-height: 1;
}

.kgv-gallery-lightbox-prev {
  left: 24px;
}

.kgv-gallery-lightbox-next {
  right: 24px;
}

.kgv-gallery-lightbox-close:hover,
.kgv-gallery-lightbox-prev:hover,
.kgv-gallery-lightbox-next:hover {
  background: #fff;
}

@media (max-width: 700px) {
  .kgv-gallery-lightbox {
    padding: 14px;
  }

  .kgv-gallery-lightbox-prev {
    left: 12px;
  }

  .kgv-gallery-lightbox-next {
    right: 12px;
  }
}

.kgv-gallery-lightbox-image,
.kgv-gallery-lightbox-video {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  object-fit: contain;
  opacity: 0;
  transition: opacity 160ms ease;
}

.kgv-gallery-lightbox-image.is-visible,
.kgv-gallery-lightbox-video.is-visible {
  opacity: 1;
}

.kgv-gallery-lightbox-video {
  background: #000;
}

html.kgv-lightbox-open,
body.kgv-lightbox-open {
  overflow: hidden !important;
}

body > .kgv-gallery-lightbox {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
}

html.kgv-lightbox-open,
body.kgv-lightbox-open {
  overflow: hidden !important;
}

body > .kgv-gallery-lightbox {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  z-index: 2147483647 !important;
  display: none;
}

body > .kgv-gallery-lightbox.is-open {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ---------- Desktop ---------- */

body > .kgv-gallery-lightbox .kgv-gallery-lightbox-image,
body > .kgv-gallery-lightbox .kgv-gallery-lightbox-video {
    width: auto;
    height: auto;
    max-width: 96vw;
    max-height: 94vh;
    object-fit: contain;
    object-position: center center;
    border-radius: 20px;
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {

    body > .kgv-gallery-lightbox {
        padding: 0;
        background: #000;
    }

    body > .kgv-gallery-lightbox .kgv-gallery-lightbox-image,
    body > .kgv-gallery-lightbox .kgv-gallery-lightbox-video {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        object-fit: cover;
        object-position: center center;
    }

    body > .kgv-gallery-lightbox .kgv-gallery-lightbox-prev {
        left: 12px;
    }

    body > .kgv-gallery-lightbox .kgv-gallery-lightbox-next {
        right: 12px;
    }

    body > .kgv-gallery-lightbox .kgv-gallery-lightbox-close {
        top: 12px;
        right: 12px;
    }

    body > .kgv-gallery-lightbox .kgv-gallery-lightbox-counter {
        bottom: 18px;
    }
}

html.kgv-lightbox-open,
body.kgv-lightbox-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body > .kgv-gallery-lightbox {
  position: fixed !important;
  inset: 0 !important;
  width: 100dvw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  z-index: 2147483647 !important;
}

body > .kgv-gallery-lightbox.is-open {
  display: flex !important;
}

.kgv-cover-media {
  position: relative;
  overflow: hidden;
}

.kgv-cover-media img,
.kgv-cover-media-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.kgv-cover-media-video {
  display: none;
}

.kgv-cover-media-prev,
.kgv-cover-media-next {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #2d2119;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  font-size: 42px;
  line-height: 1;
}

.kgv-cover-media-prev {
  left: 18px;
}

.kgv-cover-media-next {
  right: 18px;
}

.kgv-cover-media-prev:hover,
.kgv-cover-media-next:hover {
  background: #fff;
}

.kgv-cover-media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: rgba(20, 16, 12, .82);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .18);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

@media (max-width: 768px) {
  .kgv-cover-media-prev,
  .kgv-cover-media-next {
    width: 48px;
    height: 48px;
    font-size: 38px;
  }

  .kgv-cover-media-prev {
    left: 12px;
  }

  .kgv-cover-media-next {
    right: 12px;
  }
}

.kgorod-cat-detail-hero {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}

/* =========================================================
   CAT DETAIL — adaptive desktop / laptop
   ========================================================= */

/* Большие мониторы */
@media (min-width: 1400px) {

  .kgorod-cat-detail-hero .container {
    max-width: 1320px;
  }

  .kgorod-cat-detail {
    grid-template-columns: minmax(460px, 1fr) minmax(460px, 1fr);
    gap: 56px;
    align-items: start;
  }

}

/* Ноутбуки и планшеты в альбомной ориентации */
@media (min-width: 768px) and (max-width: 1399px) {

  .kgorod-cat-detail-hero .container {
    max-width: 1120px;
  }

  .kgorod-cat-detail {
    grid-template-columns: minmax(320px, .85fr) minmax(420px, 1.15fr) !important;
    gap: clamp(24px, 3vw, 40px);
    align-items: start;
  }

  .kgorod-cat-detail__media {
    min-height: 0;
  }

  .kgorod-cat-detail__media img {
    display: block;
    width: 100%;
    height: auto !important;
    object-fit: contain;
    border-radius: 28px;
  }

  .kgorod-cat-detail__body {
    border-radius: 28px;
  }

  .kgorod-cat-detail__name {
    font-size: clamp(44px, 5vw, 64px);
  }

  .kgorod-cat-detail__desc {
    max-width: none;
  }

  .kgorod-cat-detail__actions {
    grid-template-columns: 1fr;
    gap: 14px;
  }

}

/* Телефоны */
@media (max-width: 767px) {

  .kgorod-cat-detail {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }

  .kgorod-cat-detail__media img {
    width: 100%;
    height: auto !important;
    object-fit: cover;
    border-radius: 28px 28px 0 0;
  }

  .kgorod-cat-detail__body {
    border-radius: 0 0 28px 28px;
  }

  .kgorod-cat-detail__actions {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {
  .kgorod-cat-media-main {
    position: relative;
  }

  .kgorod-cat-media-arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;

    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;

    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  }

  .kgorod-cat-media-arrow--prev {
    left: 12px;
  }

  .kgorod-cat-media-arrow--next {
    right: 12px;
  }
}

/* =========================================================
   CAT DETAIL — final responsive override
========================================================= */

@media (min-width: 768px) {
  html body .kgorod-cat-detail-hero .container {
    max-width: 1280px !important;
  }

  html body .kgorod-cat-detail {
    display: grid !important;
    grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr) !important;
    gap: clamp(24px, 3vw, 48px) !important;
    align-items: start !important;
  }

  html body .kgorod-cat-detail__media {
    min-width: 0 !important;
    min-height: 0 !important;
  }

  html body .kgorod-cat-detail__media img,
  html body .kgorod-cat-media-main img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    border-radius: 28px !important;
  }

  html body .kgorod-cat-detail__body {
    border-radius: 28px !important;
  }
}

@media (max-width: 767px) {
  html body .kgorod-cat-detail {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  html body .kgorod-cat-detail__media img,
  html body .kgorod-cat-media-main img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 28px 28px 0 0 !important;
  }

  html body .kgorod-cat-detail__body {
    border-radius: 0 0 28px 28px !important;
  }
}

/* =========================================================
   CAT DETAIL — mobile spacing repair
   Уменьшаем слишком широкие поля на мобильной версии.
   Подключать в самом конце файла.
========================================================= */

@media (max-width: 767px) {
  html body {
    --theme-container-pad: 24px;
  }

  html body .kgorod-cat-breadcrumbs-hero,
  html body .kgorod-cat-detail-hero {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html body .kgorod-cat-breadcrumbs-hero .container,
  html body .kgorod-cat-detail-hero .container,
  html body .kgorod-cat-detail-hero > .container {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html body .kgorod-cat-detail {
    width: 100% !important;
    max-width: none !important;
    gap: 16px !important;
  }

  html body .kgorod-cat-detail__media,
  html body .kgorod-cat-media-main,
  html body .kgv-cover-media {
    width: 100% !important;
    max-width: none !important;
  }

  html body .kgorod-cat-detail__body {
    padding: 22px 18px 24px !important;
  }

  html body .kgorod-cat-media-strip {
    gap: 10px !important;
    margin-top: 14px !important;
  }

  html body .cat-donate,
  html body .cat-thanks {
    width: 100% !important;
    max-width: none !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}

@media (max-width: 420px) {
  html body {
    --theme-container-pad: 20px;
  }

  html body .kgorod-cat-breadcrumbs-hero .container,
  html body .kgorod-cat-detail-hero .container,
  html body .kgorod-cat-detail-hero > .container {
    width: calc(100% - 20px) !important;
  }

  html body .kgorod-cat-detail__body {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* =========================================================
   HEADER MOBILE MENU
========================================================= */

.kgv-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(20, 16, 12, .42);
}

.kgv-mobile-menu.is-open {
  display: block;
}

.kgv-mobile-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(360px, 88vw);
  height: 100%;
  padding: 22px;
  background: #fffaf3;
  box-shadow: -24px 0 60px rgba(0, 0, 0, .18);
}

.kgv-mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.kgv-mobile-menu__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
}

.kgv-mobile-menu__logo img {
  display: block;
  border-radius: 999px;
}

.kgv-menu-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #f0e6d8;
  color: #151515;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.kgv-mobile-nav {
  display: grid;
  gap: 6px;
}

.kgv-mobile-nav a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid rgba(30, 24, 18, .1);
  color: #151515;
  text-decoration: none;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}

.kgv-mobile-menu__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 28px;
  border-radius: 999px;
  background: #151515;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

@media (min-width: 901px) {
  .kgv-mobile-menu,
  .kgv-mobile-menu.is-open {
    display: none !important;
  }
}

/* HEADER mobile toggle visibility */

.kgv-menu-toggle {
  display: none;
}

@media (max-width: 900px) {
  .kgv-nav {
    display: none;
  }

  .kgv-menu-toggle {
    display: inline-flex;
  }
}

@media (min-width: 901px) {
  .kgv-mobile-menu,
  .kgv-mobile-menu.is-open {
    display: none !important;
  }

  .kgv-menu-toggle {
    display: none !important;
  }
}

/* =========================================================
   FOOTER RECOMMENDATIONS
   Самодостаточный компонент рекомендаций в футере.
========================================================= */

.footer-recommendations {
  margin-top: 64px;
  margin-bottom: 56px;
}

.footer-recommendations__head {
  max-width: 760px;
  margin-bottom: 24px;
}

.footer-recommendations__head h2 {
  margin: 0 0 10px;
  color: var(--kgv-text, #1f1f1f);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.footer-recommendations__head p {
  margin: 0;
  color: var(--kgv-muted, #625b52);
  font-size: 18px;
  line-height: 1.5;
}

.footer-recommendations__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.footer-rec-card {
  display: grid;
  grid-template-rows: 180px 1fr;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(30, 24, 18, .08);
  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;
}

.footer-rec-card:hover {
  transform: translateY(-3px);
  border-color: rgba(30, 24, 18, .14);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .06);
}

.footer-rec-card__image {
  display: block;
  min-width: 0;
  overflow: hidden;
  background: #f5efe4;
}

.footer-rec-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.footer-rec-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
}

.footer-rec-card__label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f5efe4;
  color: #6a5738;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.footer-rec-card__title {
  display: block;
  margin: 0 0 10px;
  color: var(--kgv-text, #1f1f1f);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.footer-rec-card__text {
  display: block;
  margin: 0;
  color: var(--kgv-muted, #625b52);
  font-size: 15px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .footer-recommendations__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .footer-recommendations {
    margin-top: 48px;
    margin-bottom: 44px;
  }

  .footer-recommendations__grid {
    grid-template-columns: 1fr;
  }

  .footer-rec-card {
    grid-template-rows: 210px 1fr;
  }
}

.kgv-program-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.kgv-program-card {
  padding: 28px;
  border-radius: 24px;
  background: #f5efe4;
  border: 1px solid rgba(0,0,0,.08);

  display: flex;
  flex-direction: column;
}

.kgv-program-card__label {
  display: inline-flex;
  width: fit-content;

  padding: 6px 12px;
  margin-bottom: 16px;

  border-radius: 999px;
  background: #fff;

  font-size: .82rem;
  font-weight: 600;
}

.kgv-program-card h3 {
  margin: 0 0 12px;
}

.kgv-program-card p {
  flex: 1;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .kgv-program-cards {
    grid-template-columns: 1fr;
  }
}
@media(max-width:768px){html body .kgorod-cat-detail{grid-template-columns:minmax(0,1fr)!important}}
