html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --primary-color: #2c3e50;
  --accent-color: #e67e22;
  --text-color: #333;
  --light-bg: #f8f9fa;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  padding-bottom: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Open Sans', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
}

/* General Layout */
.container.flex-grow-1 {
  flex: 1 0 auto;
  min-height: 300px; /* Minimum height to ensure content has space */
}

.footer {
  flex-shrink: 0;
  position: relative;
  z-index: 100; /* Ensure footer is above other content */
  background-color: white; /* Make sure it has a background */
  margin-top: auto; /* Push to the bottom if content is short */
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* Fix for sticky footer and proper spacing */
main {
  padding-bottom: 2rem !important; /* Ensure space between content and footer */
}

/* Fix for potential button coverage */
button, .btn, a.btn {
  position: relative;
  z-index: 50; /* Ensure buttons are above other elements but below footer */
}

.hero-section {
  position: relative;
  background-color: var(--light-bg);
  padding: 6rem 0;
  margin-bottom: 4rem;
  overflow: hidden;
}

.hero-text {
  position: relative;
  z-index: 2;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  font-weight: 300;
  color: var(--primary-color);
}

.btn-custom {
  background-color: var(--accent-color);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  transition: all 0.3s ease;
}

.btn-custom:hover {
  background-color: darken(var(--accent-color), 10%);
  transform: translateY(-2px);
}

.image-grid {
  display: block; /* Changed from grid to block for Masonry */
  margin: 0 -12px; /* Negative margin to offset the padding in items */
}

/* Grid sizer for masonry layout */
.grid-sizer {
  width: 25%;
  visibility: hidden;
}

.portfolio-item {
  width: 25%; /* Default width for desktop */
  padding: 12px;
  float: left; /* Required for masonry */
  box-sizing: border-box;
}

/* For portfolio item inner content */
.portfolio-item .position-relative {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  margin-bottom: 0;
}

/* Responsive breakpoints for masonry grid */
/* For mobile devices - 1 column on very small screens */
@media (max-width: 575px) {
  .grid-sizer,
  .portfolio-item {
    width: 100%;
  }
}

/* For small devices - 2 columns */
@media (min-width: 576px) and (max-width: 767px) {
  .grid-sizer,
  .portfolio-item {
    width: 50%;
  }
}

/* For medium devices - 3 columns */
@media (min-width: 768px) and (max-width: 991px) {
  .grid-sizer,
  .portfolio-item {
    width: 33.333%;
  }
}

/* For large devices - 4 columns (default) */
@media (min-width: 992px) {
  .grid-sizer,
  .portfolio-item {
    width: 25%;
  }
}

.portfolio-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.portfolio-item .position-relative {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  background-color: #fff;
}

/* Clear fix for masonry layout */
.image-grid:after {
  content: '';
  display: block;
  clear: both;
}

/* Image aspect ratio handling */
.portfolio-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  backface-visibility: hidden; /* Prevents glitchy animations */
}

.hover-effect {
  transition: all 0.3s ease;
}

.hover-effect:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}