@charset "utf-8";

/* Global Styles */
body {
  margin: 0;
  padding: 0;
  background: #FFFFFF;
  font-family: sans-serif;
}

/* TOP NAVIGATION */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95); /* Semi-transparent white */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1100;
  overflow: visible; /* Prevent clipping on narrow screens */
  min-height: 60px; /* Set a minimum height to control vertical expansion */
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo img {
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

.main-menu ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap; /* Wrap menu items if needed */
  justify-content: flex-end; /* Align to right */
}

.main-menu ul li {
  margin-left: 20px;
}

.main-menu ul li a {
  text-decoration: none;
  color: #1A1919;
  font-size: 16px;
  transition: color 0.3s ease;
}

.main-menu ul li a:hover,
.main-menu ul li a:focus {
  color: #FEC33F;
}

/* HERO SECTION (Landing Page) */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  background: url("../images/swap drawing 2025.webp") no-repeat center center;
  background-size: contain; /* Full image visible */
  background-position: center center;
  margin-top: 70px;
}

.hero-content {
  position: absolute;
  top: 50%;
  right: 10%; /* Right-aligned by default (original style) */
  transform: translateY(-50%); /* Vertical center only */
  text-align: right; /* Right-aligned text */
  max-width: 40%;
  padding: 20px;
  animation: fadeIn 1.5s ease-in-out;
}

.hero h1 {
  font-size: clamp(30px, 6vw, 70px);
  font-weight: bold;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  padding: 0;
}

.hero p {
  font-size: 18px;
  margin-top: 10px;
  opacity: 0.8;
}

/* Enable smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

/* Scroll Pointer Styling */
.scroll-down {
  display: inline-block;
  margin-top: 20px;
  font-size: 40px;
  /* Force the color to your chosen color (e.g., #1A1919) */
  color: #1A1919 !important;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.scroll-down:hover {
  transform: translateY(5px);
}

/* Keyframe for fadeIn animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PROJECTS CONTAINER (CSS GRID) */
.container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 1600px;
  margin: 120px auto 0;
  padding: 0 10px;
}

/* BOX STYLING */
.box {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* Maintain square aspect ratio */
  overflow: hidden;
}

.imgbox {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.imgbox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s, filter 0.3s;
  filter: grayscale(80%);
}

.box:hover .imgbox img {
  transform: scale(1.2);
  filter: grayscale(0%);
}

/* DETAILS OVERLAY */
.details {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  color: white;
  opacity: 0;
  transition: opacity 0.3s;
  padding: 15px;
  box-sizing: border-box;
  overflow: hidden; /* Prevent text overflow */
}

.box:hover .details {
  opacity: 1;
}

.details .content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.details .content h3 {
  margin: 0 0 2px 0; /* Even tighter margins */
  padding: 1px 0;
  font-size: clamp(10px, 2.5vw, 14px); /* Smaller: 10px min on mobile */
  color: #FEC33F;
  line-height: 1.0; /* More compact */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.details .content h1 {
  margin: 0 0 2px 0;
  padding: 1px 0;
  font-size: clamp(10px, 2.5vw, 14px);
  color: #FF0004;
  line-height: 1.0;
}

.details .content h4 {
  margin: 2px 0 0 0;
  padding: 2px 4px; /* Minimal padding */
  font-size: clamp(8px, 2vw, 11px); /* Even smaller: 8px min */
  color: antiquewhite;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1; /* 1 line max on small screens */
  -webkit-box-orient: vertical;
}

/* FOOTER / SOCIAL ICONS */
.linked {
  text-align: center;
  margin: 20px 0;
}

.linked h4 {
  margin-bottom: 10px;
}

/* CUSTOM FILTERS */
.custom-filters {
  text-align: center;
  margin: 40px auto;
  font-family: sans-serif;
}

.filter-group {
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-label {
  font-weight: bold;
  margin-right: 10px;
  white-space: nowrap;
}

.filter-option {
  margin: 0 8px;
  cursor: pointer;
  color: #aaa;
  transition: all 0.3s ease;
  padding: 4px 8px;
  border-radius: 4px;
}

.filter-option.active {
  font-weight: bold;
  color: #000;
  text-decoration: underline;
  background: #ffffff;
}

.filter-option:hover {
  color: #000;
  text-decoration: underline;
  transform: scale(1.05);
  background: #ffffff;
}

.reset-button {
  background: none;
  border: 1px solid #aaa;
  padding: 5px 15px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.reset-button:hover {
  background-color: #f0f0f0;
  color: #000;
  border-color: #000;
}

/* Footer fixed at bottom */
.site-footer {
  grid-column: 1 / span 2;
  grid-row: 2 / 3;
  background: linear-gradient(135deg, #F5F5F5 0%, #FFFFFF 100%);
  padding: 10px 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 5;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1150px;
  margin: 0 auto;
  color: #444444;
  font-size: 16px;
  font-family: Helvetica, Cambria, serif;
}

.footer-inner .footer-icons img {
  height: 30px;
  width: auto;
  margin-left: 12px;
  transition: transform 0.3s ease;
}

.footer-inner .footer-icons img:hover {
  transform: scale(1.2) rotate(10deg);
}

/* MOBILE RESPONSIVE ADJUSTMENTS */
@media (max-width: 600px) {
  .container {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets/small phones */
    gap: 8px;
  }

  .details {
    padding: 6px; /* Further reduced padding */
  }

  .details .content h3,
  .details .content h1 {
    font-size: clamp(11px, 2.8vw, 15px); /* Smaller clamp */
    padding: 0.5px 0;
  }

  .details .content h4 {
    font-size: clamp(9px, 2.2vw, 12px);
    padding: 1px 3px;
    -webkit-line-clamp: 1;
  }

  .main-menu ul li a {
    font-size: 14px;
  }

  .hero-content {
    right: 5%;
    max-width: 70%;
    padding: 15px;
  }

  /* Compress filters */
  .custom-filters {
    margin: 20px auto;
    font-size: 14px;
  }

  .filter-group {
    margin-bottom: 8px;
    gap: 3px;
  }

  .filter-label {
    margin-right: 5px;
    font-size: 13px;
  }

  .filter-option {
    margin: 0 4px;
    font-size: 12px;
    padding: 3px 6px;
  }

  .reset-button {
    font-size: 12px;
    padding: 4px 12px;
  }

  /* Fix top nav vertical expansion */
  .top-nav {
    min-height: 50px; /* Reduce minimum height on smaller screens */
    padding: 5px 10px;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    gap: 5px; /* Reduce gap between logo and menu */
  }

  .logo img {
    max-height: 40px; /* Smaller logo on small screens */
  }

  .main-menu ul {
    flex-direction: column; /* Stack menu items vertically */
    align-items: center;
    gap: 5px; /* Reduce spacing between menu items */
  }

  .main-menu ul li {
    margin-left: 0; /* Remove horizontal margin */
  }

  .main-menu ul li a {
    font-size: 12px; /* Smaller font size for better fit */
    padding: 2px 5px; /* Reduce padding */
  }
}

@media (max-width: 480px) {
  /* iPhone: 1 column for grid */
  .container {
    grid-template-columns: 1fr; /* Single column for readability */
    gap: 15px; /* Increased gap for readability */
    padding: 0 5px; /* Reduced padding */
  }

  .box {
    padding-bottom: 120%; /* Adjust aspect ratio for better visibility */
  }

  .imgbox img {
    filter: grayscale(50%); /* Slightly less grayscale for visibility */
  }

  .details {
    padding: 5px;
  }

  .details .content h3 {
    font-size: clamp(12px, 3vw, 14px);
  }

  .details .content h4 {
    font-size: clamp(10px, 2.2vw, 12px);
    -webkit-line-clamp: 2; /* Allow 2 lines for more info */
  }

  /* Ultra-small nav */
  .top-nav {
    min-height: 40px; /* Even smaller height for very small screens */
    padding: 2px 5px;
  }

  .nav-container {
    flex-direction: column;
    align-items: center;
    gap: 2px; /* Minimal gap */
  }

  .logo img {
    max-height: 30px; /* Even smaller logo */
  }

  .main-menu ul {
    flex-direction: column;
    gap: 2px; /* Minimal spacing */
  }

  .main-menu ul li a {
    font-size: 10px; /* Smaller font size */
    padding: 1px 3px; /* Minimal padding */
  }

  /* Hero on iPhone */
  .hero {
    height: 60vh; /* Reduced height for iPhone */
    margin-top: 40px; /* Adjust for smaller nav */
    background-size: cover; /* Ensure image covers properly */
  }

  .hero-content {
    top: 40%; /* Adjust vertical positioning */
    right: 5%;
    max-width: 85%;
    padding: 10px;
    text-align: center; /* Center text for better readability */
  }

  .hero h1 {
    font-size: clamp(16px, 5vw, 24px); /* Smaller, more flexible font size */
    line-height: 1.2;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .scroll-down {
    font-size: 30px; /* Smaller scroll indicator */
  }

  /* CUSTOM FILTERS */
  .custom-filters {
    text-align: center;
    margin: 40px auto;
    font-family: sans-serif;
    max-width: 1200px;
  }

  .filter-group {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Space between elements */
    flex-wrap: wrap; /* Allow wrapping on very small screens */
  }

  .filter-label {
    font-weight: bold;
    font-size: clamp(12px, 3vw, 14px);
    white-space: nowrap;
    margin-right: 5px; /* Space between label and dropdown */
  }

  .filter-dropdown {
    padding: 8px;
    font-size: clamp(12px, 3vw, 14px);
    border: 1px solid #aaa;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    min-width: 120px; /* Ensure dropdown is wide enough */
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color 0.3s ease;
  }

  .filter-dropdown:focus {
    outline: none;
    border-color: #FEC33F;
  }

  .reset-button {
    background: none;
    border: 1px solid #aaa;
    padding: 8px 15px;
    cursor: pointer;
    font-size: clamp(12px, 3vw, 14px);
    color: #555;
    transition: all 0.3s ease;
    border-radius: 4px;
  }

  .reset-button:hover {
    background-color: #f0f0f0;
    color: #000;
    border-color: #000;
  }

  /* MOBILE RESPONSIVE ADJUSTMENTS */
  @media (max-width: 480px) {
    .custom-filters {
      margin: 15px 5px;
      padding: 10px;
    }

    .filter-group {
      flex-direction: row; /* Keep horizontal by default */
      gap: 8px; /* Reduced space on mobile */
      justify-content: center; /* Center align on wrap */
    }

    .filter-label {
      font-size: clamp(10px, 2.5vw, 12px);
      margin-right: 3px;
    }

    .filter-dropdown {
      font-size: clamp(10px, 2.5vw, 12px);
      padding: 6px;
      min-width: 100px; /* Slightly narrower on mobile */
    }

    .reset-button {
      font-size: clamp(10px, 2.5vw, 12px);
      padding: 6px 12px;
    }
  }

  @media (max-width: 360px) {
    /* Force wrap for very small screens (e.g., iPhone SE) */
    .filter-group {
      flex-wrap: wrap;
      gap: 5px;
    }

    .filter-dropdown,
    .reset-button {
      flex: 1 1 100%; /* Full width on wrap */
      margin-top: 5px;
    }
  }

  /* Tablet/Small Laptop Fixes */
  @media (max-width: 768px) {
    /* Nav stack */
    .nav-container {
      flex-direction: column;
      gap: 10px;
      padding: 10px;
    }

    .main-menu ul {
      flex-direction: row;
      justify-content: center;
      gap: 10px;
      margin: 0;
      padding: 0;
    }

    .main-menu ul li {
      margin-left: 0;
    }

    .main-menu ul li a {
      font-size: 14px;
      padding: 5px 8px;
    }

    .logo img {
      max-height: 60px;
    }

    .hero {
      margin-top: 60px;
    }

    /* 3 columns on tablets */
    .container {
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    .details {
      padding: 7px;
    }

    .details .content h3,
    .details .content h1 {
      font-size: clamp(12px, 3vw, 16px);
    }

    .details .content h4 {
      font-size: clamp(10px, 2.3vw, 12px);
    }
  }