/* CampusConnect shared design tokens + base typography.
   Load AFTER Bootstrap so these defaults apply site-wide. */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --brand-600: #00a86b;   /* text, buttons (passes contrast on white) */
  --brand-500: #00c27a;
  --brand-400: #00d084;   /* accents only */
  --brand-50:  #ecfdf5;

  --ink-900: #0b1620;
  --ink-600: #475467;
  --ink-400: #98a2b3;
  --line:    #e4e7ec;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgb(16 24 40 / .06);
  --shadow:    0 4px 12px -2px rgb(16 24 40 / .08);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  line-height: 1.2;
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Legacy palette, tokenised so pages share one source of truth */
:root {
  --navy-900: #0d1b2a;
  --navy-700: #1a3c5e;
  --brand-700: #00b070;   /* hover / pressed */
  --radius-pill: 999px;
}

/* Green for TEXT on light surfaces: ~5.4:1 on white (the bright brand green is ~2:1).
   Dark theme flips back to the bright green, which reads well on navy. */
:root { --brand-text: #007a4d; }
:root[data-theme="dark"] { --brand-text: var(--brand-400); }

/* Type scale (use these instead of one-off rem values) */
:root {
  --text-xs: .75rem;   --text-sm: .875rem; --text-base: 1rem;
  --text-lg: 1.25rem;  --text-xl: 1.5rem;  --text-2xl: 2rem; --text-3xl: 3rem;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
h1 { font-size: clamp(var(--text-xl), 4vw, var(--text-3xl)); }
h2 { font-size: clamp(var(--text-lg), 3vw, var(--text-2xl)); }
h3 { font-size: var(--text-lg); }
h4, h5, h6 { font-size: var(--text-base); }

/* Editorial headings use the serif; everything else stays Inter */
.journal-title, .article-title { font-family: var(--font-serif); font-weight: 700; }

/* Logo: app icon + two-weight wordmark */
.cc-logo { display: inline-flex; align-items: center; gap: .55rem; line-height: 1; }
.cc-logo__mark { display: inline-flex; width: 30px; height: 30px; flex: none; }
.cc-logo__mark .cc-mark { width: 100%; height: 100%; }
.cc-logo__word { font-weight: 700; letter-spacing: -0.02em; font-size: 1.15rem; }
.cc-logo__word span { font-weight: 500; color: var(--brand-400); }

/* Repeated surfaces, defined once */
:root {
  --grad-navy:      linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
  --grad-navy-deep: linear-gradient(180deg, var(--navy-900) 0%, #091422 100%);
  --line-1: #e8ecf0;   /* card borders */
  --line-2: #f1f5f9;   /* subtle dividers */
  --line-3: #e0e6ed;   /* inputs, outlined buttons */
}

/* Listing cards: price badge over the photo, one muted meta line under the title */
.cc-price-badge {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  background: #fff; color: var(--ink-900); font-weight: 700; font-size: .75rem;
  padding: .25rem .6rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.cc-meta-line { font-size: .78rem; color: var(--ink-600); margin-top: .35rem; }
:root[data-theme="dark"] .cc-meta-line { color: var(--text-tertiary, #94a3b8); }

/* Typographic details: balanced headlines, no orphaned last words */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* One focus style for every field */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
textarea:focus, select:focus {
  border-color: var(--brand-500) !important;
  box-shadow: 0 0 0 3px rgba(0, 194, 122, .18) !important;
  outline: none;
}

/* ---- Cross-page refinement (specificity raised so it wins over per-page CSS) ---- */
html body :is(.article-card, .job-card, .event-card, .resource-card, .hostel-card, .journal-card, .news-card, .uni-card,
              .thread-card, .review-card, .related-card, .rel-card, .result-card, .main-card, .sidebar-card, .section-card) {
  box-shadow: none;
  border: 1px solid var(--border-color, #e8ecf0);
  border-radius: var(--radius-lg);
}
html body :is(.article-card, .job-card, .event-card, .resource-card, .hostel-card, .journal-card, .news-card, .uni-card,
              .thread-card, .review-card, .related-card, .rel-card, .result-card):hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}
html body :is(a, button)[class*="btn-"]:hover { transform: none; box-shadow: none; }
html body :is(h1, h2, h3, .section-title, .page-title) { font-weight: 700; }

/* Modals always sit above the sticky navbar (z-index 4000) and floating Ask button */
.modal-backdrop { z-index: 4998 !important; }
.modal { z-index: 4999 !important; }

/* Bootstrap .text-white on a solid green button: use ink, white on #00d084 is too faint to read */
:is(a, button).text-white:is([style*="background-color: var(--accent"], [style*="background-color: var(--brand-400"], [style*="background: var(--brand-400"]) { color: var(--navy-900, #0d1b2a) !important; }

/* Motion tokens: one timing language for every transition and micro-interaction */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .16s;
  --dur-base: .28s;
  --dur-slow: .5s;
}
