/* ══════════════════════════════════════════════════════
   Нүүр хуудас  —  home.css
══════════════════════════════════════════════════════ */

/* ── API Diagram section ──────────────────────────────── */
.home-api-section {
  background: #032849;
  padding: 64px 2.5rem;
}
.home-api-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; align-items: center;
}
.home-api-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(29,158,117,.15); color: #4ECBA4;
  border: 1px solid rgba(29,158,117,.3);
  padding: 5px 14px; border-radius: 100px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
  margin-bottom: 16px;
}
.home-api-text h2 {
  font-size: 28px; font-weight: 700; color: #E8F4FE;
  line-height: 1.3; margin-bottom: 14px;
}
.home-api-text p {
  font-size: 14.5px; color: #8FAFCA; line-height: 1.7; margin-bottom: 22px;
}
.home-api-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.api-cta-btn {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 24px; text-decoration: none;
  background: linear-gradient(135deg, #378ADD 0%, #185FA5 100%);
  color: #fff; font-size: 14.5px; font-weight: 600;
  padding: 13px 24px; border-radius: 50px;
  box-shadow: 0 0 0 0 rgba(55,138,221,.5);
  animation: api-cta-pulse 2.2s ease-out infinite;
  transition: transform .15s, box-shadow .15s;
  align-self: flex-start;
}
.api-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(55,138,221,.45);
  animation: none;
}
.api-cta-arrow {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  animation: how-arrow-bounce 1.4s ease-in-out infinite;
}
@keyframes api-cta-pulse {
  0%   { box-shadow: 0 0 0 0    rgba(55,138,221,.55); }
  70%  { box-shadow: 0 0 0 14px rgba(55,138,221,.0); }
  100% { box-shadow: 0 0 0 0    rgba(55,138,221,.0); }
}
.home-api-chips span {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.06); color: #93C5E8;
  border: 1px solid rgba(255,255,255,.1);
  padding: 5px 12px; border-radius: 20px; font-size: 12.5px;
}
.home-api-diagram {
  background: rgba(255,255,255,.03); border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08); overflow: hidden;
  padding: 8px;
}

/* ── KPI + Orgs layout ────────────────────────────────── */
.home-kpi-orgs-wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 2.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 36px;
  align-items: start;
}
.home-kpi-sidebar {
  display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: 80px;
}
.home-kpi-card {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.home-kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.home-kpi-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.home-kpi-val { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.home-kpi-lbl { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; }
.home-orgs-main { min-width: 0; }

/* ── Section header ───────────────────────────────────── */
.home-section-head {
  text-align: left; margin-bottom: 24px;
}
.home-section-label {
  display: flex; align-items: center; gap: 7px; width: fit-content;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 4px 14px; border-radius: 100px;
  font-size: 12px; font-weight: 600; letter-spacing: .3px;
  margin-bottom: 10px;
}
.home-section-head h2 {
  display: inline;
  font-size: 22px; font-weight: 700; color: var(--text-primary);
  margin-right: 10px;
}
.home-section-head p {
  display: inline;
  font-size: 13.5px; color: var(--text-muted);
}

/* ── Organizations section ────────────────────────────── */
.home-org-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.home-org-card {
  background: var(--bg-white); border-radius: 14px;
  border: 1px solid var(--border-light); padding: 18px 20px;
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.home-org-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.home-org-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.home-org-logo { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.home-org-logo-img { width: 100%; height: 100%; object-fit: cover; }
.home-org-logo-init {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;
}
.home-org-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 100px;
  font-size: 11px; font-weight: 600; margin-bottom: 5px;
}
.home-org-badge.certifier { background: #E6F1FB; color: #0F4C81; border: 1px solid #B5D4F4; }
.home-org-badge.client    { background: #EAF3DE; color: #3B6D11; border: 1px solid #C0DD97; }
.home-org-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.home-org-reg  { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.home-org-contact {
  display: flex; flex-direction: column; gap: 5px;
  border-top: 1px solid var(--border-light); padding-top: 10px;
}
.home-org-contact span {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-secondary);
}
.home-org-contact i { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.home-orgs-empty { color: var(--text-muted); font-size: 13.5px; text-align: center; padding: 32px; }
.home-org-empty-wrap {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 0 8px;
}
.home-org-empty-svg { width: 180px; height: auto; margin-bottom: 10px; }
.home-org-empty-msg { font-size: 13.5px; color: var(--text-muted); }
.home-org-loading { display: flex; justify-content: center; align-items: center; padding: 32px; grid-column: 1/-1; }

/* ── News section ─────────────────────────────────────── */
.home-news-section {
  background: var(--bg-secondary); padding: 60px 2.5rem;
}
.home-news-section .home-section-head { max-width: 1200px; margin: 0 auto 24px; }
.home-news-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.home-news-card {
  background: var(--bg-white); border-radius: 14px;
  border: 1px solid var(--border-light); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.home-news-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.home-news-img { width: 100%; height: 140px; overflow: hidden; background: var(--bg-secondary); }
.home-news-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-news-img-ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 32px;
}
.home-news-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.home-news-date {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-muted);
}
.home-news-title { font-size: 13.5px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.home-news-intro { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; flex: 1; }
.home-news-section .home-org-loading { grid-column: 1/-1; }

/* ── Spinner ──────────────────────────────────────────── */
.home-spinner {
  display: inline-block; width: 28px; height: 28px;
  border: 2.5px solid #e2e8f0; border-top-color: var(--primary);
  border-radius: 50%; animation: home-spin .7s linear infinite;
}
@keyframes home-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .home-api-inner { grid-template-columns: 1fr; }
  .home-api-diagram { display: none; }
  .home-kpi-orgs-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 40px 1.5rem;
  }
  .home-kpi-sidebar {
    position: static;
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
@media (max-width: 600px) {
  .home-api-section { padding: 40px 1.5rem; }
  .home-news-section { padding: 40px 1.5rem; }
  .home-kpi-orgs-wrap { padding: 32px 1.25rem; }
  .home-kpi-sidebar { grid-template-columns: 1fr 1fr; }
  .home-kpi-card { padding: 12px 14px; }
  .home-kpi-val { font-size: 20px; }
}
