/* Снято с campus-web-schedule: стили каталога /organizations из views/index.html (контент страницы, поиск,
   популярные, города, CTA и адаптив). Шапка, подвал и шрифты — в base.css. Подключается только на /universidades. */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Inter", sans-serif;
  color: #111118;
  background: #f3f4fa;
  padding: 112px 0 0;
  overflow-x: hidden;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
/* ───── PAGE CONTENT ───── */
:root {
  --org-blue: #4f63f0;
  --org-lavender: #d9ddff;
  --org-ink: #111118;
  --org-mute: rgba(35, 36, 58, 0.6);
  --org-line: #e6e7f0;
  --org-display: "SF Pro Rounded", -apple-system, "SF Pro Display", system-ui, sans-serif;
}
h1 {
  margin: 0 auto 14px;
  max-width: 720px;
  text-align: center;
}
.subtitle {
  text-align: center;
  color: var(--org-mute);
  font-size: 17px;
  line-height: 1.45;
  margin: 0 auto 28px;
  max-width: 640px;
}
.org-empty {
  text-align: center;
  color: var(--org-mute);
  padding: 40px 0 80px;
}

/* ───── SEARCH ───── */
.org-search {
  position: relative;
  z-index: 20;
  max-width: 720px;
  margin: 0 auto 56px;
}
.org-search__field {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 8px 0 20px;
  gap: 8px;
  border: 2px solid var(--org-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 20, 60, 0.04), 0 14px 36px rgba(20, 20, 60, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.org-search.is-open .org-search__field,
.org-search__field:focus-within {
  border-color: var(--org-blue);
  box-shadow: 0 0 0 4px rgba(79, 99, 240, 0.14), 0 14px 36px rgba(20, 20, 60, 0.08);
}
.org-search__icon {
  width: 22px;
  height: 22px;
  color: #6b6b80;
  flex-shrink: 0;
}
.org-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--org-ink);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.org-search__input::-webkit-search-cancel-button {
  display: none;
}
.org-search__input::placeholder {
  color: #9a9aae;
  font-weight: 500;
}
.org-search__kbd {
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid var(--org-line);
  border-radius: 8px;
  color: #9a9aae;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  user-select: none;
}
.org-search__clear {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f3f4fa;
  color: #6b6b80;
  font-size: 22px;
  line-height: 36px;
  cursor: pointer;
}
.org-search__clear[hidden],
.org-search__kbd[hidden] {
  display: none;
}
.org-search__btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--org-blue);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.org-search__btn:hover {
  background: #3e50d8;
}
/* Typeahead: universities + cities, rendered from the SSR catalog. */
.org-search__pop {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  padding: 10px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 20, 60, 0.16), 0 2px 6px rgba(20, 20, 60, 0.06);
  max-height: min(480px, 60vh);
  overflow-y: auto;
}
.org-search__pop[hidden] {
  display: none;
}
.org-search__group {
  padding: 10px 14px 6px;
  color: #9a9aae;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.org-search__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  color: var(--org-ink);
  text-decoration: none;
  cursor: pointer;
}
.org-search__item:hover,
.org-search__item.is-active {
  background: #f3f4fa;
}
.org-search__item .org-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.org-search__item mark {
  background: none;
  color: var(--org-blue);
}
.org-search__city {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff1f3;
  color: #e2445c;
  flex-shrink: 0;
}
.org-search__city svg {
  width: 20px;
  height: 20px;
}
.org-search__text {
  flex: 1;
  min-width: 0;
}
.org-search__text b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-search__text small {
  display: block;
  font-size: 12px;
  color: #8a8aa0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-search__arrow {
  color: #8a8aa0;
  font-size: 15px;
  flex-shrink: 0;
}
.org-search__none {
  padding: 18px 14px;
  text-align: center;
  color: #8a8aa0;
  font-size: 14px;
  font-weight: 500;
}

/* ───── SECTIONS ───── */
.org-sec {
  margin-bottom: 64px;
}
.org-sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.org-h2 {
  font-family: var(--org-display);
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--org-ink);
}
.org-sec__more {
  color: var(--org-blue);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.org-sec__more:hover {
  text-decoration: underline;
}
.org-sec__meta {
  color: var(--org-mute);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.org-grid--popular {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.org-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  background: #fff;
  border-radius: 22px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--org-ink);
  border: 1.5px solid transparent;
  overflow: hidden;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.org-card:hover {
  border-color: rgba(79, 99, 240, 0.45);
  box-shadow: 0 10px 26px rgba(79, 99, 240, 0.12);
}
.org-grid--popular .org-card {
  padding: 18px;
  border-radius: 26px;
}
.org-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
  background: #f3f4fa;
}
.org-grid--popular .org-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.org-logo--fallback {
  padding: 6px;
  background: #eef0ff;
}
.org-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.org-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-grid--popular .org-name {
  font-size: 16px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.org-desc {
  font-size: 12px;
  color: #8a8aa0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.org-grid--popular .org-desc {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.org-desc--city {
  color: var(--org-blue);
  font-weight: 600;
}

/* ───── CITIES: sidebar + catalog ───── */
.org-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.org-side {
  position: sticky;
  top: 96px;
}
.org-side__card {
  background: #fff;
  border-radius: 26px;
  padding: 18px 12px 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.org-side__label {
  padding: 0 10px 8px;
  color: #9a9aae;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.org-side__list {
  list-style: none;
  margin-bottom: 8px;
}
.org-side__list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--org-ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.org-side__list li a b {
  font-size: 13px;
  font-weight: 600;
  color: #8a8aa0;
}
.org-side__list li a:hover {
  background: #f3f4fa;
}
.org-side__list li a.is-active {
  background: var(--org-blue);
  color: #fff;
}
.org-side__list li a.is-active b {
  color: rgba(255, 255, 255, 0.75);
}
.org-side__list--all[hidden] {
  display: none;
}
.org-side__all {
  display: block;
  width: 100%;
  padding: 9px 12px 14px;
  border: 0;
  background: none;
  color: var(--org-blue);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.org-side__all:hover {
  text-decoration: underline;
}
.org-abc {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 4px;
}
.org-abc a,
.org-abc span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--org-ink);
  background: #f3f4fa;
  transition: background 0.15s, color 0.15s;
}
.org-abc span {
  color: #c4c5d2;
  background: transparent;
}
.org-abc a:hover {
  background: var(--org-lavender);
  color: var(--org-blue);
}
.org-abc a.is-active {
  background: var(--org-ink);
  color: #fff;
}
.org-catalog {
  min-width: 0;
}
.city-section {
  margin-bottom: 36px;
  scroll-margin-top: 100px;
}
.city-section[hidden],
.org-card[hidden],
.org-sec[hidden] {
  display: none;
}
.city-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.city-name {
  font-family: var(--org-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--org-ink);
}
.city-count {
  color: var(--org-mute);
  font-size: 14px;
  font-weight: 500;
}
/* Six cards per city until «Ещё N» (or a search) opens the rest. */
.org-catalog:not(.is-searching) .city-section:not(.is-open) .org-card:nth-child(n + 7) {
  display: none;
}
.city-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 0 16px;
  border: 1.5px dashed rgba(79, 99, 240, 0.4);
  border-radius: 18px;
  background: transparent;
  color: var(--org-blue);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.city-more:hover {
  background: rgba(79, 99, 240, 0.06);
  border-color: var(--org-blue);
}
.org-catalog.is-searching .city-more,
.city-section.is-open .city-more {
  display: none;
}
.org-search__empty {
  margin: 0 0 40px;
  text-align: center;
  color: #8a8aa0;
  font-size: 15px;
  font-weight: 500;
}
.org-search__empty[hidden] {
  display: none;
}

/* ───── CTA ───── */
.org-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
  padding: 36px 40px;
  border-radius: 32px;
  background: #fff;
}
.org-cta__title {
  font-family: var(--org-display);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.org-cta p {
  color: var(--org-mute);
  font-size: 15px;
  line-height: 1.5;
  max-width: 520px;
}
.org-cta__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: #d4f56a;
  color: #1f3d06;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.org-cta__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(120, 180, 20, 0.3);
}

/* ───── TABLET 900px: sidebar becomes a city strip ───── */
@media (max-width: 900px) {
  .org-grid--popular {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .org-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  /* Sits right under the scrolled nav pill (60px, 56px on phones). */
  .org-side {
    position: sticky;
    top: 60px;
    z-index: 5;
    margin: 0 -24px;
  }
  .org-side__card {
    display: flex;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 0;
    background: rgba(243, 244, 250, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .org-side__card::-webkit-scrollbar {
    display: none;
  }
  .org-side__label,
  .org-side__all,
  .org-side__list--all,
  .org-abc {
    display: none;
  }
  .org-side__list {
    display: flex;
    gap: 6px;
    margin: 0;
  }
  .org-side__list li a {
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    white-space: nowrap;
  }
  .org-side__list li a b {
    font-size: 12px;
  }
  .city-section {
    scroll-margin-top: 140px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ───── MOBILE 600px ───── */
@media (max-width: 600px) {
  body {
    padding-top: 88px;
  }
  nav {
    padding: 16px 16px 0;
  }
  nav.scrolled {
    padding: 0;
  }
  .nav-pill {
    height: 56px;
    padding: 0 16px;
  }
  nav.scrolled .nav-pill {
    padding: 0 16px;
  }
  .subtitle {
    font-size: 15px;
  }
  .org-search {
    margin-bottom: 40px;
  }
  .org-search__field {
    height: 54px;
    padding-left: 16px;
  }
  .org-search__input {
    font-size: 16px;
  }
  .org-search__kbd,
  .org-search__btn {
    display: none;
  }
  .org-search__pop {
    border-radius: 20px;
    padding: 6px;
  }
  .org-sec {
    margin-bottom: 44px;
  }
  .org-sec__head {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
  .org-grid,
  .org-grid--popular {
    grid-template-columns: minmax(0, 1fr);
  }
  .org-grid--popular .org-card {
    padding: 14px 16px;
  }
  .org-side {
    top: 56px;
    margin: 0 -16px;
  }
  .org-side__card {
    padding: 8px 16px;
  }
  .city-name {
    font-size: 20px;
  }
  .org-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 22px;
    border-radius: 26px;
  }
  .org-cta__btn {
    width: 100%;
    justify-content: center;
  }
  footer {
    margin: 16px 10px 24px;
    border-radius: 26px;
  }
  .container {
    padding: 0 16px;
  }
  .cookie-toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }
  .cookie-toast-inner {
    align-items: flex-end;
    gap: 12px;
    padding: 14px;
    border-radius: 24px;
  }
  .cookie-toast p {
    font-size: 12px;
  }
}
