:root {
  --vk-blue: #2787f5;
  --vk-blue-dark: #1a6fd4;
  --navy: #0d2d5c;
  --text-muted: #6c757d;
}

body {
  font-family: "Montserrat", sans-serif;
  color: #212529;
  background: #fff;
}

.site-header .navbar {
  background: var(--navy);
}

.navbar-brand .brand-text {
  font-size: 0.95rem;
  font-weight: 600;
  max-width: 280px;
  line-height: 1.2;
}

.nav-link.active {
  font-weight: 600;
  color: #fff !important;
}

.hero-section {
  background-size: cover;
  background-position: center;
  min-height: 70vh;
}

.hero-overlay {
  background: linear-gradient(135deg, rgba(13, 45, 92, 0.77), rgba(13, 45, 92, 0.55));
  min-height: 70vh;
}

.min-vh-50 {
  min-height: 50vh;
}

.page-hero {
  background: linear-gradient(90deg, #f8f9fb, #eef4fc);
  border-bottom: 1px solid #e9ecef;
}

.section-title {
  font-weight: 700;
  color: var(--navy);
}

.value-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.value-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(13, 45, 92, 0.08);
}

.value-icon {
  font-size: 2.5rem;
  color: var(--vk-blue);
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--vk-blue);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.news-card,
.team-card {
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.team-card {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.team-photo-frame {
  aspect-ratio: 3 / 4;
  background: #f8f9fb;
  overflow: hidden;
}

.news-card .card-img-top {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  background: #f8f9fb;
}

/* News list cards: 16:9 preview on top, text below */
.news-card-stacked {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.news-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f8f9fb;
  overflow: hidden;
  flex: 0 0 auto;
}

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

.news-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem 1.1rem 1.1rem;
}

.news-card-date {
  flex: 0 0 auto;
  margin-bottom: 0.15rem;
}

.news-card-title {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0.15rem 0 0.45rem;
  line-height: 1.3;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.news-card-excerpt {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin: 0 0 0.4rem;
  line-height: 1.4;
  font-size: 0.925rem;
  overflow-wrap: anywhere;
}

.news-card-tags {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1.25em;
  margin-bottom: 0.65rem;
  line-height: 1.25;
  font-size: 0.8125rem;
}

.news-card-action {
  flex: 0 0 auto;
  margin-top: auto;
  align-self: flex-start;
}

.team-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
}

.content-carousel .carousel-img {
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
}

.content-carousel.gallery-carousel .carousel-img {
  aspect-ratio: 16 / 9;
  max-height: none;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.gallery-carousel-wrap {
  max-width: 960px;
  margin: 0 auto;
}

.news-gallery-carousel .news-gallery-img,
.news-gallery-img {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #e9ecef;
}

.content-carousel .carousel-video,
.gallery-carousel .carousel-video,
.news-gallery-carousel .carousel-video,
.carousel-video {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #111;
  display: block;
  position: relative;
  z-index: 2;
}

/* Don't let full-height arrow zones block video pause/fullscreen controls */
.media-carousel .carousel-control-prev,
.media-carousel .carousel-control-next,
.news-gallery-carousel .carousel-control-prev,
.news-gallery-carousel .carousel-control-next {
  width: 12%;
  height: calc(100% - 56px);
  top: 0;
  bottom: auto;
  z-index: 3;
  pointer-events: none;
}

.media-carousel .carousel-control-prev-icon,
.media-carousel .carousel-control-next-icon,
.news-gallery-carousel .carousel-control-prev-icon,
.news-gallery-carousel .carousel-control-next-icon {
  pointer-events: auto;
  cursor: pointer;
}

.container-narrow {
  max-width: 960px;
}

.news-article-body {
  white-space: pre-line;
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  padding: 0.5rem 1rem;
}

.site-footer {
  background: #f8f9fb;
  border-top: 1px solid #e9ecef;
}

.footer-social {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}

.footer-social:hover {
  color: var(--vk-blue);
}

.btn-primary {
  background: var(--vk-blue);
  border-color: var(--vk-blue);
}

.btn-primary:hover {
  background: var(--vk-blue-dark);
  border-color: var(--vk-blue-dark);
}

.doc-link,
.doc-card {
  color: inherit;
  text-decoration: none;
}

.doc-card {
  background: #f8f9fb;
  border: 1px solid #e9ecef;
  transition: border-color 0.2s;
}

.doc-card:hover {
  border-color: var(--vk-blue);
  color: var(--vk-blue);
}

.raccoon-img {
  max-width: 170px;
}

.site-logo {
  border-radius: 8px;
  object-fit: cover;
}

.director-photo {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.director-photo-lg {
  max-width: 420px;
}

.director-sign {
  font-weight: 600;
  color: var(--navy);
}

.gallery-thumb {
  height: 160px;
  object-fit: cover;
  width: 100%;
}

.gallery-item img {
  height: 180px;
  object-fit: cover;
  width: 100%;
}

.event-album-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-album-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.75rem 1.5rem rgba(17, 36, 68, 0.12) !important;
}

.event-album-cover-wrap {
  background: #eef2f6;
}

.event-album-cover,
.event-detail-cover {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  display: block;
}

.event-album-cover-placeholder {
  aspect-ratio: 16 / 9;
  padding: 1rem;
  text-align: center;
}

.grants-table-wrap {
  margin-top: 1.5rem;
}

.grants-table {
  font-size: 0.9rem;
}

.grants-table th,
.grants-table td {
  vertical-align: top;
  min-width: 120px;
}

.grants-table th:first-child,
.grants-table td:first-child {
  min-width: 48px;
  width: 48px;
  text-align: center;
}

.grants-table th:nth-child(2),
.grants-table td:nth-child(2) {
  min-width: 64px;
  white-space: nowrap;
}

.event-detail-text {
  line-height: 1.7;
  white-space: normal;
}

.video-placeholder {
  height: 180px;
  background: #eef4fc;
}

.object-fit-cover {
  object-fit: cover;
}

.contact-details li {
  line-height: 1.6;
}

.top-bar {
  background: #0a2347;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.top-bar-link:hover {
  color: #fff;
}

.hero-title-lines span {
  line-height: 1.15;
}

.tag-cloud-card {
  background: #f8f9fb;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem;
}

.tag-cloud {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tag-cloud-item {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}

.tag-cloud-item:hover,
.tag-cloud-item.is-active {
  color: var(--vk-blue);
}

.tag-cloud-item.is-active {
  text-decoration: underline;
}

.partner-card {
  border: 1px solid #e9ecef;
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.partner-card:hover {
  border-color: var(--vk-blue);
  box-shadow: 0 8px 24px rgba(13, 45, 92, 0.08);
}

.partner-logo {
  max-height: 72px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.partners-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.partners-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: partners-scroll 67.5s linear infinite;
}

.partner-item {
  flex: 0 0 150px;
  width: 150px;
  text-align: center;
}

.partner-logo-circle {
  width: 110px;
  height: 110px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 14px rgba(13, 45, 92, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.partner-logo-circle img {
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.partner-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
  min-height: 3.1em;
}

@keyframes partners-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .partners-track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
  }

  .partner-item[aria-hidden="true"] {
    display: none;
  }
}

.home-video-block iframe {
  border: 0;
  width: 100%;
  height: 100%;
}

.home-video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.achievement-card {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.achievement-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  background: #e9ecef;
  display: block;
}

.achievement-label {
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--navy);
}

.thanks-list {
  max-height: min(60vh, 420px);
  overflow-y: auto;
}

.mto-carousel-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.mto-carousel .mto-carousel-img {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: none;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  background: #e9ecef;
}

.mto-caption {
  margin: 0.85rem 0 0;
  text-align: center;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.4;
}

.mto-carousel .carousel-indicators {
  position: static;
  margin: 0.75rem 0 0;
}

.mto-carousel .carousel-indicators [data-bs-target] {
  background-color: var(--vk-blue);
}

.mto-carousel .carousel-control-prev,
.mto-carousel .carousel-control-next {
  width: 12%;
}

.quote-box {
  border-left: 4px solid var(--vk-blue);
  background: #f8f9fb;
  padding: 1.25rem 1.5rem;
  border-radius: 0 12px 12px 0;
}

.quote-text {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.1rem;
}

.quote-label {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.project-logo {
  max-height: 192px;
}

.reporting-year {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.85rem;
}

.reporting-docs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reporting-doc {
  width: 100%;
}

.news-photo-scroll {
  scrollbar-width: thin;
}

.news-scroll-item {
  width: 180px;
  text-decoration: none;
  color: inherit;
}

.news-scroll-item img {
  width: 180px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
}

.news-scroll-caption {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  color: var(--text-muted);
}

@media (max-width: 767px) {
  .hero-section,
  .hero-overlay {
    min-height: auto;
  }

  .display-5 {
    font-size: 1.75rem;
  }
}
