/* Margam — design tokens.
   Single source of truth for color, spacing, radius, shadow, typography.
   Legacy aliases preserved at the bottom so older CSS keeps working. */

:root {
  /* ============ COLOR ============ */

  /* Surfaces — warm off-whites instead of pure white for a softer feel */
  --bg:         #FBFAF7;
  --surface:    #FFFFFF;
  --surface-2:  #FCF7EC;
  --surface-3:  #F4ECDA;
  --hover:      rgba(196, 164, 90, 0.07);

  /* Borders */
  --border:     #EDE6D5;
  --border-2:   #DDD3BC;
  --border-3:   #C9BB9D;

  /* Text — warm browns rather than pure black */
  --text:       #1F1814;
  --text-2:     #5A4A3F;
  --text-3:     #8A7A6F;
  --text-4:     #B8AC9F;

  /* Brand (deep maroon) — used sparingly for primary actions + key headings */
  --brand:      #8B1538;
  --brand-2:    #6F0F2C;
  --brand-bg:   #FBEFF2;
  --brand-fg:   #FFFFFF;

  /* Accent (warm amber) — softer than saffron, used for highlights */
  --accent:     #C77B2B;
  --accent-2:   #A0631E;
  --accent-bg:  #FBEFD8;

  /* Gold (ornament only) */
  --gold:       #C4A45A;
  --gold-2:     #DCBE7A;
  --gold-bg:    #F7EFD4;

  /* Semantic */
  --success:    #4F7B47;
  --success-bg: #E5EEE1;
  --warning:    #B36F1F;
  --warning-bg: #F8E5CC;
  --danger:     #A92D20;
  --danger-bg:  #F6DDD8;
  --info:       #4F7AAA;
  --info-bg:    #DEE9F5;

  /* ============ SPACING ============ */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-7:  28px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* ============ RADIUS ============ */
  --r-1: 4px;
  --r-2: 6px;
  --r-3: 8px;
  --r-4: 12px;
  --r-5: 16px;
  --r-6: 20px;
  --r-7: 24px;
  --r-full: 9999px;

  /* ============ SHADOWS ============ */
  --shadow-xs: 0 1px 2px rgba(31, 24, 20, 0.04);
  --shadow-sm: 0 1px 3px rgba(31, 24, 20, 0.06), 0 1px 2px rgba(31, 24, 20, 0.03);
  --shadow-md: 0 4px 12px rgba(31, 24, 20, 0.08), 0 2px 4px rgba(31, 24, 20, 0.04);
  --shadow-lg: 0 12px 28px rgba(31, 24, 20, 0.10), 0 4px 8px rgba(31, 24, 20, 0.04);
  --shadow-xl: 0 24px 48px rgba(31, 24, 20, 0.12);
  --shadow-inner: inset 0 1px 2px rgba(31, 24, 20, 0.04);

  /* ============ TYPOGRAPHY ============ */
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-serif:  'Cormorant Garamond', 'Georgia', serif;
  --font-mono:   'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --t-xs:  0.75rem;     /* 12px */
  --t-sm:  0.8125rem;   /* 13px */
  --t-md:  0.875rem;    /* 14px */
  --t-base:0.9375rem;   /* 15px */
  --t-lg:  1rem;        /* 16px */
  --t-xl:  1.125rem;    /* 18px */
  --t-2xl: 1.375rem;    /* 22px */
  --t-3xl: 1.75rem;     /* 28px */
  --t-4xl: 2.25rem;     /* 36px */
  --t-5xl: 3rem;        /* 48px */
  --t-6xl: 3.75rem;     /* 60px */

  --lh-tight:  1.2;
  --lh-snug:   1.35;
  --lh-normal: 1.55;
  --lh-relaxed:1.7;

  /* ============ MOTION ============ */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  /* ============ LEGACY ALIASES (so existing CSS keeps working) ============ */
  --saffron: var(--accent);
  --saffron-soft: var(--accent-bg);
  --maroon: var(--brand);
  --maroon-deep: var(--brand-2);
  --gold-soft: var(--gold-2);
  --ivory: var(--surface);
  --ivory-deep: var(--surface-2);
  --charcoal: var(--text);
  --charcoal-soft: var(--text-2);
  --stone: var(--border);
  --leaf: var(--success);
  --shadow-soft: var(--shadow-sm);
  --shadow-card: var(--shadow-md);
  --radius-sm: var(--r-2);
  --radius-md: var(--r-4);
  --radius-lg: var(--r-5);
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
  margin: 0;
}

/* Headings — sans-serif by default. Serif is opt-in via .font-serif */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.011em;
  line-height: var(--lh-tight);
  margin: 0;
}

.font-serif { font-family: var(--font-serif); }
.font-mono  { font-family: var(--font-mono); }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

::selection { background: var(--accent-bg); color: var(--text); }

/* ============ HEADER CHROME ============ */
.gold-band {
  height: 3px;
  background: linear-gradient(90deg, var(--gold-2), var(--gold), var(--gold-2));
}

.site-header {
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.brand-name {
  font-family: var(--font-serif);
  color: var(--brand);
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-tagline {
  color: var(--text-3);
  margin: 2px 0 0;
  font-size: var(--t-xs);
  font-style: italic;
}
.brand-mark {
  width: 36px;
  height: 36px;
  color: var(--brand);
}

.event-name {
  color: var(--text-2);
  font-size: var(--t-md);
  font-weight: 500;
}

/* ============ SIDEBAR ============ */
.side-nav {
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.side-nav a {
  color: var(--text-2);
  border-left: 2px solid transparent;
}
.side-nav a:hover {
  background: var(--hover);
  color: var(--brand);
  text-decoration: none;
}
.side-nav a.active {
  background: var(--surface);
  color: var(--brand);
  border-left-color: var(--accent);
  font-weight: 600;
}
.nav-icon { display: none; }

/* ============ CARDS ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-xs);
}
.card-accent { border-top: 2px solid var(--accent); }

/* ============ BUTTONS ============ */
button { font-family: inherit; }

/* Base button-like styles applied via shared selectors so anchor and button
   look identical when given the same .btn-* class. */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px 16px;
  border-radius: var(--r-3);
  font-family: inherit;
  font-size: var(--t-md);
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
a.btn-primary, a.btn-secondary, a.btn-ghost, a.btn-danger, a.link-button { text-decoration: none; }
a.btn-primary:hover, a.btn-secondary:hover, a.btn-ghost:hover, a.btn-danger:hover, a.link-button:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand);
  color: var(--brand-fg);
  border-color: var(--brand);
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
  box-shadow: var(--shadow-sm);
}
.btn-primary:active { transform: translateY(1px); box-shadow: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-3);
}
.btn-secondary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--hover); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #ffffff; }

button[disabled], .btn-primary[disabled], .btn-secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Inline button row (replaces the old form-row grid abuse for button groups) */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

/* ============ TAGS / PILLS ============ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
.tag.success { background: var(--success-bg); color: var(--success);  border-color: transparent; }
.tag.warning { background: var(--warning-bg); color: var(--warning);  border-color: transparent; }
.tag.danger  { background: var(--danger-bg);  color: var(--danger);   border-color: transparent; }
.tag.info    { background: var(--info-bg);    color: var(--info);     border-color: transparent; }
.tag.neutral { background: var(--surface-2);  color: var(--text-3);   border-color: var(--border); }
.tag.brand   { background: var(--brand-bg);   color: var(--brand);    border-color: transparent; }

.divider-motif {
  display: block;
  text-align: center;
  color: var(--gold);
  letter-spacing: 1em;
  margin: var(--sp-6) 0;
}
