/* Projects section styles */
.projets {
  padding: 2rem 12px 8rem;
  background: var(--surface);
  border-top: var(--accent-green) solid 0.5rem;
}

.projects-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.projects-title {
  font-size: 3rem;
  color: var(--accent-green);
  margin: 1rem 0rem 3rem;
}

.projects-sub {
  margin: 0 0 2rem;
  color: var(--accent-green);
  opacity: .9;
}

.projects-filters { 
  display:flex;
  gap:1rem;
  justify-content:center;
  margin-bottom:2.6rem;
}

.pill {
  border-radius: 999px;
  padding: .6rem 1.1rem;
  background: var(--surface);
  color: var(--accent-green);
  border: 0.15rem solid var(--accent-green);
  cursor: pointer;
  font-weight: bolder;
}
.pill.active { background: var(--accent-green); color: var(--surface);}

.projects-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.6rem;
}

.project-card{
  background: linear-gradient(180deg, var(--surface), var(--surface));
  border-radius: 16px;
  overflow: hidden;
  display:flex;
  flex-direction:column;
  border: var(--accent-green) solid 0.5rem;
}

.project-media{
  width: 100%;
  height: 220px;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Play overlay for video projects */

.project-play{
  position: absolute;
  top: 8px;
  right: 8px;
  transform: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  font-size: 1.1rem;
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
  cursor: pointer;
  opacity: .95;
  border: 0.2rem solid var(--accent-green);
}
.project-card:hover .project-play{ transform: scale(1.02);} 

/* make the media container positioned for overlay */
.project-card .media-wrap{ position: relative; }

/* Play button inside lightbox (top-right of the panel content) */
.lightbox-content{ position:relative; }
.lightbox-play{
  position: absolute;
  bottom: 2.65rem;
  right: 1rem;
  z-index: 4;
  width:44px;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--accent-green);
  border-radius:8px;
  border: 0.3rem solid var(--accent-green);
  cursor:pointer;
}
.lightbox-play:hover{ background: var(--surface);}

/* Lightbox: support iframe (video) */
.lightbox-video{ width:100%; max-width:100%; border-radius:6px; }
/* 16:9 responsive box */
/* default: let the media wrapper size to the image (don't force full width) */
.lightbox-media-wrapper{ display:inline-block; width:auto; max-width:90vw; position:relative; }
/* Treat iframe and images the same: natural sizing, centered and constrained */
.lightbox-media-wrapper{ display:inline-block; width:auto; max-width:90vw; position:relative; }
/* Make video iframe noticeably larger and maintain 16:9 ratio */
.lightbox-media-wrapper iframe{
  display:block;
  margin:0 auto;
  /* responsive width: cap at 1100px or 90vw */
  width: min(1100px, 90vw);
  /* enforce 16:9 aspect ratio so height scales appropriately */
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 75vh; /* keep within viewport */
  border-radius:6px;
  border:0;
}
.lightbox-iframe{
  /* extra-specific selector to ensure iframe is always landscape */
  display:block !important;
  width: min(1100px, 90vw) !important;
  aspect-ratio: 16 / 9 !important;
  height: auto !important;
  max-height: 75vh !important;
  margin: 0 auto !important;
  border-radius:6px !important;
  border:0 !important;
}
.lightbox-media-wrapper .lightbox-image{ position:static; display:block; margin:0 auto; width:100%; max-width:1100px; height:auto; border-radius:6px; object-fit:contain; }

.project-info{
  padding: 1.6rem 1.8rem;
  background: var(--surface);
}
.project-info h3{ margin:0 0 .4rem; color: var(--accent-green) }
.project-info .meta{
  margin:0 0 1rem;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .95rem;
}

/* center the meta row as a group */
.project-info{ display:flex; flex-direction:column; align-items:center; }
.project-info .tags{ justify-content:center; }

.project-info .meta img{
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width:640px){
  .project-info .meta img{ width:20px; height:20px; }
  .project-info .meta{ font-size:.92rem }
}

.tags{ display:flex; gap:.6rem }
.tag{ background: var(--surface); color:var(--accent-green); padding:.35rem .6rem; border-radius:20px; font-size: 1rem; border: 0.15rem solid var(--accent-green);}

@media (max-width: 980px){
  .projects-grid{ grid-template-columns: repeat(2, 1fr) }
}
@media (max-width: 640px){
  .projects-grid{ grid-template-columns: 1fr }
  .projects-title{ font-size:2.4rem }
}

/* Filter helpers */
.project-card[hidden]{
  display:none !important;
}

.pill:focus{outline:2px solid var(--surface);}

/* Lightbox styles - panel sizes to the image */
.lightbox{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:9999; }
.lightbox.open{ display:flex; }
.lightbox-backdrop{ position:absolute; inset:0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.lightbox-panel{ position:relative; display:inline-block; max-height:90vh; z-index:2; padding:0; box-sizing:border-box; text-align:center; }
.lightbox-content{ position:relative; display:inline-block; flex:0 0 auto; background:transparent; padding:0; border-radius:0; text-align:center; }
.lightbox-image{ display:block; margin:0; width:auto; height:auto; max-width:90vw; max-height:90vh; border-radius:6px; }
.lightbox-caption{ position:absolute; left:50%; transform:translateX(-50%); bottom:8px; background:rgba(0,0,0,0.6); color:var(--surface); padding:.35rem .6rem; border-radius:6px; font-size:.95rem; }
.lightbox-close{ position:absolute; top:6px; right:6px; z-index:4; background:rgba(255,255,255,0.9); color:var(--accent-green); border:0; padding:.35rem .5rem; border-radius:6px; cursor:pointer; font-size:1.1rem; }
/* overlay prev/next so they don't affect content size */
.lightbox-prev, .lightbox-next{ position:absolute; top:50%; transform:translateY(-50%); z-index:4; background:rgba(255,255,255,0.95); color:var(--accent-green); border:0; height:44px; width:44px; display:flex; align-items:center; justify-content:center; font-size:1.4rem; border-radius:50%; cursor:pointer; box-shadow:0 6px 18px rgba(0,0,0,0.25); }
.lightbox-prev{ left:8px; }
.lightbox-next{ right:8px; }

@media (max-width:640px){
  .lightbox-panel{ flex-direction:column; }
  .lightbox-prev, .lightbox-next{ width:40px; height:40px }
}

