/* ==========================================================================
   Partner agents page (partner_institution.html)
   Palette matches the main TILK site.
   ========================================================================== */

:root {
  --navy: #0b1f3d;
  --navy-light: #16305a;
  --crimson: #c8102e;
  --crimson-dark: #970c22;
  --parchment: #faf7f2;
  --ink: #1c1c1c;
  --ink-soft: #55606e;
  --gold: #e3a857;
  --white: #ffffff;
  --line: #e7e1d8;
  --shadow-soft: 0 18px 40px -22px rgba(11, 31, 61, 0.35);
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: #fff;                /* same white as institution_cards_block.css */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); color: var(--navy); margin: 0 0 .4em; line-height: 1.15; }

/* ---------- Header with TILK logo ---------- */
.site-header {
  background: var(--navy);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}
.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 3px solid var(--gold); background: var(--white);
}
.brand-label { display: flex; flex-direction: column; line-height: 1.15; }
.brand-label strong { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: #fff; letter-spacing: .02em; }
.brand-label span { font-size: .68rem; font-weight: 600; color: var(--gold); letter-spacing: .08em; margin-top: 3px; }
.back-home {
  color: #fff; font-weight: 600; font-size: .92rem;
  border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; padding: 8px 18px;
  transition: background .15s ease, color .15s ease;
}
.back-home:hover { background: #fff; color: var(--navy); }

/* ---------- Intro ---------- */
.page { max-width: 1500px; margin: 0 auto; padding: 40px 28px 60px; }
.intro { margin-bottom: 32px; }
.eyebrow { font-size: 11px; letter-spacing: 3px; color: var(--crimson); font-weight: 800; }
.intro h1 { font-size: clamp(32px, 4.5vw, 54px); margin: 8px 0; letter-spacing: -1px; }
.intro h1 em { color: var(--crimson); font-style: normal; }
.intro p { color: var(--ink-soft); margin: 0; }

/* ---------- Layout: gallery (country nav bar is above) ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}



.viewer-flag { width: 64px; height: 43px; object-fit: cover; border-radius: 5px; box-shadow: 0 0 0 1px rgba(11, 31, 61, .15); }
.viewer-head h2 { font-size: 1.8rem; margin: 0; }
.viewer-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: .9rem; }

.viewer-status {
  text-align: center; padding: 48px 20px; border: 1px dashed var(--line);
  border-radius: 16px; color: var(--ink-soft); background: var(--parchment);
}
.viewer-status[hidden] { display: none; }
.viewer-status.is-error { background: #fdecec; border-color: #f5c4c7; color: #a5222f; }

/* ---------- Image cards: max 4 per row, extra images wrap to the next row ---------- */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}
.agent-card {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin: 0; padding: 14px; border: 1px solid var(--line);
  border-top: 5px solid var(--crimson);
  border-radius: 16px; overflow: hidden; cursor: zoom-in;
  background: linear-gradient(160deg, #ffffff 0%, #eef3fb 55%, #dbe6f6 100%);   /* soft navy-tinted card */
  box-shadow: 0 14px 28px -18px rgba(11, 31, 61, .55);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.agent-card:hover {
  transform: translateY(-6px);
  border-top-color: var(--gold);
  box-shadow: 0 22px 34px -16px rgba(11, 31, 61, .6);
}
.agent-card:focus-visible { outline: 2px solid var(--crimson); outline-offset: 3px; }
.agent-card img {
  display: block; width: 100%; aspect-ratio: 4 / 3;     /* every card the same height, rows stay even */
  object-fit: contain;                                   /* whole image shown, never cropped */
  background: #fff; border-radius: 10px;
  box-shadow: 0 6px 16px -10px rgba(11, 31, 61, .5);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(11, 31, 61, .88);
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox-close {
  position: absolute; top: 16px; right: 22px; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: #fff; color: var(--navy);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .agent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .agent-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .header-inner { padding: 10px 16px; }
  .brand-label span { display: none; }
}

/* ---------- Top country nav bar (flag + name) ---------- */
.country-nav {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px -14px rgba(11, 31, 61, .45);
  position: sticky; top: 0; z-index: 50;
}
.country-nav__inner {
  max-width: 1500px; margin: 0 auto; padding: 10px 28px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin;
}
.country-tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--navy);
  font-family: var(--font-body); font-weight: 600; font-size: .88rem; white-space: nowrap; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.country-tab:hover { border-color: var(--crimson); color: var(--crimson); }
.country-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.country-tab:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }
.country-tab .flag {
  width: 26px; height: 17px; object-fit: cover; border-radius: 3px; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(11, 31, 61, .15);
}
@media (max-width: 860px) { .country-nav__inner { padding: 8px 16px; } }
