/* Main layout elements */
main, header, footer {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Content wrappers */
.container,
.main-content,
#main-content {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0 auto;
}

/* Section wrapper */
.four-column-images {
  position: relative;
  padding: 0 20px 10px 20px;
}

/* Row layout using CSS Grid */
.four-column-images .row {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns by default */
  gap: 10px;
  width: 100%;
  margin: 0;
}

/* Column layout */
.four-column-images .column {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 0 10px;
}

/* Image styling */
.four-column-images img {
  width: 100%;
  max-width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
}

/* Flight instruction image tweak */
.four-column-images .column img[src*="flight-instruction"] {
  object-fit: contain;
  max-height: 300px;
  height: auto;
}

/* Match VFR and IFR heights */
.four-column-images .column img[src*="vfr-resources"],
.four-column-images .column img[src*="ifr-resources"] {
  height: 300px;
  object-fit: cover;
}

/* Paragraph styling under images */
.four-column-images p {
  margin-top: 10px;
  font-size: 16px;
  text-align: center;
  width: 100%;
}

/* Bottom container layout */
.bottom-containers {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-gap: 20px;
  margin-top: 0;
}

/* Container blocks */
.container {
  padding: 20px;
  text-align: center;
  min-height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

/* Spanning container */
.container.span-two {
  grid-column: 2 / 3;
}

/* Paragraph inside container */
.container p {
  margin: 0;
}

/* ==========================
   Responsive styles
   ========================== */
@media (max-width: 1024px) {
  /* Tablets: 2 columns */
  .four-column-images .row {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (max-width: 720px) {
  /* Mobile: 1 column */
  .four-column-images .row {
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
  }
  .four-column-images .column {
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
  }
  .four-column-images img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
  }
  .four-column-images p {
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
    font-size: 16px;
    text-align: center;
  }

  .bottom-containers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .container,
  .container.span-two {
    width: 100%;
    max-width: 100%;
    grid-column: auto;
  }
}
