/* ============================================
   9ormore Static Site — Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Antonio:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --card: #ffffff;
  --card-fg: #1a1a1a;
  --primary: #333333;
  --primary-fg: #fafafa;
  --secondary: #f5f5f5;
  --secondary-fg: #333333;
  --muted: #f5f5f5;
  --muted-fg: #8a8a8a;
  --border: #e5e5e5;
  --input: #e5e5e5;
  --ring: #b3b3b3;
  --destructive: #dc2626;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Antonio', sans-serif;

  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-pill: 0;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Base --- */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
}

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

img {
  display: block;
  max-width: 100%;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .site-header {
    padding: 0 24px;
  }
}

.site-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-logo span {
  font-size: 28px;
  line-height: 1.1;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Default / Primary */
.btn-primary {
  height: 32px;
  padding: 0 10px;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: var(--radius-lg);
}

.btn-primary:hover {
  background: #1a1a1a;
}

/* Outline */
.btn-outline {
  height: 32px;
  padding: 0 10px;
  background: var(--bg);
  color: var(--fg);
  border-color: var(--border);
  border-radius: var(--radius-lg);
}

.btn-outline:hover {
  background: var(--muted);
}

/* Large */
.btn-lg {
  height: 40px;
  padding: 0 16px;
  font-size: 15px;
}

/* Full Width */
.btn-full {
  width: 100%;
}

/* ============================================
   BADGES / FILTER CHIPS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.badge-default {
  background: var(--primary);
  color: var(--primary-fg);
}

.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-fg);
}

.badge-outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

/* Filter chips */
.filter-chip {
  cursor: pointer;
  user-select: none;
  height: 28px;
  padding: 0 12px;
  font-size: 13px;
}

.filter-chip:hover {
  background: var(--muted);
  color: var(--fg);
}

.filter-chip.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}

.filter-chip.active:hover {
  background: #1a1a1a;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
}

.main {
  min-height: calc(100vh - 56px);
  padding: 24px 0;
}

.main-detail {
  padding-top: 0;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted-fg);
  line-height: 1.5;
}

/* ============================================
   SEARCH
   ============================================ */
.search-input {
  width: 100%;
  max-width: 384px;
  height: 32px;
  padding: 4px 10px;
  font-size: 14px;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--fg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input::placeholder {
  color: var(--muted-fg);
}

.search-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(179, 179, 179, 0.3);
}

/* ============================================
   TOOLBAR (search + filters row)
   ============================================ */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

@media (min-width: 640px) {
  .toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ============================================
   CARD GRID
   ============================================ */
.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   PROPERTY CARD
   ============================================ */
.property-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-fg);
  transition: background-color 0.15s ease;
  overflow: hidden;
  text-decoration: none;
}

.property-card:hover {
  background: rgba(245, 245, 245, 0.5);
}

.property-card-image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--muted);
}

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.property-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.property-card-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.375;
}

.property-card-city {
  font-size: 12px;
  color: var(--muted-fg);
}

.property-card-desc {
  font-size: 13px;
  color: var(--muted-fg);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.property-card-tags .badge {
  height: 20px;
  font-size: 11px;
  padding: 0 6px;
}

/* Badge xs variant (for card tags) */
.badge-xs {
  height: 18px;
  font-size: 10px;
  padding: 0 4px;
}

/* Avatar fallback for cards without images */
.property-card-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.property-card-avatar span {
  font-size: 36px;
  font-weight: 700;
  font-family: var(--font-display);
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

/* Live badge overlay */
.property-card-image {
  position: relative;
}

.property-card-live {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: var(--fg);
  font-size: 10px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}

/* ============================================
   PROPERTY DETAIL PAGE
   ============================================ */
.detail-hero {
  width: 100%;
  aspect-ratio: 16 / 4;
  overflow: hidden;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-header {
  margin-bottom: 24px;
}

.detail-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted-fg);
  margin-bottom: 12px;
}

.detail-meta-sep {
  color: var(--border);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.detail-personality {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-fg);
}

.detail-description {
  font-size: 15px;
  line-height: 1.625;
  color: var(--fg);
}

.detail-questions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-questions li {
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--secondary);
  cursor: default;
  transition: background 0.15s;
}

.detail-questions li:hover {
  background: var(--border);
}

.detail-cta {
  margin-top: 8px;
}

/* Gallery grid */
.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (min-width: 640px) {
  .detail-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.detail-gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
}

.detail-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.detail-gallery-item:hover img {
  transform: scale(1.03);
}

/* Hero avatar fallback */
.detail-hero-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-hero-avatar span {
  font-size: 64px;
  font-weight: 700;
  font-family: var(--font-display);
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
}

/* Layout: 2-column on desktop */
.detail-layout {
  display: grid;
  gap: 32px;
}

@media (min-width: 1024px) {
  .detail-layout {
    grid-template-columns: 2fr 1fr;
  }
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================
   NOT FOUND STATE
   ============================================ */
.not-found {
  text-align: center;
  padding: 80px 16px;
}

.not-found h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.not-found p {
  color: var(--muted-fg);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ============================================
   FORM (Submit Page)
   ============================================ */
.form-page {
  max-width: 480px;
  margin: 0 auto;
}

.form-page h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.form-page .form-subtitle {
  color: var(--muted-fg);
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
}

.form-input,
.form-textarea {
  height: 36px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--fg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(179, 179, 179, 0.3);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted-fg);
}

.form-textarea {
  height: auto;
  min-height: 100px;
  resize: vertical;
}

.form-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid .form-group-full {
    grid-column: 1 / -1;
  }
}

.form-actions {
  margin-top: 24px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted-fg);
  grid-column: 1 / -1;
}

.empty-state p {
  font-size: 14px;
}

/* ============================================
   FOOTER (optional, minimal)
   ============================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted-fg);
}

/* ============================================
   UTILITIES
   ============================================ */
/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-error {
  background: var(--destructive);
  color: #fff;
}

/* ============================================
   UTILITIES
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
