/* --- FONTS & BASE STYLES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #fafafa;
}

/* Ensure spaces between paragraphs */
p {
  margin-bottom: 1.25rem;
}

/* --- NAVIGATION BAR --- */
.navbar {
  background-color: #074598;
  border-bottom: 1px solid #06367a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-brand a {
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  color: #ffffff;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links li {
  position: relative; 
}

.nav-links > li > a {
  text-decoration: none;
  color: #ffffff;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
  display: block;
}

.nav-links > li > a:hover {
  color: #d1e3f8;
}

/* --- DROPDOWN MENU --- */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0; 
  background-color: #fff;
  border: 1px solid #eaeaea;
  border-radius: 4px;
  min-width: 200px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  list-style: none;
}

.nav-links li:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #333;
  text-decoration: none;
  display: block;
  margin-bottom: 0; 
}

.dropdown-menu a:hover {
  background-color: #f5f5f5;
  color: #074598;
}

/* --- LAYOUT CONTAINERS & TYPOGRAPHY --- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

section {
  margin-bottom: 4rem;
}

/* Offsets anchor links so headers are not hidden under the navbar */
.project-section {
  scroll-margin-top: 100px; 
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-top: 2rem; 
}

/* Turns project headers into solid gray divider bars with sharp corners */
.project-section h2 {
  background-color: #eaeaea;
  padding: 1rem 1.5rem;
  border-radius: 0; 
  margin-top: 1rem;
  margin-bottom: 2rem;
  color: #333;
}



/* --- HOME PAGE: 2-COLUMN ABOUT SECTION --- */
.about-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  align-items: center;
}

.profile-pic {
  width: 100%;
  height: auto;
  border: 3px solid #eaeaea;
}

/* --- HOME PAGE: 3-COLUMN PROJECTS GRID --- */
.grid-3-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Removes default link styling and ensures the anchor behaves nicely in the grid */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px; 
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.card-content {
  padding: 1.5rem;
}

.card-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* --- PROJECTS PAGE: SIDEBAR LAYOUT --- */
.projects-layout {
  max-width: 1200px; 
  display: grid;
  grid-template-columns: 220px 1fr; 
  gap: 4rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 100px;
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #eaeaea;
}

.sidebar ul {
  list-style: none;
}

.sidebar a {
  text-decoration: none;
  color: #555;
  display: block;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.sidebar a:hover {
  color: #074598;
}

.sidebar a.active {
  color: #074598;
  font-weight: 600;
  border-left: 3px solid #074598;
  padding-left: 10px;
  margin-left: -13px;
}

/* --- PROJECT IMAGE LAYOUTS --- */
.img-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: center;
}

.img-row > figure, .img-row > img {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers the shrunken wrapper div above the caption */
  width: 100%;
  min-width: 0; 
}

.img-row img {
  width: 100%;
  max-width: 100%; 
  height: 100%;
  object-fit: contain;
  border: 1px solid #eaeaea;
}

.full-width-img {
  width: 100%;
  max-width: 100%; 
  height: auto;
  border: 1px solid #eaeaea;
  margin-bottom: 0.5rem;
}

figure {
  margin-bottom: 2rem;
}

figcaption {
  font-size: 0.85rem;
  color: #666;
  text-align: center;
  margin-top: 0.75rem;
  font-style: italic;
}

/* VIDEO WRAPPER FIX */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; 
  height: 0;
  overflow: hidden;
  background-color: #000;
  border: 1px solid #eaeaea;
}

.video-wrapper iframe, .video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- RESPONSIVE DESIGN (MOBILE) --- */
@media (max-width: 768px) {
  .about-grid, .projects-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    margin-bottom: 2rem;
  }
  .img-row {
    flex-direction: column;
    gap: 1rem;
  }
}

/* --- IMAGE CAROUSEL --- */
.carousel-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.carousel-main {
  position: relative;
  display: flex;
  align-items: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1.25rem;
  z-index: 10;
  transition: background 0.2s ease;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.prev-btn { left: 10px; }
.next-btn { right: 10px; }

.carousel-thumbnails {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.thumb {
  width: 80px;
  height: 60px;
  object-fit: contain;
  border: 1px solid #eaeaea;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
}

.thumb:hover {
  opacity: 1;
}

.thumb.active-thumb {
  opacity: 1;
  border: 2px solid #074598; /* Highlights the currently viewed thumbnail */
}

/* --- HORIZONTAL CARDS ("More From Me") --- */
.horizontal-cards-container {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Creates two equal columns side-by-side */
  gap: 2rem;
}

.horizontal-card {
  display: flex;
  flex-direction: row; 
  align-items: center;
  justify-content: space-between;
}

.horizontal-content {
  flex: 1; 
  padding: 1.5rem; /* Reduced padding to fit the smaller half-width card */
  justify-content: center; /* Centers the short titles horizontally */
}

.horizontal-card img {
  width: 220px; /* Reduced from 350px so the image and text share the smaller space comfortably */
  height: 200px; /* Slightly shorter to match the new width */
  object-fit: cover;
  border-radius: 0 8px 8px 0; 
  border-left: 1px solid #eaeaea; 
}

/* Make it stack properly on mobile phones */
@media (max-width: 768px) {
  .horizontal-cards-container {
    grid-template-columns: 1fr; /* Reverts to single column on small screens */
  }
  .horizontal-card {
    flex-direction: column-reverse; 
  }
  .horizontal-card img {
    width: 100%;
    height: 200px;
    border-radius: 8px 8px 0 0;
    border-left: none;
    border-bottom: 1px solid #eaeaea;
  }
  .horizontal-content {
    padding: 1.5rem;
  }
}


/* --- SOCIAL LINKS --- */
.social-links {
  margin-top: 1.5rem;
}

.social-icon {
  display: inline-block;
  color: #989898;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-icon:hover {
  color: #717171; 
  transform: translateY(-3px); 
}

/* --- 2-COLUMN GRID (For 3D Printing) --- */
.grid-2-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* --- CARD BUTTONS --- */
.card-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  flex: 1; /* Forces both buttons to be the exact same width */
  text-align: center;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

/* Printables Button Style */
.btn-outline {
  color: #333;
  background-color: transparent;
  border: 1px solid #333;
}

.btn-outline:hover {
  background-color: #333;
  color: #fff;
}

/* MakerWorld Button Style */
.btn-primary {
  color: #fff;
  background-color: #074598; /* Uses your primary navbar blue */
  border: 1px solid #074598;
}

.btn-primary:hover {
  background-color: #052c65;
  border-color: #052c65;
}

/* --- STATIC NO-HOVER CARDS --- */
.static-card:hover {
  transform: none !important;
  box-shadow: inherit !important; /* Prevents the shadow from enlarging on hover */
}