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

/* Body */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  background: #f9f9f9;
  color: #333;
  transition: background 0.3s, color 0.3s;
  background-image: url('/images/abstract-background.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
}

/* Header & Footer */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  color: #fff;
}
footer {
  background: #2c3e50;
  color: #fff;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
}

/* NAV Container */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 1rem 2rem;
  gap: 1rem;
}

.logo img {
  height: 40px; /* adjust as needed */
  display: block;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* This aligns content to the left */
}

.nav-links {
  display: none;
  list-style: none;
  gap: 2rem;
}
.nav-links li { display: inline; }
.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

.toggle-container {
  position: absolute;
  right: 2rem;
  display: flex;
  gap: 0.5rem;
}

#menu-toggle,
#theme-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}
#theme-toggle { font-size: 1.2rem; }

#menu-toggle:hover,
#theme-toggle:hover,
.nav-links a:hover,
form button:hover {
  background: #1a2733;
  transition: background 0.3s;
}

.hero {
  background:
    linear-gradient(135deg, #1e3c72 0%, #2a5298 100%),
    url('/images/abstract-background.png') center/cover no-repeat;
  background-blend-mode: overlay;
  animation: backgroundShift 20s ease infinite;
  color: #fff;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

@keyframes backgroundShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-content { max-width: 600px; padding-top: 80px; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero img {
  border-radius: 50%;
  width: 150px;
  margin-top: 1rem;
}

section {
  padding: 8rem 2rem 8rem !important;
  width: 100%;
}
section h2 {
  text-align: center;
  position: relative;
  font-size: 1.75rem;
  margin-bottom: 2rem;
  color: #fff;
}
section h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #2a5298;
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

.about,
.projects,
.contact {
  background: url('/images/abstract-background.png') center/cover no-repeat;
  background-attachment: fixed;
}

main .about, main .projects, main .contact {
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
}
.about-content p {
  max-width: 500px;
}
.about-image {
  width: 100%;
  max-width: 350px;
  height: 350px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 12px;
}
@media (min-width: 769px) {
  .about-content {
    flex-direction: row-reverse;
    justify-content: space-between;
    text-align: left;
    align-items: center;
  }
}

.projects .project {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 1rem auto;
  max-width: 1000px;
}
.projects .view-projects {
  color: #ffffff;
  font-style: italic;
  margin: 0 auto 1rem;
  max-width: 1000px;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#gameContainer { /* This is your .project-embed-frame */
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    border: 2px solid white;
    background: #111;
    position: relative;
}

.contact-container {
  background: rgba(255, 255, 255, 0.85);
  padding: 1rem;
  border-radius: 12px;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

.contact-info {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
  gap: 1.5rem;
  color: #ffffff
}

.contact-info p {
  margin: 0;
  display: flex;
  align-items: center;
}

.contact-info a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  transition: background 0.3s, color 0.3s;
}

.contact-info a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #000000;
}

.form-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.form-wrapper iframe {
  max-width: 750px;
  width: 100%;
  height: auto;
  border: none;
}

.project-list .project-card {
  background: rgba(255, 255, 255, 0.92); /* Semi-transparent white, similar to .content-container */
  padding: 1.5rem 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin: 1.5rem auto;
  max-width: 900px; /* Adjust as needed */
  color: #333;
}

.project-list .project-card h3 {
  color: #2c3e50;
  margin-bottom: 0.75rem;
  font-size: 1.6em;
}

.project-list .project-card p {
  margin-bottom: 1rem;
  color: #555;
}

.project-list .project-card a {
  color: #2a5298; /* Your theme's link color */
  font-weight: bold;
  text-decoration: none;
  align-self: flex-end;
}

.project-list .project-card a:hover {
  text-decoration: underline;
}

.project-list > h2 { /* Targeting the h2 that is a direct child of .project-list */
  text-align: center;
  color: #fff; /* White, as it's on the main page background */
  font-size: 2.2em;
  margin-bottom: 2rem; /* Space before the first card */
  position: relative;
}

.project-list > h2::after { /* Underline for the title, similar to other section titles */
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #fff; /* White underline, as title is white */
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

.content-container {
    max-width: 800px; /* Or your preferred general content width */
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: #333;
}

.content-container.content-container-wide {
    max-width: 1600px;
}

.content-container h2 { /* Titles for the project page itself */
    text-align: center;
    color: #2c3e50;
    margin-bottom: 1rem; /* Reduced margin if description follows */
    font-size: 2.2em;
}

.content-container h2 + p { /* The main description paragraph */
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem auto; /* Center description and add space below */
    font-size: 1.1em;
    color: #555;
}

.project-embed-frame {
    width: 100%; /* Take full width of its parent (which is .content-container) */
    border: 2px solid #e0e0e0;
    margin: 1rem auto 2rem auto; /* Space around the embed frame */
    background-color: #111;
    box-sizing: border-box;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: auto;
}

.project-detail-page-wrapper {
  padding-top: 100px; /* Adjust this value based on actual fixed header height + desired gap */
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 4rem;
}

/* A generic button style for links like "Back to Projects" */
.button-style-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #4d79c4;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.button-style-link:hover {
  background-color: #1e3c72;
  color: #fff;
}

.feed-container {
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Space between posts */
}

/* feed.html */
/* The main card for a single post */
.post-card {
  position: relative;
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 1rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Header section of the post */
.post-header {
  position: static;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e1e4e8;
}

.post-title, .post-date {
  position: static;
  margin: 0;
  transform: none;
  left: auto;
  top: auto;
  right: auto;
  bottom: auto;
}

/* main title of the post */
.post-title {
  font-size: 1.5em;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

/* date of the post */
.post-date {
  font-size: 0.8em;
  color: #6a737d;
}

/* body content of the post */
.post-body p {
  margin-bottom: 1em;
  line-height: 1.7;
  color: #333;
}
/* removes the extra bottom margin from the last paragraph in the body */
.post-body p:last-child {
  margin-bottom: 0;
}

.post-body ul,
.post-body ol {
  padding-left: 25px; /* Adjust left indentation */
}

/* The container for the image or video */
.post-media {
  margin-top: 1.5rem;
  border-radius: 8px;
  overflow: hidden; /* Ensures images with border-radius look good */
}

/* Styling for the media itself */
.post-media img,
.post-media video,
.post-media iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Styles for a flexible, multi-column image/video gallery */
.media-gallery {
  display: grid;
  /* create as many columns as can fit that are at least 200px wide */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  /* The space between items */
}

/* This targets direct children of the gallery, making sure they fill their grid cell */
.media-gallery>* {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Special rule for iframes to maintain their aspect ratio */
.media-gallery iframe {
  aspect-ratio: 16 / 9;
}

/* Styles for a custom link preview card within a post */
.post-link-preview {
  display: block;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  background-color: #f9f9f9;
  /* A very light gray background */
  text-decoration: none;
  transition: background-color 0.2s ease-in-out;
}

.post-link-preview:hover {
  background-color: #f1f1f1;
  /* Slightly darker on hover */
}

.link-preview-title {
  display: block;
  font-weight: bold;
  color: #333;
  font-size: 1.1em;
  margin-bottom: 0.25rem;
}

.link-preview-url {
  display: block;
  color: #6a737d;
  /* A muted gray for the URL */
  font-size: 0.9em;
}

/* MEDIA QUERIES */
@media (min-width: 769px) {
  .nav-links {
    display: flex !important;
    position: static;
    background: none;
    padding: 0;
  }
  #menu-toggle { display: none; }
}

@media (max-width: 768px) {
  .nav-links.show-menu {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(44, 62, 80, 0.85); /* This is the same color (#2c3e50) but with 85% opacity */
    /* creates the blur effect */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari support */
    padding: 1rem 1rem;
    text-align: right;
    border-radius: 0 0 8px 8px;
    z-index: 1001;
  }

  .nav-links li {
    display: block;
    margin-bottom: 0.5rem;
  }
  .hero h1 { font-size: 2rem; }
  .hero img { width: 120px; }
  header {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .page-header {
    background: #fff; /* Give it a white background like a card */
    padding: .5rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem; /* Space between this card and the first post */
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }

  .feed-section .content-container {
    /* This makes the white box container disappear on mobile */
    background: none;
    box-shadow: none;
    padding: 0 0;
  }

  .post-card {
    /* Reduce the internal padding on mobile to maximize text width */
    padding: 1rem 1rem;
  }

  /* CHANGED: Make the post titles a bit smaller on mobile */
  .post-title {
    font-size: 1.4em;
  }

  /* CHANGED: Slightly tighten up the line height for body text on mobile */
  .post-body p {
    line-height: 1.5;
  }
}

body, html {
  overflow-x: hidden;
}
