/* ═══════════════════════════════════════
   Jawn Legend — Style Sheet
   Layout: Sidebar + Feed
   Monochrome, minimal, dark-first
   ═══════════════════════════════════════ */

/* ─── Section 1: Theme Overrides (Monochrome) ─── */
/* Dark-first monochrome palette. No color accents — contrast only. */

:root,
[data-theme="dark"] {
  --color-bg:           #0A0A0A;
  --color-surface:      #141414;
  --color-surface-2:    #1C1C1C;
  --color-surface-3:    #242424;
  --color-border:       #2A2A2A;
  --color-border-hover: #404040;
  --color-divider:      #1E1E1E;

  --color-text:         #E8E8E8;
  --color-text-muted:   #8A8A8A;
  --color-text-faint:   #666666;
  --color-text-inverse: #0A0A0A;

  --color-accent:       #E8E8E8;
  --color-accent-hover: #FFFFFF;
  --color-accent-active:#D0D0D0;
  --color-accent-muted: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-overlay: 0 24px 64px rgba(0,0,0,0.7);
}

[data-theme="light"] {
  --color-bg:           #FAFAFA;
  --color-surface:      #F0F0F0;
  --color-surface-2:    #E8E8E8;
  --color-surface-3:    #E0E0E0;
  --color-border:       #D4D4D4;
  --color-border-hover: #B0B0B0;
  --color-divider:      #E0E0E0;

  --color-text:         #1A1A1A;
  --color-text-muted:   #737373;
  --color-text-faint:   #A0A0A0;
  --color-text-inverse: #FAFAFA;

  --color-accent:       #1A1A1A;
  --color-accent-hover: #000000;
  --color-accent-active:#333333;
  --color-accent-muted: rgba(0, 0, 0, 0.06);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --shadow-overlay: 0 24px 64px rgba(0,0,0,0.15);
}

/* ─── Font Override ─── */
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Section 2: Base Body ─── */
body {
  font-family: var(--font-body);
  font-weight: 400;
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Section 3: Layout ─── */
.layout { display: flex; height: 100vh; }

/* ─── Section 4: Sidebar ─── */
.sidebar {
  width: 344px;
  min-width: 344px;
  display: flex;
  flex-direction: column;
  padding: 28px 30px 18px;
}

.sidebar-top {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Brand row — quiet, minimal */
.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}

.brand-logo {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
}

.brand-actions {
  display: flex;
  gap: 2px;
}

.board-toggle,
.theme-toggle {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  color: var(--color-text-faint);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-interactive);
  position: relative;
}

.board-toggle svg,
.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.board-toggle:hover,
.theme-toggle:hover {
  color: var(--color-text-muted);
}

.board-toggle.active {
  color: var(--color-text);
}

.board-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

.board-badge:empty {
  display: none;
}

/* Theme toggle icon visibility */
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Hero */
.sidebar-title {
  font-family: var(--font-body);
  font-size: 34px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.title-italic {
  font-style: italic;
  color: var(--color-text-muted);
}

.sidebar-subtitle {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--color-text-faint);
  margin-bottom: 40px;
  max-width: 280px;
}

/* ─── Section 5: CTAs ─── */
.sidebar-ctas {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
}

.cta-primary {
  padding: 11px 22px;
  border-radius: var(--radius-full);
  background: var(--color-text);
  color: var(--color-bg);
  border: none;
  font-size: 13px;
  font-weight: 400;
  font-family: var(--font-body);
  cursor: pointer;
  min-height: 44px;
  letter-spacing: 0.01em;
  transition: all var(--transition-interactive);
}

.cta-primary:hover {
  opacity: 0.85;
}

.cta-secondary {
  padding: 11px 22px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 400;
  font-family: var(--font-body);
  cursor: pointer;
  min-height: 44px;
  letter-spacing: 0.01em;
  transition: all var(--transition-interactive);
}

.cta-secondary:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

/* ─── Section 6: Filter Section (collapsed by default) ─── */
.filter-section {
  margin-bottom: 20px;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--color-text-faint);
  font-size: 12px;
  font-weight: 400;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 10px 0;
  min-height: 44px;
  letter-spacing: 0.02em;
  transition: color var(--transition-interactive);
}

.filter-toggle:hover {
  color: var(--color-text-muted);
}

.filter-chevron {
  transition: transform var(--transition-interactive);
}

.filter-section.expanded .filter-chevron {
  transform: rotate(180deg);
}

.filter-pills-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease, opacity 200ms ease;
  opacity: 0;
  visibility: hidden;
}

.filter-section.expanded .filter-pills-wrap {
  opacity: 1;
  visibility: visible;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-faint);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-family: var(--font-body);
  min-height: 36px;
  cursor: pointer;
  transition: all var(--transition-interactive);
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-muted);
}

.filter-pill.active {
  background: var(--color-accent-muted);
  border-color: var(--color-text-muted);
  color: var(--color-text);
  font-weight: 500;
}

/* ─── Section 7: Search / Prompt Input ─── */
.input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-radius: var(--radius-lg);
  padding: 0 var(--space-4);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
}

.input-container:focus-within {
  border-color: var(--color-text-faint);
  box-shadow: 0 0 0 1px var(--color-text-faint);
}

/* Rotating placeholder hint */
.input-hint {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 300;
  font-style: italic;
  color: var(--color-text-faint);
  pointer-events: none;
  transition: opacity 400ms ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - var(--space-16));
}

.input-hint.hidden {
  opacity: 0;
}

.input-field {
  position: relative;
  flex: 1;
  height: 48px;
  background: none;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 300;
  color: var(--color-text);
  font-family: var(--font-body);
}

.input-clear {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-interactive);
}

.input-clear:hover {
  background: var(--color-surface-3);
  color: var(--color-text);
}

/* ─── Section 8: Feed + Masonry ─── */
.feed {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--color-surface);
}

.feed::-webkit-scrollbar {
  width: 0;
}

.masonry {
  column-width: 220px;
  column-gap: 5px;
  padding: 5px;
}

.card {
  break-inside: avoid;
  width: 100%;
  margin: 0 0 5px;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  transition: opacity var(--transition-interactive);
  position: relative;
  --card-ratio: 3 / 4;
  --card-object-y: 58%;
}

.card:focus-visible {
  outline: 2px solid var(--color-text-muted);
  outline-offset: 2px;
}

.card:hover .card-shoe,
.card:focus-visible .card-shoe,
.card:focus-within .card-shoe {
  opacity: 1;
}

.card-media {
  position: relative;
  aspect-ratio: var(--card-ratio);
  overflow: hidden;
  border-radius: 5px;
  background: var(--color-surface-2);
}

.card-overlay {
  display: none;
}

.card-remix-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  pointer-events: auto;
}

.card-remix-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.card-remix-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,0.95);
  outline-offset: 3px;
}

.card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center var(--card-object-y);
}

.card--portrait {
  --card-ratio: 3 / 4;
  --card-object-y: 58%;
}

.card--standard {
  --card-ratio: 4 / 5;
  --card-object-y: 64%;
}

.card--cropped {
  --card-ratio: 5 / 6;
  --card-object-y: 70%;
}

.card--square {
  --card-ratio: 1 / 1;
  --card-object-y: 78%;
}

.card-shoe {
  position: absolute;
  z-index: 3;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 7px 9px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  border-radius: 0 0 5px 5px;
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  opacity: 0;
  transition: opacity var(--transition-interactive);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
  }

  .card:hover .card-overlay,
  .card:focus-visible .card-overlay,
  .card:focus-within .card-overlay {
    opacity: 1;
  }
}

.feed-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  text-align: center;
  gap: 16px;
}

.feed-empty-text {
  font-size: 15px;
  color: var(--color-text-muted);
}

.feed-reset-btn {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  min-height: 44px;
  transition: all var(--transition-interactive);
}

.feed-reset-btn:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

/* ─── Section 9: Lightbox ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  display: flex;
  max-width: 1000px;
  max-height: 90vh;
  width: 90%;
  background: var(--color-surface);
  border-radius: 10px;
  overflow: hidden;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition-interactive);
}

.lightbox-close:hover {
  background: rgba(0,0,0,0.5);
}

.lightbox-image-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background var(--transition-interactive);
}

.lightbox-nav:hover {
  background: rgba(0,0,0,0.5);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-info {
  width: 320px;
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lightbox-info-brand {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.lightbox-info-model {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 2px;
}

.lightbox-info-colorway {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.lightbox-info-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: 20px;
}

.lightbox-outfit {
  margin-bottom: 20px;
}

.lightbox-outfit-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.lightbox-outfit-item {
  font-size: 13px;
  color: var(--color-text);
  padding: 4px 0;
  border-bottom: 1px solid var(--color-divider);
}

.lightbox-outfit-item strong {
  color: var(--color-text-muted);
  font-weight: 500;
  text-transform: capitalize;
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.lightbox-tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}

.lightbox-board-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: none;
  color: var(--color-text);
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 400;
  cursor: pointer;
  min-height: 44px;
  margin-top: auto;
  transition: all var(--transition-interactive);
}

.lightbox-board-btn:hover {
  border-color: var(--color-border-hover);
  background: var(--color-accent-muted);
}

.lightbox-board-btn.saved {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

/* ─── Section 10: Responsive ─── */
@media (max-width: 1024px) {
  .sidebar { width: 320px; min-width: 320px; padding: 28px 28px 16px; }
  .brand-row { margin-bottom: 40px; }
}

@media (max-width: 768px) {
  .layout { flex-direction: column; height: auto; }
  body { overflow: auto; height: auto; }
  .sidebar { width: 100%; min-width: unset; padding: 32px 24px 20px; }
  .sidebar-top { flex: none; }
  .brand-row { margin-bottom: 40px; }
  .sidebar-title { font-size: 30px; }
  .sidebar-subtitle { margin-bottom: 32px; }
  .sidebar-ctas { margin-bottom: 32px; }
  .input-wrap {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--color-bg) 85%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-border);
    z-index: 50;
  }
  .feed { padding-bottom: 76px; }
  .masonry { column-width: auto; column-count: 2; }
  .card--square {
    --card-ratio: 5 / 6;
  }
  .lightbox-content { flex-direction: column; max-height: 95vh; }
  .lightbox-image-wrap { max-height: 50vh; }
  .lightbox-info { width: 100%; max-height: 45vh; }
}

@media (max-width: 480px) {
  .sidebar { padding: 28px 20px 16px; }
  .brand-row { margin-bottom: 32px; }
  .sidebar-title { font-size: 26px; }
  .sidebar-subtitle { margin-bottom: 28px; }
  .masonry { column-count: 1; }
  .card--cropped,
  .card--square {
    --card-ratio: 4 / 5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
