/* Ethernite — Museum-style minimalist gallery */

:root {
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --accent: #8b6914;
  --accent-light: #c8a96e;
  --border: #e0ddd8;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --frame-shadow: 2px 2px 12px rgba(0,0,0,0.15), -1px -1px 6px rgba(0,0,0,0.05);
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, sans-serif;
  --radius: 2px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: normal;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header / Nav */
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text);
  letter-spacing: 0.05em;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

/* Hero / Page Header */
.page-header {
  padding: 4rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); }

/* Gallery Grid */
.gallery-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.search-bar {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  max-width: 400px;
}

.search-bar input {
  flex: 1;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  background: white;
  color: var(--text);
}
.search-bar input:focus { outline: none; border-color: var(--accent); }

.painting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
}

/* Painting Card */
.painting-card {
  cursor: pointer;
  transition: transform 0.2s;
}
.painting-card:hover { transform: translateY(-3px); }

.painting-frame {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--frame-shadow);
  overflow: hidden;
  margin-bottom: 1rem;
  aspect-ratio: 4/3;
}

.painting-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.painting-frame .status-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.painting-card-info {
  padding: 0 0.25rem;
}
.painting-card-info h3 {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}
.painting-card-info .author {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}
.painting-card-info .price {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  font-family: var(--font-sans);
}
.badge-available { background: #e8f5e9; color: #2e7d32; }
.badge-sold { background: #fce4ec; color: #c62828; }
.badge-auction { background: #fff3e0; color: #e65100; }

/* Painting Detail */
.painting-detail {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  padding: 3rem 0;
}

@media (max-width: 800px) {
  .painting-detail { grid-template-columns: 1fr; gap: 2rem; }
}

.painting-detail-image {
  background: white;
  border: 1px solid var(--border);
  box-shadow: var(--frame-shadow);
  padding: 1.5rem;
}
.painting-detail-image img {
  width: 100%;
  height: auto;
  display: block;
}

.painting-meta { }
.painting-meta h1 { margin-bottom: 0.25rem; }
.painting-meta .meta-author {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.painting-meta .meta-year {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.painting-meta .description {
  margin: 1.5rem 0;
  line-height: 1.8;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.meta-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* AI Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.tag {
  background: #f5f3ef;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 2px;
}

/* Color Swatches */
.color-swatches {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 2px;
  title: attr(data-color);
}

/* Buy/Auction Widget */
.buy-widget {
  background: white;
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.buy-widget h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
  color: var(--text-muted);
}
.price-display {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.bid-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.countdown {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 500;
}
.bid-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.bid-form input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}
.bid-form input:focus { outline: none; border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  transition: background 0.15s;
  text-align: center;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #7a5c10; text-decoration: none; color: white; }
.btn-secondary {
  background: white;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-secondary:hover { background: #faf8f3; text-decoration: none; }
.btn-danger {
  background: #c62828;
  color: white;
}
.btn-danger:hover { background: #b71c1c; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-full { width: 100%; }

/* Forms */
.form-page {
  max-width: 480px;
  margin: 4rem auto;
  padding: 0 1rem;
}
.form-page h1 {
  margin-bottom: 0.5rem;
  text-align: center;
}
.form-page p.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.form-card {
  background: white;
  border: 1px solid var(--border);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  background: white;
  color: var(--text);
  border-radius: var(--radius);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 100px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

.toggle-section {
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 1rem;
}
.toggle-section.hidden { display: none; }

/* Image upload */
.upload-area {
  border: 2px dashed var(--border);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.upload-area:hover { border-color: var(--accent); }
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-preview {
  max-width: 100%;
  max-height: 300px;
  margin-top: 1rem;
  border: 1px solid var(--border);
}
.upload-text { color: var(--text-muted); font-size: 0.9rem; }

/* Draft indicator */
.draft-indicator {
  font-size: 0.8rem;
  color: var(--accent);
  margin-left: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.draft-indicator.visible { opacity: 1; }

/* AI preview */
.ai-preview {
  background: #faf8f3;
  border: 1px solid var(--border);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.875rem;
}
.ai-preview h4 { font-size: 0.875rem; margin-bottom: 0.5rem; color: var(--text-muted); }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.admin-table th {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.admin-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover td { background: #faf8f3; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}
.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Loading */
.loading {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.empty-state h2 { margin-bottom: 0.5rem; }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4rem;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }

@media (max-width: 600px) {
  nav { padding: 1rem; }
  .nav-links { gap: 1rem; }
  .container { padding: 0 1rem; }
  .painting-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
}
