/* ============================================================
   StayByOwner — Design System
   Tokens, reset, typography, layout, components, utilities
   ============================================================ */

/* ── 1. CSS Custom Properties ─────────────────────────────── */
:root {
  /* Colors */
  --cream:        #f5f1ea;
  --cream-2:      #ede7dc;
  --paper:        #faf7f1;
  --ink:          #1a1a1a;
  --ink-soft:     #2a2723;
  --mute:         #6b6258;
  --mute-2:       #9a8f82;
  --line:         #d9d1c2;
  --line-soft:    #e7e0d2;
  --forest:       #1e3a2f;
  --forest-2:     #2b4f40;
  --ochre:        #c8924a;
  --ochre-2:      #d4a574;
  --terra:        #b85e3a;
  --gold:         #b08646;
  --white:        #ffffff;

  /* Typography */
  --f-display: "Instrument Serif", "Times New Roman", serif;
  --f-body:    "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono:    "Geist Mono", ui-monospace, monospace;

  /* Border radius */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   14px;
  --r-xl:   22px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 20, 12, 0.07), 0 1px 2px rgba(26, 20, 12, 0.05);
  --shadow-md: 0 4px 12px rgba(26, 20, 12, 0.09), 0 2px 4px rgba(26, 20, 12, 0.06);
  --shadow-lg: 0 12px 32px rgba(26, 20, 12, 0.12), 0 4px 8px rgba(26, 20, 12, 0.08);

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-base:   0.2s ease;
  --t-slow:   0.35s ease;

  /* Layout */
  --container-width:       1320px;
  --container-tight-width: 1080px;
  --container-prose-width: 720px;
  --container-px:          32px;

  /* Header */
  --header-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  background-color: var(--cream);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

ul,
ol {
  list-style: none;
}

/* ── 3. Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }

/* Prose containers constrain line length; use .container-prose for that */

/* Display — serif italic for hero headings */
.display {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  line-height: 1.0;
}

/* Eyebrow label */
.eyebrow {
  display: block;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--mute);
}

/* ── 4. Layout Containers ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

.container-tight {
  width: 100%;
  max-width: var(--container-tight-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

.container-prose {
  width: 100%;
  max-width: var(--container-prose-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-px);
  padding-right: var(--container-px);
}

main {
  padding-top: var(--header-h);
}

/* ── 5. Button System ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-md);
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base),
              border-color var(--t-base), filter var(--t-base),
              box-shadow var(--t-base);
  white-space: nowrap;
  padding: 12px 24px;
}

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

/* Primary */
.btn-primary {
  background: var(--forest);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--forest-2);
  color: var(--white);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover {
  background: var(--cream-2);
  border-color: var(--mute-2);
}

/* Ochre */
.btn-ochre {
  background: var(--ochre);
  color: var(--white);
}
.btn-ochre:hover {
  background: var(--gold);
  color: var(--white);
}

/* Terra */
.btn-terra {
  background: var(--terra);
  color: var(--white);
}
.btn-terra:hover {
  filter: brightness(0.9);
}

/* Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ── 6. Card Components ───────────────────────────────────── */
.card {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.35;
}

.card-meta {
  font-size: 13px;
  color: var(--mute);
  line-height: 1.5;
}

.card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--forest);
  margin-top: 12px;
}

.card-price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--mute);
}

/* ── 7. Chip / Badge System ───────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.chip-default {
  background: var(--cream-2);
  color: var(--mute);
}

.chip-forest {
  background: var(--forest);
  color: var(--white);
}

.chip-ochre {
  background: var(--ochre);
  color: var(--white);
}

.chip-terra {
  background: var(--terra);
  color: var(--white);
}

.chip-gold {
  background: var(--gold);
  color: var(--white);
}

.chip-outline {
  background: transparent;
  color: var(--mute);
  border: 1px solid var(--line);
}

/* ── 8. Breadcrumb ────────────────────────────────────────── */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--mute);
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 4px;
  color: var(--mute-2);
}

.breadcrumb li a {
  color: var(--ochre);
  text-decoration: none;
  transition: color var(--t-fast);
}

.breadcrumb li a:hover {
  color: var(--gold);
}

.breadcrumb li:last-child {
  color: var(--ink-soft);
}

/* ── 9. Responsive Grid ───────────────────────────────────── */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }

  .container,
  .container-tight,
  .container-prose {
    --container-px: 20px;
  }
}

/* ── 10. Form Elements ────────────────────────────────────── */
.input {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}

.input::placeholder {
  color: var(--mute-2);
}

.input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(30, 58, 47, 0.1);
}

.label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

/* ── 11. Divider ──────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 32px 0;
}

/* ── 12. Utility Classes ──────────────────────────────────── */

/* Screen-reader only */
.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;
}

/* Color utilities */
.text-mute    { color: var(--mute); }
.text-mute-2  { color: var(--mute-2); }
.text-forest  { color: var(--forest); }
.text-ochre   { color: var(--ochre); }
.text-terra   { color: var(--terra); }
.text-gold    { color: var(--gold); }
.text-white   { color: var(--white); }
.text-ink     { color: var(--ink); }

/* Background utilities */
.bg-cream    { background-color: var(--cream); }
.bg-cream-2  { background-color: var(--cream-2); }
.bg-paper    { background-color: var(--paper); }
.bg-forest   { background-color: var(--forest); }

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Spacing helpers */
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }

.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }

/* Display */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }

/* Gap helpers */
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* Truncation */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Font weight */
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Font size */
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-15 { font-size: 15px; }

/* Rounded */
.rounded-sm  { border-radius: var(--r-sm); }
.rounded-md  { border-radius: var(--r-md); }
.rounded-lg  { border-radius: var(--r-lg); }
.rounded-xl  { border-radius: var(--r-xl); }
.rounded-pill { border-radius: var(--r-pill); }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ── 13. Section Spacing ──────────────────────────────────── */
.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-lg {
  padding: 112px 0;
}

@media (max-width: 768px) {
  .section    { padding: 56px 0; }
  .section-sm { padding: 32px 0; }
  .section-lg { padding: 72px 0; }
}
