/*
 * SocksDesigner - Gallery Styles
 * Extends base.css design system
 */

/* =============================================
   Gallery Layout
   ============================================= */

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: inherit;
}

/* =============================================
   Toolbar
   ============================================= */

.toolbar {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  gap: var(--space-2);
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
}

.search-form .input {
  flex: 1;
  min-width: 220px;
}

.filter-panel {
  width: 100%;
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.filter-group {
  display: grid;
  gap: var(--space-2);
}

.filter-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filter-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.filter-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-pill span {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-pill input:checked + span {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-glow-sm);
}

/* =============================================
   Gallery Grid
   ============================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

/* =============================================
   Work Cards
   ============================================= */

.work-card {
  background: var(--gradient-card), var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  transition: all var(--duration-normal) var(--ease-out);
}

.work-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.work-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: var(--bg-surface);
  transition: opacity var(--duration-slow) var(--ease-out);
}

/* 3D Preview Container */
.work-3d {
  position: relative;
  width: 100%;
  min-height: 420px;
  max-height: 520px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  overflow: hidden;
}

.work-3d canvas,
.work-3d img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: none;
  border-radius: 0;
}

.work-3d .work-3d-fallback,
.work-3d .work-3d-design-img,
.work-3d .work-placeholder {
  display: none;
}

.work-3d img.work-3d-fallback,
.work-3d img.work-3d-design-img {
  object-fit: contain;
  background: var(--bg-surface);
}

.work-3d.is-mode-3d canvas {
  display: block;
}

.work-3d:not(.is-mode-3d) canvas {
  display: none;
}

.work-3d.is-mode-render .work-3d-render-img {
  display: block;
}

.work-3d.is-mode-design .work-3d-design-img {
  display: block;
}

.work-3d.is-mode-empty .work-placeholder {
  display: flex;
}

.work-3d-hint {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(15, 20, 34, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-default);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.work-3d:not(.is-mode-3d) .work-3d-hint {
  display: none;
}

.work-3d-mode {
  position: absolute;
  top: var(--space-2);
  left: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: rgba(15, 20, 34, 0.8);
  border: 1px solid var(--border-default);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  z-index: 4;
}

.work-3d-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: rgba(15, 20, 34, 0.8);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  transition: all var(--duration-fast) var(--ease-out);
}

.work-3d-nav:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.work-3d-prev {
  left: var(--space-2);
}

.work-3d-next {
  right: var(--space-2);
}

.work-3d-nav span {
  font-size: 24px;
  line-height: 1;
}

.work-3d-seo-images {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.work-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.work-body {
  padding: var(--space-3) var(--space-4) var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.work-title {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
  color: var(--text-primary);
}

.work-meta {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-bottom: var(--space-2);
}

.work-stats {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin-top: auto;
}

.work-action {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.work-primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.work-action form {
  margin: 0;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-with-icon .btn-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-with-icon .btn-icon svg {
  width: 16px;
  height: 16px;
  fill: transparent;
  transition: transform var(--duration-fast) var(--ease-out), fill var(--duration-fast) var(--ease-out);
}

.btn-with-icon.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-with-icon.is-active .btn-icon svg {
  fill: currentColor;
  stroke: currentColor;
}

.btn-with-icon.is-animating .btn-icon svg,
.btn-with-icon:active .btn-icon svg {
  animation: btn-pop 0.22s ease;
}

@keyframes btn-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* =============================================
   Detail Page
   ============================================= */

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  align-items: stretch;
}

.detail-media-column {
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--space-4);
  align-self: start;
  min-width: 0;
}

.detail-hero > .card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.detail-hero img {
  width: 100%;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  object-fit: cover;
}

.detail-side-info {
  padding-top: var(--space-3);
}

.detail-side-info h2 {
  margin-bottom: var(--space-3);
}

/* =============================================
   Cards
   ============================================= */

.card {
  background: var(--gradient-card), var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  padding: var(--space-4);
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  border-color: var(--border-strong);
}

.card h2,
.card h1,
.card h3 {
  font-family: var(--font-display);
  margin: 0 0 var(--space-2);
}

.detail-hero .card h1 {
  font-size: clamp(1.55rem, 2.1vw, 2.1rem);
  line-height: 1.15;
}

/* =============================================
   Tags
   ============================================= */

.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  margin-left: var(--space-1);
}

.tag-section {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
}

.tag-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: var(--space-1);
}

/* =============================================
   Stats & Share
   ============================================= */

.stats-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.share-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin-top: var(--space-3);
}

.share-row .input {
  flex: 1;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.share-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

.share-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.share-btn.share-x { background: #0f1115; }
.share-btn.share-facebook { background: #1877f2; }
.share-btn.share-linkedin { background: #0a66c2; }
.share-btn.share-whatsapp { background: #25d366; }
.share-btn.share-reddit { background: #ff4500; }
.share-btn.share-pinterest { background: #e60023; }
.share-btn.share-copy { background: #0ea5e9; }

.share-btn.share-x:hover { box-shadow: 0 6px 16px rgba(15, 17, 21, 0.35); }
.share-btn.share-facebook:hover { box-shadow: 0 6px 16px rgba(24, 119, 242, 0.35); }
.share-btn.share-linkedin:hover { box-shadow: 0 6px 16px rgba(10, 102, 194, 0.35); }
.share-btn.share-whatsapp:hover { box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35); }
.share-btn.share-reddit:hover { box-shadow: 0 6px 16px rgba(255, 69, 0, 0.35); }
.share-btn.share-pinterest:hover { box-shadow: 0 6px 16px rgba(230, 0, 35, 0.35); }
.share-btn.share-copy:hover { box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35); }

/* =============================================
   SEO Blocks
   ============================================= */

.seo-summary {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.detail-hero > .card p {
  margin-top: 0;
  margin-bottom: var(--space-2);
}

.design-blueprint-card {
  margin-bottom: var(--space-6);
}

.design-blueprint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--space-4);
}

.design-data-block {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  padding: var(--space-3);
  min-width: 0;
}

.design-color-table {
  display: grid;
  gap: 1px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--border-default);
}

.design-color-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.7fr);
  gap: var(--space-2);
  align-items: center;
  background: var(--bg-elevated);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.design-color-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.design-color-head {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.design-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.design-color-chip i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.design-meta-list {
  display: grid;
  gap: var(--space-2);
}

.design-meta-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.design-meta-label {
  color: var(--text-muted);
}

.design-meta-value {
  color: var(--text-secondary);
  word-break: break-all;
}

.design-text-group {
  margin-top: var(--space-3);
}

.design-subtitle {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.design-text-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.design-elements-block {
  margin-top: var(--space-4);
}

.design-elements-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-3);
}

.design-element-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: var(--space-2);
  align-items: center;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: var(--space-2);
}

.design-element-preview {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.design-element-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  border-radius: 0;
}

.design-copy-btn {
  justify-content: flex-start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.design-uploaded-name {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =============================================
   Comments
   ============================================= */

/* Comment Showcase */
.comment-showcase {
  margin-top: var(--space-4);
  margin-bottom: var(--space-5);
}

.comment-showcase-title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.comment-showcase-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 240px);
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scroll-snap-type: x mandatory;
}

.comment-showcase-item {
  scroll-snap-align: start;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  overflow: hidden;
}

.comment-showcase-image {
  width: 100%;
  height: 180px;
  background: var(--bg-base);
}

.comment-showcase-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comment-showcase-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
}

.comment-showcase-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  background: var(--bg-highlight);
}

.comment-showcase-chip.is-verified {
  border-color: rgba(16, 185, 129, 0.6);
  color: #10b981;
}

/* Comment Form */
.comment-form {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-default);
}

.comment-form-main {
  margin-bottom: var(--space-4);
}

.comment-textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-3);
  resize: vertical;
  font-family: var(--font-sans);
  line-height: var(--leading-relaxed);
}

.comment-form-extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.comment-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.comment-form-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.comment-form-label svg {
  opacity: 0.7;
}

.comment-file-input {
  padding: var(--space-2);
  font-size: var(--text-sm);
}

.comment-file-input.is-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.comment-file-picker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.comment-file-name {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.comment-file-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.comment-form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
}

/* Comment List */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.comment-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-5);
}

.comment-page {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.comment-page:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.comment-page.is-active {
  border-color: var(--color-primary);
  color: var(--text-primary);
  background: var(--bg-highlight);
}

.comment-page.is-disabled {
  opacity: 0.5;
  cursor: default;
}

.comment {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  background: var(--bg-surface);
  transition: all var(--duration-fast) var(--ease-out);
}

.comment:hover {
  border-color: var(--border-strong);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.comment-author {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.comment-date {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.tag-verified {
  background: var(--color-secondary-muted);
  color: var(--color-secondary);
}

.comment-content {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.comment-video {
  margin-top: var(--space-3);
}

.comment-video-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: #ff0000;
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.comment-video-link:hover {
  background: #cc0000;
  color: white;
  transform: translateY(-1px);
}

.comment-video-link svg {
  flex-shrink: 0;
}

.comment-image {
  margin-top: var(--space-3);
}

.comment-image img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--bg-base);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-out);
}

.comment-image img:hover {
  transform: scale(1.02);
}

.comment-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}

.comment-empty svg {
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.comment-empty p {
  margin: 0;
  font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 640px) {
  .comment-form-extras {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Utility Classes
   ============================================= */

.muted {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.empty {
  color: var(--text-muted);
  padding: var(--space-8);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
}

.inline {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
}

/* =============================================
   Profile Layout
   ============================================= */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 2fr);
  gap: var(--space-5);
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  background: var(--bg-highlight);
  object-fit: cover;
  border: 2px solid var(--border-default);
  transition: all var(--duration-normal) var(--ease-out);
}

.profile-avatar:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow-sm);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-out);
}

.pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 900px) {
  .detail-hero,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .detail-media-column {
    gap: var(--space-3);
  }

  .design-blueprint-grid {
    grid-template-columns: 1fr;
  }

  .design-color-row {
    gap: var(--space-2);
  }

  .design-color-chip {
    white-space: normal;
  }

  .design-color-head {
    display: none;
  }

  .design-color-row:not(.design-color-head) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3);
  }

  .design-color-row:not(.design-color-head) > span {
    display: grid;
    gap: 2px;
    align-content: start;
  }

  .design-color-row:not(.design-color-head) > span::before {
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .design-color-row:not(.design-color-head) > span:nth-child(1)::before {
    content: "Color";
  }

  .design-color-row:not(.design-color-head) > span:nth-child(2)::before {
    content: "Yarn Code";
  }

  .design-color-row:not(.design-color-head) > span:nth-child(3)::before {
    content: "Yarn Name";
  }

  .design-color-row:not(.design-color-head) > span:nth-child(4)::before {
    content: "Ratio";
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .work-card {
    min-height: 260px;
  }

  .work-card img {
    height: 140px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form .input {
    min-width: 0;
  }

  .design-color-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-3);
  }

  .design-meta-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .design-elements-list {
    grid-template-columns: 1fr;
  }
}
