/* =========================================
   1. RESET & BASE SETUP
========================================= */
/* IMPORT GOOGLE FONT AT THE TOP */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px; /* Base for rem units */
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  /* Changed from Arial to Poppins */
  font-family: 'Poppins', sans-serif;
  background-color: #d6e4f0;
  color: #111111;
  line-height: 1.6;
}

/* =========================================
   2. HEADER & NAVIGATION
========================================= */
header {
  background-color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4vw; /* Responsive horizontal padding */
  height: 10vh; /* Matches main site header */
  min-height: 80px;
  max-height: 120px;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #dddddd;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0b1f33;
}

.arlogo {
  display: flex;
  align-items: center;
  height: 100%;
  max-height: 8vh; /* Fluid height based on the laptop/screen height */
  padding: 0;
  margin: 0;
}

.arlogo img {
  display: block;
  width: auto;
  max-height: 3.75rem; /* Replaces 60px; scales smoothly with the base text size */
  max-width: 45vw; /* Prevents the logo from overlapping the navigation on smaller laptops */
}

nav {
  display: flex;
  gap: 2vw;
}

nav a {
  text-decoration: none;
  color: #111111;
  font-size: 1.15rem;
  transition: 0.3s;
}

nav a:hover {
  color: #163a5f;
}

/* =========================================
   3. PROJECT PAGE LAYOUT (SPLIT SCREEN)
========================================= */
.project-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 10vh is the header, 80px is the bottom navigation bar */
  height: calc(100vh - 10vh - 80px); 
  min-height: 0;
}

/* =========================================
   4. LEFT SIDE: INFO & DETAILS
========================================= */
.project-info {
  padding: 40px 4vw;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 75% auto;
  gap: 25px;
  overflow-y: auto;
}

.hero-image {
  width: 100%;
  height: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-details {
  min-height: 0;
  overflow: visible;
}

.project-details h1 {
  font-size: 2.5rem;
  font-weight: 400;
  color: #0b1f33;
  margin-bottom: 5px;
}

.project-date {
  font-size: 0.9rem;
  color: #667085;
  margin-bottom: 15px;
  text-align: justify;
}

.project-description {
  max-width: 600px;
  color: #3f4f5f;
  font-size: 1rem;
  overflow: visible;
  padding-right: 0;
  text-align: justify;
}

/* =========================================
   5. RIGHT SIDE: GALLERY
========================================= */
.project-gallery {
  height: 100%;
  padding: 40px 4vw;
  min-height: 0;
  overflow-y: auto;
}

.gallery-image {
  width: 100%;
  margin-bottom: 30px;
  overflow: hidden;
}

.gallery-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-image:hover img {
  transform: scale(1.02);
}

/* =========================================
   6. CUSTOM SCROLLBARS 
========================================= */
.project-info::-webkit-scrollbar,
.project-gallery::-webkit-scrollbar {
  width: 7px;
}

.project-info::-webkit-scrollbar-track,
.project-gallery::-webkit-scrollbar-track {
  background-color: #d6e4f0;
}

.project-info::-webkit-scrollbar-thumb,
.project-gallery::-webkit-scrollbar-thumb {
  background-color: #0b1f33;
}

/* =========================================
   7. PROJECT NAVIGATION (Prev / Next)
========================================= */
.project-navigation {
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 6vw;
  background-color: #d6e4f0;
}

.project-navigation a {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid #0b1f33;
  text-decoration: none;
  color: #0b1f33;
  font-size: 0.875rem;
  transition: 0.3s;
  border-radius: 5px;
}

.project-navigation a:hover {
  background-color: #0b1f33;
  color: #ffffff;
}

/* =========================================
   8. FOOTER
========================================= */
footer {
  height: auto;
  padding: 30px 6vw;
  background-color: #111111;
  color: #ffffff;
  text-align: center;
}

/* =========================================
   MOBILE RESPONSIVE STYLES
========================================= */
@media (max-width: 991px) {
  /* 1. Reset the body to allow Sticky Headers */
  html,
  body {
    height: auto !important;
    overflow: visible !important; 
    overflow-x: hidden !important; 
  }

  /* 2. Header & Nav (Mobile) */
  header {
    height: auto !important;
    min-height: auto;
    max-height: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: sticky; 
    top: 0;
    z-index: 1000;
    background-color: #ffffff;
    width: 100%;
    padding: 15px 0; 
  }

 /* Perfectly centers the logo container vertically */
.arlogo {
  height: auto;
  justify-content: center; /* Centers the logo horizontally on phones */
}

.arlogo img {
  max-height: 3rem; /* Replaces fixed pixels with a slightly smaller fluid size for phones */
  max-width: 70vw; /* Ensures the logo never breaks the edges of a narrow mobile screen */
}

  nav {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: space-around;
    padding: 0 4vw;
  }

  nav a {
    font-size: 1rem;
  }

  /* 3. Force the Split Screen to Stack */
  .project-page {
    display: block !important; 
    height: auto !important;
  }

  /* 4. Left Side (Hero Image & Info) */
  .project-info {
    display: block !important;
    padding: 30px 6vw;
    height: auto !important;
    overflow-y: visible !important; 
  }

  .hero-image {
    width: 100%;
    height: auto;
    max-height: 40vh; /* Prevents hero image from consuming entire mobile screen */
    margin-bottom: 30px;
  }

  .project-details {
    padding-top: 0;
    padding-bottom: 20px;
  }

  .project-details h1 {
    font-size: 2rem;
  }

  .project-description {
    max-width: 100%;
  }

  /* 5. Right Side (Gallery) */
  .project-gallery {
    display: block !important;
    height: auto !important;
    padding: 10px 6vw 40px 6vw; 
    overflow-y: visible !important; 
  }

  .gallery-image {
    margin-bottom: 20px;
  }

  /* --- FIXED: Mobile Project Navigation (Compact Buttons) --- */
  .project-navigation {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important; /* Keeps one on the left, one on the right */
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    padding: 20px 6vw !important; /* Restored standard mobile padding */
    background: #0b1c2c !important; 
    gap: 10px; /* Small safety gap */
  }
  
  .project-navigation a {
    display: inline-block !important;
    flex: 0 1 auto !important; /* Stops the buttons from stretching */
    padding: 10px 16px !important; /* Restored the compact button padding */
    font-size: 0.75rem !important; 
    text-align: center !important;
    white-space: nowrap !important; /* Keeps "Previous Project" on one line */
    border-radius: 5px !important;
  }

  /* Left Button */
  .project-navigation .previous-project {
    border: 1px solid #ffffff !important;
    color: #ffffff !important;
    background-color: transparent !important;
  }
  
  .project-navigation .previous-project:hover {
    background-color: #ffffff !important;
    color: #0b1c2c !important;
  }

  /* Right Button */
  .project-navigation .next-project {
    border: 1px solid #ffffff !important;
    background-color: #ffffff !important;
    color: #0b1c2c !important;
  }
  
  .project-navigation .next-project:hover {
    background-color: transparent !important;
    color: #ffffff !important;
  }

 footer {
    padding: 25px 4vw;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center; /* Forces text to center align */
  }

  footer p {
    font-size: 0.85rem; /* Slightly smaller footer text for mobile */
    margin: 0; /* Removes default paragraph margins that cause misalignment */
  }
}
