/* gallery.css — gallery page only (DOES NOT style global header/buttons) */

.field{ display:block; margin:10px 0 14px; }
.label{
  display:block;
  font-size:12px;
  color:#5f6b7a;
  margin-bottom:6px;
}
.input{
  width:100%;
  border:1px solid #e6e9ee;
  border-radius:12px;
  padding:12px;
  font-size:15px;
  outline:none;
}
.input:focus{
  border-color:#1f6fd6;
  box-shadow:0 0 0 3px rgba(31,111,214,0.12);
}

.section{ margin-top:12px; }
.section-title{
  font-size:12px;
  color:#5f6b7a;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:0.08em;
}
.meta{
  font-size:12px;
  color:#8a94a6;
  margin:6px 0 10px;
}

/* Jobs list */
.list{ display:grid; gap:10px; }

.card-item{
  width:100%;
  text-align:left;
  border:1px solid #e6e9ee;
  background:#ffffff;
  border-radius:14px;
  padding:12px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.card-item:active{ transform: translateY(1px); }

.card-title{ font-weight:750; font-size:14px; }
.card-sub{
  margin-top:3px;
  font-size:13px;
  color:#5f6b7a;
}
.card-action{
  font-size:12px;
  font-weight:750;
  color:#1f6fd6;
  white-space:nowrap;
}

/* Back row */
.actions{
  margin-top: 12px;
  display:flex;
  gap:10px;
}

/* === GRID GALLERY === */
.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
@media (min-width: 520px){
  .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 860px){
  .grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.thumb{
  border:1px solid #e6e9ee;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  cursor:pointer;
}
.thumb:active{ transform: translateY(1px); }

.thumb-media{
  width:100%;
  aspect-ratio: 1 / 1;
  background:#f3f5f8;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.thumb-media img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.thumb-meta{
  padding:10px;
}
.thumb-name{
  font-size:12px;
  font-weight:750;
  color:#1f2937;
  line-height:1.2;
}
.thumb-sub{
  margin-top:4px;
  font-size:11px;
  color:#6b7280;
}

/* Infinite scroll sentinel */
.sentinel{
  height: 1px;
}

/* === LIGHTBOX === */
.hidden{ display:none !important; }

.lightbox{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display:flex;
  flex-direction: column;
}

.lightbox-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 14px;
  color:#fff;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.lightbox-title{
  font-weight: 750;
  font-size: 14px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60vw;
}

.lightbox-actions{
  display:flex;
  gap:10px;
}

.lb-btn{
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Fit to screen constraints (width/height) while preserving aspect ratio */
.lightbox-stage{
  position: relative;
  flex: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 0;             /* edge-to-edge stage */
  overflow: hidden;
  touch-action: pan-y;    /* allow vertical scroll but we’ll interpret horizontal swipes */
  min-height: 0;
}

/* CONTAIN = fill by constraint (width OR height), no cropping */
.lightbox-img{
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;     /* <-- key change */
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-nav{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  border:none;
  background: rgba(255,255,255,0.10);
  color:#fff;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 26px;
  cursor:pointer;
  z-index: 2;
}

#prevBtn{ left: 10px; }
#nextBtn{ right: 10px; }

@media (max-width: 520px){
  .lb-nav{
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}

/* iOS safe-area: keep the TOP bar from colliding with notch */
@supports (padding: max(0px)) {
  .lightbox-top{
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
}

/* =========================================================
   Match projects.css
   ========================================================= */

.year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.year-tab {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.14);
  background: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  min-width: 72px;
  text-align: center;
}

.year-tab:hover {
  border-color: rgba(31,111,214,0.35);
}

.year-tab:active {
  transform: translateY(1px);
}

.year-tab.active {
  border-color: #1f6fd6;
  box-shadow: 0 0 0 3px rgba(31,111,214,0.12);
  font-weight: 750;
}
