/* Responsive fixes for public site */
*, *::before, *::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  overflow-x: hidden;
}

:root {
  --site-header-height: 70px;
}

body.nav-open {
  overflow: hidden;
}

.container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 64px 0;
}

@media (max-width: 768px) {
  .section {
    padding: 40px 0;
  }
}

.section,
.hero,
.resources-hero,
.news-hero,
.contact-hero {
  padding-left: 16px;
  padding-right: 16px;
}

/* ===== EduBridgeSA Premium University Navbar ===== */
.eb-navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15,23,42,0.08);
}

.eb-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.eb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
  min-width: max-content;
}

.eb-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.eb-brand-text {
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #0f172a;
  font-size: 16px;
  white-space: nowrap;
}

.eb-nav-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
}

.eb-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex: 1 1 auto;
  min-width: 0;
}

.eb-link {
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 10px;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.eb-link:hover,
.eb-link.active {
  background: rgba(59,130,246,0.10);
  color: #1d4ed8;
}

.eb-link-donate {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #ffffff;
  border: 1px solid rgba(180, 83, 9, 0.35);
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.25);
  position: relative;
  overflow: hidden;
}

.eb-link-donate:hover,
.eb-link-donate.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(234, 88, 12, 0.28);
}

.eb-link-donate:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.eb-link-donate::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.55);
  animation: donatePulse 2.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes donatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(249, 115, 22, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .eb-link-donate::after {
    animation: none;
  }
}

.eb-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: max-content;
}

.eb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.eb-btn-ghost {
  color: #0f172a;
  border-color: rgba(15,23,42,0.12);
  background: #ffffff;
}

.eb-btn-ghost:hover,
.eb-btn-ghost.active {
  background: rgba(15,23,42,0.04);
}

.eb-btn-primary {
  background: linear-gradient(135deg,#2563eb,#1d4ed8);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(37,99,235,0.18);
}

.eb-btn-primary:hover {
  filter: brightness(1.03);
}

.eb-burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.12);
  background: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
}

.eb-burger span {
  width: 18px;
  height: 2px;
  background: #0f172a;
  display: block;
  border-radius: 2px;
}

@media (max-width: 980px) {
  .eb-burger {
    display: inline-flex;
  }

  .eb-nav-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 18px;
    right: 18px;
    background: #ffffff;
    border: 1px solid rgba(15,23,42,0.10);
    border-radius: 16px;
    padding: 10px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    box-shadow: 0 20px 40px rgba(2,6,23,0.12);
  }

  .eb-nav-panel.is-open {
    display: flex;
  }

  .eb-nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .eb-link {
    padding: 12px 12px;
  }

  .eb-link-donate {
    text-align: center;
  }

  .eb-nav-actions {
    width: 100%;
    justify-content: stretch;
  }

  .eb-nav-actions .eb-btn {
    flex: 1;
  }
}

.navbar,
.topbar,
.header-top {
  float: none !important;
}

.eb-navbar * {
  box-sizing: border-box;
}

/* Grid responsiveness */
.grid-3,
.card-grid,
.additional-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 992px) {
  .grid-3,
  .card-grid,
  .additional-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-3,
  .card-grid,
  .additional-grid {
    grid-template-columns: 1fr;
  }
}

/* Hero responsiveness */
.hero-title,
.hero h1 {
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 600px) {
  .hero-actions .btn,
  .hero-actions a {
    width: 100%;
    justify-content: center;
  }
}

.btn,
.btn-primary,
.btn-secondary,
.btn-outline {
  max-width: 100%;
}

@media (max-width: 768px) {
  :root {
    --site-header-height: 70px;
  }

  .topbar {
    display: none;
  }
}

/* Home page grids */
.features-grid,
.steps-grid,
.stats-grid {
  align-items: stretch;
}

@media (min-width: 1200px) {
  .features-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .steps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .features-grid,
  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .features-grid,
  .steps-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer responsiveness */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
.footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-container {
    width: min(1100px, calc(100% - 32px));
    padding: 0;
  }

  .footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

/* Global mobile hardening for mixed legacy/student pages */
html,
body {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

.reference-number,
.application-ref {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 768px) {
  .actions,
  .button-group,
  .btn-group,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions > *,
  .button-group > *,
  .btn-group > *,
  .hero-actions > * {
    width: 100%;
  }

  .status-row,
  .form-row,
  .grid {
    grid-template-columns: 1fr !important;
  }

  .application-item {
    min-width: 0;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
