/* ===== PORTFOLIO STYLES ===== */

/* Hash targets - hidden but needed for CSS targeting */
#grid,
#list {
  position: absolute;
  top: -9999px;
  left: -9999px;
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2em;
  padding-top: 20px;
}

.portfolio-title {
  font-size: 2em;
  color: #333;
  margin: 0;
}

.view-toggle {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  padding: 8px 16px;
  border: 1px solid black;
  background: white;
  cursor: pointer;
  border-radius: 0px;
  font-size: 14px;
  text-decoration: none;
  color: black;
  display: inline-block;
}

.toggle-btn:hover {
  background: black;
  color: white;
}

/* Default active state for grid */
.toggle-btn[href="#grid"] {
  background: black;
  color: white;
  border-color: black;
}

/* Hash-based view switching */
#list:target ~ .portfolio-header .toggle-btn[href="#list"] {
  background: black;
  color: white;
  border-color: black;
}

#list:target ~ .portfolio-header .toggle-btn[href="#grid"] {
  background: white;
  color: black;
  border-color: black;
}

.project-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0;
}

/* List view when #list is targeted */
#list:target ~ .project-list {
  flex-direction: column;
  gap: 8px;
}

.project-item {
  border: 1px solid black;
  border-radius: 0px;
  padding: 20px;
  width: 180px;
  height: 300px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

/* List view styling when #list is targeted */
#list:target ~ .project-list .project-item {
  flex: none;
  width: 100%;
  height: auto;
  padding: 12px 16px;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border: none;
  border-radius: 0;
}

#list:target ~ .project-list .project-item .project-image {
  display: none;
}

#list:target ~ .project-list .project-item .project-subhead {
  display: none;
}

#list:target ~ .project-list .project-item .project-title {
  flex: 0 0 300px;
  margin: 0;
  text-decoration: none;
}

#list:target ~ .project-list .project-item .project-description {
  flex: 1;
  margin: 0;
  min-width: 400px;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  overflow: hidden;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.project-title {
  font-size: 1em;
  font-weight: bold;
  text-decoration: none;
  color: #000;
}

.project-subhead {
  font-size: 0.8em;
  color: #666;
  margin-top: 0.2em;
}

.project-description {
  font-size: 0.75em;
  margin-top: 0.3em;
  line-height: 1.3;
}
