/**
 * Project Card Component
 *
 * Reusable project card for displaying project summaries.
 * Used on: home.php, projects.php
 */

/* Card Container */
.project-card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  overflow: hidden;
  transition: var(--card-transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--card-border-hover);
}

.project-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* Media */
.project-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  overflow: hidden;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: opacity var(--transition-base);
}

.project-card:hover .project-card__media img {
  opacity: 1;
}

.project-card__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 4rem;
  font-weight: 900;
  color: var(--color-text-dim);
  background: var(--card-bg);
  letter-spacing: -.05em;
}

/* Card Body */
.project-card__body {
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  flex: 1;
}

/* Eyebrow */
.project-card__eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin: 0;
}

/* Title */
.project-card__title {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--color-text);
  margin: .15rem 0 .5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Year */
.project-card__year {
  font-size: .85em;
  font-weight: 600;
  color: var(--color-text-dim);
  margin-left: .25rem;
  white-space: nowrap;
  display: inline-block;
}

/* Excerpt */
.project-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(226, 227, 234, 0.75);
  margin: 0;
  font-weight: 400;
}

/* Tags Container */
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: auto;
  padding-top: 1.25rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.project-card__tags li {
  list-style: none;
  display: flex;
}

/* Tag Link */
.project-card__tag-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: .82rem;
  font-weight: 600;
  color: rgba(226, 227, 234, 0.85);
  text-decoration: none;
  transition: var(--card-transition);
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.project-card__tag-link:hover {
  background: var(--card-bg-hover);
  border-color: var(--card-border-hover);
  color: var(--color-text);
}

/* Tag Location */
.project-card__tag-location {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: .82rem;
  font-weight: 600;
  color: rgba(226, 227, 234, 0.85);
  text-decoration: none;
  cursor: pointer;
  transition: var(--card-transition);
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.project-card__tag-location:hover {
  background: var(--card-bg-hover);
  border-color: var(--card-border-hover);
  color: var(--color-text);
}

.project-card__tag-location svg {
  width: .85rem;
  height: .85rem;
  opacity: .7;
  flex-shrink: 0;
}

/* Tag More */
.project-card__tag-more {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: .82rem;
  font-weight: 600;
  color: rgba(226, 227, 234, 0.6);
  cursor: default;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

/* Hidden State */
.project-card[hidden],
.project-card[data-project-card][hidden] {
  display: none !important;
}

/* ======== MOBILE (< 640px) ======== */
@media (max-width: 39.99rem) {
  /* Edge-to-edge cards on mobile */
  .project-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .project-card:first-child {
    border-top: 0;
  }

  /* Increase internal padding to compensate */
  .project-card__body {
    padding: 1.5rem 2rem 2.5rem 2rem;
  }

  /* Adjust typography */
  .project-card__eyebrow {
    font-size: .7rem;
  }

  .project-card__title {
    font-size: 1.3rem;
    line-height: 1.35;
    margin-bottom: .5rem;
  }

  .project-card__year {
    font-size: .75rem;
  }

  .project-card__excerpt {
    font-size: .9rem;
    line-height: 1.65;
  }

  /* Smaller tags on mobile */
  .project-card__tag-link,
  .project-card__tag-more,
  .project-card__tag-location {
    font-size: .7rem;
    padding: .25rem .5rem;
  }

  .project-card__tag-location {
    gap: .5rem;
  }

  .project-card__tag-location svg {
    width: .75rem;
    height: .75rem;
  }

  .project-card__tags {
    padding-top: 1rem;
  }
}


/* ======== LIGHT THEME ======== */
html[data-theme="light"] .project-card__excerpt {
  color: rgba(50, 52, 68, 0.7);
}

html[data-theme="light"] .project-card__placeholder {
  color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .project-card__tag-link {
  color: rgba(50, 52, 68, 0.85);
}

html[data-theme="light"] .project-card__tag-location {
  color: rgba(50, 52, 68, 0.85);
}

html[data-theme="light"] .project-card__tag-more {
  color: rgba(50, 52, 68, 0.7);
}
