/* css/work.css */

.work-hero {
  padding: 160px 0 40px;
  background-color: var(--bg-primary);
  text-align: left;
}

.work-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.work-section {
  padding: 20px 0 100px;
  background-color: var(--bg-primary);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem 2rem;
}

/* Responsive Columns */
@media (max-width: 1200px) {
  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem 1.5rem;
  }
}

@media (max-width: 600px) {
  .work-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .work-hero {
    padding-top: 130px;
  }
}

/* Modernist boxy card wrapper with sharp corners (no border-radius) */
.work-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover {
  transform: translateY(-8px);
}

.work-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  /* Force sharp corners */
  transition: border-color 0.4s var(--transition-hover), background-color 0.4s ease;
}

.work-card:hover .work-card-media {
  border-color: var(--accent-blue);
}

.work-card-media svg,
.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card-media svg {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.work-card:hover .work-card-media svg,
.work-card:hover .work-card-media img {
  transform: scale(1.08);
}

.work-card-info {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.work-card-tag {
  font-family: var(--font-body);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.work-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
  transition: color 0.3s ease;
}

.work-card:hover .work-card-title {
  color: var(--accent-blue);
}

/* Theme Adaptive Colors for SVGs */
.svg-vector {
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-accent {
  stroke: var(--accent-blue);
  fill: none;
}

.svg-fill-accent {
  fill: var(--accent-blue);
}

.svg-fill-primary {
  fill: var(--text-primary);
}

.svg-grid-line {
  stroke: var(--border);
  stroke-width: 0.75;
  stroke-dasharray: 2 4;
}

/* Specific Light Mode Adjustments */
html.light-mode .work-card-media {
  background-color: #E8E4DF;
  /* Sand color matching philosophy */
  border-color: var(--border);
}

/* --- Amazon/Flipkart-Style Multi-Select Project Filtering System --- */

/* Dual-Column Layout */
.projects-layout-container {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-top: 2rem;
  width: 100%;
}

/* Sidebar filter column */
.filter-sidebar {
  flex: 0 0 280px;
  width: 280px;
  position: sticky;
  top: 100px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.5rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.filter-sidebar::-webkit-scrollbar {
  width: 4px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 2px;
}

.filter-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.filter-sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}

.btn-clear-all {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.btn-clear-all:hover {
  opacity: 0.8;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 1.75rem;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-title {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.filter-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.filter-option-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.filter-option-label:hover {
  color: var(--text-primary);
}

/* Modern minimalist custom checkboxes */
.filter-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  background-color: transparent;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  border-radius: 0;
}

.filter-checkbox:checked {
  background-color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.filter-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid var(--bg-primary);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.filter-checkbox:focus-visible {
  outline: 1.5px solid var(--accent-blue);
  outline-offset: 1px;
}

/* Right Content Pane containing results */
.projects-grid-pane {
  flex: 1;
  width: 100%;
}

/* Search bar, Sort & Mobile Filters row */
.search-sort-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-icon-svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.85rem 1rem 0.85rem 2.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: var(--accent-blue);
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.85rem 2rem 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  transition: border-color 0.3s ease;
}

.sort-select:focus {
  border-color: var(--accent-blue);
}

/* Active Chips row styling */
.active-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0.5rem 0;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(239, 195, 131, 0.1);
  border: 1px solid rgba(239, 195, 131, 0.2);
  color: var(--accent-blue);
  padding: 0.4rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  transition: border-color 0.2s ease;
}

.active-chip:hover {
  border-color: var(--accent-blue);
}

.active-chip-btn-remove {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Live counts and status tags */
.live-count-wrapper {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.live-count-highlight {
  color: var(--text-primary);
  font-weight: 500;
}

/* Empty state styling */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  border: 1px dashed var(--border);
  text-align: center;
  width: 100%;
}

.empty-state-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Mobile trigger layout */
.mobile-filter-bar {
  display: none;
}

.btn-mobile-filter {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: border-color 0.3s ease;
}

.btn-mobile-filter:hover {
  border-color: var(--accent-blue);
}

/* Collapsible Mobile Drawer filters */
.filter-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.4s ease;
}

.filter-drawer.active {
  pointer-events: auto;
  visibility: visible;
}

.filter-drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.filter-drawer.active .filter-drawer-overlay {
  opacity: 1;
}

.filter-drawer-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 75vh;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-drawer.active .filter-drawer-content {
  transform: translateY(0);
}

.filter-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.filter-drawer-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.filter-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Media Queries for Filters Layout */
@media (max-width: 1024px) {
  .projects-layout-container {
    gap: 2rem;
  }

  .filter-sidebar {
    flex: 0 0 250px;
    width: 250px;
  }
}

@media (max-width: 768px) {
  .projects-layout-container {
    flex-direction: column;
    margin-top: 1rem;
  }

  .filter-sidebar {
    display: none;
    /* Hide on mobile/tablet */
  }

  .mobile-filter-bar {
    display: block;
  }

  .search-sort-row {
    gap: 1rem;
  }

  .sort-select {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }
}

@media (max-width: 480px) {
  .search-sort-row {
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-filter-bar {
    display: flex;
    justify-content: stretch;
  }

  .btn-mobile-filter {
    flex: 1;
    justify-content: center;
  }

  .sort-wrapper {
    justify-content: space-between;
  }

  .sort-select {
    flex: 1;
    max-width: 70%;
  }
}