/* Shared components for the hidden "AI for Good, Not Evil" section:
   the gallery page and its project pages (voted-off-the-island.html and
   let-me-watch-my-show.html currently keep their own inline copies of the
   media/back-to-gallery rules below; new project pages should link this
   file instead of duplicating them). */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Gallery grid + project cards */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.project-card {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.project-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}
.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-card-media.no-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light);
}
.project-card-media.no-media span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-mid);
}
.project-card-body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-dark);
  border: 1px solid var(--gray-light);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 12px;
}
.project-card-body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 12px;
}
.project-card-body p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 20px;
  flex: 1;
}
.project-card-labels {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-mid);
}
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* Project-page media players */
.media-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-mid);
  max-width: 680px;
  margin: 36px auto 12px;
  text-align: left;
}
.media-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.media-wrap audio {
  width: 100%;
  display: block;
  border-radius: 8px;
}
.video-wrap {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}
.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
}
.media-fallback {
  font-size: 13px;
  color: var(--gray-mid);
  margin-top: 8px;
}
.media-fallback a { color: var(--gray-dark); }

/* Side-by-side labeled image/video comparisons (e.g. photo -> portrait -> animation) */
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1040px;
  margin: 0 auto;
  align-items: start;
}
.result-item { text-align: center; }
.result-item .media-label {
  max-width: none;
  margin: 0 0 12px;
  text-align: center;
}
.result-item .media-caption {
  font-size: 13px;
  color: var(--gray-mid);
  margin-top: 10px;
  line-height: 1.6;
}
.portrait-wrap {
  max-width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
}
.portrait-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.portrait-video-wrap {
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  aspect-ratio: 360 / 540;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}
.portrait-video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
}
@media (max-width: 800px) {
  .result-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    gap: 48px;
  }
}

/* Large clickable centerpiece image (opens full size in a new tab) */
.centerpiece-wrap {
  max-width: 600px;
  margin: 0 auto;
  display: block;
  border-radius: 8px;
  overflow: hidden;
}
.centerpiece-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.centerpiece-link {
  display: block;
  text-align: center;
  margin: 16px auto 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-dark);
  text-decoration: none;
  transition: color 0.3s;
}
.centerpiece-link:hover { color: var(--black); }

/* Tools Used: reusable tool-name + role list */
.tools-list {
  max-width: 680px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}
.tools-list-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--off-white);
}
.tools-list-item:first-child { padding-top: 0; }
.tools-list-item:last-child { border-bottom: none; }
.tools-list-name {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 6px;
}
.tools-list-name a {
  color: var(--black);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-light);
  transition: color 0.3s, border-color 0.3s;
}
.tools-list-name a:hover {
  color: var(--gray-dark);
  border-color: var(--gray-dark);
}
.tools-list-name .external-icon {
  font-size: 13px;
  margin-left: 2px;
}
.tools-list-role {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.7;
  font-weight: 300;
}

/* Two-column problem/fix table (currently used on still-sailing.html) */
.fix-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 26px;
}
.fix-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-mid);
  text-align: left;
  padding: 0 16px 12px 0;
  border-bottom: 1px solid var(--gray-light);
}
.fix-table td {
  font-size: 15px;
  color: var(--gray-dark);
  line-height: 1.7;
  font-weight: 300;
  vertical-align: top;
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--off-white);
  width: 50%;
}
.fix-table tr:last-child td { border-bottom: none; }
@media (max-width: 600px) {
  .fix-table thead { display: none; }
  .fix-table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--off-white); }
  .fix-table tr:last-child { border-bottom: none; }
  .fix-table td { display: block; width: auto; padding: 0; border: none; }
  .fix-table td:first-child { font-weight: 500; margin-bottom: 4px; }
}

/* Closing note (currently used on voted-off-the-island.html) */
.closing-note {
  max-width: 680px;
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid var(--off-white);
  text-align: center;
}
.closing-note p {
  font-size: 15px;
  color: var(--gray-mid);
  font-style: italic;
  line-height: 1.8;
  font-weight: 300;
}

/* Back-to-gallery link */
.back-to-gallery {
  max-width: 680px;
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--off-white);
  text-align: center;
}
.back-to-gallery a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-dark);
  text-decoration: none;
  transition: color 0.3s;
}
.back-to-gallery a:hover { color: var(--black); }
