/* ===================================================================
   GNIET Final Polish CSS
   Final refinements for premium Bootstrap education theme
   ================================================================= */

/* ===== PREMIUM SECTION BALANCE ===== */
/* Ensure perfect vertical rhythm */
section {
  margin-bottom: 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.3);
}

section:last-of-type {
  border-bottom: none;
}

/* ===== ENHANCED CONTENT FLOW ===== */
/* Better paragraph spacing in cards */
.card-body p:last-child {
  margin-bottom: 0;
}

.card-body .small:last-child {
  margin-bottom: 0;
}

/* ===== IMPROVED BUTTON CONSISTENCY ===== */
/* Ensure all buttons have consistent appearance */
.btn {
  font-family: var(--font-family-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: 0;
}

.hero-btn {
  font-family: var(--font-family-primary);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: 0;
}

/* ===== REFINED CAROUSEL STYLING ===== */
.carousel-inner {
  border-radius: var(--radius-lg);
}

.carousel-item {
  border-radius: var(--radius-lg);
}

/* ===== ENHANCED GRID CONSISTENCY ===== */
/* Ensure consistent grid gaps */
.row {
  --bs-gutter-x: 2rem;
  --bs-gutter-y: 2rem;
}

@media (max-width: 768px) {
  .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }
}

/* ===== TYPOGRAPHY FINE-TUNING ===== */
section h2 + p {
  margin-top: -var(--space-4);
  margin-bottom: var(--space-8);
}

section h3 + p {
  margin-top: -var(--space-2);
  margin-bottom: var(--space-6);
}

/* ===== IMPROVED VISUAL BALANCE ===== */
/* Better spacing for list items */
.list-unstyled li {
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

.list-unstyled li:last-child {
  margin-bottom: 0;
}

/* ===== ENHANCED ACCESSIBILITY ===== */
/* Better focus indicators */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--primary-navy);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.1);
}

/* ===== FINAL POLISH TOUCHES ===== */
/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better image rendering */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Consistent border radius for all images in cards */
.card img {
  border-radius: 0;
}

.card-img-top {
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
}

/* ===== MOBILE POLISH ===== */
@media (max-width: 768px) {
  /* Better mobile spacing */
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  
    .section-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-8);
  }
  
  .section-subtitle {
    font-size: var(--text-base);
    margin-bottom: var(--space-8);
  }
}