/* ===== MATCH ENGINE STYLES ===== */
/* Scope: /match page only. Imports theme tokens from theme.css */

/* NAV */
.match-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 2rem;
  background: var(--bg);
  border-bottom: 1px solid var(--stitch);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-tag {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--stitch);
  border-radius: 100px;
}

/* HERO */
.match-hero {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--stitch);
  padding: 4rem 2rem;
}

.match-hero-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.match-heading {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 1rem;
}

.match-heading em {
  font-style: italic;
  color: var(--accent);
}

.match-sub {
  font-size: 1.05rem;
  color: var(--fg-muted);
  line-height: 1.7;
}

/* ERROR BANNER */
.match-error {
  background: #fff3f0;
  border-left: 4px solid var(--accent);
  color: #7a2a1a;
  padding: 1rem 2rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.error-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* FORM */
.match-form-section {
  padding: 3.5rem 2rem;
  max-width: 860px;
  margin: 0 auto;
}

.match-form-wrap {
  background: var(--bg);
  border: 1px solid var(--stitch);
  border-radius: 12px;
  padding: 2.5rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
}

.field-hint {
  font-size: 0.82rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.4;
}

.field-main {
  margin-bottom: 1.75rem;
}

textarea, input[type="text"], select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--stitch);
  border-radius: 7px;
  background: var(--cream);
  color: var(--fg);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}

textarea:focus, input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 93, 62, 0.12);
}

textarea::placeholder, input::placeholder {
  color: var(--fg-muted);
  opacity: 0.6;
}

/* Details / optional fields */
.field-details {
  border: 1px solid var(--stitch);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  background: var(--bg-warm);
}

.field-details summary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-details summary::-webkit-details-marker { display: none; }

.field-details[open] summary { margin-bottom: 1.25rem; }

.details-hint {
  font-weight: 400;
  opacity: 0.6;
}

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

.field-wide {
  grid-column: 1 / -1;
}

/* Submit button */
.btn-pull {
  width: 100%;
  padding: 1rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}

.btn-pull:hover:not(:disabled) {
  background: #b34f33;
}

.btn-pull:active:not(:disabled) {
  transform: scale(0.99);
}

.btn-pull:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* ===== RESULTS ===== */
.results-section {
  background: var(--bg-warm);
  border-top: 1px solid var(--stitch);
  padding: 4rem 2rem;
}

.results-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.results-header {
  text-align: center;
  margin-bottom: 3rem;
}

.results-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.results-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.fabric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.fabric-card {
  background: var(--bg);
  border: 1px solid var(--stitch);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}

.fabric-card:hover {
  box-shadow: 0 4px 20px rgba(44,24,16,0.08);
}

/* Decorative swatch — color strip at top using hue rotation on accent */
.fabric-swatch {
  height: 6px;
  background: oklch(55% 0.12 var(--card-hue, 15deg));
}

.fabric-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}

.fabric-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--stitch);
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 0.25rem;
}

.fabric-name {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
}

.fabric-color {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.55;
  font-style: italic;
}

.fabric-why {
  font-size: 0.92rem;
  color: var(--fg);
  line-height: 1.65;
}

.fabric-yardage {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--stitch);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.yardage-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.yardage-value {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 500;
}

.results-actions {
  text-align: center;
}

.btn-new {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  border: 2px solid var(--fg);
  border-radius: 8px;
  background: transparent;
  color: var(--fg);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-new:hover {
  background: var(--fg);
  color: var(--bg);
}

/* ===== RECENT SECTION ===== */
.recent-section {
  padding: 3.5rem 2rem;
  border-top: 1px solid var(--stitch);
}

.recent-inner {
  max-width: 860px;
  margin: 0 auto;
}

.recent-title {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-item {
  background: var(--cream);
  border: 1px solid var(--stitch);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
}

.recent-desc {
  font-size: 0.92rem;
  color: var(--fg);
  line-height: 1.55;
  margin-bottom: 0.5rem;
}

.recent-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--stitch);
  color: var(--fg-muted);
  border-radius: 100px;
}

.meta-count {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .match-form-wrap { padding: 1.5rem; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: 1; }
  .fabric-grid { grid-template-columns: 1fr; }
  .match-form-section { padding: 2rem 1rem; }
  .results-section { padding: 2.5rem 1rem; }
  .match-hero { padding: 2.5rem 1.5rem; }
}
