/* ============================================================
   Besler Market, shared stylesheet
   Edit tokens at the top; everything else flows from them.
   ============================================================ */

:root {
  /* Colors, warm Mediterranean palette */
  --cream: #FBF6EC;
  --cream-deep: #F2E9D6;
  --paper: #FFFDF7;
  --ink: #2A1F18;
  --ink-soft: #5A4A3C;
  --brick: #A8321E;          /* deep red, primary accent */
  --brick-deep: #862719;
  --terracotta: #C76B3F;
  --olive: #6B7A3A;
  --olive-deep: #4F5A28;
  --gold: #C9A24A;
  --rule: #E4D8BF;

  /* Type */
  --serif-display: "DM Serif Display", "Hoefler Text", Georgia, serif;
  --serif: "Cormorant Garamond", "Hoefler Text", Georgia, serif;
  --sans: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Spacing */
  --gutter: clamp(20px, 4vw, 56px);
  --maxw: 1240px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--brick);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 120ms ease;
}
a:hover { color: var(--brick-deep); }

h1, h2, h3, h4 {
  font-family: var(--serif-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: clamp(44px, 7vw, 92px); line-height: 1.02; }
h2 { font-size: clamp(32px, 4.4vw, 56px); line-height: 1.1; }
h3 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; }
h4 { font-family: var(--serif); font-size: 22px; font-weight: 500; }

p { margin: 0 0 1em; max-width: 64ch; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brick);
  font-weight: 600;
  display: inline-block;
}

.eyebrow.gold { color: var(--gold); }
.eyebrow.olive { color: var(--olive-deep); }
.eyebrow.ink { color: var(--ink-soft); }

/* Layout */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: clamp(64px, 9vw, 128px) 0; }

/* ---------- Site header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 246, 236, 0.94);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header .bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: 0;
  color: var(--ink);
}
.brand .logo {
  height: 44px;
  width: auto;
  display: block;
  border-radius: 4px;
}
.brand .visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
/* Footer brand variant, slightly larger, on dark */
.site-footer .brand .logo { height: 56px; }

nav.primary {
  display: flex;
  gap: clamp(12px, 2.5vw, 32px);
  align-items: center;
}
nav.primary a {
  color: var(--ink);
  border: 0;
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
}
nav.primary a:hover { color: var(--brick); border-bottom-color: var(--brick); }
nav.primary a.active { color: var(--brick); border-bottom-color: var(--brick); }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  position: relative;
}
.nav-toggle .lines,
.nav-toggle .lines::before,
.nav-toggle .lines::after {
  content: "";
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 1px;
}
.nav-toggle .lines { top: 50%; transform: translate(-50%, -50%); }
.nav-toggle .lines::before { top: -5px; }
.nav-toggle .lines::after { top: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (max-width: 720px) {
  nav.primary { display: none; flex-direction: column; align-items: flex-start; padding: 16px var(--gutter) 24px; gap: 14px; background: var(--cream); border-top: 1px solid var(--rule); }
  nav.primary.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--brick);
  color: var(--cream);
  border: 0;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
.btn:hover { background: var(--brick-deep); color: var(--cream); }
.btn:active { transform: translateY(1px); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: var(--cream); }
.btn .arrow { transition: transform 160ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Placeholder pill (for owner-fill values) ---------- */
.placeholder {
  display: inline-block;
  background: #FFF3C2;
  color: #6E5400;
  border: 1px dashed #C9A24A;
  border-radius: 4px;
  padding: 1px 8px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.placeholder::before { content: "⚑ "; opacity: 0.6; }

/* ---------- Striped SVG placeholder image ---------- */
.ph-img {
  width: 100%;
  aspect-ratio: 4/3;
  background:
    repeating-linear-gradient(
      135deg,
      var(--cream-deep) 0,
      var(--cream-deep) 12px,
      #EDE0C7 12px,
      #EDE0C7 24px
    );
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  padding: 16px;
  border: 1px solid var(--rule);
}
.ph-img.tall { aspect-ratio: 3/4; }
.ph-img.wide { aspect-ratio: 16/9; }
.ph-img.square { aspect-ratio: 1/1; }
.ph-img span { background: var(--cream); padding: 4px 10px; border-radius: 2px; }
.ph-img.has-img { background: var(--cream); padding: 12px; }
.ph-img.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Real image containers (story + hero) */
.story-photo {
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.story-photo img,
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-image { padding: 0; background: var(--cream-deep); overflow: hidden; }
.hero-image img { position: absolute; inset: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 64px 0 36px;
  margin-top: 80px;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
.site-footer h4 {
  color: var(--cream);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.site-footer p, .site-footer a, .site-footer li {
  color: rgba(251, 246, 236, 0.78);
  font-size: 14px;
  line-height: 1.7;
}
.site-footer a { border-bottom-color: rgba(251,246,236,0.25); }
.site-footer a:hover { color: var(--cream); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer .legal {
  border-top: 1px solid rgba(251,246,236,0.15);
  margin-top: 48px;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(251,246,236,0.55);
}
.site-footer .legal .placeholder { background: rgba(201,162,74,0.18); border-color: var(--gold); color: #F0D89B; }
@media (max-width: 760px) {
  .site-footer .wrap { grid-template-columns: 1fr 1fr; gap: 32px; }
  .site-footer .legal { flex-direction: column; gap: 10px; }
}

/* ---------- Decorative rule ---------- */
.rule-orn {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
  font-family: var(--serif-display);
  margin: 24px 0;
}
.rule-orn::before, .rule-orn::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ---------- Utility ---------- */
.serif { font-family: var(--serif); }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.lead { font-family: var(--serif); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.45; color: var(--ink-soft); }

/* a small star/rosette glyph used as flourish */
.rosette {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle at center, var(--gold) 30%, transparent 32%),
              conic-gradient(var(--gold) 0 25%, transparent 0 50%, var(--gold) 0 75%, transparent 0);
  border-radius: 50%;
  vertical-align: middle;
  opacity: 0.85;
}
