/* Project Article Styling */

html, body {
  overflow-x: hidden; /* Prevents full-bleed pseudo-elements from triggering scrollbars */
}

.project-article {
  width: 100%;
  padding-bottom: 40px;
}

.project-hero {
  background-color: var(--shade);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding: 30px 20px 25px 20px; /* Reduced top padding to raise date, reduced bottom padding to tighten end of hero */
  text-align: center;
  margin-top: 0px; 
  margin-bottom: 50px;
  
  /* Pseudo-element full-bleed strategy */
  position: relative;
  z-index: 0;
}

.project-hero::before {
  content: "";
  position: absolute;
  top: -1px;    /* Align with top border */
  bottom: -1px; /* Align with bottom border */
  left: -100vw; /* Extend massively to the left */
  right: -100vw;/* Extend massively to the right */
  background-color: var(--shade);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  z-index: -1;  /* Sit behind the hero content */
}

.project-hero-content {
  max-width: 1000px;
  margin: 0 auto;
}

.project-title {
  font-family: 'CascadiaCode', monospace, sans-serif;
  font-size: 3em;
  margin: 0 0 20px 0; /* Increased bottom margin to push subtitle down slightly */
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -1px;
}

.project-subtitle {
  font-size: 1.4em;
  color: var(--text);
  opacity: 0.85;
  margin: 0.00;
  font-family: 'karla', sans-serif;
  font-weight: 300;
}

.project-date {
  font-size: 0.9em;
  color: var(--text);
  font-weight: 600;
  margin: 0 0 12px 0; /* Added bottom margin to separate date from title visually */
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'karla', sans-serif;
  opacity: 0.7;
}

.project-body {
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.4;
  font-size: 1.15em;
  color: var(--text);
  padding: 0 20px;
}

.project-body h2 {
  font-family: 'CascadiaCode', monospace, sans-serif;
  margin-top: 2.2em;
  margin-bottom: 0.8em;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.3em;
  font-size: 1.9em;
}

.project-body h3 {
  font-family: 'CascadiaCode', monospace, sans-serif;
  margin-top: 1.8em;
  font-size: 1.4em;
}

.project-body p {
  margin-bottom: 1.5em;
}

.project-body ul, .project-body ol {
  margin-bottom: 2em;
  padding-left: 2em;
}

.project-body li {
  margin-bottom: 0.8em;
}

/* Base image styling */
.project-body img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 2.5em 0;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

@media (prefers-color-scheme: dark) {
  .project-body img {
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  }
}

/* Image on the side pulling out of the main column */
.pull-right {
  float: right;
  width: 50%;
  margin: 1em -100px 1.5em 3em;
}

.pull-left {
  float: left;
  width: 50%;
  margin: 1em 3em 1.5em -100px;
}

.pull-right img, .pull-left img {
  margin: 0;
  width: 100%;
}

.image-caption {
  font-size: 0.9em;
  color: var(--text);
  opacity: 0.6;
  text-align: center;
  font-style: italic;
  display: block;
  margin-top: -1.5em;
  margin-bottom: 2.5em;
}

.image-caption a {
  text-decoration: underline;
  color: inherit;
}

.pull-right .image-caption, .pull-left .image-caption {
  margin-top: 0.8em;
  margin-bottom: 0;
}

/* Clearfix for floats */
.project-body::after {
  content: "";
  display: table;
  clear: both;
}

/* Centered media container */
.centered-media {
  text-align: center;
  margin: 1.5em 0 2.5em 0;
  clear: both;
}

/* Remove the global 2.5em margin for images inside centered containers */
.centered-media img {
  margin: 0 auto;
}

/* Match the caption spacing of the pull-right/left elements */
.centered-media .image-caption {
  margin-top: 0.8em;
  margin-bottom: 0;
}

@media only screen and (max-width: 1150px) {
  .pull-right, .pull-left {
    margin-right: 0;
    margin-left: 0;
    width: 100%;
    float: none;
  }
  
  .pull-right, .pull-left {
    margin-bottom: 2.5em;
  }
  
  .image-caption {
    margin-top: -1.5em;
  }
}

@media only screen and (max-width: 767px) {
  .project-hero {
    padding: 30px 20px;
  }
  
  .project-title {
    font-size: 2.2em;
  }
  
  .project-subtitle {
    font-size: 1.1em;
  }
  
  .project-body {
    padding: 0 15px;
    font-size: 1.1em;
  }
}

/* Revert link styling to standard underlined text inside project bodies */
.project-body p a,
.project-body p a:link,
.project-body p a:visited {
  background-color: transparent;
  padding: 0;
  display: inline;
  text-decoration: underline;
}

.project-body p a:hover,
.project-body p a:active {
  background-color: transparent;
  color: var(--selected); /* Replaces the background box effect with a subtle text color shift */
}
