/* ==========================================================================
   WORK PAGE STYLES
   Separate page-specific card, grid, modal, and project-gallery styling from
   the global site stylesheet so the app remains easier to maintain.
   ========================================================================== */

/* --- WORK CONTAINER & HEADER --- */
.work-container {
  max-width: 1200px;
  margin: 110px auto 60px auto;
  padding: 0 24px;
}

.gallery-header {
  margin-bottom: 30px;
}

.title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 18px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.gallery-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0;
}

.gallery-subtitle {
  margin: 0;
  color: #a8a0bb;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- FILTER DROPDOWN --- */
.filter-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #14141d;
  border: 1px solid #282838;
  padding: 8px 16px;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.filter-wrapper:hover {
  border-color: #00f3ff;
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.15);
}

.filter-icon {
  width: 16px;
  height: 16px;
  stroke: #00f3ff;
  flex-shrink: 0;
}

.filter-select {
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  outline: none;
  padding-right: 18px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.filter-wrapper::after {
  content: '▼';
  font-size: 0.6rem;
  color: #00f3ff;
  position: absolute;
  right: 14px;
  pointer-events: none;
}

.filter-select option {
  background-color: #14141d;
  color: var(--ink);
  padding: 10px;
}

/* --- WORK GRID --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 12px;
}

/* Base Tile Styling - NO BORDERS. Scoped to .work-container so it never
   collides with the homepage's separate .card style above. */
.work-container .card {
  position: relative;
  height: auto;
  display: block;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.work-container .card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(143, 184, 255, 0.08), transparent 55%);
  pointer-events: none;
}

.work-container .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 243, 255, 0.45);
}

/* Image Container */
.work-container .card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: #1a1a24;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #44445a;
  font-size: 0.75rem;
  letter-spacing: 1px;
  overflow: hidden;
}

.card-image-inner {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0d0d14;
}

/* Wide tiles fill the row more naturally */
.work-container .card-wide {
  grid-column: span 2;
}

.work-container .card-wide .card-image {
  aspect-ratio: 8 / 3;
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Minimalist Text Overlay Bar */
.work-container .card-info {
  padding: 10px 12px;
  background: rgba(11, 11, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: none;
}

.project-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 12, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.project-detail-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.project-detail-panel {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(135deg, rgba(12, 12, 24, 0.95), rgba(18, 18, 32, 0.9));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  padding: 24px;
  position: relative;
}

.project-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1.4rem;
  cursor: pointer;
}

.project-detail-tag {
  margin: 0 0 8px;
  color: #00f3ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.project-detail-content h2 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  color: var(--ink);
}

.project-detail-desc {
  color: #b8b1c9;
  line-height: 1.7;
  margin: 0 0 18px;
}

.project-detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.project-detail-gallery-item {
  min-height: 160px;
  overflow: hidden;
  display: block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0;
}

.mini-project-card {
  display: block;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mini-project-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
  background-color: rgba(255, 255, 255, 0.04);
}

/* Ensure inserted <img> fills the tile and preserves aspect ratio */
.mini-project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Show a clear placeholder when an image fails to load */
.mini-project-image.image-broken {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 10px,
    rgba(255,255,255,0.01) 10px,
    rgba(255,255,255,0.01) 20px
  );
  color: #8a84a0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.mini-project-image.image-broken::after {
  content: 'Image not available';
}

/* Placeholder tiles — used when a gallery item is still just a text label,
   no real image uploaded yet. Keeps the modal from looking broken. */
.mini-project-image-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.03) 10px,
    rgba(255,255,255,0.01) 10px,
    rgba(255,255,255,0.01) 20px
  );
}

.mini-project-placeholder .mini-project-info span {
  color: #8a84a0;
}

.mini-project-info {
  padding: 10px 12px;
}

.mini-project-info h3 {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--ink);
}

.mini-project-info span {
  color: #00f3ff;
  font-size: 0.62rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-detail-filter-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.project-detail-filter-label {
  color: #b8b1c9;
  font-size: 0.7rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.project-detail-filter {
  background: #14141d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-detail-link-wrap {
  margin-top: 8px;
}

.project-detail-link {
  display: inline-block;
  color: #00f3ff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.project-lightbox-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.project-lightbox-panel {
  position: relative;
  width: min(1000px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(12, 12, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  padding: 26px 20px 18px;
}

.project-lightbox-panel img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

.project-lightbox-caption {
  color: #e8e5f0;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.project-lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 1.6rem;
  cursor: pointer;
}

/* Micro Typography */
.work-container .card-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #e0e0e8;
  margin: 0;
}

.work-container .card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #00f3ff;
  opacity: 0.8;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.work-container .card-tag:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Mobile Responsiveness for Wide Cards */
@media (max-width: 600px) {
  .work-container .card-wide {
    grid-column: span 1;
  }
  .work-container .card-wide .card-image {
    aspect-ratio: 4 / 3;
  }
}

/* ==========================================================================
   PROJECT PAGE STYLES
   ========================================================================== */
.project-page {
  max-width: 1000px;
  margin: 110px auto 60px;
  padding: 0 24px;
}

.project-header {
  margin-bottom: 2rem;
}

.project-kicker {
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-page h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin: 0 0 1rem;
}

.project-summary {
  color: #dfe5f8;
  line-height: 1.7;
  max-width: 700px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.project-panel {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a84a0;
  padding: 1rem;
  text-align: center;
}

.project-back {
  display: inline-block;
  margin-top: 2rem;
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-back:hover {
  color: var(--magenta);
}