/* Home — category tabs, cards, FAB (browse grid). */
/* —— Browse section —— */
.home-browse {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background:
    radial-gradient(ellipse 80% 60% at 15% 0%, rgba(31, 78, 120, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 20%, rgba(255, 149, 21, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f7fafd 60%, #eef3f9 100%);
  padding: clamp(16px, 3vw, 28px) 0 clamp(32px, 6vw, 52px);
  box-sizing: border-box;
}

.home-tabs-wrap {
  max-width: min(1200px, calc(100% - clamp(16px, 4vw, 28px)));
  margin: clamp(-12px, -2vw, -6px) auto 28px;
  padding: 14px 16px;
  border-radius: var(--home-radius-lg);
  background: #ffffff;
  border: 1px solid rgba(31, 78, 120, 0.1);
  box-shadow: 0 18px 40px -22px rgba(31, 78, 120, 0.18);
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 78, 120, 0.3) transparent;
}

.home-tabs-wrap::-webkit-scrollbar {
  height: 5px;
}

.home-tabs-wrap::-webkit-scrollbar-thumb {
  background: rgba(31, 78, 120, 0.3);
  border-radius: 6px;
}

.home-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 900px) {
  .home-tabs-wrap {
    overflow-x: visible;
  }

  .home-tabs {
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    min-width: 0;
  }
}

.home-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(31, 78, 120, 0.14);
  background: #ffffff;
  cursor: pointer;
  font-weight: 700;
  font-size: clamp(0.78rem, 2vw, 0.9rem);
  font-family: inherit;
  color: #475569;
  flex-shrink: 0;
  touch-action: manipulation;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.22s ease,
    transform 0.2s ease;
}

.home-tab .label-text {
  white-space: nowrap;
}

.home-tab i {
  font-size: 0.95em;
  color: var(--home-brand);
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.home-tab.is-active {
  background: var(--home-brand);
  color: #ffffff;
  border-color: var(--home-brand);
  box-shadow: 0 12px 24px rgba(31, 78, 120, 0.28);
  transform: translateY(-1px);
}

.home-tab.is-active i {
  color: #ffffff;
  opacity: 1;
}

.home-tab:not(.is-active):hover {
  border-color: rgba(31, 78, 120, 0.32);
  color: var(--home-brand);
  box-shadow: 0 8px 18px rgba(31, 78, 120, 0.1);
  transform: translateY(-2px);
}

.home-tab:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 2px;
}

.home-panels [id^="home-panel-"] {
  scroll-margin-top: min(100px, 20vh);
}

.home-panels {
  width: 100%;
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 clamp(12px, 2.2vw, 20px) clamp(8px, 2vw, 16px);
  box-sizing: border-box;
}

.home-panel {
  display: none;
}

.home-panel.is-active {
  display: block !important;
  animation: home-fade 0.25s ease-out;
}

.home-panel[hidden] {
  display: none !important;
}

.home-panel.is-active[hidden] {
  display: block !important;
}

.home-study-abroad-teaser {
  margin: 0 0 22px;
  padding: 14px 18px;
  font-size: 0.93rem;
  line-height: 1.5;
  color: #334155;
  background: #ffffff;
  border: 1px solid rgba(31, 78, 120, 0.12);
  border-radius: var(--home-radius-md);
  box-shadow: 0 6px 18px -10px rgba(31, 78, 120, 0.18);
}

.home-study-abroad-teaser a {
  color: var(--home-brand);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(31, 78, 120, 0.32);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.home-study-abroad-teaser a:hover {
  color: var(--home-accent);
  border-bottom-color: var(--home-accent);
}

@keyframes home-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-panel.is-active {
    animation: none;
  }
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3.2vw, 24px);
}

@media (min-width: 520px) {
  .home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .home-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  }
}

.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--home-radius-lg);
  padding: 24px 22px 22px;
  border: 1px solid rgba(31, 78, 120, 0.1);
  box-shadow: var(--home-shadow-card);
  transition: transform 0.22s ease, box-shadow 0.28s ease, border-color 0.2s ease;
  overflow: hidden;
}

.home-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--home-brand) 0%, var(--home-accent) 100%);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.home-card:hover {
  box-shadow: var(--home-shadow-card-hover);
  transform: translateY(-4px);
  border-color: rgba(31, 78, 120, 0.22);
}

.home-card:hover::before {
  opacity: 1;
}

.home-card.is-hidden {
  display: none;
}

/* Cap to first 10 cards on initial load; expand on click or while filtering. */
.home-grid:not(.is-expanded):not(.is-filtering) .home-card--extra {
  display: none;
}

.home-grid__more-wrap {
  display: flex;
  justify-content: center;
  margin-top: clamp(18px, 3vw, 28px);
}

.home-grid__more {
  appearance: none;
  border: 1px solid rgba(31, 78, 120, 0.22);
  background: #ffffff;
  color: var(--home-brand);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: 0 6px 16px -8px rgba(31, 78, 120, 0.18);
}

.home-grid__more:hover,
.home-grid__more:focus-visible {
  background: var(--home-brand);
  color: #ffffff;
  border-color: var(--home-brand);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(31, 78, 120, 0.28);
  outline: none;
}

.home-grid__more-count {
  font-weight: 600;
  opacity: 0.85;
}

.home-grid__more i {
  font-size: 0.8rem;
  transition: transform 0.18s ease;
}

.home-card__type {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--home-brand);
  margin-bottom: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--home-brand-soft);
  border: 1px solid rgba(31, 78, 120, 0.18);
}

.home-card h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.28;
  color: #0f172a;
}

.home-card__meta {
  margin: 0 0 18px;
  color: var(--dc-muted, #64748b);
  font-size: 0.89rem;
  line-height: 1.45;
}

.home-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(241, 245, 249, 0.95);
}

.home-card__apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  color: #ffffff;
  background: var(--home-accent);
  box-shadow: 0 8px 18px rgba(255, 149, 21, 0.32);
  transition: transform 0.18s ease, box-shadow 0.22s ease, background 0.2s ease;
}

.home-card__apply i {
  font-size: 0.92em;
}

.home-card__apply:hover {
  transform: translateY(-2px);
  background: #f08400;
  box-shadow: 0 12px 24px rgba(255, 149, 21, 0.42);
}

.home-card__apply:active {
  transform: translateY(0);
}

.home-card__apply:focus-visible {
  outline: 3px solid rgba(255, 149, 21, 0.45);
  outline-offset: 3px;
}

.home-card a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--home-brand) !important;
  text-decoration: none !important;
  touch-action: manipulation;
  padding: 4px 0;
  border-radius: 8px;
  transition: gap 0.2s ease, color 0.15s ease;
}

.home-card a:hover {
  gap: 12px;
  color: #163a5a !important;
}

.home-empty {
  padding: clamp(32px, 6vw, 48px) clamp(20px, 4vw, 32px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f1f5f9 100%);
  border-radius: var(--home-radius-lg);
  border: 2px dashed rgba(148, 163, 184, 0.65);
  color: var(--dc-muted, #64748b);
  text-align: center;
  font-size: 0.96rem;
  line-height: 1.6;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.home-empty a {
  color: var(--home-brand);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(0, 103, 182, 0.25);
}

.home-empty a:hover {
  border-bottom-color: rgba(0, 103, 182, 0.5);
}

/* Apply popup on home — brand navy accent; uses #applyModal from dc-apply-modal.css */
.home-page #applyModal {
  --dc-modal-accent: #1f4e78;
  --dc-modal-accent-hover: #163a5a;
  --dc-modal-accent-soft: rgba(31, 78, 120, 0.12);
}

.home-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 150;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  border: none;
  border-radius: 999px;
  background: #1f4e78;
  color: #ffffff;
  font-weight: 800;
  font-family: inherit;
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(31, 78, 120, 0.42), 0 4px 10px rgba(15, 23, 42, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.2s ease;
}

.home-fab:hover,
.home-fab:focus,
.home-fab:active {
  background: #1f4e78;
  color: #ffffff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 42px rgba(31, 78, 120, 0.5), 0 6px 14px rgba(15, 23, 42, 0.12);
}

.home-fab:focus-visible {
  outline: 3px solid rgba(31, 78, 120, 0.45);
  outline-offset: 3px;
}

.home-fab i {
  margin-right: 6px;
}

@media (max-width: 900px) {
  .home-fab {
    bottom: calc(max(20px, env(safe-area-inset-bottom, 0px)) + 52px);
  }
}

@media (max-width: 480px) {
  .home-fab {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 320px;
  }
  .home-fab:hover {
    transform: translateX(-50%) translateY(-3px) scale(1.02);
  }

  .home-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-card__apply,
  .home-card__actions a {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
}
