/* Market Image Container */

/* Market Container 1 */
.market_container_1 {
    background-image: url('img/home-map.png');
    background-size: cover;
    background-position: center;
    height: clamp(50vh, 80vw, 70vh); /* Responsive height using clamp */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 10px; /* Adding 10px margin for mobile */
}

/* Paragraph inside Market Container 1 */
.market_container_1 p {
    max-width: 60%;
    font-size: clamp(2rem, 5vw, 3rem); /* Responsive font size using clamp */
    color: rgb(255, 255, 255);
    text-align: justify;
    background-color: rgba(10, 1, 36, 0.433);
    padding: 5%;
    border-radius: 10px;
    font-weight: 600;
}

/* Mobile view adjustment */
@media screen and (max-width: 768px) {
    .market_container_1 {
        height: auto; /* Remove height constraint for smaller screens */
        padding: 10px; /* 10px margin on mobile */
    }

    .market_container_1 p {
        max-width: 100%; /* Full width for text on mobile */
        font-size: clamp(1.5rem, 5vw, 2.5rem); /* Smaller font size on mobile */
    }
}


/* Market Container Sectors */
.market_container_sectors {
    background-color: #002b6a;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: clamp(2rem, 5vw, 5rem); /* Responsive padding using clamp */
    padding-bottom: clamp(2rem, 5vw, 5rem); /* Responsive padding using clamp */
}

.market_container_sectors h1 {
    text-align: center;
    color: rgb(255, 255, 255);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3rem); /* Responsive font size using clamp */
    text-transform: uppercase;
    padding-bottom: 2rem;
}

.market_container_sectors hr {
    max-width: 23%;
    border-radius: 4px;
    border: 4px solid #ffffff;
    background-color: transparent;
    opacity: 0.9;
}


@media (max-width: 600px) {
  .projects-item {
    flex: 0 0 calc(50% - clamp(15px, 2vw, 20px));  /* two per row */
    max-width: none;                               /* don’t constrain */
  }
}


/* ---------------- Sectors Gallery Styles ---------------- */
.sectors-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(15px, 2vw, 20px); /* Responsive gap using clamp */
    padding: clamp(15px, 2vw, 20px); /* Responsive padding using clamp */
}

.sectors-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(15px, 2vw, 20px); /* Responsive gap using clamp */
    width: 100%;
}

.sectors-item {
    position: relative;
    width: clamp(180px, 25vw, 200px); /* Responsive width using clamp */
    height: clamp(220px, 30vw, 250px); /* Responsive height using clamp */
    overflow: hidden;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sectors-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

/* Center text with a background mask ONLY around it */
.sectors-overlay {
    position: absolute;
    bottom: 10px; /* Adjust placement */
    left: 50%;
    transform: translateX(-50%);
    background: rgb(0, 0, 0); /* Mask only behind the text */
    color: white;
    font-size: clamp(1.2rem, 4vw, 1.5rem); /* Responsive font size using clamp */
    font-weight: bold;
    text-transform: uppercase;
    padding: 10px 15px;
    transition: opacity 0.3s ease;
    opacity: 1; /* Always visible */
    width: 100%;
}

/* Hide text on hover */
.sectors-item:hover .sectors-overlay {
    opacity: 0;
}

/* Hover effect on image */
.sectors-item:hover img {
    transform: scale(1.1);
}

/* Hover effect on container */
.sectors-item:hover {
    transform: scale(1.1);
    box-shadow: 0px 8px 20px rgba(0, 0, 104, 0.3);
}


/* Animation keyframes */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Initial state for animation */
@keyframes flipInY {
  0%   { opacity: 0; transform: perspective(600px) rotateY(90deg); }
  60%  { opacity: 1; transform: perspective(600px) rotateY(-10deg); }
  100% { opacity: 1; transform: perspective(600px) rotateY(0deg); }
}

.sectors-item {
  opacity: 0;
  transform-style: preserve-3d;      /* needed for 3‑D effect */
  animation: flipInY 0.9s ease-out forwards;
}

/* Sequential animation delay */
.sectors-item:nth-child(1) { animation-delay: 0.3s; }
.sectors-item:nth-child(2) { animation-delay: 0.6s; }
.sectors-item:nth-child(3) { animation-delay: 0.9s; }
.sectors-item:nth-child(4) { animation-delay: 1.2s; }
.sectors-item:nth-child(5) { animation-delay: 0.9s; }
.sectors-item:nth-child(6) { animation-delay: 0.6s; }
.sectors-item:nth-child(7) { animation-delay: 0.3s; }
.sectors-item:nth-child(8) { animation-delay: 0.3s; }
.sectors-item:nth-child(9) { animation-delay: 0.6s; }
.sectors-item:nth-child(10) { animation-delay: 0.9s; }
.sectors-item:nth-child(11) { animation-delay: 1.2s; }
.sectors-item:nth-child(12) { animation-delay: 0.9s; }
.sectors-item:nth-child(13) { animation-delay: 0.6s; }
.sectors-item:nth-child(14) { animation-delay: 0.3s; }

/* Add more nth-child rules depending on how many items you may have */


@media (max-width: 600px) {
    .sectors-item {
        flex: 0 0 calc(50% - clamp(15px, 2vw, 20px));
        max-width: none;
    }
}

@media (min-width: 1400px) {
    .sectors-item {
        width: calc((90% - (6 * clamp(18px, 2vw, 25px))) / 7);
        height: clamp(220px, 30vw, 250px);
    }
}



/* ---------------- Projects Gallery Styles ---------------- */
.market_container_projects {
    position: relative;
    background-color: #ffffff;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: clamp(2rem, 5vw, 5rem);
    padding-bottom: clamp(2rem, 5vw, 5rem);
    background-image: url('img/market_background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 0;
}

.market_container_projects::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); /* black overlay with 50% opacity */
    pointer-events: none; /* so it doesn't block clicks */
    z-index: -1; /* place behind content */
}

.market_container_projects h1 {
    text-align: center;
    color: #ffffff;
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3rem); /* Responsive font size using clamp */
    text-transform: uppercase;
    padding-bottom: 2rem;
}

.market_container_projects hr {
    max-width: 23%;
    border-radius: 4px;
    border: 4px solid #ffffff;
    background-color: transparent;
    opacity: 0.9;
}

.projects-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(15px, 2vw, 20px); /* Responsive gap using clamp */
    padding: clamp(15px, 2vw, 20px); /* Responsive padding using clamp */
}

/* Row container with scroll animation */
.projects-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(15px, 2vw, 20px); /* Responsive gap using clamp */
    width: 100%;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Slide-up effect when row becomes visible */
.projects-row.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0);  }
}

/* Individual image container */
.projects-item {
    position: relative;
    width: clamp(180px, 30vw, 250px); /* Responsive width using clamp */
    height: clamp(220px, 35vw, 275px); /* Responsive height using clamp */
    overflow: hidden;
    border-radius: 10px;
    border: 5px solid rgba(255, 255, 255, 0.8); /* Border around image */
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    animation: fadeUp 0.6s ease forwards;  /* forwards keeps final state */
  opacity: 0;  
}

/* Image styling */
.projects-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Overlay with file name (always visible but more transparent) */
.projects-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    color: rgb(0, 0, 0);
    text-align: center;
    padding: 10px;
    font-size: clamp(1rem, 4vw, 1.2rem); /* Responsive font size using clamp */
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

/* Hover effects */
.projects-item:hover {
    transform: scale(1.05);
    box-shadow: 0px 10px 25px rgba(104, 0, 0, 0.5);
}

.projects-item:hover img {
    opacity: 0.6; /* Reduce image opacity */
}

.projects-item:hover .projects-overlay {
    opacity: 1; /* Make text fully visible */
}


.region-buttons button {
  margin: 5px;
  padding: 8px 16px;
  border: none;
  background: #333;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.region-buttons button:hover {
  background: #555;
}
