/* Content must fit its own grid cell, including longer translated labels. */
.section-heading > *, .vision-copy, .investment-panel > *, .region-countries > *,
.association-note > *, .team-card > *, .news-content, .news-meta > *,
.project-top > *, .project-copy, .project-buttons > *, .film-actions > * { min-width: 0; }
h1, h2, h3, h4, p, .partner-card > span, .button, .text-link,
.contact address a, .menu-email { overflow-wrap: anywhere; }
.button { max-width: 100%; min-width: 0; }
.section-heading > div { flex: 1 1 50%; }
.section-heading > p { flex: 1 1 40%; }
.news-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.news-meta { flex-wrap: wrap; }
.team-card h3 { line-height: 1.2; }
.team-ai .team-photo img { width: 100%; height: 100%; padding: 0; object-fit: cover; object-position: 43% 35%; }

/* Fit the entire mark, regardless of whether it is tall or wide. */
.partner-image { width: 100%; max-width: 160px; height: 80px; min-width: 0; }
.partner-card .partner-image img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
/* Only the source's white top/bottom margins are outside this wide viewport. */
.partner-zhersu .partner-image img { width: 100%; height: auto; max-height: none; object-fit: contain; flex: 0 1 auto; }
.partner-card > span { max-width: 100%; }

/* Let cards grow with the text instead of pinning copy over the image. */
.project-card { display: flex; flex-direction: column; gap: 80px; height: auto; min-height: 570px; max-height: none; padding: 32px 40px 40px; }
.project-top { position: static; flex: 0 0 auto; }
.project-copy { position: static; margin-top: auto; }
.project-copy h3 { overflow-wrap: anywhere; }
.project-category { flex: 1 1 auto; }
.project-logo { flex: 0 0 auto; width: 104px; height: 64px; max-width: 38%; max-height: none; object-fit: contain; }
.project-buttons { flex-wrap: wrap; }
.project-buttons .button { flex: 0 1 auto; min-width: 0; }
.film-frame { width: 100%; min-width: 0; }
.film-actions { flex-wrap: wrap; }
.investment-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.investment-row { flex-wrap: wrap; gap: 10px 18px; }
.investment-row > span { min-width: 0; overflow-wrap: anywhere; }
.investment-row strong { margin-left: auto; }
.dock-chat { min-width: 0; }
.dock-chat > span:not(.dock-send) { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.dock-send { flex: 0 0 24px; }
.menu-toggle, .header-contact { width: 44px; height: 44px; }
.menu-toggle { align-items: center; }
.language-switch button { min-width: 36px; min-height: 44px; }
.site-menu nav a { min-width: 0; overflow-wrap: anywhere; }
.site-menu nav a small, .site-menu nav a span { flex-shrink: 0; }
.dialog-top .wordmark { min-width: 0; }
.round-button { flex-shrink: 0; }
.contact-dock { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); height: calc(64px + env(safe-area-inset-bottom, 0px)); }
body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

/* vh fallbacks retain usable dimensions in older embedded browsers. */
@supports not (height: 100svh) { .hero { height: calc(100vh - 120px); } }
@supports not (height: 100dvh) {
  .site-menu { height: 100vh; max-height: 100vh; }
  .project-dialog { max-height: calc(100vh - 48px); }
  .chat-dialog { max-height: calc(100vh - 110px); }
}
@media (max-width: 1150px) { .header-actions { gap: 10px; } }
@media (max-width: 900px) {
  .investment-panel { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .investment-panel h2 br { display: none; }
}
@media (max-width: 800px) {
  .project-card { min-height: 520px; padding: 28px 28px 32px; }
  .vision-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}
@media (max-width: 600px) {
  .section-heading > div, .section-heading > p { flex-basis: auto; }
  .hero-copy h1 { font-size: clamp(38px, 11vw, 48px); }
  .header-actions { gap: 6px; }
  .project-card { min-height: 560px; padding: 22px 22px 26px; gap: 112px; }
  .project-logo { width: 94px; height: 60px; max-width: 40%; }
  .project-buttons { flex-wrap: nowrap; }
  .project-buttons .button { flex: none; }
  .partner-image { max-width: 140px; height: 68px; }
  .partner-card .partner-image img { height: 100%; }
  .partner-zhersu .partner-image img { height: auto; }
  .team-card:first-child, .team-ai { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); }
  .news-list { grid-template-columns: minmax(0, 1fr); }
  .film-actions { align-items: center; gap: 12px 16px; }
  .film-actions .text-link { margin-top: 0; }
  .chat-dialog textarea { font-size: 16px; }
  .contact-dock { height: calc(62px + env(safe-area-inset-bottom, 0px)); }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .dock-chat { height: auto; min-height: 42px; }
}
@media (max-width: 360px) {
  .dock-chat { gap: 8px; padding-inline: 10px; font-size: 11px; }
  .dock-ansara-logo { width: 58px; }
  .film-actions { align-items: flex-start; flex-direction: column; }
  .team-card:first-child, .team-ai { column-gap: 16px; }
}

/* Direct contact details retain readable wrapping and touch targets. */
.team-contacts { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; min-width: 0; font-size: 13px; line-height: 1.5; }
.team-contacts a { display: flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 4px; }
.contact-person { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 24px; margin-bottom: 12px; min-width: 0; max-width: 100%; }
.contact-person strong { flex-basis: 100%; font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.contact-person a { display: flex; align-items: center; min-height: 44px; max-width: 100%; }
