/**
 * Spacing Fixes CSS
 * Spacing, margins and padding fixes
 */

/* ========================================
   SPACING BETWEEN SECTIONS
   ======================================== */

/* Vertical separation between layouts */
.layout {
  margin-bottom: 2rem;
}

.layout:last-child {
  margin-bottom: 1rem;
}

/* Specific spacing for column layouts */
.layout--threecol-section,
.layout--twocol-section {
  margin-bottom: 2rem;
}

/* ========================================
   NEGATIVE MARGINS - FIXES
   ======================================== */

/* Fix negative margins causing overlap and misalignment */
.layout h1[style*="margin-bottom:0"],
.layout h2[style*="margin-bottom:0"] {
  margin-bottom: 1rem !important;
}

.layout h2[style*="margin-top:-24px"],
.layout h2[style*="margin-top:-36px"] {
  margin-top: 0 !important;
}

/* Adjust cards with negative margins */
.card[style*="margin-top:-40px"] {
  margin-top: 0 !important;
}

/* Images and divs with negative margins - reset for alignment */
div[style*="margin-top:-20px"],
div[style*="margin-top:-40px"] {
  margin-top: 0 !important;
}

/* Previous topics with negative margins */
p[style*="margin-top:-36px"],
p[style*="margin-top:-16px"] {
  margin-top: 0 !important;
  padding-top: 0.75rem !important;
}

/* ========================================
   INTERNAL SECTION PADDING
   ======================================== */

/* Padding for content blocks */
.block-content-basic .content {
  padding: 0;
}

.block-content-basic .field__item {
  padding: 0;
}

/* Padding for divs with inline styles */
div[style*="padding:8px 0 0 12px"],
div[style*="padding:24px 48px"] {
  padding: 1.5rem !important;
}

/* ========================================
   TITLE SPACING
   ======================================== */

/* Main title "Accelerating Disease Elimination" */
.layout--onecol h1 {
  margin-bottom: 1rem;
  margin-top: 0;
}

.layout--onecol h1 span {
  display: block;
  margin-bottom: 0.25rem;
}

/* H2 titles in cards */
.layout__region h2.h5 {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

/* H3 subtitles */
.layout__region h3.h6 {
  margin-bottom: 0;
  line-height: 1.5;
}

/* ========================================
   PARAGRAPH SPACING
   ======================================== */

/* Paragraphs in cards */
.block-content-basic p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.block-content-basic p:last-child {
  margin-bottom: 0;
}

/* Paragraphs with inline font size */
p[style*="font-size:29px"],
p[style*="font-size:80%"] {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* ========================================
   ROTATED BOX SPACING
   ======================================== */

/* Separation between rotated boxes */
.layout--twocol-section div[style*="margin-bottom:24px"] {
  margin-bottom: 1rem !important;
}

/* Internal padding of boxes */
div[style*="border-radius:9px"] > div {
  padding: 1.5rem 2.5rem;
}

/* Adjustment for smaller screens */
@media (max-width: 992px) {
  div[style*="border-radius:9px"] > div {
    padding: 1rem 1.5rem;
  }
}

/* ========================================
   BUTTON SPACING
   ======================================== */

/* Button separation */
.btn {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* Buttons in paragraphs */
p .btn {
  margin-top: 0.5rem;
}

/* ========================================
   DIRECTOR/ACKNOWLEDGMENTS LAYOUT SPACING
   ======================================== */

/* "A Word From The Director" section - padding adjustments removed
   to use only flexbox gap */
.layout--threecol-section--50-25-25 .layout__region--first,
.layout--threecol-section--50-25-25 .layout__region--second,
.layout--threecol-section--50-25-25 .layout__region--third {
  padding-left: 0;
  padding-right: 0;
}

/* ========================================
   PREVIOUS TOPICS SPACING
   ======================================== */

/* Section title */
.layout h2.text-secondary {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* Previous topics items */
.layout--twocol-section p[style*="border-top"] {
  margin-bottom: 0.5rem;
  padding-top: 0.75rem;
}

/* ========================================
   SPACING UTILITIES
   ======================================== */

/* Margin top utilities */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

/* Margin bottom utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

/* Padding utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* ========================================
   SPECIFIC FIXES
   ======================================== */

/* Ensure blocks have appropriate spacing */
.block {
  margin-bottom: 0.75rem;
}

.block:last-child {
  margin-bottom: 0;
}

/* Formatted text content */
.text-formatted {
  margin-bottom: 0;
}

/* Clearfix after floating elements */
.clearfix::after,
div[style*="padding:8px 0 0 12px"]::after {
  content: "";
  display: table;
  clear: both;
}

/* ========================================
   RESPONSIVE SPACING
   ======================================== */

/* Reduce spacing on tablets */
@media (max-width: 992px) {
  .layout {
    margin-bottom: 1.25rem;
  }

  .layout--threecol-section,
  .layout--twocol-section {
    margin-bottom: 1.25rem;
  }
}

/* Further reduction on mobile */
@media (max-width: 576px) {
  .layout {
    margin-bottom: 1rem;
  }

  .layout--threecol-section,
  .layout--twocol-section {
    margin-bottom: 1rem;
  }

  div[style*="border-radius:9px"] > div {
    padding: 1rem 1.25rem !important;
  }
}
